コード例 #1
0
        /// <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;
            }
        }
コード例 #2
0
 /// <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();
     }
 }
コード例 #3
0
        /// <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);
            }
        }
コード例 #4
0
 /// <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);
     }
 }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
 /// <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);
 }
コード例 #8
0
 /// <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);
 }
コード例 #9
0
        /// <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;
            }
        }
コード例 #10
0
 /// <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();
     }
 }
コード例 #11
0
 /// <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;
     }
 }
コード例 #12
0
 /// <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)
 {
 }
コード例 #13
0
        /// <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);
        }
コード例 #14
0
        /// <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;
            }
        }
コード例 #15
0
 /// <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);
 }
コード例 #16
0
 /// <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);
 }
コード例 #17
0
        /// <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);
            }
        }
コード例 #18
0
        /// <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;
            }
        }
コード例 #19
0
 /// <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);
 }
コード例 #20
0
 /// <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);
 }
コード例 #21
0
 /// <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);
 }
コード例 #22
0
 /// <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();
     }
 }
コード例 #23
0
        /// <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;
            }
        }
コード例 #24
0
        /// <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));
        }
コード例 #25
0
 /// <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);
 }
コード例 #26
0
        /// <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;
            }
        }
コード例 #27
0
 /// <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)
 {
 }
コード例 #28
0
 /// <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);
 }
コード例 #29
0
        /// <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);
            }
        }
コード例 #30
0
 /// <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;
         }
     }
 }