Пример #1
0
 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);
     }
 }
Пример #2
0
 protected override void EndProcessing()
 {
     foreach (var res in FormatManager.End())
     {
         WriteObject(res);
     }
 }
Пример #3
0
 protected override void ProcessRecord()
 {
     foreach (var res in FormatManager.Process(InputObject))
     {
         WriteObject(res);
     }
 }
Пример #4
0
 protected override void BeginProcessing()
 {
     // just make sure to have the up to data execution context
     FormatManager.SetExecutionContext(ExecutionContext);
 }
Пример #5
0
 internal FormatCommandBase(FormatShape shape)
 {
     FormatManager = new FormatManager(shape, ExecutionContext);
 }
Пример #6
0
 internal FormatCommandBase(FormatShape shape)
 {
     FormatManager = new FormatManager(shape, ExecutionContext);
 }