internal NativeCommandProcessor(ApplicationInfo applicationInfo, ExecutionContext context) : base(applicationInfo) { this.sync = new object(); if (applicationInfo == null) { throw PSTraceSource.NewArgumentNullException("applicationInfo"); } this.applicationInfo = applicationInfo; base._context = context; base.Command = new NativeCommand(); base.Command.CommandInfo = applicationInfo; base.Command.Context = context; base.Command.commandRuntime = base.commandRuntime = new MshCommandRuntime(context, applicationInfo, base.Command); base.CommandScope = context.EngineSessionState.CurrentScope; ((NativeCommand) base.Command).MyCommandProcessor = this; this.inputWriter = new ProcessInputWriter(base.Command); }
internal NativeCommandProcessor(ApplicationInfo applicationInfo, ExecutionContext context) : base(applicationInfo) { this.sync = new object(); if (applicationInfo == null) { throw PSTraceSource.NewArgumentNullException("applicationInfo"); } this.applicationInfo = applicationInfo; base._context = context; base.Command = new NativeCommand(); base.Command.CommandInfo = applicationInfo; base.Command.Context = context; base.Command.commandRuntime = base.commandRuntime = new MshCommandRuntime(context, applicationInfo, base.Command); base.CommandScope = context.EngineSessionState.CurrentScope; ((NativeCommand)base.Command).MyCommandProcessor = this; this.inputWriter = new ProcessInputWriter(base.Command); }
internal NativeCommandProcessor(ApplicationInfo applicationInfo, ExecutionContext context) : base((CommandInfo)applicationInfo) { using (NativeCommandProcessor.tracer.TraceConstructor((object)this)) { if (applicationInfo == null) { throw NativeCommandProcessor.tracer.NewArgumentNullException(nameof(applicationInfo)); } NativeCommandProcessor.tracer.WriteLine("NativeCommnadName: {0} Path: {1}", (object)applicationInfo.Name, (object)applicationInfo.Path); this.applicationInfo = applicationInfo; this.context = context; this.Command = (InternalCommand) new NativeCommand(); this.Command.CommandInfo = (CommandInfo)applicationInfo; this.Command.Context = context; this.Command.commandRuntime = (ICommandRuntime)(this.commandRuntime = new MshCommandRuntime(context, (CommandInfo)applicationInfo, this.Command)); ((NativeCommand)this.Command).MyCommandProcessor = this; this.inputWriter = new ProcessInputWriter(this.Command); } }
/// <summary> /// Initializes the new instance of NativeCommandProcessor class. /// </summary> /// /// <param name="applicationInfo"> /// The information about the application to run. /// </param> /// /// <param name="context"> /// The execution context for this command. /// </param> /// /// <exception cref="ArgumentNullException"> /// <paramref name="applicationInfo"/> or <paramref name="context"/> is null /// </exception> internal NativeCommandProcessor(ApplicationInfo applicationInfo, ExecutionContext context) : base(applicationInfo) { if (applicationInfo == null) { throw PSTraceSource.NewArgumentNullException("applicationInfo"); } _applicationInfo = applicationInfo; this._context = context; this.Command = new NativeCommand(); this.Command.CommandInfo = applicationInfo; this.Command.Context = context; this.Command.commandRuntime = this.commandRuntime = new MshCommandRuntime(context, applicationInfo, this.Command); this.CommandScope = context.EngineSessionState.CurrentScope; //provide native command a backpointer to this object. //When kill is called on the command object, //it calls this NCP back to kill the process... ((NativeCommand)Command).MyCommandProcessor = this; //Create input writer for providing input to the process. _inputWriter = new ProcessInputWriter(Command); }