internal TableFormatGeneratorOptions(FormatGeneratorOptions options)
 {
     Expand = options.Expand;
     Force = options.Force;
     GroupBy = options.GroupBy;
     DisplayError = options.DisplayError;
     ShowError = options.ShowError;
     View = options.View;
     Properties = options.Properties;
 }
 internal TableFormatGeneratorOptions(FormatGeneratorOptions options)
 {
     Expand       = options.Expand;
     Force        = options.Force;
     GroupBy      = options.GroupBy;
     DisplayError = options.DisplayError;
     ShowError    = options.ShowError;
     View         = options.View;
     Properties   = options.Properties;
 }
示例#3
0
 public static FormatGenerator Get(ExecutionContext context, FormatShape shape, FormatGeneratorOptions options)
 {
     if (_lastGenerator != null && _lastGenerator.Shape.Equals(shape) && _lastGenerator.Options.Equals(options))
     {
         return _lastGenerator;
     }
     switch (shape)
     {
         case FormatShape.List:
             _lastGenerator = new ListFormatGenerator(context, options);
             break;
         case FormatShape.Table:
             _lastGenerator = new TableFormatGenerator(context, options);
             break;
         default:
             throw new PSInvalidOperationException("Cannot get a FormatGenerator with undefined shape");
     }
     return _lastGenerator;
 }
示例#4
0
        public static FormatGenerator Get(ExecutionContext context, FormatShape shape, FormatGeneratorOptions options)
        {
            if (_lastGenerator != null && _lastGenerator.Shape.Equals(shape) && _lastGenerator.Options.Equals(options))
            {
                return(_lastGenerator);
            }
            switch (shape)
            {
            case FormatShape.List:
                _lastGenerator = new ListFormatGenerator(context, options);
                break;

            case FormatShape.Table:
                _lastGenerator = new TableFormatGenerator(context, options);
                break;

            default:
                throw new PSInvalidOperationException("Cannot get a FormatGenerator with undefined shape");
            }
            return(_lastGenerator);
        }
示例#5
0
 protected FormatGenerator(ExecutionContext context, FormatShape shape, FormatGeneratorOptions options)
 {
     Options          = options;
     Shape            = shape;
     ExecutionContext = context;
 }
示例#6
0
 internal FormatManager(FormatShape shape, ExecutionContext context)
 {
     Shape = shape;
     Options = new FormatGeneratorOptions();
     _state = FormattingState.FormatEnd;
 }
示例#7
0
 public ListFormatGenerator(ExecutionContext context, FormatGeneratorOptions options)
     : base(context, FormatShape.List, options)
 {
 }
示例#8
0
 protected FormatGenerator(ExecutionContext context, FormatShape shape, FormatGeneratorOptions options)
 {
     Options = options;
     Shape = shape;
     ExecutionContext = context;
 }
示例#9
0
 public ListFormatGenerator(ExecutionContext context, FormatGeneratorOptions options)
     : base(context, FormatShape.List, options)
 {
 }
示例#10
0
 public TableFormatGenerator(ExecutionContext context, FormatGeneratorOptions options)
     : this(context, new TableFormatGeneratorOptions(options))
 {
 }
示例#11
0
 public TableFormatGenerator(ExecutionContext context, FormatGeneratorOptions options)
     : this(context, new TableFormatGeneratorOptions(options))
 {
 }
示例#12
0
 internal FormatManager(FormatShape shape, ExecutionContext context)
 {
     Shape   = shape;
     Options = new FormatGeneratorOptions();
     _state  = FormattingState.FormatEnd;
 }