<commit_before>﻿<UserControl x:Class="NSwagStudio.Views.SwaggerGenerators.WebApiSwaggerGeneratorView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:swaggerGenerators="clr-namespace:NSwagStudio.ViewModels.SwaggerGenerators"
             xmlns:converters="clr-namespace:MyToolkit.Converters;assembly=MyToolkit.Extended"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">

    <UserControl.Resources>
        <swaggerGenerators:WebApiSwaggerGeneratorViewModel x:Key="ViewModel" />
        <converters:VisibilityConverter x:Key="VisibilityConverter" />
        <converters:NotConverter x:Key="NotConverter" />
    </UserControl.Resources>

    <StackPanel Margin="8" DataContext="{StaticResource ViewModel}">
        <Grid Margin="0,0,0,12">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>

                <TextBlock Text=".NET Assembly" FontWeight="Bold" Margin="0,0,0,6" />
                <TextBox Grid.Row="1" Text="{Binding AssemblyPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                         Margin="0,0,12,0" VerticalAlignment="Center" />
            </Grid>

            <Button Command="{Binding BrowseAssemblyCommand}" VerticalAlignment="Stretch"
                    Padding="8,4,8,4" Grid.Column="1" Content="..." Margin="0,0,12,0" />

            <Button Command="{Binding LoadAssemblyCommand}" VerticalAlignment="Stretch"
                    Padding="8,4,8,4" Grid.Column="2" Content="Load" />
        </Grid>
        <TextBlock Text="{Binding AssemblyName, Mode=OneWay}" TextWrapping="Wrap" Margin="0,-6,0,12" />

        <TextBlock Text="Paths to seach for referenced assembly files (comma separated)" FontWeight="Bold" Margin="0,0,0,6" />
        <TextBox Text="{Binding ReferencePaths, Mode=TwoWay}" Margin="0,0,0,12" />

        <TextBlock Text="Web API Controller Names" FontWeight="Bold" Margin="0,0,0,8" />
        <ListBox ItemsSource="{Binding AllControllerNames}" x:Name="ControllersList" MaxHeight="300"
                 SelectionChanged="ControllersListSelectionChanged" BorderThickness="0" Padding="0"
                 SelectionMode="Multiple">
            <ListBox.Resources>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="HorizontalContentAlignment" 
                            Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                    <Setter Property="VerticalContentAlignment" 
                            Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                    <Setter Property="Padding" Value="0"/>
                    <Setter Property="Margin" Value="0"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                                        Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListBox.Resources>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox Content="{Binding}" Margin="0,0,0,4"
                              IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}">
                        <CheckBox.LayoutTransform>
                            <ScaleTransform ScaleX="1" ScaleY="1" />
                        </CheckBox.LayoutTransform>
                    </CheckBox>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <TextBlock Text="When multiple controllers are selected, consider selecting MultipleClientsFromPathSegments as operation generation mode."
                   TextWrapping="Wrap" Margin="0,4,0,6" />
        
        <TextBlock Margin="0,6,0,6" TextWrapping="Wrap">
            <Run Text="Default Enum Handling" FontWeight="Bold" />
            <LineBreak />
            Choose 'Integer' if you use the default Json.NET serializer or 'String' if a global StringEnumConverter is registered.
        </TextBlock>
        <ComboBox SelectedItem="{Binding Command.DefaultEnumHandling, Mode=TwoWay}" ItemsSource="{Binding EnumHandlings}" Margin="0,0,0,12" />

        <CheckBox IsChecked="{Binding Command.FlattenInheritanceHierarchy, Mode=TwoWay}" Margin="0,0,0,12">
            <TextBlock Text="Flatten the inheritance hierarchy instead of using allOf to describe inheritance" TextWrapping="Wrap" />
        </CheckBox>

        <CheckBox IsChecked="{Binding Command.GenerateKnownTypes, Mode=TwoWay}" Margin="0,0,0,12">
            <TextBlock Text="Generate schemas for types in KnownTypeAttribute attributes" TextWrapping="Wrap" />
        </CheckBox>

        <TextBlock Text="Default URL Template" FontWeight="Bold" Margin="0,0,0,6" />
        <TextBox Text="{Binding Command.DefaultUrlTemplate, Mode=TwoWay}" Margin="0,0,0,24" />
    </StackPanel>
