/
solostacktoolkit
/
structurator
Обзор
Документация
Войти
/
solostacktoolkit
/
structurator
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
1
Аналитика
Безопасность
master
Views/MainWindow.xaml
346 строк
17 KB
Артем Зиновьев
Initial commit: Структуратор 1.0
29 мар 2026, 08:39
29 мар 2026, 08:39
80f0f62
Код
Авторство
О чём код?
<Window x:Class="StructureSnap.Views.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:StructureSnap.Views.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Title="Структуратор" Width="1300" Height="750" MinWidth="1100" MinHeight="650" AllowsTransparency="True" Background="Transparent" ResizeMode="CanResize" TextOptions.TextFormattingMode="Display" TextOptions.TextRenderingMode="ClearType" WindowStartupLocation="CenterScreen" WindowStyle="None" mc:Ignorable="d"> <Window.Resources> <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" /> <!-- ===== ЦВЕТОВЫЕ РЕСУРСЫ ===== --> <Color x:Key="PrimaryGreen">#4CAF50</Color> <Color x:Key="PrimaryGreenHover">#43A047</Color> <Color x:Key="DangerColor">#FF5722</Color> <Color x:Key="SecondaryColor">#5A6268</Color> <Color x:Key="GlassBackground">#343a40</Color> <Color x:Key="TextWhite">#FFFFFF</Color> <Color x:Key="TextMuted">#B0BEC5</Color> <!-- ===== ОСНОВНАЯ КНОПКА (ЗЕЛЁНАЯ) ===== --> <Style x:Key="PrimaryButtonStyle" TargetType="Button"> <Setter Property="Padding" Value="20,10" /> <Setter Property="FontSize" Value="13" /> <Setter Property="Foreground" Value="White" /> <Setter Property="Background" Value="#4CAF50" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="Cursor" Value="Hand" /> <Setter Property="MinWidth" Value="180" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Border Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" CornerRadius="4"> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> </Border> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="#43A047" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Background" Value="#5A6268" /> <Setter Property="Cursor" Value="Arrow" /> </Trigger> </Style.Triggers> </Style> <!-- ===== ВТОРИЧНАЯ КНОПКА (СЕРЫЙ) ===== --> <Style x:Key="SecondaryButtonStyle" BasedOn="{StaticResource PrimaryButtonStyle}" TargetType="Button"> <Setter Property="Background" Value="#5A6268" /> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="#495057" /> </Trigger> </Style.Triggers> </Style> <!-- ===== КНОПКА ОТМЕНЫ (КРАСНАЯ) ===== --> <Style x:Key="DangerButtonStyle" BasedOn="{StaticResource PrimaryButtonStyle}" TargetType="Button"> <Setter Property="Background" Value="#FF5722" /> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="#E64A19" /> </Trigger> </Style.Triggers> </Style> <!-- ===== PROGRESS BAR (ЗЕЛЁНЫЙ, РАБОЧИЙ) ===== --> <Style x:Key="SlimProgressBarStyle" TargetType="ProgressBar"> <Setter Property="Height" Value="10" /> <Setter Property="Background" Value="#495057" /> <Setter Property="Foreground" Value="#4CAF50" /> <Setter Property="Minimum" Value="0" /> <Setter Property="Maximum" Value="100" /> <Setter Property="BorderBrush" Value="#6C757D" /> <Setter Property="BorderThickness" Value="1" /> </Style> </Window.Resources> <Grid Background="#343a40" MouseLeftButtonDown="Window_DragMove" OpacityMask="#F2000000"> <Border BorderBrush="#6C757D" BorderThickness="1" CornerRadius="8"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <!-- ===== ВЕРХНЯЯ ПАНЕЛЬ ===== --> <Border Grid.Row="0" Padding="20" Background="#2D3238" BorderBrush="#6C757D" BorderThickness="0,0,0,1"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <!-- Логотип и описание --> <StackPanel Grid.Column="0" VerticalAlignment="Center"> <TextBlock FontSize="22" FontWeight="SemiBold" Foreground="White" Text="Структуратор" /> <TextBlock Margin="0,4,0,0" FontSize="12" Foreground="#B0BEC5" Text="Экспорт и анализ проектов Visual Studio" /> </StackPanel> <!-- Панель кнопок --> <StackPanel Grid.Column="1" VerticalAlignment="Center" Orientation="Horizontal"> <Button Margin="0,0,8,0" Command="{Binding SelectSolutionCommand}" Content="Выбрать решение" Cursor="Hand" Style="{StaticResource PrimaryButtonStyle}" ToolTip="Открыть файл решения (.sln или .slnx)" /> <!-- Кнопка "Собрать код" с чекбоксом --> <Button Margin="0,0,8,0" Command="{Binding CollectCodeCommand}" IsEnabled="{Binding CanCollectCode}" Style="{StaticResource PrimaryButtonStyle}"> <Button.Content> <StackPanel Orientation="Horizontal"> <TextBlock Margin="0,0,12,0" VerticalAlignment="Center" Text="Собрать код" /> <CheckBox VerticalAlignment="Center" Content="Удалять комментарии" IsChecked="{Binding RemoveCommentsEnabled, Mode=TwoWay}" ToolTipService.InitialShowDelay="0" ToolTipService.ShowDuration="2147483647"> <CheckBox.ToolTip> <TextBlock MaxWidth="350" TextWrapping="Wrap"> <Run FontWeight="Bold">Удалить плохие комментарии</Run> <LineBreak /><LineBreak /> Если отмечено, будут удалены обычные комментарии, но сохранятся:<LineBreak /> • XML-документация (/// <summary>)<LineBreak /> • Служебные метки (TODO, FIXME, NOTE)<LineBreak /> • Лицензионные заголовки</TextBlock> </CheckBox.ToolTip> </CheckBox> </StackPanel> </Button.Content> <ToolTipService.ToolTip> <TextBlock MaxWidth="400" TextWrapping="Wrap"> <Run FontSize="14" FontWeight="Bold">Собрать весь код проекта</Run> <LineBreak /><LineBreak /> Экспортирует все файлы исходного кода из открытого решения в один Markdown файл.<LineBreak /><LineBreak /> <Run FontWeight="Bold">☐ Удалить комментарии</Run> <LineBreak /> Если отмечено, будут удалены обычные комментарии, но сохранятся:<LineBreak /> • XML-документация (/// <summary>)<LineBreak /> • Служебные метки (TODO, FIXME, NOTE)<LineBreak /> • Лицензионные заголовки<LineBreak /><LineBreak /> <Run FontStyle="Italic">Файл будет сохранён в папке решения с именем:</Run> <LineBreak /> <Run FontFamily="Consolas">{ИмяРешения}_Structure_{дата}.md</Run> </TextBlock> </ToolTipService.ToolTip> </Button> <Button Margin="0,0,8,0" Command="{Binding CancelLoadCommand}" Content="Отмена" Cursor="Hand" Style="{StaticResource DangerButtonStyle}" ToolTip="Прервать операцию" Visibility="{Binding CanCancel, Converter={StaticResource BoolToVisibilityConverter}}" /> <Button Margin="0,0,8,0" Command="{Binding ResetCommand}" Content="Сброс" Cursor="Hand" Style="{StaticResource SecondaryButtonStyle}" ToolTip="Очистить данные и загрузить другое решение" /> <Button Margin="0,0,0,0" Click="ExitButton_Click" Content="Выход" Style="{StaticResource SecondaryButtonStyle}" ToolTip="Закрыть приложение" /> </StackPanel> </Grid> </Border> <!-- Индикатор прогресса сбора кода --> <Border Grid.Row="1" Padding="20,10,20,20" Background="#2D3238"> <StackPanel> <ProgressBar x:Name="MainProgressBar" Margin="0,0,0,8" Maximum="100" Minimum="0" Style="{StaticResource SlimProgressBarStyle}" Value="{Binding ProgressValue}" /> <TextBlock FontSize="13" Foreground="#B0BEC5" Text="{Binding StatusMessage}" TextWrapping="Wrap" /> </StackPanel> </Border> <!-- ===== СЕТКА КАРТОЧЕК ===== --> <Border Grid.Row="2" Padding="20"> <UniformGrid HorizontalAlignment="Center" VerticalAlignment="Top" Columns="4" Rows="1"> <controls:FormatCard Grid.Column="0" Margin="4" CanExport="{Binding Cards[0].CanExport}" ErrorMessage="{Binding Cards[0].ErrorMessage}" ExportCommand="{Binding Cards[0].ExportCommand}" Format="{Binding Cards[0].Format}" IsBusy="{Binding Cards[0].IsBusy}" Preview="{Binding Cards[0].Preview}" /> <controls:FormatCard Grid.Column="1" Margin="4" CanExport="{Binding Cards[1].CanExport}" ErrorMessage="{Binding Cards[1].ErrorMessage}" ExportCommand="{Binding Cards[1].ExportCommand}" Format="{Binding Cards[1].Format}" IsBusy="{Binding Cards[1].IsBusy}" Preview="{Binding Cards[1].Preview}" /> <controls:FormatCard Grid.Column="2" Margin="4" CanExport="{Binding Cards[2].CanExport}" ErrorMessage="{Binding Cards[2].ErrorMessage}" ExportCommand="{Binding Cards[2].ExportCommand}" Format="{Binding Cards[2].Format}" IsBusy="{Binding Cards[2].IsBusy}" Preview="{Binding Cards[2].Preview}" /> <controls:FormatCard Grid.Column="3" Margin="4" CanExport="{Binding Cards[3].CanExport}" ErrorMessage="{Binding Cards[3].ErrorMessage}" ExportCommand="{Binding Cards[3].ExportCommand}" Format="{Binding Cards[3].Format}" IsBusy="{Binding Cards[3].IsBusy}" Preview="{Binding Cards[3].Preview}" /> </UniformGrid> </Border> <!-- ===== ФУТЕР ===== --> <Border Grid.Row="3" Padding="20" Background="#2D3238" BorderBrush="#6C757D" BorderThickness="0,1,0,0"> <TextBlock HorizontalAlignment="Center" FontSize="11"> <Run Foreground="#B0BEC5" Text="Структуратор v1.0 • MIT License • " /> <Hyperlink Foreground="#4CAF50" NavigateUri="https://gitflic.ru/user/solostacktoolkit" RequestNavigate="Hyperlink_RequestNavigate" TextDecorations="None"> solostacktoolkit на GitFlic <Hyperlink.Style> <Style TargetType="Hyperlink"> <Setter Property="Cursor" Value="Hand" /> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="#66BB6A" /> <Setter Property="TextDecorations" Value="Underline" /> </Trigger> </Style.Triggers> </Style> </Hyperlink.Style> </Hyperlink> </TextBlock> </Border> </Grid> </Border> </Grid> </Window>