<commit_before>﻿<Window x:Class="TfvcBranchPolicy.CheckinPolicy.Editor.BranchLockPolicyEditorWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:common="clr-namespace:TfvcBranchPolicy.CheckinPolicy.Common"
        Title="Edit Branch Policies" MinHeight="300" Height="400" MinWidth="450" Width="600">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/TfvcBranchPolicy.CheckinPolicy;component/Editor/Themes/Generic.xaml"/>
                <ResourceDictionary Source="/TfvcBranchPolicy.CheckinPolicy;component/Editor/Themes/LockBranchPolicy.xaml" />
                <ResourceDictionary Source="/TfvcBranchPolicy.CheckinPolicy;component/Editor/Themes/WorkItemBranchPolicy.xaml" />
                <ResourceDictionary Source="/TfvcBranchPolicy.CheckinPolicy;component/Editor/Themes/CodeReviewBranchPolicy.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>
        <DockPanel  Grid.Column="0" Grid.RowSpan="2" MinWidth="200">
            <DockPanel DockPanel.Dock="Bottom">
                <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
                    <Label>Branch Patterns:</Label>
                    <Button Command="{Binding CreateCommand}" Margin="5" Style="{StaticResource Link}">Add</Button>
                    <Button Command="{Binding ResetCommand}" Margin="5" Style="{StaticResource Link}">Reset</Button>
                </StackPanel>
                <ListBox ItemsSource="{Binding BranchPatterns}" SelectedItem="{Binding SelectedBranchPattern}" HorizontalContentAlignment="Stretch" Margin="5">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <DockPanel>
                                <Button DockPanel.Dock="Right" Style="{StaticResource Cross}" Content="X" Width="25" Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"  CommandParameter="{Binding}" />
                                <TextBlock Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                            </DockPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </DockPanel>
        </DockPanel>
        <GridSplitter ResizeDirection="Auto" VerticalAlignment="Stretch" Width="5" />
        <DockPanel x:Name="EditPannel" Grid.Column="1" MinWidth="225" DataContext="{Binding SelectedBranchPattern}">
            <Label DockPanel.Dock="Top">Branch Policies:</Label>
            <GroupBox DockPanel.Dock="Top" Header="Branch Pattern Details">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Label Grid.Column="0" Content="Name: " HorizontalAlignment="Right" />
                    <TextBox Grid.Column="1"  Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    <Label Grid.Column="0" Grid.Row="1" Content="Pattern: " HorizontalAlignment="Right" />
                    <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Pattern, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                </Grid>
            </GroupBox>
            <ScrollViewer>
                <ItemsControl ItemsSource="{Binding BranchPolicies}" Margin="5" />
            </ScrollViewer>            
        </DockPanel>
        <StackPanel Grid.Row="1" Grid.Column="1">
            <Button Margin="5" Click="Button_Click">Save &amp; Exit</Button>
        </StackPanel>
        </Grid>
</Window><commit_msg>Changes to UI. Hide inactive Reset button.<commit_after>﻿<Window x:Class="TfvcBranchPolicy.CheckinPolicy.Editor.BranchLockPolicyEditorWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:common="clr-namespace:TfvcBranchPolicy.CheckinPolicy.Common"
        Title="Edit Branch Policies" MinHeight="300" Height="400" MinWidth="450" Width="600">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/TfvcBranchPolicy.CheckinPolicy;component/Editor/Themes/Generic.xaml"/>
                <ResourceDictionary Source="/TfvcBranchPolicy.CheckinPolicy;component/Editor/Themes/LockBranchPolicy.xaml" />
                <ResourceDictionary Source="/TfvcBranchPolicy.CheckinPolicy;component/Editor/Themes/WorkItemBranchPolicy.xaml" />
                <ResourceDictionary Source="/TfvcBranchPolicy.CheckinPolicy;component/Editor/Themes/CodeReviewBranchPolicy.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Stretch">
            <Label Content="Branch Patterns:" VerticalAlignment="Center"/>
            <Button Command="{Binding CreateCommand}" Margin="5" Content="Add pattern"/>
            <!-- Doesn't seem to do anything...
            <Button Command="{Binding ResetCommand}" Margin="5" Content="Reset"/>
            -->
        </StackPanel>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <DockPanel  Grid.Column="0" Grid.RowSpan="2" MinWidth="200">
                <DockPanel DockPanel.Dock="Bottom">
                    <ListBox ItemsSource="{Binding BranchPatterns}" SelectedItem="{Binding SelectedBranchPattern}" HorizontalContentAlignment="Stretch" Margin="5">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <DockPanel>
                                    <Button DockPanel.Dock="Right" Style="{StaticResource Cross}" Content="X" Width="25" Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"  CommandParameter="{Binding}" />
                                    <TextBlock Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                                </DockPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </DockPanel>
            </DockPanel>
            <GridSplitter ResizeDirection="Auto" VerticalAlignment="Stretch" Width="5" />
            <DockPanel x:Name="EditPannel" Grid.Column="1" MinWidth="225" DataContext="{Binding SelectedBranchPattern}">
                <GroupBox DockPanel.Dock="Top" Header="Details">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Label Grid.Column="0" Content="Name: " HorizontalAlignment="Right" />
                        <TextBox Grid.Column="1" Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ToolTip="Name of pattern (informational)" />
                        <Label Grid.Column="0" Grid.Row="1" Content="Pattern: " HorizontalAlignment="Right" />
                        <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Pattern, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ToolTip="Regex pattern to match to activate polices"/>
                    </Grid>
                </GroupBox>
                <Viewbox>
                    <ItemsControl ItemsSource="{Binding BranchPolicies}" Margin="5" />
                </Viewbox>
            </DockPanel>
        </Grid>
        <StackPanel Grid.Row="2" >
            <Button Margin="5" Click="Button_Click">Close</Button>
        </StackPanel>
    </Grid>
</Window>
{'fraction_non_alphanumeric': 0.12046718576195774, 'fraction_numerical': 0.011457174638487208, 'mean_word_length': 2.1382198952879583, 'pattern_counts': {'":': 0, '<': 146, '<?xml version=': 0, '>': 146, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5938827', 'n_tokens_mistral': 2382, 'n_tokens_neox': 2193, 'n_words': 346}