Example #1
0
        internal PSObject AddColumnsToWindow(OutWindowProxy windowProxy, PSObject liveObject)
        {
            PSObject staleObject = new PSObject();

            // Initiate arrays to be of the same size.
            int count = _columns.Count;

            string[] propertyNames = new string[count];
            string[] displayNames  = new string[count];
            Type[]   types         = new Type[count];

            count = 0; // Reuse this variable to count cycles.
            foreach (ColumnInfo column in _columns)
            {
                propertyNames[count] = column.StaleObjectPropertyName();
                displayNames[count]  = column.DisplayName();
                object columnValue = null;
                types[count] = column.GetValueType(liveObject, out columnValue);

                // Add a property to the stale object since a column value has been evaluated to get column's type.
                staleObject.Properties.Add(new PSNoteProperty(propertyNames[count], columnValue));

                count++;
            }

            windowProxy.AddColumns(propertyNames, displayNames, types);

            return(staleObject);
        }
Example #2
0
        internal PSObject AddColumnsToWindow(OutWindowProxy windowProxy, PSObject liveObject)
        {
            PSObject staleObject = new PSObject();

            // Initiate arrays to be of the same size.
            int count = _columns.Count;
            string[] propertyNames = new string[count];
            string[] displayNames = new string[count];
            Type[] types = new Type[count];

            count = 0; // Reuse this variable to count cycles.
            foreach (ColumnInfo column in _columns)
            {
                propertyNames[count] = column.StaleObjectPropertyName();
                displayNames[count] = column.DisplayName();
                Object columnValue = null;
                types[count] = column.GetValueType(liveObject, out columnValue);

                // Add a property to the stale object since a column value has been evaluated to get column's type.
                staleObject.Properties.Add(new PSNoteProperty(propertyNames[count], columnValue));

                count++;
            }

            windowProxy.AddColumns(propertyNames, displayNames, types);

            return staleObject;
        }
Example #3
0
 internal PSObject AddColumnsToWindow(OutWindowProxy windowProxy, PSObject liveObject)
 {
     PSObject obj2 = new PSObject();
     int count = this.columns.Count;
     string[] propertyNames = new string[count];
     string[] displayNames = new string[count];
     Type[] types = new Type[count];
     count = 0;
     foreach (ColumnInfo info in this.columns)
     {
         propertyNames[count] = info.StaleObjectPropertyName();
         displayNames[count] = info.DisplayName();
         object columnValue = null;
         types[count] = info.GetValueType(liveObject, out columnValue);
         obj2.Properties.Add(new PSNoteProperty(propertyNames[count], columnValue));
         count++;
     }
     windowProxy.AddColumns(propertyNames, displayNames, types);
     return obj2;
 }
Example #4
0
        internal PSObject AddColumnsToWindow(OutWindowProxy windowProxy, PSObject liveObject)
        {
            PSObject obj2  = new PSObject();
            int      count = this.columns.Count;

            string[] propertyNames = new string[count];
            string[] displayNames  = new string[count];
            Type[]   types         = new Type[count];
            count = 0;
            foreach (ColumnInfo info in this.columns)
            {
                propertyNames[count] = info.StaleObjectPropertyName();
                displayNames[count]  = info.DisplayName();
                object columnValue = null;
                types[count] = info.GetValueType(liveObject, out columnValue);
                obj2.Properties.Add(new PSNoteProperty(propertyNames[count], columnValue));
                count++;
            }
            windowProxy.AddColumns(propertyNames, displayNames, types);
            return(obj2);
        }