<commit_before>﻿<UserControl x:Class="PackageExplorer.ContentViewerPane"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:self="clr-namespace:PackageExplorer"
             mc:Ignorable="d" 
             d:DesignHeight="200" 
             d:DesignWidth="500">
    <UserControl.Resources>
        <self:FileSizeConverter x:Key="FileSizeConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!-- for binary file -->
        <ScrollViewer
            Grid.Row="1"
            Visibility="{Binding IsTextFile, Converter={StaticResource invertedBoolToVis}}"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            HorizontalScrollBarVisibility="Auto"
            VerticalScrollBarVisibility="Auto"
            Padding="4,5,4,2"
            Content="{Binding Content}">
        </ScrollViewer>

        <!-- for builtin text file -->
        <self:SyntaxHighlightingTextBox
            x:Name="contentBox"
            Grid.Row="1"
            Padding="0,5,0,2"
            BorderThickness="0"
            AcceptsReturn="True"
            IsReadOnly="True"
            Visibility="{Binding IsTextFile, Converter={StaticResource boolToVis}}"
            VerticalScrollBarVisibility="Auto"
            HorizontalScrollBarVisibility="Auto"
            SourceCode="{Binding Content, Mode=OneWay}"
            SourceLanguage="{Binding Language, Mode=OneWay}"
            ContextMenu="{StaticResource TextBoxContextMenu}" />

        <!-- 
            Note: the order of elements matter. This Border element has to come last. 
            Otherwise, the content won't update properly. I know, this is lame. 
        -->
        <Border Grid.Row="0" Background="#BCC7D8" BorderBrush="{StaticResource {x:Static SystemColors.ActiveBorderBrushKey}}" BorderThickness="0,1,0,0">
            <DockPanel>
                <TextBlock 
                    DockPanel.Dock="Left" 
                    Text="{Binding Size, Converter={StaticResource FileSizeConverter}, StringFormat='Size: {0}'}" 
                    Margin="3,0" 
                    VerticalAlignment="Center">
                </TextBlock>
                <StackPanel DockPanel.Dock="Right" HorizontalAlignment="Right" Orientation="Horizontal" Visibility="{Binding IsTextFile, Converter={StaticResource boolToVis}, ConverterParameter='hidden'}">
                    <Label Content="Choose _language:" Target="{Binding ElementName=LanguageBox}" />
                    <ComboBox 
                        x:Name="LanguageBox"
                        Style="{StaticResource {x:Static ToolBar.ComboBoxStyleKey}}"
                        Width="150"
                        DataContextChanged="UserControl_DataContextChanged"
                        SelectedItem="{Binding Language}"
                        SelectionChanged="OnLanguageBoxSelectionChanged" />
                </StackPanel>
            </DockPanel>
        </Border>
    </Grid>
</UserControl><commit_msg>Change Choose Language label to Syntax Scheme<commit_after>﻿<UserControl x:Class="PackageExplorer.ContentViewerPane"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:self="clr-namespace:PackageExplorer"
             mc:Ignorable="d" 
             d:DesignHeight="200" 
             d:DesignWidth="500">
    <UserControl.Resources>
        <self:FileSizeConverter x:Key="FileSizeConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!-- for binary file -->
        <ScrollViewer
            Grid.Row="1"
            Visibility="{Binding IsTextFile, Converter={StaticResource invertedBoolToVis}}"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            HorizontalScrollBarVisibility="Auto"
            VerticalScrollBarVisibility="Auto"
            Padding="4,5,4,2"
            Content="{Binding Content}">
        </ScrollViewer>

        <!-- for builtin text file -->
        <self:SyntaxHighlightingTextBox
            x:Name="contentBox"
            Grid.Row="1"
            Padding="0,5,0,2"
            BorderThickness="0"
            AcceptsReturn="True"
            IsReadOnly="True"
            Visibility="{Binding IsTextFile, Converter={StaticResource boolToVis}}"
            VerticalScrollBarVisibility="Auto"
            HorizontalScrollBarVisibility="Auto"
            SourceCode="{Binding Content, Mode=OneWay}"
            SourceLanguage="{Binding Language, Mode=OneWay}"
            ContextMenu="{StaticResource TextBoxContextMenu}" />

        <!-- 
            Note: the order of elements matter. This Border element has to come last. 
            Otherwise, the content won't update properly. I know, this is lame. 
        -->
        <Border Grid.Row="0" Background="#BCC7D8" BorderBrush="{StaticResource {x:Static SystemColors.ActiveBorderBrushKey}}" BorderThickness="0,1,0,0">
            <DockPanel>
                <TextBlock 
                    DockPanel.Dock="Left" 
                    Text="{Binding Size, Converter={StaticResource FileSizeConverter}, StringFormat='Size: {0}'}" 
                    Margin="3,0" 
                    VerticalAlignment="Center">
                </TextBlock>
                <StackPanel DockPanel.Dock="Right" HorizontalAlignment="Right" Orientation="Horizontal" Visibility="{Binding IsTextFile, Converter={StaticResource boolToVis}, ConverterParameter='hidden'}">
                    <Label Content="S_yntax scheme:" Target="{Binding ElementName=LanguageBox}" />
                    <ComboBox 
                        x:Name="LanguageBox"
                        Style="{StaticResource {x:Static ToolBar.ComboBoxStyleKey}}"
                        Width="150"
                        DataContextChanged="UserControl_DataContextChanged"
                        SelectedItem="{Binding Language}"
                        SelectionChanged="OnLanguageBoxSelectionChanged" />
                </StackPanel>
            </DockPanel>
        </Border>
    </Grid>
</UserControl>
{'fraction_non_alphanumeric': 0.11415929203539824, 'fraction_numerical': 0.013569321533923304, 'mean_word_length': 2.100594421582076, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 57, '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': '5277019', 'n_tokens_mistral': 1847, 'n_tokens_neox': 1636, 'n_words': 275}