Example #1
0
        protected override void ProcessRecord()
        {
            Collection <FormatData> data;

            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);
            }
            // 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);
            }
        }