Глобальное обновление #1
@@ -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,
|
||||
|
||||
@@ -94,6 +94,7 @@ internal sealed class ProcessorExecutor(
|
||||
else
|
||||
{
|
||||
Progress.Processors.Complete();
|
||||
Progress.Complete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
+32
-19
@@ -1,16 +1,17 @@
|
||||
<Window
|
||||
x:Class="Pf2eDataScrapper.WPF.ProgressForm"
|
||||
x:Class="Pf2eDataScrapper.WPF.ProgressForm.ProgressForm"
|
||||
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"
|
||||
xmlns:local="clr-namespace:Pf2eDataScrapper.WPF.ProgressForm"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="ProgressWindow"
|
||||
x:Name="_this"
|
||||
Title="Выполняется обработка..."
|
||||
Width="400"
|
||||
Height="500"
|
||||
x:ClassModifier="internal"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Margin="3,3,3,3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -42,40 +43,52 @@
|
||||
<ListView
|
||||
x:Name="MessageListView"
|
||||
Grid.Row="5"
|
||||
ItemsSource="{Binding ViewRows}"
|
||||
ItemsSource="{Binding ViewRows, ElementName=_this}"
|
||||
ScrollViewer.CanContentScroll="True">
|
||||
|
||||
<ListView.Resources>
|
||||
<Style TargetType="{x:Type ListViewItem}">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Level}" Value="Progress">
|
||||
<Setter Property="Background" Value="LightGray" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ListView.Resources>
|
||||
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Width="Auto" Header="Время" />
|
||||
<GridViewColumn Width="Auto" Header="Тип" />
|
||||
<GridViewColumn Width="Auto" Header="Сообщение" />
|
||||
<GridViewColumn
|
||||
Width="Auto"
|
||||
DisplayMemberBinding="{Binding Time}"
|
||||
Header="Время" />
|
||||
<GridViewColumn
|
||||
Width="Auto"
|
||||
DisplayMemberBinding="{Binding Level}"
|
||||
Header="Тип" />
|
||||
<GridViewColumn DisplayMemberBinding="{Binding Message}" Header="Сообщение" />
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type local:ListViewRow}">
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="70" />
|
||||
<ColumnDefinition Width="70" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Left"
|
||||
Background="{Binding Path=Color}"
|
||||
Text="{Binding Path=Time}" />
|
||||
Background="{Binding Path=Color}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
Background="{Binding Path=Color}"
|
||||
Text="{Binding Path=Level}" />
|
||||
Background="{Binding Path=Color}" />
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Left"
|
||||
Background="{Binding Path=Color}"
|
||||
Text="{Binding Path=Message}" />
|
||||
Background="{Binding Path=Color}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
+9
-1
@@ -4,7 +4,7 @@ using System.Drawing;
|
||||
using System.Windows;
|
||||
using Pf2eDataScrapper.Helpers;
|
||||
|
||||
namespace Pf2eDataScrapper.WPF;
|
||||
namespace Pf2eDataScrapper.WPF.ProgressForm;
|
||||
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для 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;
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<UserControl
|
||||
x:Class="Pf2eDataScrapper.WPF.Components.ProcessorCollectionControl"
|
||||
x:Class="Pf2eDataScrapper.WPF.StartForm.Components.ProcessorCollectionControl"
|
||||
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"
|
||||
+1
-1
@@ -6,7 +6,7 @@ using System.Windows;
|
||||
using Pf2eDataScrapper.App;
|
||||
using CheckBox = System.Windows.Controls.CheckBox;
|
||||
|
||||
namespace Pf2eDataScrapper.WPF.Components;
|
||||
namespace Pf2eDataScrapper.WPF.StartForm.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для ProcessorCollectionControl.xaml
|
||||
+4
-3
@@ -1,8 +1,8 @@
|
||||
<Window
|
||||
x:Class="Pf2eDataScrapper.WPF.Views.StartForm"
|
||||
x:Class="Pf2eDataScrapper.WPF.StartForm.StartForm"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:components="clr-namespace:Pf2eDataScrapper.WPF.Components"
|
||||
xmlns:comp="clr-namespace:Pf2eDataScrapper.WPF.StartForm.Components"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Pf2eDataScrapper.WPF"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -52,10 +52,11 @@
|
||||
Width="5"
|
||||
HorizontalAlignment="Stretch" />
|
||||
|
||||
<components:ProcessorCollectionControl
|
||||
<comp:ProcessorCollectionControl
|
||||
x:Name="ProcessorCollectionControl"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="2" />
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
+1
-4
@@ -1,11 +1,8 @@
|
||||
using System.Windows;
|
||||
using Pf2eDataScrapper.App;
|
||||
|
||||
namespace Pf2eDataScrapper.WPF.Views;
|
||||
namespace Pf2eDataScrapper.WPF.StartForm;
|
||||
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для StartForm.xaml
|
||||
/// </summary>
|
||||
internal partial class StartForm : Window
|
||||
{
|
||||
public ProcessorCollection Collection { get; }
|
||||
@@ -1,5 +1,4 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Pf2eDataScrapper.WPF.Components;
|
||||
using Pf2eDataScrapper.WPF.EntityViewer.Stores;
|
||||
using Pf2eDataScrapper.WPF.EntityViewer.ViewModel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user