Ejemplo n.º 1
0
 public bool RemovePreset(DtoPreset inPreset)
 {
     if (inPreset != null)
     {
         return(inPreset.RemoveMeFromParentSmartWall());
     }
     return(false);
 }
Ejemplo n.º 2
0
 public bool AddPreset(DtoPreset inPreset, DtoSmartWall inParentSmartWall)
 {
     if (inParentSmartWall != null && inPreset != null)
     {
         return(inParentSmartWall.AddPreset(inPreset));
     }
     return(false);
 }
Ejemplo n.º 3
0
 private bool RemovePreset(DtoPreset inPreset)
 {
     if (SmartWall != null)
     {
         SmartWall.RemovePreset(inPreset);
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
 //Work with presets
 #region Add & Remove Presets functions
 private bool AddPreset(DtoPreset inNewPreset)
 {
     if (SmartWall != null)
     {
         SmartWall.AddPreset(inNewPreset);
         return(true);
     }
     return(false);
 }
Ejemplo n.º 5
0
        //Events
        #region Buttons Events
        private void button_AddNewPreset_Click(object sender, RoutedEventArgs e)
        {
            DtoPreset      presetToAdd      = new DtoPreset("New Preset");
            AddPreset_Form createPresetForm = new AddPreset_Form(presetToAdd);
            var            resault          = createPresetForm.ShowDialog();

            if (resault.HasValue && resault == true)
            {
                var presetAdded = AddPreset(presetToAdd);
                if (presetAdded == true)
                {
                    NotifyThatSavingsNeed();
                }
            }
        }
Ejemplo n.º 6
0
        //Events
        #region Eizo Config Events
        private void PluginConfig_EizoActionCalled(object sender, MVW_UserActionEventArgument <DtoMainConfiguration, EMVWActions> e)
        {
            #region SmartWall calls
            if (e.ActionType == EMVWActions.EditSmartWall && (e.ObjectCaller.GetType() == typeof(DtoSmartWall))) //Edit SmartWall
            {
                var tmpSmartWall = e.ObjectCaller as DtoSmartWall;
                if (tmpSmartWall != null)
                {
                    var resault = EditSmartWall(tmpSmartWall);
                    if (resault == true)
                    {
                        NotifyThatSavingsNeed();
                    }
                }
            }

            else if (e.ActionType == EMVWActions.RemoveSmartWall && (e.ObjectCaller.GetType() == typeof(DtoSmartWall))) //Remove SmartWall
            {
                var tmpSmartWall = e.ObjectCaller as DtoSmartWall;
                if (tmpSmartWall != null)
                {
                    var resault = MessageBox.Show($"Are you sure want delete {tmpSmartWall.Name}", "Delete SmartWall", MessageBoxButton.YesNo, MessageBoxImage.Question);
                    if (resault == MessageBoxResult.Yes)
                    {
                        var removedSmartWall = RemoveSmartWall(tmpSmartWall);
                        if (removedSmartWall == true)
                        {
                            NotifyThatSavingsNeed();
                        }
                    }
                }
            }
            else if (e.ActionType == EMVWActions.EditSmartWallLayout && (e.ObjectCaller.GetType() == typeof(DtoSmartWall))) //Remove SmartWall
            {
                var tmpSmartWall = e.ObjectCaller as DtoSmartWall;
                if (tmpSmartWall != null)
                {
                    //SetActiveEditLayoutSmartWall(tmpSmartWall);
                }
            }
            #endregion

            #region  Monitor calls
            else if (e.ActionType == EMVWActions.AddMonitor && (e.ObjectCaller.GetType() == typeof(DtoSmartWall))) //ADD Monitor
            {
                var tmpSmartWall = e.ObjectCaller as DtoSmartWall;
                if (tmpSmartWall != null)
                {
                    DtoMonitor      monitorToAdd      = new DtoMonitor("New Monitor");
                    AddMonitor_Form createMonitorForm = new AddMonitor_Form(monitorToAdd);
                    var             resault           = createMonitorForm.ShowDialog();
                    if (resault.HasValue && resault == true)
                    {
                        var monitorAdded = AddMonitor(monitorToAdd, tmpSmartWall);
                        if (monitorAdded == true)
                        {
                            NotifyThatSavingsNeed();
                        }
                    }
                }
            }

            else if (e.ActionType == EMVWActions.EditMonitor && (e.ObjectCaller.GetType() == typeof(DtoMonitor))) //EDIT Monitor
            {
                var tmpMonitor = e.ObjectCaller as DtoMonitor;
                if (tmpMonitor != null)
                {
                    var resault = EditMonitor(tmpMonitor);
                    if (resault == true)
                    {
                        NotifyThatSavingsNeed();
                    }
                }
            }

            else if (e.ActionType == EMVWActions.RemoveMonitor && (e.ObjectCaller.GetType() == typeof(DtoMonitor))) //REMOVE Monitor
            {
                var tmpMonitor = e.ObjectCaller as DtoMonitor;
                if (tmpMonitor != null)
                {
                    var resault = MessageBox.Show($"Are you sure want delete {tmpMonitor.Name}", "Delete Monitor", MessageBoxButton.YesNo, MessageBoxImage.Question);
                    if (resault == MessageBoxResult.Yes)
                    {
                        var removedMonitor = RemoveMonitor(tmpMonitor);
                        if (removedMonitor == true)
                        {
                            NotifyThatSavingsNeed();
                        }
                    }
                }
            }
            #endregion

            #region Preset calls
            else if (e.ActionType == EMVWActions.AddPreset && (e.ObjectCaller.GetType() == typeof(DtoSmartWall))) //Add Preset
            {
                var tmpSmartWall = e.ObjectCaller as DtoSmartWall;
                if (tmpSmartWall != null)
                {
                    DtoPreset      presetToAdd      = new DtoPreset("New Preset");
                    AddPreset_Form createPresetForm = new AddPreset_Form(presetToAdd);
                    var            resault          = createPresetForm.ShowDialog();
                    if (resault.HasValue && resault == true)
                    {
                        var monitorAdded = AddPreset(presetToAdd, tmpSmartWall);
                        if (monitorAdded == true)
                        {
                            NotifyThatSavingsNeed();
                        }
                    }
                }
            }
            else if (e.ActionType == EMVWActions.EditPreset && (e.ObjectCaller.GetType() == typeof(DtoPreset))) //Edit Preset
            {
                var tmpPreset = e.ObjectCaller as DtoPreset;
                if (tmpPreset != null)
                {
                    var resault = EditPreset(tmpPreset);
                    if (resault == true)
                    {
                        NotifyThatSavingsNeed();
                    }
                }
            }
            else if (e.ActionType == EMVWActions.RemovePreset && (e.ObjectCaller.GetType() == typeof(DtoPreset))) //Remove Preset
            {
                var tmpPreset = e.ObjectCaller as DtoPreset;
                if (tmpPreset != null)
                {
                    var resault = MessageBox.Show($"Are you sure want delete {tmpPreset.Name}", "Delete Preset", MessageBoxButton.YesNo, MessageBoxImage.Question);
                    if (resault == MessageBoxResult.Yes)
                    {
                        var removedMonitor = RemovePreset(tmpPreset);
                        if (removedMonitor == true)
                        {
                            NotifyThatSavingsNeed();
                        }
                    }
                }
            }
            #endregion

            else if (e.ActionType == EMVWActions.EditPresetSettings && (e.ObjectCaller.GetType() == typeof(DtoPresetSettings))) //Add Preset
            {
            }
        }
Ejemplo n.º 7
0
 private void SetSelectedPresetSettings(DtoPreset inPreset)
 {
     //smartWallSettings_UC.SetSmartWall(inSmartWall);
 }
Ejemplo n.º 8
0
 public bool EditPreset(DtoPreset inPreset)
 {
     return(false);
 }
 public void SetPresetAndControlUIType(DtoPreset inPreset, EFormInitializeType inControlUIType = EFormInitializeType.New)
 {
     Preset         = inPreset;
     tmpName        = inPreset.Name;
     tmpDescription = inPreset.Description;
 }
 public AddEditPreset_UserControl(DtoPreset inPreset)
 {
     this.DataContext = this;
     InitializeComponent();
     InitializeForm();
 }