protected override void ProcessRecord() { Collection<FormatData> data; if (InputObject == null) { return; } else if (InputObject.BaseObject is FormatData) { data = new Collection<FormatData>(); data.Add((FormatData)InputObject.BaseObject); } else { if (_formatManager == null) { _formatManager = new FormatManager(FormatShape.Undefined, ExecutionContext); } data = _formatManager.Process(InputObject); } // make sure we have data to process if (data.Count == 0) { return; } // although we might have multiple FormatData objects, they are all derived from a single data object // so all should be formatted in the same shape var processor = FormatProcessor.Get(OutputWriter, data[0].Shape); foreach (var curData in data) { processor.ProcessPayload(curData); } }
protected override void EndProcessing() { foreach (var res in FormatManager.End()) { WriteObject(res); } }
protected override void ProcessRecord() { foreach (var res in FormatManager.Process(InputObject)) { WriteObject(res); } }
protected override void BeginProcessing() { // just make sure to have the up to data execution context FormatManager.SetExecutionContext(ExecutionContext); }
internal FormatCommandBase(FormatShape shape) { FormatManager = new FormatManager(shape, ExecutionContext); }