move interfaces to separate folder
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Windows;
|
||||
using CodeContextGenerator.Interfaces;
|
||||
using CodeContextGenerator.Services;
|
||||
using CodeContextGenerator.ViewModels;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
6
CodeContextGenerator/Interfaces/IContextFileGenerator.cs
Normal file
6
CodeContextGenerator/Interfaces/IContextFileGenerator.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace CodeContextGenerator.Interfaces;
|
||||
|
||||
public interface IContextFileGenerator
|
||||
{
|
||||
Task GenerateContextFileAsync(List<string> selectedFiles, string outputPath, string projectRootPath, IProgress<int> progress, CancellationToken cancellationToken);
|
||||
}
|
||||
6
CodeContextGenerator/Interfaces/IFileProcessorService.cs
Normal file
6
CodeContextGenerator/Interfaces/IFileProcessorService.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace CodeContextGenerator.Interfaces;
|
||||
|
||||
public interface IFileProcessorService
|
||||
{
|
||||
string ProcessFileContent(string content, string fileName);
|
||||
}
|
||||
9
CodeContextGenerator/Interfaces/IFileScannerService.cs
Normal file
9
CodeContextGenerator/Interfaces/IFileScannerService.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using CodeContextGenerator.Models;
|
||||
|
||||
namespace CodeContextGenerator.Interfaces;
|
||||
|
||||
public interface IFileScannerService
|
||||
{
|
||||
Task BuildDirectoryTreeAsync(string path, FileItem parentItem, IProgress<int> progress = null, CancellationToken cancellationToken = default);
|
||||
List<string> GetSelectedFiles(FileItem rootItem);
|
||||
}
|
||||
9
CodeContextGenerator/Interfaces/IProjectLoaderService.cs
Normal file
9
CodeContextGenerator/Interfaces/IProjectLoaderService.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using CodeContextGenerator.Models;
|
||||
|
||||
namespace CodeContextGenerator.Interfaces;
|
||||
|
||||
public interface IProjectLoaderService
|
||||
{
|
||||
Task<FileItem> LoadProjectFromPathAsync(string projectPath, IProgress<int> progress, CancellationToken cancellationToken);
|
||||
string GetDefaultOutputFileName(string projectPath);
|
||||
}
|
||||
7
CodeContextGenerator/Interfaces/ISettingsService.cs
Normal file
7
CodeContextGenerator/Interfaces/ISettingsService.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace CodeContextGenerator.Interfaces;
|
||||
|
||||
public interface ISettingsService
|
||||
{
|
||||
string GetLastProjectPath();
|
||||
void SaveLastProjectPath(string path);
|
||||
}
|
||||
11
CodeContextGenerator/Interfaces/IUIService.cs
Normal file
11
CodeContextGenerator/Interfaces/IUIService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace CodeContextGenerator.Interfaces;
|
||||
|
||||
public interface IUIService
|
||||
{
|
||||
string ShowFolderBrowserDialog(string initialDirectory = null);
|
||||
bool ShowOpenProjectFileDialog(out string selectedPath);
|
||||
bool ShowSaveFileDialog(string defaultFileName, string initialDirectory, out string savePath);
|
||||
void ShowMessage(string message, string title, MessageBoxImage icon = MessageBoxImage.Information);
|
||||
}
|
||||
@@ -1,13 +1,9 @@
|
||||
using System.IO;
|
||||
using CodeContextGenerator.Interfaces;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace CodeContextGenerator.Services;
|
||||
|
||||
public interface IContextFileGenerator
|
||||
{
|
||||
Task GenerateContextFileAsync(List<string> selectedFiles, string outputPath, string projectRootPath, IProgress<int> progress, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
public class ContextFileGenerator : IContextFileGenerator
|
||||
{
|
||||
private readonly IFileProcessorService _fileProcessorService;
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
using System.Text;
|
||||
using CodeContextGenerator.Interfaces;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace CodeContextGenerator.Services;
|
||||
|
||||
public interface IFileProcessorService
|
||||
{
|
||||
string ProcessFileContent(string content, string fileName);
|
||||
}
|
||||
|
||||
public class FileProcessorService : IFileProcessorService
|
||||
{
|
||||
public string ProcessFileContent(string content, string fileName)
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using CodeContextGenerator.Models;
|
||||
using CodeContextGenerator.Interfaces;
|
||||
using CodeContextGenerator.Models;
|
||||
using System.IO;
|
||||
|
||||
namespace CodeContextGenerator.Services;
|
||||
|
||||
public interface IFileScannerService
|
||||
{
|
||||
Task BuildDirectoryTreeAsync(string path, FileItem parentItem, IProgress<int> progress = null, CancellationToken cancellationToken = default);
|
||||
List<string> GetSelectedFiles(FileItem rootItem);
|
||||
}
|
||||
|
||||
public class FileScannerService : IFileScannerService
|
||||
{
|
||||
private static readonly string[] ExcludedDirectories = {
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
using CodeContextGenerator.Models;
|
||||
using CodeContextGenerator.Interfaces;
|
||||
using CodeContextGenerator.Models;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
|
||||
namespace CodeContextGenerator.Services;
|
||||
|
||||
public interface IProjectLoaderService
|
||||
{
|
||||
Task<FileItem> LoadProjectFromPathAsync(string projectPath, IProgress<int> progress, CancellationToken cancellationToken);
|
||||
string GetDefaultOutputFileName(string projectPath);
|
||||
}
|
||||
|
||||
public class ProjectLoaderService : IProjectLoaderService
|
||||
{
|
||||
private readonly IFileScannerService _fileScannerService;
|
||||
|
||||
@@ -1,96 +1,91 @@
|
||||
using System.IO;
|
||||
using CodeContextGenerator.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using CodeContextGenerator.Models;
|
||||
using System.IO;
|
||||
|
||||
namespace CodeContextGenerator.Services
|
||||
namespace CodeContextGenerator.Services;
|
||||
|
||||
public static class ProjectScannerService
|
||||
{
|
||||
public static class ProjectScannerService
|
||||
private static readonly string[] ExcludedDirectories = {
|
||||
"bin", "obj", ".git", "packages", ".vs", "Properties",
|
||||
"node_modules", ".vscode", ".idea", ".vs", "Debug", "Release"
|
||||
};
|
||||
|
||||
private static readonly string[] IncludedExtensions = { ".cs", ".xaml" };
|
||||
|
||||
public static async Task BuildDirectoryTreeAsync(string path, FileItem parentItem, IProgress<int> progress = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
private static readonly string[] ExcludedDirectories = {
|
||||
"bin", "obj", ".git", "packages", ".vs", "Properties",
|
||||
"node_modules", ".vscode", ".idea", ".vs", "Debug", "Release"
|
||||
};
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
private static readonly string[] IncludedExtensions = { ".cs", ".xaml" };
|
||||
|
||||
public static async Task BuildDirectoryTreeAsync(string path, FileItem parentItem, IProgress<int> progress = null, CancellationToken cancellationToken = default)
|
||||
try
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
if (!Directory.Exists(path))
|
||||
return;
|
||||
|
||||
try
|
||||
var directories = Directory.GetDirectories(path)
|
||||
.Where(d => !ExcludedDirectories.Any(ex => d.EndsWith(ex, System.StringComparison.OrdinalIgnoreCase) ||
|
||||
Path.GetFileName(d).Equals(ex, System.StringComparison.OrdinalIgnoreCase)))
|
||||
.ToList();
|
||||
|
||||
var files = Directory.GetFiles(path)
|
||||
.Where(f => IncludedExtensions.Any(ext => f.EndsWith(ext, System.StringComparison.OrdinalIgnoreCase)))
|
||||
.ToList();
|
||||
|
||||
int totalItems = directories.Count + files.Count;
|
||||
int processedItems = 0;
|
||||
|
||||
// Обрабатываем поддиректории
|
||||
foreach (var dir in directories)
|
||||
{
|
||||
if (!Directory.Exists(path))
|
||||
return;
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var directories = Directory.GetDirectories(path)
|
||||
.Where(d => !ExcludedDirectories.Any(ex => d.EndsWith(ex, System.StringComparison.OrdinalIgnoreCase) ||
|
||||
Path.GetFileName(d).Equals(ex, System.StringComparison.OrdinalIgnoreCase)))
|
||||
.ToList();
|
||||
|
||||
var files = Directory.GetFiles(path)
|
||||
.Where(f => IncludedExtensions.Any(ext => f.EndsWith(ext, System.StringComparison.OrdinalIgnoreCase)))
|
||||
.ToList();
|
||||
|
||||
int totalItems = directories.Count + files.Count;
|
||||
int processedItems = 0;
|
||||
|
||||
// Обрабатываем поддиректории
|
||||
foreach (var dir in directories)
|
||||
var dirName = Path.GetFileName(dir);
|
||||
var dirItem = new FileItem
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
Name = dirName,
|
||||
FullName = dir,
|
||||
IsDirectory = true,
|
||||
Parent = parentItem,
|
||||
IsSelected = false
|
||||
};
|
||||
|
||||
var dirName = Path.GetFileName(dir);
|
||||
var dirItem = new FileItem
|
||||
{
|
||||
Name = dirName,
|
||||
FullName = dir,
|
||||
IsDirectory = true,
|
||||
Parent = parentItem,
|
||||
IsSelected = false
|
||||
};
|
||||
await BuildDirectoryTreeAsync(dir, dirItem, progress, cancellationToken);
|
||||
|
||||
await BuildDirectoryTreeAsync(dir, dirItem, progress, cancellationToken);
|
||||
|
||||
// Добавляем директорию только если в ней есть файлы или поддиректории с файлами
|
||||
if (dirItem.Children.Any())
|
||||
{
|
||||
parentItem.Children.Add(dirItem);
|
||||
}
|
||||
|
||||
processedItems++;
|
||||
progress?.Report((int)((processedItems * 100.0) / totalItems));
|
||||
// Добавляем директорию только если в ней есть файлы или поддиректории с файлами
|
||||
if (dirItem.Children.Any())
|
||||
{
|
||||
parentItem.Children.Add(dirItem);
|
||||
}
|
||||
|
||||
// Обрабатываем файлы
|
||||
foreach (var file in files)
|
||||
processedItems++;
|
||||
progress?.Report((int)((processedItems * 100.0) / totalItems));
|
||||
}
|
||||
|
||||
// Обрабатываем файлы
|
||||
foreach (var file in files)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var fileItem = new FileItem
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
Name = Path.GetFileName(file),
|
||||
FullName = file,
|
||||
IsDirectory = false,
|
||||
Parent = parentItem,
|
||||
IsSelected = false
|
||||
};
|
||||
|
||||
var fileItem = new FileItem
|
||||
{
|
||||
Name = Path.GetFileName(file),
|
||||
FullName = file,
|
||||
IsDirectory = false,
|
||||
Parent = parentItem,
|
||||
IsSelected = false
|
||||
};
|
||||
|
||||
parentItem.Children.Add(fileItem);
|
||||
processedItems++;
|
||||
progress?.Report((int)((processedItems * 100.0) / totalItems));
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
// Игнорируем ошибки доступа к директориям
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
// Игнорируем ошибки доступа
|
||||
parentItem.Children.Add(fileItem);
|
||||
processedItems++;
|
||||
progress?.Report((int)((processedItems * 100.0) / totalItems));
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
// Игнорируем ошибки доступа к директориям
|
||||
}
|
||||
catch (UnauthorizedAccessException)
|
||||
{
|
||||
// Игнорируем ошибки доступа
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,9 @@
|
||||
using System.IO;
|
||||
using CodeContextGenerator.Interfaces;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace CodeContextGenerator.Services;
|
||||
|
||||
public interface ISettingsService
|
||||
{
|
||||
string GetLastProjectPath();
|
||||
void SaveLastProjectPath(string path);
|
||||
}
|
||||
|
||||
public class SettingsService : ISettingsService
|
||||
{
|
||||
private const string SettingsFileName = "app_settings.json";
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
using Microsoft.Win32;
|
||||
using CodeContextGenerator.Interfaces;
|
||||
using Microsoft.Win32;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
|
||||
namespace CodeContextGenerator.Services;
|
||||
|
||||
public interface IUIService
|
||||
{
|
||||
string ShowFolderBrowserDialog(string initialDirectory = null);
|
||||
bool ShowOpenProjectFileDialog(out string selectedPath);
|
||||
bool ShowSaveFileDialog(string defaultFileName, string initialDirectory, out string savePath);
|
||||
void ShowMessage(string message, string title, MessageBoxImage icon = MessageBoxImage.Information);
|
||||
}
|
||||
|
||||
public class UIService : IUIService
|
||||
{
|
||||
public string ShowFolderBrowserDialog(string initialDirectory = null)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using CodeContextGenerator.Models;
|
||||
using CodeContextGenerator.Services;
|
||||
using CodeContextGenerator.Interfaces;
|
||||
using CodeContextGenerator.Models;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using System.IO;
|
||||
|
||||
@@ -1,68 +1,93 @@
|
||||
<Window x:Class="CodeContextGenerator.Views.MainWindow"
|
||||
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:local="clr-namespace:CodeContextGenerator.Views"
|
||||
mc:Ignorable="d"
|
||||
Title="Code Context Generator" Height="600" Width="800"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<Window
|
||||
x:Class="CodeContextGenerator.Views.MainWindow"
|
||||
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:local="clr-namespace:CodeContextGenerator.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="Code Context Generator"
|
||||
Width="800"
|
||||
Height="600"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Window.Resources>
|
||||
<Style TargetType="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Padding" Value="10,5"/>
|
||||
<Setter Property="Margin" Value="5,0"/>
|
||||
<Setter Property="Padding" Value="10,5" />
|
||||
<Setter Property="Margin" Value="5,0" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Text="Выберите файл решения, проекта или папку:" FontWeight="Bold" Margin="0,0,0,5"/>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,5"
|
||||
FontWeight="Bold"
|
||||
Text="Выберите файл решения, проекта или папку:" />
|
||||
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<Button Content="Выбрать..."
|
||||
Command="{Binding SelectProjectCommand}"
|
||||
IsEnabled="{Binding CanSelectProject}"
|
||||
Width="100"/>
|
||||
<TextBlock Text="{Binding SelectedProjectPath}"
|
||||
VerticalAlignment="Center"
|
||||
TextWrapping="Wrap"
|
||||
MaxWidth="600"
|
||||
Margin="10,0,0,0"/>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,10"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Width="100"
|
||||
Command="{Binding SelectProjectCommand}"
|
||||
Content="Выбрать..."
|
||||
IsEnabled="{Binding CanSelectProject}" />
|
||||
<TextBlock
|
||||
MaxWidth="600"
|
||||
Margin="10,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding SelectedProjectPath}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
|
||||
<Border Grid.Row="2" BorderBrush="Gray" BorderThickness="1" CornerRadius="4" Padding="5"
|
||||
Visibility="{Binding IsProjectLoaded, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
|
||||
PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||
<TreeView x:Name="ProjectTree" ItemsSource="{Binding RootDirectory.Children}"
|
||||
VirtualizingPanel.IsVirtualizing="True"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling">
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Padding="5"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4"
|
||||
Visibility="{Binding IsProjectLoaded, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ScrollViewer
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
PreviewMouseWheel="ScrollViewer_PreviewMouseWheel"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<TreeView
|
||||
x:Name="ProjectTree"
|
||||
ItemsSource="{Binding RootDirectory.Children}"
|
||||
VirtualizingPanel.IsVirtualizing="True"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling">
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
|
||||
<StackPanel Orientation="Horizontal" MinHeight="24">
|
||||
<CheckBox IsChecked="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsThreeState="True"
|
||||
VerticalAlignment="Center" Margin="2,0,5,0"
|
||||
Click="CheckBox_Click"/>
|
||||
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"
|
||||
ToolTip="{Binding FullName}"/>
|
||||
<StackPanel MinHeight="24" Orientation="Horizontal">
|
||||
<CheckBox
|
||||
Margin="2,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
Click="CheckBox_Click"
|
||||
IsChecked="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsThreeState="True" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}"
|
||||
ToolTip="{Binding FullName}" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
@@ -70,27 +95,49 @@
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
||||
<TextBlock Grid.Row="2" Text="Проект еще не загружен. Выберите файл решения или проекта."
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="Gray" FontSize="14"
|
||||
Visibility="{Binding IsProjectLoaded, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter=Collapsed}"/>
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="Gray"
|
||||
Text="Проект еще не загружен. Выберите файл решения или проекта."
|
||||
Visibility="{Binding IsProjectLoaded, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter=Collapsed}" />
|
||||
|
||||
<ProgressBar Grid.Row="3" Value="{Binding ProgressValue}" Height="20" Margin="0,10,0,10"
|
||||
Visibility="{Binding IsProcessing, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<ProgressBar
|
||||
Grid.Row="3"
|
||||
Height="20"
|
||||
Margin="0,10,0,10"
|
||||
Visibility="{Binding IsProcessing, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Value="{Binding ProgressValue}" />
|
||||
|
||||
<TextBlock Grid.Row="3" Text="{Binding ProgressText}" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontWeight="Bold"
|
||||
Visibility="{Binding IsProcessing, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding ProgressText}"
|
||||
Visibility="{Binding IsProcessing, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
||||
|
||||
<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
|
||||
<Button Content="Отмена" Command="{Binding CancelProcessingCommand}"
|
||||
Visibility="{Binding IsProcessing, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Background="#FFDC3545" Foreground="White"/>
|
||||
<Button Content="Закрыть" Command="{Binding ExitApplicationCommand}"/>
|
||||
<Button Content="Сформировать" Command="{Binding GenerateContextFileCommand}"
|
||||
IsEnabled="{Binding CanGenerate}"
|
||||
Background="#FF28A745" Foreground="White"
|
||||
Visibility="{Binding IsProjectLoaded, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
<StackPanel
|
||||
Grid.Row="4"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Background="#FFDC3545"
|
||||
Command="{Binding CancelProcessingCommand}"
|
||||
Content="Отмена"
|
||||
Foreground="White"
|
||||
Visibility="{Binding IsProcessing, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
||||
<Button Command="{Binding ExitApplicationCommand}" Content="Закрыть" />
|
||||
<Button
|
||||
Background="#FF28A745"
|
||||
Command="{Binding GenerateContextFileCommand}"
|
||||
Content="Сформировать"
|
||||
Foreground="White"
|
||||
IsEnabled="{Binding CanGenerate}"
|
||||
Visibility="{Binding IsProjectLoaded, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user