protected override void PerformExecuteWithArgs(CommandExecutionVerb verb, ExecuteEventHandlerArgs args) { if (_allowPreview || verb == CommandExecutionVerb.Execute) { base.PerformExecuteWithArgs(verb, args); } }
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); }
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); }
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); }
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); }
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; }
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); }
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; } }
protected override void PerformExecuteWithArgs(CommandExecutionVerb verb, ExecuteEventHandlerArgs args) { _command.PerformExecuteWithArgs(args); }
public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { PerformExecuteWithArgs(verb, new ExecuteEventHandlerArgs()); return(HRESULT.S_OK); }
public int Execute(uint commandId, CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { return(contentEditor.CommandManager.Execute(commandId, verb, key, currentValue, commandExecutionProperties)); }
protected override void PerformExecuteWithArgs(CommandExecutionVerb verb, ExecuteEventHandlerArgs args) { _command.PerformExecuteWithArgs(args); }
public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { return _command.PerformExecute(verb, key, currentValue, commandExecutionProperties); }
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; }
public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { PerformExecuteWithArgs(verb, new ExecuteEventHandlerArgs()); return HRESULT.S_OK; }
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; }
public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { return(_command.PerformExecute(verb, key, currentValue, commandExecutionProperties)); }
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; }
public int Execute(uint commandId, CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { return contentEditor.CommandManager.Execute(commandId, verb, key, currentValue, commandExecutionProperties); }
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); } }