<commit_before>﻿<controls:MetroWindow
    xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:qdms="clr-namespace:QDMS;assembly=QDMS"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:qdmsServer="clr-namespace:QDMSServer"
    x:Class="QDMSServer.EditRootSymbolWindow"
    Title="Edit Root Symbol" Height="416" Width="458"
        BorderBrush="Black"
        BorderThickness="1"
    >
    <controls:MetroWindow.Resources>
        <qdmsServer:StringToIntConverter x:Key="StringToIntConverter" />
        <qdmsServer:InvertBooleanConverter x:Key="InvertBooleanConverter"/>
        
        <ObjectDataProvider x:Key="DayTypes" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="qdms:DayType"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider x:Key="RelativeMonths" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="qdms:RelativeMonth"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider x:Key="WeekDayCounts" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="qdms:WeekDayCount"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider x:Key="DaysOfTheWeek" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="qdms:DayOfTheWeek"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </controls:MetroWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="302*"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
        <Button Click="ModifyBtn_Click" Name="ModifyBtn" Content="Add" HorizontalAlignment="Right" Margin="0,5,90,0" VerticalAlignment="Top" Width="75" Grid.Row="2"/>
        <Button Click="CancelBtn_Click" Name="CancelBtn" Content="Cancel" HorizontalAlignment="Right" Margin="0,5,10,0" VerticalAlignment="Top" Width="75" Grid.Row="2"/>
        <Label Grid.Row="0" Content="Symbol:" HorizontalAlignment="Left" Margin="10,7,0,0" VerticalAlignment="Top" Width="79"/>
        <TextBox Grid.Row="0" Name="SymbolTextBox" HorizontalAlignment="Left" Height="23" Margin="94,6,0,0" 
                 TextWrapping="NoWrap" Text="{Binding TheSymbol.Symbol}" VerticalAlignment="Top" Width="120"/>
        <GroupBox Header="Expiration Rule" HorizontalAlignment="Stretch" Margin="16,10,16,0" Grid.Row="1" VerticalAlignment="Top" Height="273">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="130"/>
                    <RowDefinition Height="40"/>
                </Grid.RowDefinitions>
                <Label Content="Expires" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="54"/>
                <TextBox Grid.Row="0" HorizontalAlignment="Left" Height="23" Margin="69,10,0,0" TextWrapping="Wrap" Text="{Binding TheSymbol.Rule.DaysBefore}" 
                         ToolTip="The contract expires this many days before the Reference day." VerticalAlignment="Top" Width="32"/>
                <ComboBox Grid.Row="0" SelectedItem="{Binding TheSymbol.Rule.DayType}" ItemsSource="{Binding Source={StaticResource DayTypes}}"
                          ToolTip="Calendar days or business days for the calculation."
                          HorizontalAlignment="Left" Margin="121,10,0,0" VerticalAlignment="Top" Width="120"/>
                <Label Grid.Row="0" Content="days before:" HorizontalAlignment="Left" Margin="263,10,0,0" VerticalAlignment="Top" Width="103"/>

                <Label Content="of the" HorizontalAlignment="Left" Margin="10,11,0,0" VerticalAlignment="Top" Width="45" Grid.Row="2"/>
                <ComboBox HorizontalAlignment="Left" Margin="60,11,0,0" VerticalAlignment="Top" Width="120" Grid.Row="2" 
                          ToolTip="The month that the reference day is in."
                          ItemsSource="{Binding Source={StaticResource RelativeMonths}}" SelectedItem="{Binding TheSymbol.Rule.ReferenceRelativeMonth}" />

                <RadioButton Name="DaysBasedRefCheckBox"
                    ToolTip="The reference day is set at a specified number of calendar days of a specified month." 
                             IsChecked="{Binding TheSymbol.Rule.ReferenceUsesDays}"
                             Content="Nth day of the month:" HorizontalAlignment="Left" Margin="11,13,0,0" Grid.Row="1" VerticalAlignment="Top"/>

                <TextBox HorizontalAlignment="Left" Height="23" Margin="176,10,0,0" Grid.Row="1" 
                         TextWrapping="NoWrap" 
                         Text="{Binding TheSymbol.Rule.ReferenceDays,Converter={StaticResource StringToIntConverter}}" 
                         IsEnabled="{Binding IsChecked, ElementName=DaysBasedRefCheckBox}"
                         VerticalAlignment="Top" Width="36"/>



                <RadioButton Name="WeeksBasedRefCheckBox"
                    ToolTip="The reference day is set at a particular day of the week of the nth week of the month."
                    Content="Day of nth week:" HorizontalAlignment="Left" Margin="11,57,0,0" Grid.Row="1" VerticalAlignment="Top"
                             IsChecked="{Binding TheSymbol.Rule.ReferenceUsesDays,Converter={StaticResource InvertBooleanConverter}}"
                             />
                <ComboBox HorizontalAlignment="Left" Margin="272,49,0,0" Grid.Row="1" VerticalAlignment="Top" Width="76"
                          IsEnabled="{Binding IsChecked, ElementName=WeeksBasedRefCheckBox}"
                          ItemsSource="{Binding Source={StaticResource WeekDayCounts}}" 
                          SelectedItem="{Binding TheSymbol.Rule.ReferenceWeekDayCount}"/>
                
                <ComboBox HorizontalAlignment="Left" Margin="130,52,0,0" Grid.Row="1" VerticalAlignment="Top" Width="98"
                          IsEnabled="{Binding IsChecked, ElementName=WeeksBasedRefCheckBox}"
                          ItemsSource="{Binding Source={StaticResource DaysOfTheWeek}}" 
                          SelectedItem="{Binding TheSymbol.Rule.ReferenceWeekDay}"/>

                <RadioButton Content="Last business day of the month." ToolTip="The reference day is the last business day of the month."
                             IsChecked="{Binding TheSymbol.Rule.ReferenceDayIsLastBusinessDayOfMonth}" 
                             HorizontalAlignment="Left" Margin="11,101,0,0" Grid.Row="1" VerticalAlignment="Top"/>
                <Label Content="of the" HorizontalAlignment="Left" Margin="230,54,0,0" VerticalAlignment="Top" Width="42" Grid.Row="1"/>
                <Label Content="week." HorizontalAlignment="Left" Margin="353,54,0,0" Grid.Row="1" VerticalAlignment="Top"/>



            </Grid>
        </GroupBox>
    </Grid>
