From 00de4cb3192dc9ebe4f89c3a1ff5dd1152665850 Mon Sep 17 00:00:00 2001 From: kozhilya Date: Wed, 21 May 2025 15:57:18 +0400 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=81=D1=91-=D1=82=D0=B0=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BD=D0=B5=20=D0=BA=D0=BE=D0=BD=D0=B5=D1=86,=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=B4=D0=BE=20=D0=B5=D1=89=D1=91=20=D0=BA=D0=BD=D0=BE=D0=BF?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BF=D0=BE=D1=87=D0=B8=D0=BD=D0=B8=D1=82=D1=8C?= =?UTF-8?q?...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pf2eDataScrapper/Helpers/ProcessProgress.cs | 7 +++ .../Processors/ProcessorExecutor.cs | 1 + .../Component/EntityListControl.xaml | 1 - .../WPF/EntityViewer/EntityForm.xaml.cs | 1 - .../{Views => ProgressForm}/ProgressForm.xaml | 51 ++++++++++++------- .../ProgressForm.xaml.cs | 10 +++- .../ProcessorCollectionControl.xaml | 2 +- .../ProcessorCollectionControl.xaml.cs | 2 +- .../WPF/{Views => StartForm}/StartForm.xaml | 7 +-- .../{Views => StartForm}/StartForm.xaml.cs | 5 +- .../WPF/WpfServiceProviderExtension.cs | 1 - 11 files changed, 56 insertions(+), 32 deletions(-) rename Pf2eDataScrapper/WPF/{Views => ProgressForm}/ProgressForm.xaml (58%) rename Pf2eDataScrapper/WPF/{Views => ProgressForm}/ProgressForm.xaml.cs (87%) rename Pf2eDataScrapper/WPF/{ => StartForm}/Components/ProcessorCollectionControl.xaml (99%) rename Pf2eDataScrapper/WPF/{ => StartForm}/Components/ProcessorCollectionControl.xaml.cs (98%) rename Pf2eDataScrapper/WPF/{Views => StartForm}/StartForm.xaml (91%) rename Pf2eDataScrapper/WPF/{Views => StartForm}/StartForm.xaml.cs (85%) diff --git a/Pf2eDataScrapper/Helpers/ProcessProgress.cs b/Pf2eDataScrapper/Helpers/ProcessProgress.cs index d4f6d26..80514cb 100644 --- a/Pf2eDataScrapper/Helpers/ProcessProgress.cs +++ b/Pf2eDataScrapper/Helpers/ProcessProgress.cs @@ -36,9 +36,16 @@ internal class ProcessProgress : AbstractLogger ProgressMessage?.Invoke(this, level, message); } + public void Complete() + { + ProgressComplete?.Invoke(this); + } + public delegate void ProgressUpdateDelegate(ProcessProgress sender); public event ProgressUpdateDelegate? ProgressUpdate; + public event ProgressUpdateDelegate? ProgressComplete; + public delegate void ProgressMessageDelegate( ProcessProgress sender, LogLevel level, diff --git a/Pf2eDataScrapper/Processors/ProcessorExecutor.cs b/Pf2eDataScrapper/Processors/ProcessorExecutor.cs index b4d97f8..b0e22d2 100644 --- a/Pf2eDataScrapper/Processors/ProcessorExecutor.cs +++ b/Pf2eDataScrapper/Processors/ProcessorExecutor.cs @@ -94,6 +94,7 @@ internal sealed class ProcessorExecutor( else { Progress.Processors.Complete(); + Progress.Complete(); } } diff --git a/Pf2eDataScrapper/WPF/EntityViewer/Component/EntityListControl.xaml b/Pf2eDataScrapper/WPF/EntityViewer/Component/EntityListControl.xaml index 69b7ad6..7ba545e 100644 --- a/Pf2eDataScrapper/WPF/EntityViewer/Component/EntityListControl.xaml +++ b/Pf2eDataScrapper/WPF/EntityViewer/Component/EntityListControl.xaml @@ -3,7 +3,6 @@ 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:Pf2eDataScrapper.WPF.Components" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewmodel="clr-namespace:Pf2eDataScrapper.WPF.EntityViewer.ViewModel" Padding="3,3,3,3" diff --git a/Pf2eDataScrapper/WPF/EntityViewer/EntityForm.xaml.cs b/Pf2eDataScrapper/WPF/EntityViewer/EntityForm.xaml.cs index ed9fc02..de08bbe 100644 --- a/Pf2eDataScrapper/WPF/EntityViewer/EntityForm.xaml.cs +++ b/Pf2eDataScrapper/WPF/EntityViewer/EntityForm.xaml.cs @@ -1,6 +1,5 @@ using System.Collections.ObjectModel; using System.Windows; -using Pf2eDataScrapper.WPF.Components; using Pf2eDataScrapper.WPF.EntityViewer.ViewModel; using Pf2eModel; using Pf2eModel.Model.Enum; diff --git a/Pf2eDataScrapper/WPF/Views/ProgressForm.xaml b/Pf2eDataScrapper/WPF/ProgressForm/ProgressForm.xaml similarity index 58% rename from Pf2eDataScrapper/WPF/Views/ProgressForm.xaml rename to Pf2eDataScrapper/WPF/ProgressForm/ProgressForm.xaml index 9d342e8..daae789 100644 --- a/Pf2eDataScrapper/WPF/Views/ProgressForm.xaml +++ b/Pf2eDataScrapper/WPF/ProgressForm/ProgressForm.xaml @@ -1,16 +1,17 @@  + @@ -42,40 +43,52 @@ + + + + - - - + + + - + - - - - - + Background="{Binding Path=Color}" /> + Background="{Binding Path=Color}" /> + Background="{Binding Path=Color}" /> diff --git a/Pf2eDataScrapper/WPF/Views/ProgressForm.xaml.cs b/Pf2eDataScrapper/WPF/ProgressForm/ProgressForm.xaml.cs similarity index 87% rename from Pf2eDataScrapper/WPF/Views/ProgressForm.xaml.cs rename to Pf2eDataScrapper/WPF/ProgressForm/ProgressForm.xaml.cs index c368f1b..5dc1936 100644 --- a/Pf2eDataScrapper/WPF/Views/ProgressForm.xaml.cs +++ b/Pf2eDataScrapper/WPF/ProgressForm/ProgressForm.xaml.cs @@ -4,7 +4,7 @@ using System.Drawing; using System.Windows; using Pf2eDataScrapper.Helpers; -namespace Pf2eDataScrapper.WPF; +namespace Pf2eDataScrapper.WPF.ProgressForm; /// /// Логика взаимодействия для ProgressFormWpf.xaml @@ -23,8 +23,10 @@ internal partial class ProgressForm : Window Progress.ProgressUpdate += Progress_ProgressUpdate; Progress.ProgressMessage += Progress_ProgressMessage; + Progress.ProgressComplete += Progress_ProgressComplete; } + private void Progress_ProgressUpdate(ProcessProgress sender) { if (!Dispatcher.CheckAccess()) @@ -53,6 +55,12 @@ internal partial class ProgressForm : Window ListViewRow item = new(level, message) { IsVisible = true }; ViewRows.Add(item); + + MessageListView.ScrollIntoView(item); + } + private void Progress_ProgressComplete(ProcessProgress sender) + { + //(Application.Current as ImportApplication)!.CurrentStage = ApplicationStage.Viewer; } public event ImportApplication.ApplicationStateChangeDelegate? ApplicationStateChange; diff --git a/Pf2eDataScrapper/WPF/Components/ProcessorCollectionControl.xaml b/Pf2eDataScrapper/WPF/StartForm/Components/ProcessorCollectionControl.xaml similarity index 99% rename from Pf2eDataScrapper/WPF/Components/ProcessorCollectionControl.xaml rename to Pf2eDataScrapper/WPF/StartForm/Components/ProcessorCollectionControl.xaml index fe55a68..2cda45a 100644 --- a/Pf2eDataScrapper/WPF/Components/ProcessorCollectionControl.xaml +++ b/Pf2eDataScrapper/WPF/StartForm/Components/ProcessorCollectionControl.xaml @@ -1,5 +1,5 @@  /// Логика взаимодействия для ProcessorCollectionControl.xaml diff --git a/Pf2eDataScrapper/WPF/Views/StartForm.xaml b/Pf2eDataScrapper/WPF/StartForm/StartForm.xaml similarity index 91% rename from Pf2eDataScrapper/WPF/Views/StartForm.xaml rename to Pf2eDataScrapper/WPF/StartForm/StartForm.xaml index a2d388f..e67758e 100644 --- a/Pf2eDataScrapper/WPF/Views/StartForm.xaml +++ b/Pf2eDataScrapper/WPF/StartForm/StartForm.xaml @@ -1,8 +1,8 @@  - + diff --git a/Pf2eDataScrapper/WPF/Views/StartForm.xaml.cs b/Pf2eDataScrapper/WPF/StartForm/StartForm.xaml.cs similarity index 85% rename from Pf2eDataScrapper/WPF/Views/StartForm.xaml.cs rename to Pf2eDataScrapper/WPF/StartForm/StartForm.xaml.cs index 865fc19..15e0580 100644 --- a/Pf2eDataScrapper/WPF/Views/StartForm.xaml.cs +++ b/Pf2eDataScrapper/WPF/StartForm/StartForm.xaml.cs @@ -1,11 +1,8 @@ using System.Windows; using Pf2eDataScrapper.App; -namespace Pf2eDataScrapper.WPF.Views; +namespace Pf2eDataScrapper.WPF.StartForm; -/// -/// Логика взаимодействия для StartForm.xaml -/// internal partial class StartForm : Window { public ProcessorCollection Collection { get; } diff --git a/Pf2eDataScrapper/WPF/WpfServiceProviderExtension.cs b/Pf2eDataScrapper/WPF/WpfServiceProviderExtension.cs index fabd556..7c68770 100644 --- a/Pf2eDataScrapper/WPF/WpfServiceProviderExtension.cs +++ b/Pf2eDataScrapper/WPF/WpfServiceProviderExtension.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using Pf2eDataScrapper.WPF.Components; using Pf2eDataScrapper.WPF.EntityViewer.Stores; using Pf2eDataScrapper.WPF.EntityViewer.ViewModel;