private void AddColumnsAndItemEnd(PSObject liveObject) { // Add columns to the underlying Management list and as a byproduct get a stale PSObject. PSObject staleObject = _headerInfo.AddColumnsToWindow(this, liveObject); // Add 3 extra properties, so that the stale PSObject has meaningful info in the Hetero-type header view. AddExtraProperties(staleObject, liveObject); // Add the stale PSObject to the underlying Management list. _graphicalHostReflectionWrapper.CallMethod("AddItem", staleObject); }
// Hetero types. internal void AddHeteroViewColumnsAndItem(PSObject liveObject) { _headerInfo = new HeaderInfo(); _headerInfo.AddColumn(new IndexColumnInfo(OutWindowProxy.IndexPropertyName, StringUtil.Format(FormatAndOut_out_gridview.IndexColumnName), _index)); _headerInfo.AddColumn(new ToStringColumnInfo(OutWindowProxy.ToStringValuePropertyName, StringUtil.Format(FormatAndOut_out_gridview.ValueColumnName), _parentCmdlet)); _headerInfo.AddColumn(new TypeNameColumnInfo(OutWindowProxy.OriginalTypePropertyName, StringUtil.Format(FormatAndOut_out_gridview.TypeColumnName))); // Add columns to the underlying Management list and as a byproduct get a stale PSObject. PSObject staleObject = _headerInfo.AddColumnsToWindow(this, liveObject); // Add the stale PSObject to the underlying Management list. _graphicalHostReflectionWrapper.CallMethod("AddItem", staleObject); }