Esempio n. 1
0
 public bool IsSame(LocalObjectKey key)
 {
     if (key == null)
     {
         return(false);
     }
     return((key.KeyType == KeyType.InstanceId && InstanceId == key.Id) || GlobalId == key.Id);
 }
Esempio n. 2
0
 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());
     }
 }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
 public T GetEntry <T>(LocalObjectKey key) where T : EntryObjectDTO
 {
     return((T)GetEntry(key));
 }