<commit_before>﻿<Window x:Class="MsmqFastView.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="600" Width="800">
    <Window.InputBindings>
        <KeyBinding Key="F5" Command="{Binding Refresh}" />
        <KeyBinding Key="F8" Command="{Binding Purge}" />
        <KeyBinding Key="F9" Command="{Binding PurgeAll}" />
    </Window.InputBindings>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="23" />
            <RowDefinition Height="23" />
            <RowDefinition />
            <RowDefinition Height="23" />
        </Grid.RowDefinitions>

        <Button Grid.Row="0" Grid.Column="0" Command="{Binding Refresh}" Content="Refresh queue list (F5)" />

        <Grid Grid.Row="0" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Button Grid.Column="0" Command="{Binding Purge}" Content="Purge all queues (F8)" />
            <Button Grid.Column="1" Command="{Binding PurgeAll}" Content="Purge all queues and subqueues (F9)" />
        </Grid>

        <CheckBox Grid.Row="1" Grid.Column="0" IsChecked="{Binding ShowOnlyNonempty}" Command="{Binding Refresh}" Content="Show only nonempty queues" Margin="1" />


        <TextBlock Grid.Row="1" Grid.Column="1" Margin="1" TextAlignment="Right">
            <Span>Last refresh: </Span>
            <Run Text="{Binding LastRefresh, Mode=OneWay}" />
        </TextBlock>

        <ScrollViewer Grid.Row="2" Grid.Column="0" VerticalScrollBarVisibility="Auto">
            <TreeView x:Name="QueuesTreeView" ItemsSource="{Binding Queues}">
                <TreeView.ItemContainerStyle>
                    <Style TargetType="TreeViewItem">
                        <Setter Property="IsExpanded" Value="True" />
                    </Style>
                </TreeView.ItemContainerStyle>
                <TreeView.ItemTemplate>
                    <HierarchicalDataTemplate ItemsSource="{Binding SubQueues}">
                        <TextBlock Margin="1" Text="{Binding Name}" />
                    </HierarchicalDataTemplate>
                </TreeView.ItemTemplate>
            </TreeView>
        </ScrollViewer>

        <GridSplitter Grid.Row="2" Grid.Column="0" Width="1" HorizontalAlignment="Right" VerticalAlignment="Stretch"/>

        <Grid  Grid.Row="2" Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="23" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Button Grid.Column="0" Command="{Binding SelectedItem.Refresh, ElementName=QueuesTreeView}" Content="Refresh this queue" />
                <Button Grid.Column="1" Command="{Binding SelectedItem.Purge, ElementName=QueuesTreeView}" Content="Purge this queue" />
            </Grid>

            <DataGrid Grid.Row="1" ScrollViewer.CanContentScroll="False" ItemsSource="{Binding ElementName=QueuesTreeView, Path=SelectedItem.Messages}" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" HeadersVisibility="Column">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Label" Binding="{Binding Label}" />
                    <DataGridTextColumn Header="Sent" Binding="{Binding Sent}" />
                    <DataGridTextColumn Header="Response queue" Binding="{Binding ResponseQueue}" />
                    <DataGridTextColumn Header="Id" Binding="{Binding Id}" />
                    <DataGridTextColumn Header="Correlation Id" Binding="{Binding CorrelationId}" />
                </DataGrid.Columns>
                <DataGrid.RowDetailsTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <StackPanel.Resources>
                                <CollectionViewSource Source="{Binding Details.AdditionalDetails}" x:Key="AdditionalDetails">
                                    <CollectionViewSource.GroupDescriptions>
                                        <PropertyGroupDescription PropertyName="Group" />
                                    </CollectionViewSource.GroupDescriptions>
                                </CollectionViewSource>
                            </StackPanel.Resources>
                            <TextBlock Text="Body" Background="LightGray" />
                            <TextBlock Text="{Binding Details.Body}" Margin="5 0 0 0" />
                            <ItemsControl ItemsSource="{Binding Source={StaticResource AdditionalDetails}}" Grid.IsSharedSizeScope="True">
                                <ItemsControl.GroupStyle>
                                    <GroupStyle>
                                        <GroupStyle.HeaderTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding Name}" Background="LightGray" />
                                            </DataTemplate>
                                        </GroupStyle.HeaderTemplate>
                                    </GroupStyle>
                                </ItemsControl.GroupStyle>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition SharedSizeGroup="MessageDetailNameGroup" />
                                                <ColumnDefinition SharedSizeGroup="MessageDetailValueGroup" />
                                            </Grid.ColumnDefinitions>

                                            <TextBlock Grid.Column="0" Text="{Binding Name}" Margin="1" />
                                            <TextBlock Grid.Column="1" Text="{Binding Value}" Margin="1" />
                                        </Grid>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </StackPanel>
                    </DataTemplate>
                </DataGrid.RowDetailsTemplate>
            </DataGrid>
        </Grid>

        <StatusBar Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2">
            <StatusBarItem DockPanel.Dock="Right">
                <TextBlock>
                    <Span>Version: </Span>
                    <Run Text="{Binding Path=ApplicationVersion, Mode=OneWay}" />
                </TextBlock>
            </StatusBarItem>
            <StatusBarItem>
                <TextBlock>
                    <Span>Homepage: </Span>
                    <Hyperlink Command="{Binding OpenHomepage}">https://github.com/whut/MsmqFastView</Hyperlink>
                </TextBlock>
            </StatusBarItem>
        </StatusBar>
    </Grid>
