コード例 #1
0
 public DisplayEntry(string value, DisplayEntryValueType type)
 {
     if (string.IsNullOrEmpty(value))
     {
         throw PSTraceSource.NewArgumentNullException("value");
     }
     this._value = value;
     this._type  = type;
 }
コード例 #2
0
ファイル: DisplayEntry.cs プロジェクト: nickchal/pash
 public DisplayEntry(string value, DisplayEntryValueType type)
 {
     if (string.IsNullOrEmpty(value))
     {
         throw PSTraceSource.NewArgumentNullException("value");
     }
     this._value = value;
     this._type = type;
 }
コード例 #3
0
        /// <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;
        }
コード例 #4
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);
        }
コード例 #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);
        }
コード例 #6
0
 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
     });
 }
コード例 #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;
        }
コード例 #8
0
 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
     });
 }
コード例 #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;
        }