</controls:MetroWindow><commit_msg>Added UI element for new expiration rule option.<commit_after>﻿<controls:MetroWindow
    xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:qdms="clr-namespace:QDMS;assembly=QDMS"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:qdmsServer="clr-namespace:QDMSServer"
    x:Class="QDMSServer.EditRootSymbolWindow"
    Title="Edit Root Symbol" Height="416" Width="458"
        BorderBrush="Black"
        BorderThickness="1"
    >
    <controls:MetroWindow.Resources>
        <qdmsServer:StringToIntConverter x:Key="StringToIntConverter" />
        <qdmsServer:InvertBooleanConverter x:Key="InvertBooleanConverter"/>

        <ObjectDataProvider x:Key="DayTypes" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="qdms:DayType"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider x:Key="RelativeMonths" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="qdms:RelativeMonth"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider x:Key="WeekDayCounts" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="qdms:WeekDayCount"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider x:Key="DaysOfTheWeek" MethodName="GetValues" ObjectType="{x:Type system:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type Type="qdms:DayOfTheWeek"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </controls:MetroWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="302*"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
        <Button Click="ModifyBtn_Click" Name="ModifyBtn" Content="Add" HorizontalAlignment="Right" Margin="0,5,90,0" VerticalAlignment="Top" Width="75" Grid.Row="2"/>
        <Button Click="CancelBtn_Click" Name="CancelBtn" Content="Cancel" HorizontalAlignment="Right" Margin="0,5,10,0" VerticalAlignment="Top" Width="75" Grid.Row="2"/>
        <Label Grid.Row="0" Content="Symbol:" HorizontalAlignment="Left" Margin="10,7,0,0" VerticalAlignment="Top" Width="79"/>
        <TextBox Grid.Row="0" Name="SymbolTextBox" HorizontalAlignment="Left" Height="23" Margin="94,6,0,0" 
                 TextWrapping="NoWrap" Text="{Binding TheSymbol.Symbol}" VerticalAlignment="Top" Width="120"/>
        <GroupBox Header="Expiration Rule" HorizontalAlignment="Stretch" Margin="16,10,16,0" Grid.Row="1" VerticalAlignment="Top" Height="290">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="130"/>
                    <RowDefinition Height="40"/>
                </Grid.RowDefinitions>
                <Label Content="Expires" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="54"/>
                <TextBox Grid.Row="0" HorizontalAlignment="Left" Height="23" Margin="69,10,0,0" TextWrapping="Wrap" Text="{Binding TheSymbol.Rule.DaysBefore}" 
                         ToolTip="The contract expires this many days before the Reference day." VerticalAlignment="Top" Width="32"/>
                <ComboBox Grid.Row="0" SelectedItem="{Binding TheSymbol.Rule.DayType}" ItemsSource="{Binding Source={StaticResource DayTypes}}"
                          ToolTip="Calendar days or business days for the calculation."
                          HorizontalAlignment="Left" Margin="121,10,0,0" VerticalAlignment="Top" Width="120"/>
                <Label Grid.Row="0" Content="days before:" HorizontalAlignment="Left" Margin="263,10,0,0" VerticalAlignment="Top" Width="103"/>

                <Label Content="of the" HorizontalAlignment="Left" Margin="10,11,0,0" VerticalAlignment="Top" Width="45" Grid.Row="2"/>
                <ComboBox HorizontalAlignment="Left" Margin="60,11,0,0" VerticalAlignment="Top" Width="120" Grid.Row="2" 
                          ToolTip="The month that the reference day is in."
                          ItemsSource="{Binding Source={StaticResource RelativeMonths}}" SelectedItem="{Binding TheSymbol.Rule.ReferenceRelativeMonth}" />

                <RadioButton Name="DaysBasedRefCheckBox"
                    ToolTip="The reference day is set at a specified number of calendar days of a specified month." 
                             IsChecked="{Binding TheSymbol.Rule.ReferenceUsesDays}"
                             Content="Nth day of the month:" HorizontalAlignment="Left" Margin="11,13,0,0" Grid.Row="1" VerticalAlignment="Top"/>

                <TextBox HorizontalAlignment="Left" Height="23" Margin="176,10,0,0" Grid.Row="1" 
                         TextWrapping="NoWrap" 
                         Text="{Binding TheSymbol.Rule.ReferenceDays,Converter={StaticResource StringToIntConverter}}" 
                         IsEnabled="{Binding IsChecked, ElementName=DaysBasedRefCheckBox}"
                         VerticalAlignment="Top" Width="36"/>



                <RadioButton Name="WeeksBasedRefCheckBox"
                    ToolTip="The reference day is set at a particular day of the week of the nth week of the month."
                    Content="The" HorizontalAlignment="Left" Margin="11,57,0,0" Grid.Row="1" VerticalAlignment="Top"
                             IsChecked="{Binding TheSymbol.Rule.ReferenceUsesDays,Converter={StaticResource InvertBooleanConverter}}"
                             />
                <ComboBox HorizontalAlignment="Left" Margin="76,54,0,0" Grid.Row="1" VerticalAlignment="Top" Width="76"
                          IsEnabled="{Binding IsChecked, ElementName=WeeksBasedRefCheckBox}"
                          ItemsSource="{Binding Source={StaticResource WeekDayCounts}}" 
                          SelectedItem="{Binding TheSymbol.Rule.ReferenceWeekDayCount}"/>

                <ComboBox HorizontalAlignment="Left" Margin="176,54,0,0" Grid.Row="1" VerticalAlignment="Top" Width="98"
                          IsEnabled="{Binding IsChecked, ElementName=WeeksBasedRefCheckBox}"
                          ItemsSource="{Binding Source={StaticResource DaysOfTheWeek}}" 
                          SelectedItem="{Binding TheSymbol.Rule.ReferenceWeekDay}"/>

                <RadioButton Content="Last business day of the month." ToolTip="The reference day is the last business day of the month."
                             IsChecked="{Binding TheSymbol.Rule.ReferenceDayIsLastBusinessDayOfMonth}" 
                             HorizontalAlignment="Left" Margin="11,101,0,0" Grid.Row="1" VerticalAlignment="Top"/>

                <CheckBox Grid.Row="2" Name="ForceRefDayBusinessDay" IsChecked="{Binding TheSymbol.Rule.ReferenceDayMustBeBusinessDay}"
                          Content="Reference day must be a business day." HorizontalAlignment="Left" VerticalAlignment="Top" Margin="11,51,0,-30" Width="368" Height="20" />


            </Grid>
        </GroupBox>
    </Grid>
</controls:MetroWindow>
{'fraction_non_alphanumeric': 0.12693082605775688, 'fraction_numerical': 0.027400940228341168, 'mean_word_length': 2.905323891948597, 'pattern_counts': {'":': 0, '<': 122, '<?xml version=': 0, '>': 122, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1551001', 'n_tokens_mistral': 4336, 'n_tokens_neox': 3829, 'n_words': 702}