private Array ApplyFormatting(object o) { if (this.command == null) { this.command = new CommandWrapper(); this.command.Initialize(this.OuterCmdlet().Context, "format-default", typeof(FormatDefaultCommand)); } return this.command.Process(o); }
private void Dispose(bool isDisposing) { if (!this.alreadyDisposed) { this.alreadyDisposed = true; if (isDisposing && (this.commandWrapper != null)) { this.commandWrapper.Dispose(); this.commandWrapper = null; } } }
protected override void BeginProcessing() { this.commandWrapper = new CommandWrapper(); if (string.Equals(base.ParameterSetName, "File", StringComparison.OrdinalIgnoreCase)) { this.commandWrapper.Initialize(base.Context, "out-file", typeof(OutFileCommand)); this.commandWrapper.AddNamedParameter("filepath", this.fileName); this.commandWrapper.AddNamedParameter("append", this.append); } else if (string.Equals(base.ParameterSetName, "LiteralFile", StringComparison.OrdinalIgnoreCase)) { this.commandWrapper.Initialize(base.Context, "out-file", typeof(OutFileCommand)); this.commandWrapper.AddNamedParameter("LiteralPath", this.fileName); this.commandWrapper.AddNamedParameter("append", this.append); } else { this.commandWrapper.Initialize(base.Context, "set-variable", typeof(SetVariableCommand)); this.commandWrapper.AddNamedParameter("name", this.variable); } }
/// <summary> /// /// </summary> protected override void BeginProcessing() { _commandWrapper = new CommandWrapper(); if (String.Equals(ParameterSetName, "File", StringComparison.OrdinalIgnoreCase)) { _commandWrapper.Initialize(Context, "out-file", typeof(OutFileCommand)); _commandWrapper.AddNamedParameter("filepath", _fileName); _commandWrapper.AddNamedParameter("append", _append); } else if (String.Equals(ParameterSetName, "LiteralFile", StringComparison.OrdinalIgnoreCase)) { _commandWrapper.Initialize(Context, "out-file", typeof(OutFileCommand)); _commandWrapper.AddNamedParameter("LiteralPath", _fileName); _commandWrapper.AddNamedParameter("append", _append); } else { // variable parameter set _commandWrapper.Initialize(Context, "set-variable", typeof(SetVariableCommand)); _commandWrapper.AddNamedParameter("name", _variable); // Can't use set-var's passthru because it writes the var object to the pipeline, we want just // the values to be written } }
protected override void InternalDispose() { base.InternalDispose(); if (this.command != null) { this.command.Dispose(); this.command = null; } }
public void Dispose() { if (this.command != null) { this.command.Dispose(); this.command = null; } }
/// <summary> /// just dispose of the inner command wrapper /// </summary> public void Dispose() { if (this.command == null) return; this.command.Dispose(); this.command = null; }