private void TmpMonitor_EizoActionCalled(object sender, MVW_UserActionEventArgument <MonitorRectangle, EMVWActions> e) { if (e.ActionType == EMVWActions.MonitorRectangleSelected) { if (sender.GetType() == typeof(MonitorRectangle)) { var typedMonitorRect = sender as MonitorRectangle; if (typedMonitorRect != null) { SelectedMonitorRectangle = typedMonitorRect; } } } else if (e.ActionType == EMVWActions.MonitorRectangleMoved) { if (SelectedMonitorRectangle != null) { if (lShiftDown.HasValue && lShiftDown.Value == false) { LookForRectangleSideAligment(SelectedMonitorRectangle); //LokForRectangleDistanceAligment(SelectedMonitorRectangle, FindClosestMonitor(SelectedMonitorRectangle)); LokForRectangleDistanceAligment(SelectedMonitorRectangle); } NotifyThatSavingsNeed(); } } else if (e.ActionType == EMVWActions.MonitorRectangleEdited) { if (SelectedMonitorRectangle != null) { NotifyThatSavingsNeed(); } } }
//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 { } }
private void InPreset_EizoActionCalled(object sender, MVW_UserActionEventArgument <DtoPreset, EMVWActions> e) // Presets EIZO ACTION CALLED EVENT { NotifyEizoActionCalled(e.ObjectCaller, this, e.ActionType); }
//Events #region Monitors & Presets Events private void InMonitor_EizoActionCalled(object sender, MVW_UserActionEventArgument <DtoMonitor, EMVWActions> e) // Monitors EIZO ACTION CALLED EVENT { NotifyEizoActionCalled(e.ObjectCaller, this, e.ActionType); }
private void Preset_EizoActionCalled(object sender, MVW_UserActionEventArgument <DtoPresetSettings, EMVWActions> e) //PresetSettings action called { NotifyEizoActionCalled(e.ObjectCaller, this, e.ActionType); }