Ejemplo n.º 1
0
 public DisplayEntry(string value, DisplayEntryValueType type)
 {
     if (string.IsNullOrEmpty(value))
     {
         throw PSTraceSource.NewArgumentNullException("value");
     }
     this._value = value;
     this._type  = type;
 }
Ejemplo n.º 2
0
 public DisplayEntry(string value, DisplayEntryValueType type)
 {
     if (string.IsNullOrEmpty(value))
     {
         throw PSTraceSource.NewArgumentNullException("value");
     }
     this._value = value;
     this._type = type;
 }
        /// <summary>Public constructor for DisplayEntry</summary>
        public DisplayEntry(string value, DisplayEntryValueType type)
        {
            if (String.IsNullOrEmpty(value))
            {
                if (value == null || type == DisplayEntryValueType.Property)
                {
                    throw PSTraceSource.NewArgumentNullException("value");
                }
            }

            Value     = value;
            ValueType = type;
        }
        private TableRowDefinitionBuilder AddItem(string value, DisplayEntryValueType entryType, Alignment alignment, string format)
        {
            if (string.IsNullOrEmpty(value))
            {
                throw PSTraceSource.NewArgumentException("value");
            }

            var tableControlColumn = new TableControlColumn(alignment, new DisplayEntry(value, entryType))
            {
                FormatString = format
            };

            _tcr.Columns.Add(tableControlColumn);

            return(this);
        }
Ejemplo n.º 5
0
        private ListEntryBuilder AddItem(string value, string label, DisplayEntryValueType kind, string format)
        {
            if (string.IsNullOrEmpty(value))
            {
                throw PSTraceSource.NewArgumentNullException("property");
            }

            _listEntry.Items.Add(new ListControlEntryItem
            {
                DisplayEntry = new DisplayEntry(value, kind),
                Label        = label,
                FormatString = format
            });

            return(this);
        }
 private void AddDisplayExpressionBinding(
     string value,
     DisplayEntryValueType valueType,
     bool enumerateCollection    = false,
     string selectedByType       = null,
     string selectedByScript     = null,
     CustomControl customControl = null)
 {
     _entryStack.Peek().Add(new CustomItemExpression()
     {
         ItemSelectionCondition = selectedByScript != null
             ? new DisplayEntry(selectedByScript, DisplayEntryValueType.ScriptBlock)
             : selectedByType != null
                 ? new DisplayEntry(selectedByType, DisplayEntryValueType.Property)
                 : null,
         EnumerateCollection = enumerateCollection,
         Expression          = new DisplayEntry(value, valueType),
         CustomControl       = customControl
     });
 }
Ejemplo n.º 7
0
        private TableRowDefinitionBuilder AddItem(string value, DisplayEntryValueType entryType, Alignment alignment, string format)
        {
            if (string.IsNullOrEmpty(value))
                throw PSTraceSource.NewArgumentException("value");

            var tableControlColumn = new TableControlColumn(alignment, new DisplayEntry(value, entryType))
            {
                FormatString = format
            };
            _tcr.Columns.Add(tableControlColumn);

            return this;
        }
 private void AddDisplayExpressionBinding(
     string value,
     DisplayEntryValueType valueType,
     bool enumerateCollection = false,
     string selectedByType = null,
     string selectedByScript = null,
     CustomControl customControl = null)
 {
     _entryStack.Peek().Add(new CustomItemExpression()
     {
         ItemSelectionCondition = selectedByScript != null
             ? new DisplayEntry(selectedByScript, DisplayEntryValueType.ScriptBlock)
             : selectedByType != null
                 ? new DisplayEntry(selectedByType, DisplayEntryValueType.Property)
                 : null,
         EnumerateCollection = enumerateCollection,
         Expression = new DisplayEntry(value, valueType),
         CustomControl = customControl
     });
 }
Ejemplo n.º 9
0
        private ListEntryBuilder AddItem(string value, string label, DisplayEntryValueType kind, string format)
        {
            if (string.IsNullOrEmpty(value))
                throw PSTraceSource.NewArgumentNullException("property");

            _listEntry.Items.Add(new ListControlEntryItem
            {
                DisplayEntry = new DisplayEntry(value, kind),
                Label = label,
                FormatString = format
            });

            return this;
        }