コード例 #1
0
 protected override void PerformExecuteWithArgs(CommandExecutionVerb verb, ExecuteEventHandlerArgs args)
 {
     if (_allowPreview || verb == CommandExecutionVerb.Execute)
     {
         base.PerformExecuteWithArgs(verb, args);
     }
 }
コード例 #2
0
        public int Execute(uint commandId, CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
        {
            try
            {
                Command command = Get((CommandId)commandId);

                if (verb != CommandExecutionVerb.Execute)
                {
                    return(HRESULT.S_OK);
                }

                FireBeforeExecute((CommandId)commandId);
                int result;
                try
                {
                    result = command.PerformExecute(verb, key, currentValue, commandExecutionProperties);
                }
                finally
                {
                    FireAfterExecute((CommandId)commandId);
                }

                return(result);
            }
            catch (Exception ex)
            {
                Trace.Fail("Exception thrown when executing " + (CommandId)commandId + ": " + ex);
            }

            return(HRESULT.S_OK);
        }
コード例 #3
0
        public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
        {
            decimal spinnerValue = Convert.ToDecimal(currentValue.PropVariant.Value, CultureInfo.InvariantCulture);

            PerformExecuteWithArgs(verb, new ExecuteEventHandlerArgs(CommandId.ToString(), spinnerValue));
            return(HRESULT.S_OK);
        }
コード例 #4
0
 public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
 {
     // This is the main command
     if (verb == CommandExecutionVerb.Execute)
     {
         OnExecute(EventArgs.Empty);
     }
     return(HRESULT.S_OK);
 }
コード例 #5
0
        public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
        {
            int index = -1;

            if ((uint)currentValue.PropVariant.Value != UI_COLLECTION_INVALIDINDEX)
            {
                index = Convert.ToInt32(currentValue.PropVariant.Value, CultureInfo.InvariantCulture);
            }

            PerformExecuteWithArgs(verb, new ExecuteEventHandlerArgs(CommandId.ToString(), index));
            return(HRESULT.S_OK);
        }
コード例 #6
0
 public virtual int Execute(UInt32 commandId, CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
 {
     switch (verb)
     {
         case CommandExecutionVerb.Execute:
             ParentCommandManager.Execute((CommandId)commandId);
             return HRESULT.S_OK;
         case CommandExecutionVerb.Preview:
             break;
         case CommandExecutionVerb.CancelPreview:
             break;
     }
     return HRESULT.S_OK;
 }
コード例 #7
0
        public virtual int Execute(UInt32 commandId, CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
        {
            switch (verb)
            {
            case CommandExecutionVerb.Execute:
                ParentCommandManager.Execute((CommandId)commandId);
                return(HRESULT.S_OK);

            case CommandExecutionVerb.Preview:
                break;

            case CommandExecutionVerb.CancelPreview:
                break;
            }
            return(HRESULT.S_OK);
        }
コード例 #8
0
        protected override void PerformExecuteWithArgs(CommandExecutionVerb verb, ExecuteEventHandlerArgs args)
        {
            switch (verb)
            {
            case CommandExecutionVerb.Execute:
                PerformExecuteWithArgs(args);
                break;

            case CommandExecutionVerb.Preview:
                FireStartPreview(args);
                break;

            case CommandExecutionVerb.CancelPreview:
                FireCancelPreview();
                break;

            default:
                Debug.Fail("Unexpected CommandExecutionVerb!");
                break;
            }
        }
コード例 #9
0
 protected override void PerformExecuteWithArgs(CommandExecutionVerb verb, ExecuteEventHandlerArgs args)
 {
     _command.PerformExecuteWithArgs(args);
 }
コード例 #10
0
 public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
 {
     PerformExecuteWithArgs(verb, new ExecuteEventHandlerArgs());
     return(HRESULT.S_OK);
 }
コード例 #11
0
 public int Execute(uint commandId, CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
 {
     return(contentEditor.CommandManager.Execute(commandId, verb, key, currentValue, commandExecutionProperties));
 }
コード例 #12
0
 protected override void PerformExecuteWithArgs(CommandExecutionVerb verb, ExecuteEventHandlerArgs args)
 {
     _command.PerformExecuteWithArgs(args);
 }
コード例 #13
0
 public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
 {
     return _command.PerformExecute(verb, key, currentValue, commandExecutionProperties);
 }
コード例 #14
0
        public virtual int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
        {
            switch (verb)
            {
                case CommandExecutionVerb.Execute:
                    PerformExecute();
                    break;
                case CommandExecutionVerb.Preview:
                    Debug.Fail("Preview is not implemented for " + CommandId);
                    break;
                case CommandExecutionVerb.CancelPreview:
                    Debug.Fail("CancelPreview is not implemented for " + CommandId);
                    break;
                default:
                    Debug.Fail("Unexpected CommandExecutionVerb.");
                    break;
            }

            return HRESULT.S_OK;
        }
コード例 #15
0
 public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
 {
     PerformExecuteWithArgs(verb, new ExecuteEventHandlerArgs());
     return HRESULT.S_OK;
 }
コード例 #16
0
        public int Execute(uint commandId, CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
        {
            try
            {
                Command command = Get((CommandId)commandId);

                if (verb != CommandExecutionVerb.Execute)
                    return HRESULT.S_OK;

                FireBeforeExecute((CommandId)commandId);
                int result;
                try
                {
                    result = command.PerformExecute(verb, key, currentValue, commandExecutionProperties);
                }
                finally
                {
                    FireAfterExecute((CommandId)commandId);
                }

                return result;
            }
            catch (Exception ex)
            {
                Trace.Fail("Exception thrown when executing " + (CommandId)commandId + ": " + ex);
            }

            return HRESULT.S_OK;
        }
コード例 #17
0
 public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
 {
     return(_command.PerformExecute(verb, key, currentValue, commandExecutionProperties));
 }
コード例 #18
0
 public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
 {
     decimal spinnerValue = Convert.ToDecimal(currentValue.PropVariant.Value, CultureInfo.InvariantCulture);
     PerformExecuteWithArgs(verb, new ExecuteEventHandlerArgs(CommandId.ToString(), spinnerValue));
     return HRESULT.S_OK;
 }
コード例 #19
0
 public int Execute(uint commandId, CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties)
 {
     return contentEditor.CommandManager.Execute(commandId, verb, key, currentValue, commandExecutionProperties);
 }
コード例 #20
0
 protected virtual void PerformExecuteWithArgs(CommandExecutionVerb verb, ExecuteEventHandlerArgs args)
 {
     if (verb == CommandExecutionVerb.Execute)
     {
         if (On && Enabled)
         {
             OnExecute(args);
         }
         else
         {
             Debug.Fail("Command state error.", "It is illogical to execute a command that is not on and enabled.");
         }
     }
     else
     {
         Debug.Fail("Expected execute verb on " + CommandId);
     }
 }