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); }
/// <summary> /// Handles IUICommandHandler.Execute function for supported events /// </summary> /// <param name="verb">the mode of execution</param> /// <param name="key">the property that has changed</param> /// <param name="currentValue">the new value of the property that has changed</param> /// <param name="commandExecutionProperties">additional data for this execution</param> /// <returns>Returns S_OK if successful, or an error value otherwise</returns> public override HRESULT Execute(ExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { if (verb == ExecutionVerb.Execute) { if (ExecuteEvent != null) { try { ExecuteEvent(_sender, new ExecuteEventArgs(key, currentValue, commandExecutionProperties)); } catch (Exception ex) { BaseRibbonControl ctrl = _sender as BaseRibbonControl; if (ctrl != null) { ThreadExceptionEventArgs e = new ThreadExceptionEventArgs(ex); if (ctrl._ribbon.OnRibbonEventException(_sender, e)) { return(HRESULT.E_FAIL); } } Environment.FailFast(ex.StackTrace); return(HRESULT.E_ABORT); } } } 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) { // This is the main command if (verb == CommandExecutionVerb.Execute) { OnExecute(EventArgs.Empty); } return(HRESULT.S_OK); }
/// <summary> /// Implementation of IUICommandHandler.Execute /// Responds to execute events on Commands bound to the Command handler /// </summary> /// <param name="commandID">the command that has been executed</param> /// <param name="verb">the mode of execution</param> /// <param name="key">the property that has changed</param> /// <param name="currentValue">the new value of the property that has changed</param> /// <param name="commandExecutionProperties">additional data for this execution</param> /// <returns>Returns S_OK if successful, or an error value otherwise</returns> /// <remarks>This method is used internally by the Ribbon class and should not be called by the user.</remarks> public virtual HRESULT Execute(uint commandID, ExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { if (_mapRibbonControls.ContainsKey(commandID)) { return(_mapRibbonControls[commandID].Execute(verb, key, currentValue, commandExecutionProperties)); } return(HRESULT.S_OK); }
/// <summary> /// Handles IUICommandHandler.Execute function for supported events /// </summary> /// <param name="verb">the mode of execution</param> /// <param name="key">the property that has changed</param> /// <param name="currentValue">the new value of the property that has changed</param> /// <param name="commandExecutionProperties">additional data for this execution</param> /// <returns>Returns S_OK if successful, or an error value otherwise</returns> public override HRESULT Execute(ExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { if (verb == ExecutionVerb.Execute) { if (ExecuteEvent != null) { ExecuteEvent(_sender, new ExecuteEventArgs(key, currentValue, commandExecutionProperties)); } } 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); }
/// <summary> /// Implementation of IUICommandHandler.Execute /// Responds to execute events on Commands bound to the Command handler /// </summary> /// <param name="commandID">the command that has been executed</param> /// <param name="verb">the mode of execution</param> /// <param name="key">the property that has changed</param> /// <param name="currentValue">the new value of the property that has changed</param> /// <param name="commandExecutionProperties">additional data for this execution</param> /// <returns>Returns S_OK if successful, or an error value otherwise</returns> /// <remarks>This method is used internally by the Ribbon class and should not be called by the user.</remarks> public virtual HRESULT Execute(uint commandID, ExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { #if DEBUG Debug.WriteLine(string.Format("Execute verb: {0} for command {1}", verb, commandID)); #endif if (_mapRibbonControls.ContainsKey(commandID)) { return(_mapRibbonControls[commandID].Execute(verb, key, currentValue, commandExecutionProperties)); } 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; }
/// <summary> /// Handles IUICommandHandler.Execute function for this ribbon control /// </summary> /// <param name="verb">the mode of execution</param> /// <param name="key">the property that has changed</param> /// <param name="currentValue">the new value of the property that has changed</param> /// <param name="commandExecutionProperties">additional data for this execution</param> /// <returns>Returns S_OK if successful, or an error value otherwise</returns> public virtual HRESULT Execute(ExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { // check if verb is registered with this ribbon control if (_mapEvents.ContainsKey(verb)) { // find events provider IEventsProvider eventsProvider = _mapEvents[verb]; // delegates execution to events provider return(eventsProvider.Execute(verb, key, currentValue, commandExecutionProperties)); } Debug.WriteLine(string.Format("Class {0} does not support verb: {1}.", GetType(), verb)); return(HRESULT.E_NOTIMPL); }
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); }
/// <summary> /// Handles IUICommandHandler.Execute function for supported events /// </summary> /// <param name="verb">the mode of execution</param> /// <param name="key">the property that has changed</param> /// <param name="currentValue">the new value of the property that has changed</param> /// <param name="commandExecutionProperties">additional data for this execution</param> /// <returns>Returns S_OK if successful, or an error value otherwise</returns> public override HRESULT Execute(ExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { switch (verb) { case ExecutionVerb.Preview: if (PreviewEvent != null) { PreviewEvent(_sender, new ExecuteEventArgs(key, currentValue, commandExecutionProperties)); } break; case ExecutionVerb.CancelPreview: if (CancelPreviewEvent != null) { CancelPreviewEvent(_sender, new ExecuteEventArgs(key, currentValue, commandExecutionProperties)); } break; } return(HRESULT.S_OK); }
/// <summary> /// /// </summary> public HRESULT Execute(ExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { 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); }
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) { PerformExecuteWithArgs(verb, new ExecuteEventHandlerArgs()); 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) { return(contentEditor.CommandManager.Execute(commandId, 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) { 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 ExecuteEventArgs(PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { _key = key; _currentValue = currentValue; _commandExecutionProperties = commandExecutionProperties; }
public override int PerformExecute(CommandExecutionVerb verb, PropertyKeyRef key, PropVariantRef currentValue, IUISimplePropertySet commandExecutionProperties) { return _command.PerformExecute(verb, key, currentValue, commandExecutionProperties); }