Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgy Levchenko committed Mar 30, 2021
1 parent 35df592 commit 14991f4
Show file tree
Hide file tree
Showing 4 changed files with 969 additions and 436 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SessionDialogViewModel : DialogViewModelBase
{
private readonly INotifications _notifications;
private ObservableCollection<SessionInfo> _sessionItems = new ObservableCollection<SessionInfo>();
private bool _checkCurrentSession = true;
private bool _checkCurrentSession;
private int _sessionItemsSelected;

public bool CheckCurrentSession
Expand Down Expand Up @@ -116,6 +116,7 @@ private bool CheckSessionItemsForZero()
{
if (SessionItems.Count != 0)
return false;

_notifications.ShowInformation("Отсутствуют записи для удаления.");
return true;
}
Expand All @@ -136,7 +137,7 @@ private async void GetSessionInfo()
DateCreate = x.DateCreate,
CountRecord = context.SensorInformations
.Count(y => y.SensorGroup.SessionId == x.Id
&& y.SensorGroup.Name == "Первая группа")
&& y.SensorGroup.Name == "Первая группа")
})
.Skip(1)
.ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ public LoadDataViewerWindowViewModel(IDeviceConnector deviceConnector, INotifica

using var context = new Context();
var selectMode = context.SelectModes
.Where(x => x.Id == i)
.FirstOrDefault();
.FirstOrDefault(x => x.Id == i);
selectMode.Stage = _selectMode[(int)i - 1];
context.SaveChanges();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public CustomersTooltip()

public TooltipData Data
{
get { return _data; }
get => _data;
set
{
_data = value;
Expand All @@ -33,8 +33,7 @@ public TooltipData Data

protected virtual void OnPropertyChanged(string propertyName = null)
{
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}
Loading

0 comments on commit 14991f4

Please sign in to comment.