protected override void OnExecute(CommandExecutorContext context) { var command = context.Command; if (command != null) { context.Result = command.Execute(new TerminalCommandContext(this, context.CommandLine, context.CommandNode, context.Parameter)); } }
protected override void OnExecute(CommandExecutorContext context) { var args = context.Parameter as ReceivedEventArgs; if (args == null) { throw new InvalidOperationException("Invalid execution parameter."); } context.Result = context.Command.Execute( new FtpCommandContext( this, context.Command, (FtpServerChannel)args.Channel, (FtpStatement)args.ReceivedObject)); }
protected override CommandContext CreateCommandContext(CommandExecutorContext session, CommandExpression expression, CommandTreeNode node, object parameter) { var args = parameter as ReceivedEventArgs; if (args == null) { throw new InvalidOperationException("Invalid execution parameter."); } return(new FtpCommandContext( session, expression, node.Command, (FtpServerChannel)args.Channel, (FtpStatement)args.ReceivedObject)); }
protected override CommandContext CreateCommandContext(CommandExecutorContext session, CommandExpression expression, CommandTreeNode node, object parameter) { return(new TerminalCommandContext(session, expression, node, parameter)); }
public TerminalCommandContext(CommandExecutorContext session, CommandExpression expression, CommandTreeNode commandNode, object parameter, IDictionary <string, object> extendedProperties = null) : base(session, expression, commandNode, parameter, extendedProperties) { }
internal FtpCommandContext(CommandExecutorContext session, CommandExpression expression, ICommand command, FtpServerChannel channel, FtpStatement statement) : base(session, expression, command, null, null) { _channel = channel; _statement = statement; }