</UserControl>
<commit_msg>Changed info text in UI<commit_after>﻿<UserControl x:Class="NSwagStudio.Views.SwaggerGenerators.WebApiSwaggerGeneratorView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:swaggerGenerators="clr-namespace:NSwagStudio.ViewModels.SwaggerGenerators"
             xmlns:converters="clr-namespace:MyToolkit.Converters;assembly=MyToolkit.Extended"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">

    <UserControl.Resources>
        <swaggerGenerators:WebApiSwaggerGeneratorViewModel x:Key="ViewModel" />
        <converters:VisibilityConverter x:Key="VisibilityConverter" />
        <converters:NotConverter x:Key="NotConverter" />
    </UserControl.Resources>

    <StackPanel Margin="8" DataContext="{StaticResource ViewModel}">
        <Grid Margin="0,0,0,12">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>

                <TextBlock Text=".NET Assembly" FontWeight="Bold" Margin="0,0,0,6" />
                <TextBox Grid.Row="1" Text="{Binding AssemblyPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                         Margin="0,0,12,0" VerticalAlignment="Center" />
            </Grid>

            <Button Command="{Binding BrowseAssemblyCommand}" VerticalAlignment="Stretch"
                    Padding="8,4,8,4" Grid.Column="1" Content="..." Margin="0,0,12,0" />

            <Button Command="{Binding LoadAssemblyCommand}" VerticalAlignment="Stretch"
                    Padding="8,4,8,4" Grid.Column="2" Content="Load" />
        </Grid>
        <TextBlock Text="{Binding AssemblyName, Mode=OneWay}" TextWrapping="Wrap" Margin="0,-6,0,12" />

        <TextBlock Text="Paths to seach for referenced assembly files (comma separated)" FontWeight="Bold" Margin="0,0,0,6" />
        <TextBox Text="{Binding ReferencePaths, Mode=TwoWay}" Margin="0,0,0,12" />

        <TextBlock Text="Web API Controller Names" FontWeight="Bold" Margin="0,0,0,8" />
        <ListBox ItemsSource="{Binding AllControllerNames}" x:Name="ControllersList" MaxHeight="300"
                 SelectionChanged="ControllersListSelectionChanged" BorderThickness="0" Padding="0"
                 SelectionMode="Multiple">
            <ListBox.Resources>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="HorizontalContentAlignment" 
                            Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                    <Setter Property="VerticalContentAlignment" 
                            Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
                    <Setter Property="Padding" Value="0"/>
                    <Setter Property="Margin" Value="0"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                                        Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListBox.Resources>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox Content="{Binding}" Margin="0,0,0,4"
                              IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}">
                        <CheckBox.LayoutTransform>
                            <ScaleTransform ScaleX="1" ScaleY="1" />
                        </CheckBox.LayoutTransform>
                    </CheckBox>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <TextBlock Text="When multiple controllers are selected, consider selecting MultipleClientsFromOperationId or MultipleClientsFromPathSegments as operation generation mode."
                   TextWrapping="Wrap" Margin="0,4,0,6" />

        <TextBlock Margin="0,6,0,6" TextWrapping="Wrap">
            <Run Text="Default Enum Handling" FontWeight="Bold" />
            <LineBreak />
            Choose 'Integer' if you use the default Json.NET serializer or 'String' if a global StringEnumConverter is registered.
        </TextBlock>
        <ComboBox SelectedItem="{Binding Command.DefaultEnumHandling, Mode=TwoWay}" ItemsSource="{Binding EnumHandlings}" Margin="0,0,0,12" />

        <CheckBox IsChecked="{Binding Command.FlattenInheritanceHierarchy, Mode=TwoWay}" Margin="0,0,0,12">
            <TextBlock Text="Flatten the inheritance hierarchy instead of using allOf to describe inheritance" TextWrapping="Wrap" />
        </CheckBox>

        <CheckBox IsChecked="{Binding Command.GenerateKnownTypes, Mode=TwoWay}" Margin="0,0,0,12">
            <TextBlock Text="Generate schemas for types in KnownTypeAttribute attributes" TextWrapping="Wrap" />
        </CheckBox>

        <TextBlock Text="Default URL Template" FontWeight="Bold" Margin="0,0,0,6" />
        <TextBox Text="{Binding Command.DefaultUrlTemplate, Mode=TwoWay}" Margin="0,0,0,24" />
    </StackPanel>
</UserControl>

{'fraction_non_alphanumeric': 0.11671207992733879, 'fraction_numerical': 0.01755979412655162, 'mean_word_length': 2.2203265902997806, 'pattern_counts': {'":': 0, '<': 153, '<?xml version=': 0, '>': 153, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1117466', 'n_tokens_mistral': 3602, 'n_tokens_neox': 3184, 'n_words': 568}