Skip to content

Commit

Permalink
Use expression body property
Browse files Browse the repository at this point in the history
  • Loading branch information
celeron533 committed Apr 4, 2024
1 parent 466195f commit 2e4d115
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion DicomGrep/ViewModels/DicomDictionaryLookupViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DicomDictionaryLookupViewModel : ViewModelBase
private DicomDictionaryEntry _selectedEntry;
public DicomDictionaryEntry SelectedEntry
{
get { return _selectedEntry; }
get => _selectedEntry;
set
{
if (_selectedEntry == null && value != null && string.IsNullOrEmpty(DefaultFilterString)) // only triggerred when set the initial value
Expand Down
64 changes: 32 additions & 32 deletions DicomGrep/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class MainViewModel : ViewModelBase
private string _searchPath;
public string SearchPath
{
get { return _searchPath; }
set { SetProperty(ref _searchPath, value); }
get => _searchPath;
set => SetProperty(ref _searchPath, value);
}

public ObservableCollection<string> SearchPathHistory { set; get; }
Expand All @@ -58,26 +58,26 @@ public string SearchPath
private string _fileTypes;
public string FileTypes
{
get { return _fileTypes; }
set { SetProperty(ref _fileTypes, value); }
get => _fileTypes;
set => SetProperty(ref _fileTypes, value);
}

public ObservableCollection<string> FileTypesHistory { set; get; }

private string _sopClassUid;
public string SopClassUid
{
get { return _sopClassUid; }
set { SetProperty(ref _sopClassUid, value); }
get => _sopClassUid;
set => SetProperty(ref _sopClassUid, value);
}

public ObservableCollection<string> SopClassUidHistory { set; get; }

private string _tag;
public string Tag
{
get { return _tag; }
set { SetProperty(ref _tag, value); }
get => _tag;
set => SetProperty(ref _tag, value);
}

public ObservableCollection<string> DicomTagHistory { set; get; }
Expand All @@ -86,8 +86,8 @@ public string Tag
private string _searchText;
public string SearchText
{
get { return _searchText; }
set { SetProperty(ref _searchText, value); }
get => _searchText;
set => SetProperty(ref _searchText, value);
}

public ObservableCollection<string> SearchTextHistory { set; get; }
Expand All @@ -97,37 +97,37 @@ public string SearchText
private bool _caseSensitive;
public bool CaseSensitive
{
get { return _caseSensitive; }
set { SetProperty(ref _caseSensitive, value); }
get => _caseSensitive;
set => SetProperty(ref _caseSensitive, value);
}

private bool _wholeWord;
public bool WholeWord
{
get { return _wholeWord; }
set { SetProperty(ref _wholeWord, value); }
get => _wholeWord;
set => SetProperty(ref _wholeWord, value);
}

private MatchPatternEnum _matchPattern;

public MatchPatternEnum MatchPattern
{
get { return _matchPattern; }
set { SetProperty(ref _matchPattern, value); }
get => _matchPattern;
set => SetProperty(ref _matchPattern, value);
}

private bool _includeSubfolders;
public bool IncludeSubfolders
{
get { return _includeSubfolders; }
set { SetProperty(ref _includeSubfolders, value); }
get => _includeSubfolders;
set => SetProperty(ref _includeSubfolders, value);
}

private int _searchThreads;
public int SearchThreads
{
get { return _searchThreads; }
set { SetProperty(ref _searchThreads, value); }
get => _searchThreads;
set => SetProperty(ref _searchThreads, value);
}

#endregion Search Criteria END
Expand All @@ -137,37 +137,37 @@ public int SearchThreads
private int _totalFileCount;
public int TotalFileCount
{
get { return _totalFileCount; }
set { SetProperty(ref _totalFileCount, value); }
get => _totalFileCount;
set => SetProperty(ref _totalFileCount, value);
}

private int _searchedFileCount;
public int SearchedFileCount
{
get { return _searchedFileCount; }
set { SetProperty(ref _searchedFileCount, value); }
get => _searchedFileCount;
set => SetProperty(ref _searchedFileCount, value);
}

private int _matchFileCount;
public int MatchFileCount
{
get { return _matchFileCount; }
set { SetProperty(ref _matchFileCount, value); }
get => _matchFileCount;
set => SetProperty(ref _matchFileCount, value);
}

private string _currentFile;
public string CurrentFile
{
get { return _currentFile; }
set { SetProperty(ref _currentFile, value); }
get => _currentFile;
set => SetProperty(ref _currentFile, value);
}


private MainStatusEnum _mainStatus;
public MainStatusEnum MainStatus
{
get { return _mainStatus; }
set { SetProperty(ref _mainStatus, value); }
get => _mainStatus;
set => SetProperty(ref _mainStatus, value);
}

#region Command
Expand Down Expand Up @@ -280,8 +280,8 @@ public ICommand DetailsCommand
private ResultDicomFile _selectedMatchFile;
public ResultDicomFile SelectedMatchFile
{
get { return _selectedMatchFile; }
set { SetProperty(ref _selectedMatchFile, value); }
get => _selectedMatchFile;
set => SetProperty(ref _selectedMatchFile, value);
}


Expand Down
4 changes: 2 additions & 2 deletions DicomGrep/ViewModels/SopClassLookupViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public class SopClassLookupViewModel : ViewModelBase
private DicomUID _selectedUID;
public DicomUID SelectedUID
{
get { return _selectedUID; }
get => _selectedUID;
set
{
if (_selectedUID == null && value != null && string.IsNullOrEmpty(DefaultFilterString)) // only triggerred when set the initial value
{
DefaultFilterString = value.UID.ToString();
}
SetProperty(ref _selectedUID, value);
}
}
}

private string _defaultFilterString;
Expand Down
9 changes: 3 additions & 6 deletions DicomGrep/ViewModels/TagValueDetailViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TagValueDetailViewModel : ViewModelBase
private ResultDicomItem _dicomItem;
public ResultDicomItem DicomItem
{
get { return _dicomItem; }
get => _dicomItem;
set
{
SetProperty(ref _dicomItem, value);
Expand All @@ -25,11 +25,8 @@ public ResultDicomItem DicomItem
private string _summary;
public string Summary
{
get { return _summary; }
private set
{
SetProperty(ref _summary, value);
}
get => _summary;
private set => SetProperty(ref _summary, value);
}

string GenerateSummaryDisplayString()
Expand Down

0 comments on commit 2e4d115

Please sign in to comment.