public bool IsSame(LocalObjectKey key) { if (key == null) { return(false); } return((key.KeyType == KeyType.InstanceId && InstanceId == key.Id) || GlobalId == key.Id); }
public EntryObjectDTO GetEntry(LocalObjectKey key) { if (key.KeyType == KeyType.InstanceId) { return(Objects.Where(x => x.InstanceId == key.Id).SingleOrDefault()); } else { return(Objects.Where(x => x.GlobalId == key.Id).SingleOrDefault()); } }
void checkCrashState() { if (ApplicationState.Current == null) { return; } bool crash = ApplicationState.Current.Crash; ApplicationState.Current.Crash = false; if (ApplicationState.Current.TrainingDay != null && crash) { if (BAMessageBox.Ask(ApplicationStrings.TrainingDaySelectorControl_QCrashSaverRestoreEntry) == MessageBoxResult.OK) { LocalObjectKey id = ApplicationState.Current.CurrentEntryId; Object currentEntry = ApplicationState.Current.TrainingDay.TrainingDay.GetEntry(id); TrainingDaySelectorControl.GoToPage(currentEntry, this); return; } } ApplicationState.Current.ResetCurrents(); }
public T GetEntry <T>(LocalObjectKey key) where T : EntryObjectDTO { return((T)GetEntry(key)); }