NetHelp.format.ps1xml

<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
  <Controls>
    <Control>
      <Name>NetNameSectionControl</Name>
        <CustomControl>
          <CustomEntries>
            <CustomEntry>
              <EntrySelectedBy>
                <TypeName>ObjectHelpInfo#Details</TypeName>
              </EntrySelectedBy>
              <CustomItem>
                <Text AssemblyName="System.Management.Automation" BaseName="HelpDisplayStrings" ResourceId="Name"/>
                <NewLine/>
                <Frame>
                  <LeftIndent>4</LeftIndent>
                  <CustomItem>
                    <ExpressionBinding>
                      <PropertyName>Name</PropertyName>
                    </ExpressionBinding>
                    <Text> Class</Text>
                    <NewLine/>
                    <NewLine/>
                  </CustomItem>
                </Frame>
              </CustomItem>
            </CustomEntry>
            <CustomEntry>
              <EntrySelectedBy>
                <TypeName>ObjectHelpInfo#Net#Property</TypeName>
              </EntrySelectedBy>
              <CustomItem>
                <Text AssemblyName="System.Management.Automation" BaseName="HelpDisplayStrings" ResourceId="Name"/>
                <NewLine/>
                <Frame>
                  <LeftIndent>4</LeftIndent>
                  <CustomItem>
                    <ExpressionBinding>
                      <PropertyName>Name</PropertyName>
                    </ExpressionBinding>
                    <Text> Property</Text>
                    <NewLine/>
                    <NewLine/>
                  </CustomItem>
                </Frame>
              </CustomItem>
            </CustomEntry>
            <CustomEntry>
              <EntrySelectedBy>
                <TypeName>ObjectHelpInfo#Net#Method</TypeName>
              </EntrySelectedBy>
              <CustomItem>
                <Text AssemblyName="System.Management.Automation" BaseName="HelpDisplayStrings" ResourceId="Name"/>
                <NewLine/>
                <Frame>
                  <LeftIndent>4</LeftIndent>
                  <CustomItem>
                    <ExpressionBinding>
                      <PropertyName>Name</PropertyName>
                    </ExpressionBinding>
                    <Text> Method</Text>
                    <NewLine/>
                    <NewLine/>
                  </CustomItem>
                </Frame>
              </CustomItem>
            </CustomEntry>
            <CustomEntry>
              <CustomItem>
                <Text AssemblyName="System.Management.Automation" BaseName="HelpDisplayStrings" ResourceId="Name"/>
                <NewLine/>
                <Frame>
                  <LeftIndent>4</LeftIndent>
                  <CustomItem>
                    <ExpressionBinding>
                      <PropertyName>Name</PropertyName>
                    </ExpressionBinding>
                    <NewLine/>
                    <NewLine/>
                  </CustomItem>
                </Frame>
              </CustomItem>
            </CustomEntry>
          </CustomEntries>
        </CustomControl>
    </Control>
    <Control>
      <Name>NetClassSectionControl</Name>
        <CustomControl>
          <CustomEntries>
            <CustomEntry>
              <CustomItem>
                <Text>CLASS</Text>
                <NewLine/>
                <Frame>
                  <LeftIndent>4</LeftIndent>
                  <CustomItem>
                    <ExpressionBinding>
                      <PropertyName>Namespace</PropertyName>
                    </ExpressionBinding>
                    <Text>.</Text>
                    <ExpressionBinding>
                      <PropertyName>Name</PropertyName>
                    </ExpressionBinding>
                    <NewLine/>
                    <NewLine/>
                  </CustomItem>
                </Frame>
                <Text>SUPERCLASS</Text>
                <NewLine/>
                <Frame>
                  <LeftIndent>4</LeftIndent>
                  <CustomItem>
                    <ExpressionBinding>
                      <PropertyName>SuperClass</PropertyName>
                    </ExpressionBinding>
                    <NewLine/>
                    <NewLine/>
                  </CustomItem>
                </Frame>
              </CustomItem>
            </CustomEntry>
          </CustomEntries>
        </CustomControl>
    </Control>
    <Control>
      <Name>NetIndentedDescriptionSectionControl</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <Text AssemblyName="System.Management.Automation" BaseName="HelpDisplayStrings" ResourceId="DetailedDescription"/>
              <NewLine/>
              <Frame>
                <LeftIndent>4</LeftIndent>
                <CustomItem>
                  <ExpressionBinding>
                    <PropertyName>Description</PropertyName>
                    <EnumerateCollection/>
                    <CustomControlName>NetDescriptionItemControl</CustomControlName>
                  </ExpressionBinding>
                  <NewLine/>
                </CustomItem>
              </Frame>
              <NewLine/>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>NetDescriptionItemControl</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <EntrySelectedBy>
              <TypeName>NetParaTextItem</TypeName>
            </EntrySelectedBy>
            <CustomItem>
              <ExpressionBinding>
                <PropertyName>Text</PropertyName>
              </ExpressionBinding>
              <NewLine/>
              <NewLine/>
            </CustomItem>
          </CustomEntry>
          <CustomEntry>
            <EntrySelectedBy>
              <TypeName>NetOrderedListTextItem</TypeName>
            </EntrySelectedBy>
            <CustomItem>
              <Frame>
                <FirstLineHanging>4</FirstLineHanging>
                <CustomItem>
                  <ExpressionBinding>
                    <PropertyName>Tag</PropertyName>
                  </ExpressionBinding>
                  <ExpressionBinding>
                    <PropertyName>Text</PropertyName>
                  </ExpressionBinding>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
          <CustomEntry>
            <EntrySelectedBy>
              <TypeName>NetUnorderedListTextItem</TypeName>
            </EntrySelectedBy>
            <CustomItem>
              <Frame>
                <FirstLineHanging>2</FirstLineHanging>
                <CustomItem>
                  <ExpressionBinding>
                    <PropertyName>Tag</PropertyName>
                  </ExpressionBinding>
                  <ExpressionBinding>
                    <PropertyName>Text</PropertyName>
                  </ExpressionBinding>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
          <CustomEntry>
            <EntrySelectedBy>
              <TypeName>NetDefinitionTextItem</TypeName>
            </EntrySelectedBy>
            <CustomItem>
              <ExpressionBinding>
                <PropertyName>Term</PropertyName>
              </ExpressionBinding>
              <NewLine/>
              <Frame>
                <LeftIndent>4</LeftIndent>
                <CustomItem>
                  <ExpressionBinding>
                    <PropertyName>Definition</PropertyName>
                  </ExpressionBinding>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
          <CustomEntry>
            <CustomItem>
              <Text> </Text>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>NetSyntaxSectionControl</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <EntrySelectedBy>
              <TypeName>ObjectHelpInfo#Net#MethodDetail</TypeName>
            </EntrySelectedBy>
            <CustomItem>
              <Text AssemblyName="System.Management.Automation" BaseName="HelpDisplayStrings" ResourceId="Syntax"/>
              <NewLine/>
              <Frame>
                <LeftIndent>4</LeftIndent>
                <CustomItem>
                  <ExpressionBinding>
                    <PropertyName>Overloads</PropertyName>
                    <EnumerateCollection/>
                    <CustomControlName>NetSyntaxItemControl</CustomControlName>
                  </ExpressionBinding>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
          <CustomEntry>
            <CustomItem>
              <Text AssemblyName="System.Management.Automation" BaseName="HelpDisplayStrings" ResourceId="Syntax"/>
              <NewLine/>
              <Frame>
                <LeftIndent>4</LeftIndent>
                <CustomItem>
                  <ExpressionBinding>
                    <PropertyName>Constructors</PropertyName>
                    <EnumerateCollection/>
                    <CustomControlName>NetSyntaxItemControl</CustomControlName>
                  </ExpressionBinding>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>NetSyntaxItemControl</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <EntrySelectedBy>
              <TypeName>ObjectHelpInfo#Net#MethodOverload</TypeName>
            </EntrySelectedBy>
            <CustomItem>
              <Frame>
                <CustomItem>
                  <ExpressionBinding>
                    <ScriptBlock>
                      if ($_.Static) {
                        '[{0}.{1}]::{2}(' -f $_.Namespace, $_.Class, $_.Name
                      } else {
                        '$object.{0}(' -f $_.Name
                      }
                    </ScriptBlock>
                  </ExpressionBinding>
                  <ExpressionBinding>
                    <ScriptBlock>
                      $Parameters = foreach ($Parameter in $_.Parameters) {
                        '[{0}] ${1}' -f $Parameter.ParameterType, $Parameter.Name
                      }
                      $Parameters -join ", "
                    </ScriptBlock>
                  </ExpressionBinding>
                  <Text>)</Text>
                  <NewLine/>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
          <CustomEntry>
            <CustomItem>
              <Frame>
                <CustomItem>
                  <Text>New-Object </Text>
                  <ExpressionBinding>
                    <PropertyName>Namespace</PropertyName>
                  </ExpressionBinding>
                  <Text>.</Text>
                  <ExpressionBinding>
                    <PropertyName>Name</PropertyName>
                  </ExpressionBinding>
                  <Text> (</Text>
                  <ExpressionBinding>
                    <ScriptBlock>
                      $Parameters = foreach ($Parameter in $_.Parameters) {
                        '[{0}] ${1}' -f $Parameter.ParameterType,$Parameter.Name
                      }
                      $Parameters -join ", "
                    </ScriptBlock>
                  </ExpressionBinding>
                  <Text>)</Text>
                  <NewLine/>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>NetPropertyItemControl</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <Frame>
                <LeftIndent>4</LeftIndent>
                <CustomItem>
                  <ExpressionBinding>
                    <PropertyName>Name</PropertyName>
                  </ExpressionBinding>
                  <Text> [</Text>
                  <ExpressionBinding>
                    <PropertyName>Type</PropertyName>
                  </ExpressionBinding>
                  <Text>]</Text>
                  <NewLine/>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>NetMethodListItemControl</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <Frame>
                <LeftIndent>4</LeftIndent>
                <CustomItem>
                  <ExpressionBinding>
                    <PropertyName>Name</PropertyName>
                  </ExpressionBinding>
                  <Text>()</Text>
                  <ExpressionBinding>
                    <ScriptBlock>if ($_.Static) {' &lt;static&gt;'}</ScriptBlock>
                  </ExpressionBinding>
                  <NewLine/>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
  </Controls>
  <!-- ################ VIEW DEFINITIONS ################ -->
  <ViewDefinitions>
    <View>
      <!-- This view is used when no local DotNet help is found. -->
      <Name>DefaultNetHelp</Name>
      <ViewSelectedBy>
        <TypeName>ObjectHelpInfo#Net</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <PropertyName>Details</PropertyName>
                <CustomControlName>NetNameSectionControl</CustomControlName>
              </ExpressionBinding>
              <ExpressionBinding>
                <PropertyName>Details</PropertyName>
                <CustomControlName>NetClassSectionControl</CustomControlName>
              </ExpressionBinding>
              <Text>PROPERTIES</Text>
              <NewLine/>
              <ExpressionBinding>
                <ScriptBlock>$_.Properties.Values | Sort-Object Name</ScriptBlock>
                <EnumerateCollection/>
                <CustomControlName>NetPropertyItemControl</CustomControlName>
              </ExpressionBinding>
              <Text>METHODS</Text>
              <NewLine/>
              <ExpressionBinding>
                <ScriptBlock>$_.Methods.Values | Sort-Object Name</ScriptBlock>
                <EnumerateCollection/>
                <CustomControlName>NetMethodListItemControl</CustomControlName>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
    <View>
      <!-- This view is used when no local DotNet help is found and Get-ObjectHelp is called on a command and passed -Detailed. -->
      <Name>DetailedNetHelp</Name>
      <ViewSelectedBy>
        <TypeName>ObjectHelpInfo#Net#DetailedView</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <PropertyName>Details</PropertyName>
                <CustomControlName>NetNameSectionControl</CustomControlName>
              </ExpressionBinding>
              <ExpressionBinding>
                <PropertyName>Details</PropertyName>
                <CustomControlName>NetClassSectionControl</CustomControlName>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>$_</ScriptBlock>
                <CustomControlName>NetSyntaxSectionControl</CustomControlName>
              </ExpressionBinding>
              <Text>PROPERTIES</Text>
              <NewLine/>
              <ExpressionBinding>
                <ScriptBlock>$_.Properties.Values | Sort-Object Name</ScriptBlock>
                <EnumerateCollection/>
                <CustomControlName>NetPropertyItemControl</CustomControlName>
              </ExpressionBinding>
              <Text>METHODS</Text>
              <NewLine/>
              <ExpressionBinding>
                <ScriptBlock>$_.Methods.Values | Sort-Object Name</ScriptBlock>
                <EnumerateCollection/>
                <CustomControlName>NetMethodListItemControl</CustomControlName>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
    <View>
      <!-- This view is used when no local DotNet help is found and Get-ObjectHelp is called on a command and passed -Property. -->
      <Name>PropertyNetHelp</Name>
      <ViewSelectedBy>
        <TypeName>ObjectHelpInfo#Net#PropertyDetail</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>$_</ScriptBlock>
                <CustomControlName>NetNameSectionControl</CustomControlName>
              </ExpressionBinding>
              <Text>TYPE</Text>
              <NewLine/>
              <Frame>
                <LeftIndent>4</LeftIndent>
                <CustomItem>
                  <ExpressionBinding>
                    <PropertyName>Type</PropertyName>
                  </ExpressionBinding>
                  <NewLine/>
                  <NewLine/>
                </CustomItem>
              </Frame>
              <ExpressionBinding>
                <ScriptBlock>$_</ScriptBlock>
                <CustomControlName>NetClassSectionControl</CustomControlName>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
    <View>
      <!-- This view is used when no local DotNet help is found and Get-ObjectHelp is called on a command and passed -Method. -->
      <Name>MethodsNetHelp</Name>
      <ViewSelectedBy>
        <TypeName>ObjectHelpInfo#Net#MethodDetail</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>$_</ScriptBlock>
                <CustomControlName>NetNameSectionControl</CustomControlName>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>$_</ScriptBlock>
                <CustomControlName>NetClassSectionControl</CustomControlName>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>$_</ScriptBlock>
                <CustomControlName>NetSyntaxSectionControl</CustomControlName>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
  </ViewDefinitions>
</Configuration>