Formats/LibGit2Sharp.StatusEntry.Format.ps1xml

<?xml version="1.0" encoding="utf-8" ?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Configuration>
    <ViewDefinitions>
        <View>
            <Name>Table</Name>
            <ViewSelectedBy>
                <TypeName>LibGit2Sharp.StatusEntry</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <!--
                        Important: each StatusEntry contains the status for one file in both the index and the workdir.
                        A file may have changes in both, so we must display both (and cannot group by staged/not staged).
                    -->
                    <TableColumnHeader>
                        <Label>State</Label>
                        <Alignment>Left</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>FilePath</Label>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>HeadToIndexRenameDetails</Label>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>IndexToWorkDirRenameDetails</Label>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>State</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>FilePath</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    if ($null -ne $_.HeadToIndexRenameDetails) {
                                        $_.HeadToIndexRenameDetails.OldFilePath + " -> " + $_.HeadToIndexRenameDetails.NewFilePath
                                    }
                                </ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    if ($null -ne $_.IndexToWorkDirRenameDetails) {
                                        $_.IndexToWorkDirRenameDetails.OldFilePath + " -> " + $_.IndexToWorkDirRenameDetails.NewFilePath
                                    }
                                </ScriptBlock>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>
        <View>
            <Name>BadgesTable</Name>
            <ViewSelectedBy>
                <TypeName>LibGit2Sharp.StatusEntry</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableHeaders>
                    <!--
                        Important: each StatusEntry contains the status for one file in both the index and the workdir.
                        A file may have changes in both, so we must display both (and cannot group by staged/not staged).
                    -->
                    <TableColumnHeader>
                        <Label>WorkDirChange</Label>
                        <Alignment>Center</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>IndexChange</Label>
                        <Alignment>Center</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>FilePath</Label>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>HeadToIndexRenameDetails</Label>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>IndexToWorkDirRenameDetails</Label>
                    </TableColumnHeader>
                </TableHeaders>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <ScriptBlock>
                                    if ($null -ne $_.WorkDirChange) {
                                        $_.WorkDirChange.ToColoredString()
                                    }
                                </ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    if ($null -ne $_.IndexChange) {
                                        $_.IndexChange.ToColoredString()
                                    }
                                </ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>FilePath</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    if ($null -ne $_.HeadToIndexRenameDetails) {
                                        $_.HeadToIndexRenameDetails.OldFilePath + " -> " + $_.HeadToIndexRenameDetails.NewFilePath
                                    }
                                </ScriptBlock>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    if ($null -ne $_.IndexToWorkDirRenameDetails) {
                                        $_.IndexToWorkDirRenameDetails.OldFilePath + " -> " + $_.IndexToWorkDirRenameDetails.NewFilePath
                                    }
                                </ScriptBlock>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
            </TableControl>
        </View>
        <View>
            <Name>List</Name>
            <ViewSelectedBy>
                <TypeName>LibGit2Sharp.StatusEntry</TypeName>
            </ViewSelectedBy>
            <ListControl>
                <ListEntries>
                    <ListEntry>
                        <ListItems>
                            <ListItem>
                                <PropertyName>FilePath</PropertyName>
                            </ListItem>
                            <ListItem>
                                <PropertyName>State</PropertyName>
                            </ListItem>
                            <ListItem>
                                <Label>IndexToWorkDirRenameDetails</Label>
                                <ItemSelectionCondition>
                                    <PropertyName>IndexToWorkDirRenameDetails</PropertyName>
                                </ItemSelectionCondition>
                                <ScriptBlock>
                                    $_.IndexToWorkDirRenameDetails.OldFilePath + " -> " + $_.IndexToWorkDirRenameDetails.NewFilePath
                                </ScriptBlock>
                            </ListItem>
                            <ListItem>
                                <Label>HeadToIndexRenameDetails</Label>
                                <ItemSelectionCondition>
                                    <PropertyName>HeadToIndexRenameDetails</PropertyName>
                                </ItemSelectionCondition>
                                <ScriptBlock>
                                    $_.HeadToIndexRenameDetails.OldFilePath + " -> " + $_.HeadToIndexRenameDetails.NewFilePath
                                </ScriptBlock>
                            </ListItem>
                        </ListItems>
                    </ListEntry>
                </ListEntries>
            </ListControl>
        </View>
    </ViewDefinitions>
</Configuration>