/// <summary> /// Actions related with the DisplaySet Execute Command event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void ProcessDisplaySetExecuteCommand(object sender, ExecuteCommandEventArgs e) { base.ProcessDisplaySetExecuteCommand(sender, e); switch (e.ExecuteCommandType) { case ExecuteCommandType.ExecuteFirstDestroyActionService: ExecuteCommandFirstDestroyActionService(); break; case ExecuteCommandType.ExecuteFirstCreateActionService: ExecuteCommandFirstCreateActionService(); break; case ExecuteCommandType.ExecuteFirstNotDestroyNotCreateActionService: ExecuteCommandFirstNotDestroyNotCreateActionService(); break; case ExecuteCommandType.ExecuteRefresh: Refresh(); break; default: break; } }
/// <summary> /// Actions related with the Execute command event from any filter variables /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void ProcessExecuteCommand(object sender, ExecuteCommandEventArgs e) { // Refresh means execute the filter again if (e.ExecuteCommandType == ExecuteCommandType.ExecuteRefresh) { Execute(); } }
/// <summary> /// Raises the ExecuteCommand event. /// </summary> /// <param name="changeEnable">Event argumnts.</param> protected virtual void OnExecuteCommand(ExecuteCommandEventArgs eventArgs) { EventHandler <ExecuteCommandEventArgs> handler = ExecuteCommand; if (handler != null) { handler(this, eventArgs); } }
/// <summary> /// Handles the Editor Execute command event /// </summary> /// <param name="e"></param> private void HandleEditorExecuteCommand(object sender, ExecuteCommandEventArgs e) { // If is for refresh get the OID if (e.ExecuteCommandType == ExecuteCommandType.ExecuteRefresh) { List <Oid> lSelectedOids = Value as List <Oid>; base.OnExecuteCommand(new ExecuteCommandRefreshEventArgs(lSelectedOids)); } else { base.OnExecuteCommand(e); } }
/// <summary> /// Actions related with the Execute command event from the viewer /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void ProcessViewerExecuteCommand(object sender, ExecuteCommandEventArgs e) { // Execute the service if (e.ExecuteCommandType == ExecuteCommandType.ExecuteDisplaySetService) { ProcessExecuteServiceTriggered(this, new TriggerEventArgs()); return; } // Values has been modified in the Display Set viewer if (e.ExecuteCommandType == ExecuteCommandType.ValuesHasBeenModified) { PendingChanges = true; return; } OnExecuteCommand(e); }
/// <summary> /// Handles the Editor Execute command event. Just propagate it. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleEditorExecuteCommand(object sender, ExecuteCommandEventArgs e) { OnExecuteCommand(e); }
/// <summary> /// Handles the Display Set ExecuteCommand event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleDisplaySetExecuteCommand(object sender, ExecuteCommandEventArgs e) { ProcessDisplaySetExecuteCommand(sender, e); }
/// <summary> /// Actions related with the DisplaySet Execute Command event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void ProcessDisplaySetExecuteCommand(object sender, ExecuteCommandEventArgs e) { // Manage the defined shortcuts if (e.Key != Keys.None) { // Action items if (Action != null) { foreach (ActionItemController lActionItem in Action.ActionItems.Values) { if (lActionItem.CheckShortcutKey(e.Key)) { if (lActionItem.Enabled) { lActionItem.Execute(null, new TriggerEventArgs()); e.Handled = true; return; } } } } // Navigation items if (Navigation != null) { foreach (NavigationItemController lNavItem in Navigation.NavigationItems.Values) { if (lNavItem.CheckShortcutKey(e.Key)) { if (lNavItem.Enabled) { lNavItem.Execute(null, new TriggerEventArgs()); e.Handled = true; return; } } } } } base.ProcessDisplaySetExecuteCommand(sender, e); switch (e.ExecuteCommandType) { case ExecuteCommandType.ExecuteFirstDestroyActionService: ExecuteCommandFirstDestroyActionService(); break; case ExecuteCommandType.ExecuteFirstCreateActionService: ExecuteCommandFirstCreateActionService(); break; case ExecuteCommandType.ExecuteFirstNotDestroyNotCreateActionService: ExecuteCommandFirstNotDestroyNotCreateActionService(); break; case ExecuteCommandType.ExecuteRefresh: Refresh(); break; case ExecuteCommandType.ExecuteRetriveAll: ExecuteCommandRetriveAll(Context); break; case ExecuteCommandType.ExecuteSelectInstance: // If there is an associated service set the selected instance. IUQueryController lIUQueryController = this as IUQueryController; if (lIUQueryController != null && lIUQueryController.AssociatedServiceController != null) { ExecuteCommandFirstNotDestroyNotCreateActionService(); break; } if (this.OkTrigger != null && this.OkTrigger.Enabled && this.OkTrigger.Visible) { ProcessExecuteOk(); } else { ExecuteCommandFirstNotDestroyNotCreateActionService(); } break; default: break; } }
/// <summary> /// Related actions with the Scenario Execute Command event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void ProcessScenarioExecuteCommand(object sender, ExecuteCommandEventArgs e) { switch (e.ExecuteCommandType) { case ExecuteCommandType.ExecuteGoNextInstance: ProcessExecuteNext(sender, new TriggerEventArgs()); break; case ExecuteCommandType.ExecuteGoPreviousInstance: ProcessExecutePrevious(sender, new TriggerEventArgs()); break; case ExecuteCommandType.ExecuteServiceAndGoNextInstance: ProcessExecuteApplyNext(sender, new TriggerEventArgs()); break; case ExecuteCommandType.ExecuteServiceAndGoPreviousInstance: ProcessExecuteApplyPrevious(sender, new TriggerEventArgs()); break; case ExecuteCommandType.ExecuteService: ProcessExecuteApply(sender, new TriggerEventArgs()); break; case ExecuteCommandType.ExecuteClose: ProcessExecuteCancel(); break; default: break; } }
/// <summary> /// Actions related with the Execute Command events from the editors /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void ProcessExecuteCommand(object sender, ExecuteCommandEventArgs e) { }
/// <summary> /// Handles the Argument Execute Command event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleArgumentExecuteCommand(object sender, ExecuteCommandEventArgs e) { OnExecuteCommand(e); }
/// <summary> /// Hsndles the Execute command event from the viewer /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleViewerExecuteCommand(object sender, ExecuteCommandEventArgs e) { ProcessViewerExecuteCommand(sender, e); }
/// <summary> /// Raises the ExecuteCommand event /// </summary> /// <param name="eventArgs"></param> protected virtual void OnExecuteCommand(ExecuteCommandEventArgs eventArgs) { if (!mRaiseEventsFlag) { return; } EventHandler<ExecuteCommandEventArgs> handler = ExecuteCommand; if (handler != null) { handler(this, eventArgs); } }
/// <summary> /// Executes actions related with Tree ExecuteCommand event. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleTreeExecuteCommand(object sender, ExecuteCommandEventArgs e) { ProcessTreeExecuteCommand(sender, e); }
/// <summary> /// Executes actions related to commands. Empty implementation. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnExecuteCommand(object sender, ExecuteCommandEventArgs e) { ProcessExecuteCommand(sender, e); }
/// <summary> /// Process the Execute Command event from the Tree /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void ProcessTreeExecuteCommand(object sender, ExecuteCommandEventArgs e) { // Only for Refesh command if (e.ExecuteCommandType == ExecuteCommandType.ExecuteRefresh) { Refresh(); } }
/// <summary> /// Process ExecuteCommand event from the Input fields /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void ProcessExecuteCommand(object sender, ExecuteCommandEventArgs e) { base.ProcessExecuteCommand(sender, e); // If it is associated (no scenario), then execute the service if (e.ExecuteCommandType == ExecuteCommandType.ExecuteRefresh && Scenario == null) { // Avoiding dependency rules execution as consequence of changing any inbound argument. this.mEnabledChangeArgument = false; Execute(); this.mEnabledChangeArgument = true; } }
/// <summary> /// Select Instance with double click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleDataGridViewITDoubleClick(object sender, EventArgs e) { // If it is the header row, do nothing if (((MouseEventArgs)e).Y < mDataGridViewIT.ColumnHeadersHeight) { return; } // Raise de double click, if it is handled, skip next step ExecuteCommandEventArgs lEventAgs = new ExecuteCommandEventArgs(Keys.NoName); OnExecuteCommand(lEventAgs); if (lEventAgs.Handled) { return; } OnExecuteCommand(new ExecuteCommandEventArgs(ExecuteCommandType.ExecuteSelectInstance)); }
/// <summary> /// Private implementatino for Execute Commads. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleScenarioExecuteCommand(object sender, ExecuteCommandEventArgs e) { ProcessScenarioExecuteCommand(sender, e); }
/// <summary> /// Actions related with the KeyDown event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleDataGridViewITKeyDown(object sender, KeyEventArgs e) { // Manage default Keys Keys lKeyPressed = (Keys)e.KeyCode; if (!(e.Control && e.Alt && e.Shift)) { switch (lKeyPressed) { case Keys.F5: // Refresh Population e.Handled = true; List<Oid> lSelectedOids = this.GetSelectedOIDs(); OnExecuteCommand(new ExecuteCommandRefreshEventArgs(lSelectedOids)); break; case Keys.F6: // Retrive All Instances. e.Handled = true; OnExecuteCommand(new ExecuteCommandEventArgs(ExecuteCommandType.ExecuteRetriveAll)); break; case Keys.F9: // Execute service e.Handled = true; OnExecuteCommand(new ExecuteCommandEventArgs(ExecuteCommandType.ExecuteDisplaySetService)); break; default: break; } if (e.Handled) return; } // Raise the event ExecuteCommandEventArgs lEventArgs = new ExecuteCommandEventArgs(e.KeyData); OnExecuteCommand(lEventArgs); // It has not been handled, then default behaviour if (!lEventArgs.Handled) { if (!(e.Control && e.Alt && e.Shift)) { switch (lKeyPressed) { case Keys.Delete: // Execute the First Destroy Service in Acctions Pattern. e.Handled = true; OnExecuteCommand(new ExecuteCommandEventArgs(ExecuteCommandType.ExecuteFirstDestroyActionService)); break; case Keys.Insert: // Execute the First Create Service in Acctions Pattern. e.Handled = true; OnExecuteCommand(new ExecuteCommandEventArgs(ExecuteCommandType.ExecuteFirstCreateActionService)); break; case Keys.Enter: // Selecte Instance. e.Handled = true; OnExecuteCommand(new ExecuteCommandEventArgs(ExecuteCommandType.ExecuteSelectInstance)); break; } } } else { e.Handled = true; } }
/// <summary> /// Raise ExecuteCommand Event. /// </summary> /// <param name="eventArgs"></param> protected virtual void OnExecuteCommand(ExecuteCommandEventArgs eventArgs) { EventHandler<ExecuteCommandEventArgs> handler = ExecuteCommand; if (handler != null) { handler(this, eventArgs); } }
/// <summary> /// Actions related woth the Display Set Execute command event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void ProcessDisplaySetExecuteCommand(object sender, ExecuteCommandEventArgs e) { if (e.ExecuteCommandType == ExecuteCommandType.ExecuteRefresh || e.ExecuteCommandType == ExecuteCommandType.ExecuteRetriveAll) { // If there is any pending change, cancel the refresh if (!CheckPendingChanges(true, true)) { e.ExecuteCommandType = ExecuteCommandType.None; } } }