public DtoPresetSettings(DtoPreset inConnectedPreset)
 {
     Name = inConnectedPreset.Name;
     ConnectedPresetID = inConnectedPreset.PresetIDstring;
     ConnectedPreset   = inConnectedPreset;
     InitializeContextMenu();
 }
Beispiel #2
0
 public bool RemovePreset(DtoPreset inPreset)
 {
     if (PresetsList != null && PresetsList.Contains(inPreset))
     {
         PresetsList.Remove(inPreset);
         inPreset.EizoActionCalled -= InPreset_EizoActionCalled;
         return(true);
     }
     return(false);
 }
Beispiel #3
0
 public bool AddPreset(DtoPreset inPreset)
 {
     if (PresetsList == null)
     {
         PresetsList = new ObservableCollection <DtoPreset>();
     }
     if (PresetsList != null && !PresetsList.Contains(inPreset))
     {
         inPreset.ParentSmartWall = this;
         PresetsList.Add(inPreset);
         inPreset.EizoActionCalled += InPreset_EizoActionCalled;
         return(true);
     }
     return(false);
 }
Beispiel #4
0
 private bool RemovePresetSettings(DtoPreset inConnectedPresetForRemove)
 {
     if (PresetSettingsList != null)
     {
         foreach (var presetSettingsItem in PresetSettingsList)
         {
             if (presetSettingsItem?.ConnectedPresetID == inConnectedPresetForRemove.PresetIDstring)
             {
                 PresetSettingsList.Remove(presetSettingsItem);
                 presetSettingsItem.EizoActionCalled -= Preset_EizoActionCalled;
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #5
0
 //PresetSettings functions
 #region Add & Remove PresetSettings from list functions
 private bool AddPresetSettings(DtoPreset inConnectedPreset)
 {
     if (PresetSettingsList == null)
     {
         PresetSettingsList = new ObservableCollection <DtoPresetSettings>();
     }
     if (PresetSettingsList != null && !CheckIfPressetSettingsForGivenPresetExistInList(inConnectedPreset))
     {
         DtoPresetSettings presetSettingsToAdd = new DtoPresetSettings(inConnectedPreset);
         if (!PresetSettingsList.Contains(presetSettingsToAdd))
         {
             PresetSettingsList.Add(presetSettingsToAdd);
             presetSettingsToAdd.EizoActionCalled += Preset_EizoActionCalled;
             return(true);
         }
     }
     return(false);
 }
Beispiel #6
0
 private bool CheckIfPressetSettingsForGivenPresetExistInList(DtoPreset inConnectedPreset)
 {
     if (PresetSettingsList != null && PresetSettingsList.Count > 0)
     {
         //var resaultPreset = PresetSettingsList.Where(i => i.ConnectedPreset.PresetIDstring == inConnectedPreset.PresetIDstring).FirstOrDefault();
         //if (resaultPreset != null)
         //{
         //    return true;
         //}
         foreach (var presetSettings in PresetSettingsList)
         {
             if (presetSettings.ConnectedPresetID == inConnectedPreset.PresetIDstring)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #7
0
 public void NotifyEizoActionCalled(object inObjectCaller, DtoPreset inSelectedObjectInstance, EMVWActions inActionType)
 {
     EizoActionCalled?.Invoke(this, new MVW_UserActionEventArgument <DtoPreset, EMVWActions>(inObjectCaller, inSelectedObjectInstance, inActionType));
 }