/// <summary> /// Deserialization constructor /// </summary> public CommandTriggerData( SerializationInfo info, StreamingContext context ) { CommandSerializationContext commandContext = context.Context as CommandSerializationContext; if ( commandContext == null ) { throw new System.IO.IOException( "CommandTriggerData must be deserialized with a CommandSerializationContext present" ); } m_User = commandContext.Users.FindById( ( int )info.GetValue( "u", typeof( int ) ) ); m_Command = commandContext.Commands.FindById( ( int )info.GetValue( "c", typeof( int ) ) ); m_InputState = ( ICommandInputState )info.GetValue( "s", typeof( ICommandInputState ) ); }
/// <summary> /// Creates a <see cref="WorkspaceCommandTriggerData"/> object /// </summary> public CommandTriggerData Create( ICommandUser user, Command command, ICommandInputState inputState ) { return new WorkspaceCommandTriggerData( m_Workspace, user, command, inputState ); }
/// <summary> /// Setup constructor /// </summary> /// <param name="workspace">Workspace that the command was triggered in</param> /// <param name="user">User that triggered the command</param> /// <param name="command">Command that was triggered</param> /// <param name="inputState">Command input state</param> public WorkspaceCommandTriggerData( IWorkspace workspace, ICommandUser user, Command command, ICommandInputState inputState ) : base(user, command, inputState) { Arguments.CheckNotNull( workspace, "workspace" ); m_Workspace = workspace; }
/// <summary> /// Setup constructor /// </summary> /// <param name="user">User that triggered the command</param> /// <param name="command">Command that was triggered</param> /// <param name="inputState">Command input state</param> public CommandTriggerData( ICommandUser user, Command command, ICommandInputState inputState ) { m_User = user; m_Command = command; m_InputState = inputState; }
/// <summary> /// Creates a CommandTriggerData object /// </summary> public CommandTriggerData Create( ICommandUser user, Command command, ICommandInputState inputState ) { return new CommandTriggerData( user, command, inputState ); }