<?xml version="1.0" encoding="utf-8" ?>

<!--
  Copyright (c) 2008-2009, Kenneth Bell

  Permission is hereby granted, free of charge, to any person obtaining a
  copy of this software and associated documentation files (the "Software"),
  to deal in the Software without restriction, including without limitation
  the rights to use, copy, modify, merge, publish, distribute, sublicense,
  and/or sell copies of the Software, and to permit persons to whom the
  Software is furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  DEALINGS IN THE SOFTWARE.

Based on the files FileSystem.format.ps1xml and Registry.format.ps1xml:

  Copyright (c) Microsoft Corporation.  All rights reserved.

  THIS SAMPLE CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 
  OF ANY KIND,WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  PURPOSE. IF THIS CODE AND INFORMATION IS MODIFIED, THE ENTIRE RISK OF USE
  OR RESULTS IN CONNECTION WITH THE USE OF THIS CODE AND INFORMATION 
  REMAINS WITH THE USER.

 -->

<Configuration>
  <Controls>
    <Control>
      <Name>VirtualRegistry-GroupingFormat</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <Frame>
                <LeftIndent>4</LeftIndent>
                <CustomItem>
                  <Text>Hive: </Text>
                  <ExpressionBinding>
                    <ScriptBlock>$_.PSParentPath.Replace("VirtualRegistry::", "")</ScriptBlock>
                  </ExpressionBinding>
                  <NewLine/>
                </CustomItem>
              </Frame>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
  </Controls>

  <ViewDefinitions>
    
    <!-- View for DiscUtils.VirtualDisk -->
    <View>
      <Name>VirtualDiskTable</Name>
      <ViewSelectedBy>
        <TypeName>DiscUtils.VirtualDisk</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>PSParentPath</PropertyName>
        <CustomControlName>FileSystemTypes-GroupingFormat</CustomControlName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>Name</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Width>13</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Width>15</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Width>15</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Signature</Label>
            <Width>10</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Partitions</Label>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>PSChildName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Capacity</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Geometry</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>BIOSGeometry</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>[string]::Format("{0:X8}",$_.Signature)</ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>if($_.IsPartitioned) {$_.Partitions.Count} else {0}</ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>


    <!-- View for DiscUtils.LogicalVolumeInfo -->
    <View>
      <Name>LogicalVolumeInfoTable</Name>
      <ViewSelectedBy>
        <TypeName>DiscUtils.LogicalVolumeInfo</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>PSParentPath</PropertyName>
        <CustomControlName>FileSystemTypes-GroupingFormat</CustomControlName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>Name</Label>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>PSChildName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Identity</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>BIOSType</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Status</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Length</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>



    <!-- Views for DiscUtils.DiscFileSystemInfo -->
    <View>
      <Name>DiscFileSystemInfoTable</Name>
      <ViewSelectedBy>
        <TypeName>DiscUtils.DiscFileSystemInfo</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>PSParentPath</PropertyName>
        <CustomControlName>FileSystemTypes-GroupingFormat</CustomControlName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>Mode</Label>
            <Width>7</Width>
            <Alignment>left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>LastWriteTime</Label>
            <Width>25</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Length</Label>
            <Width>10</Width>
            <Alignment>right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader/>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap/>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Mode</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                  [String]::Format("{0,10}  {1,8}", $_.LastWriteTime.ToString("d"), $_.LastWriteTime.ToString("t"))
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Length</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>DiscFileSystemInfoList</Name>
      <ViewSelectedBy>
        <TypeName>DiscUtils.DiscFileSystemInfo</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>PSParentPath</PropertyName>
        <CustomControlName>FileSystemTypes-GroupingFormat</CustomControlName>
      </GroupBy>
      <ListControl>
        <ListEntries>
          <ListEntry>
            <ListItems>
              <ListItem>
                <PropertyName>Name</PropertyName>
              </ListItem>
              <ListItem>
                <PropertyName>Length</PropertyName>
              </ListItem>
              <ListItem>
                <PropertyName>CreationTime</PropertyName>
              </ListItem>
              <ListItem>
                <PropertyName>LastWriteTime</PropertyName>
              </ListItem>
              <ListItem>
                <PropertyName>LastAccessTime</PropertyName>
              </ListItem>
            </ListItems>
          </ListEntry>
        </ListEntries>
      </ListControl>
    </View>
    <View>
      <Name>DiscFileSystemInfoWide</Name>
      <ViewSelectedBy>
        <TypeName>DiscUtils.DiscFileSystemInfo</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>PSParentPath</PropertyName>
        <CustomControlName>FileSystemTypes-GroupingFormat</CustomControlName>
      </GroupBy>
      <WideControl>
        <WideEntries>
          <WideEntry>
            <WideItem>
              <PropertyName>Name</PropertyName>
            </WideItem>
          </WideEntry>
          <WideEntry>
            <EntrySelectedBy>
              <TypeName>DiscUtils.DiscDirectoryInfo</TypeName>
            </EntrySelectedBy>
            <WideItem>
              <PropertyName>Name</PropertyName>
              <FormatString>[{0}]</FormatString>
            </WideItem>
          </WideEntry>
        </WideEntries>
      </WideControl>
    </View>


    <!-- Views for DiscUtils.Registry.RegistryKey -->
    <View>
      <Name>VR-children</Name>
      <ViewSelectedBy>
        <TypeName>DiscUtils.Registry.RegistryKey</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>PSParentPath</PropertyName>
        <CustomControlName>VirtualRegistry-GroupingFormat</CustomControlName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Width>3</Width>
            <Label>SKC</Label>
            <Alignment>right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            <Width>3</Width>
            <Alignment>right</Alignment>
            <Label>VC</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Width>30</Width>
            <Label>Name</Label>
          </TableColumnHeader>
          <TableColumnHeader/>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>SubKeyCount</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>ValueCount</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>if($_.PSParentPath.IndexOf("!") -lt 0) { $_.PSChildName.TrimEnd("!") } else { $_.PSChildName }</ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Property</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
  </ViewDefinitions>
</Configuration>