</Window>
<commit_msg>Body of message is now selectable<commit_after>﻿<Window x:Class="MsmqFastView.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="600" Width="800">
    <Window.InputBindings>
        <KeyBinding Key="F5" Command="{Binding Refresh}" />
        <KeyBinding Key="F8" Command="{Binding Purge}" />
        <KeyBinding Key="F9" Command="{Binding PurgeAll}" />
    </Window.InputBindings>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="23" />
            <RowDefinition Height="23" />
            <RowDefinition />
            <RowDefinition Height="23" />
        </Grid.RowDefinitions>

        <Button Grid.Row="0" Grid.Column="0" Command="{Binding Refresh}" Content="Refresh queue list (F5)" />

        <Grid Grid.Row="0" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Button Grid.Column="0" Command="{Binding Purge}" Content="Purge all queues (F8)" />
            <Button Grid.Column="1" Command="{Binding PurgeAll}" Content="Purge all queues and subqueues (F9)" />
        </Grid>

        <CheckBox Grid.Row="1" Grid.Column="0" IsChecked="{Binding ShowOnlyNonempty}" Command="{Binding Refresh}" Content="Show only nonempty queues" Margin="1" />


        <TextBlock Grid.Row="1" Grid.Column="1" Margin="1" TextAlignment="Right">
            <Span>Last refresh: </Span>
            <Run Text="{Binding LastRefresh, Mode=OneWay}" />
        </TextBlock>

        <ScrollViewer Grid.Row="2" Grid.Column="0" VerticalScrollBarVisibility="Auto">
            <TreeView x:Name="QueuesTreeView" ItemsSource="{Binding Queues}">
                <TreeView.ItemContainerStyle>
                    <Style TargetType="TreeViewItem">
                        <Setter Property="IsExpanded" Value="True" />
                    </Style>
                </TreeView.ItemContainerStyle>
                <TreeView.ItemTemplate>
                    <HierarchicalDataTemplate ItemsSource="{Binding SubQueues}">
                        <TextBlock Margin="1" Text="{Binding Name}" />
                    </HierarchicalDataTemplate>
                </TreeView.ItemTemplate>
            </TreeView>
        </ScrollViewer>

        <GridSplitter Grid.Row="2" Grid.Column="0" Width="1" HorizontalAlignment="Right" VerticalAlignment="Stretch"/>

        <Grid  Grid.Row="2" Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="23" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Button Grid.Column="0" Command="{Binding SelectedItem.Refresh, ElementName=QueuesTreeView}" Content="Refresh this queue" />
                <Button Grid.Column="1" Command="{Binding SelectedItem.Purge, ElementName=QueuesTreeView}" Content="Purge this queue" />
            </Grid>

            <DataGrid Grid.Row="1" ScrollViewer.CanContentScroll="False" ItemsSource="{Binding ElementName=QueuesTreeView, Path=SelectedItem.Messages}" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" HeadersVisibility="Column">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Label" Binding="{Binding Label}" />
                    <DataGridTextColumn Header="Sent" Binding="{Binding Sent}" />
                    <DataGridTextColumn Header="Response queue" Binding="{Binding ResponseQueue}" />
                    <DataGridTextColumn Header="Id" Binding="{Binding Id}" />
                    <DataGridTextColumn Header="Correlation Id" Binding="{Binding CorrelationId}" />
                </DataGrid.Columns>
                <DataGrid.RowDetailsTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <StackPanel.Resources>
                                <CollectionViewSource Source="{Binding Details.AdditionalDetails}" x:Key="AdditionalDetails">
                                    <CollectionViewSource.GroupDescriptions>
                                        <PropertyGroupDescription PropertyName="Group" />
                                    </CollectionViewSource.GroupDescriptions>
                                </CollectionViewSource>
                            </StackPanel.Resources>
                            <TextBlock Text="Body" Background="LightGray" />
                            <TextBox Text="{Binding Details.Body, Mode=OneTime}" IsReadOnly="True" Margin="5 0 0 0" />
                            <ItemsControl ItemsSource="{Binding Source={StaticResource AdditionalDetails}}" Grid.IsSharedSizeScope="True">
                                <ItemsControl.GroupStyle>
                                    <GroupStyle>
                                        <GroupStyle.HeaderTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding Name}" Background="LightGray" />
                                            </DataTemplate>
                                        </GroupStyle.HeaderTemplate>
                                    </GroupStyle>
                                </ItemsControl.GroupStyle>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition SharedSizeGroup="MessageDetailNameGroup" />
                                                <ColumnDefinition SharedSizeGroup="MessageDetailValueGroup" />
                                            </Grid.ColumnDefinitions>

                                            <TextBlock Grid.Column="0" Text="{Binding Name}" Margin="1" />
                                            <TextBlock Grid.Column="1" Text="{Binding Value}" Margin="1" />
                                        </Grid>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </StackPanel>
                    </DataTemplate>
                </DataGrid.RowDetailsTemplate>
            </DataGrid>
        </Grid>

        <StatusBar Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2">
            <StatusBarItem DockPanel.Dock="Right">
                <TextBlock>
                    <Span>Version: </Span>
                    <Run Text="{Binding Path=ApplicationVersion, Mode=OneWay}" />
                </TextBlock>
            </StatusBarItem>
            <StatusBarItem>
                <TextBlock>
                    <Span>Homepage: </Span>
                    <Hyperlink Command="{Binding OpenHomepage}">https://github.com/whut/MsmqFastView</Hyperlink>
                </TextBlock>
            </StatusBarItem>
        </StatusBar>
    </Grid>
</Window>

{'fraction_non_alphanumeric': 0.11077923801938139, 'fraction_numerical': 0.008761449621664676, 'mean_word_length': 1.4411860012961764, 'pattern_counts': {'":': 0, '<': 257, '<?xml version=': 0, '>': 257, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 58, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '94189', 'n_tokens_mistral': 3686, 'n_tokens_neox': 3237, 'n_words': 587}