/
Logris
/
FileWatchService
Обзор
Документация
Войти
/
Logris
/
FileWatchService
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
AdminTools/Service/Extensions/FileWatcher/FileWatcherPage.xaml
332 строки
14 KB
Logrus
first commit
15 мар 2025, 14:15
15 мар 2025, 14:15
6de831b
Код
Авторство
О чём код?
<UserControl x:Class="FileWatcher.FileWatcherPage" 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:FileWatcher" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d"> <UserControl.Resources> <FontFamily x:Key="Font.Icons">Resource/#Icons</FontFamily> <SolidColorBrush x:Key="Brush.Border" Color="#353535" /> <SolidColorBrush x:Key="Brush.Foreground" Color="#c0c0c0" /> <CornerRadius x:Key="CornerRadius.Border">5</CornerRadius> <Style TargetType="{x:Type TextBlock}"> <Setter Property="SnapsToDevicePixels" Value="true" /> <Setter Property="OverridesDefaultStyle" Value="true" /> <Setter Property="Focusable" Value="False" /> <Setter Property="Background" Value="Transparent" /> <Setter Property="Foreground" Value="#c0c0c0" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="HorizontalAlignment" Value="Right" /> <Setter Property="Margin" Value="0,0,10,0" /> <Setter Property="TextWrapping" Value="Wrap" /> </Style> <Style TargetType="{x:Type TextBox}"> <Setter Property="SnapsToDevicePixels" Value="true" /> <Setter Property="OverridesDefaultStyle" Value="true" /> <Setter Property="Background" Value="#151515" /> <Setter Property="BorderBrush" Value="{StaticResource Brush.Border}" /> <Setter Property="Foreground" Value="{StaticResource Brush.Foreground}" /> <Setter Property="Margin" Value="0,1" /> <Setter Property="Padding" Value="2,2" /> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TextBox}"> <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="{StaticResource CornerRadius.Border}"> <Grid> <ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Background="{x:Null}" BorderThickness="0" IsTabStop="False" /> <TextBlock x:Name="PlaceHolder" Margin="5,0,0,0" VerticalAlignment="Center" Foreground="{TemplateBinding BorderBrush}" IsHitTestVisible="False" Text="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed" /> </Grid> </Border> <ControlTemplate.Triggers> <Trigger Property="Text" Value=""> <Setter TargetName="PlaceHolder" Property="Visibility" Value="Visible" /> </Trigger> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="BorderBrush" Value="#606060" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="{x:Type Button}"> <Setter Property="SnapsToDevicePixels" Value="true" /> <Setter Property="OverridesDefaultStyle" Value="true" /> <Setter Property="IsTabStop" Value="True" /> <Setter Property="Focusable" Value="False" /> <Setter Property="Background" Value="#151515" /> <Setter Property="BorderBrush" Value="#151515" /> <Setter Property="Foreground" Value="#909090" /> <Setter Property="Margin" Value="5,1" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="5"> <TextBlock Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" /> </Border> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="#c0c0c0" /> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter Property="Foreground" Value="#d0d0d0" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <!-- CheckBox --> <ControlTemplate x:Key="Template.CheckBox" TargetType="{x:Type CheckBox}"> <StackPanel Background="#01000000" Orientation="Horizontal"> <Border x:Name="rect" Width="20" Height="20" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"> <TextBlock x:Name="check" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="{StaticResource Font.Icons}" FontSize="12" Foreground="#00B7E9" Text="S" Visibility="Hidden" /> </Border> <ContentPresenter x:Name="content" Margin="5,0,0,0" VerticalAlignment="Center" /> </StackPanel> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="True"> <Setter TargetName="check" Property="Visibility" Value="Visible" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> <Style BasedOn="{StaticResource {x:Type ContentControl}}" TargetType="CheckBox"> <Setter Property="OverridesDefaultStyle" Value="True" /> <Setter Property="Background" Value="Transparent" /> <Setter Property="BorderBrush" Value="{StaticResource Brush.Border}" /> <Setter Property="Foreground" Value="{StaticResource Brush.Foreground}" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Padding" Value="6,0,0,0" /> <Setter Property="UseLayoutRounding" Value="True" /> <Setter Property="Template" Value="{StaticResource Template.CheckBox}" /> </Style> </UserControl.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="199*" /> <ColumnDefinition Width="537*" /> <ColumnDefinition Width="57*" /> <ColumnDefinition Width="7*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="5" /> <RowDefinition Height="30" /> <RowDefinition Height="30" /> <RowDefinition Height="30" /> <RowDefinition Height="30" /> <RowDefinition /> </Grid.RowDefinitions> <TextBlock x:Name="folder" Grid.Row="1" Width="74" Margin="0,0,5,0" HorizontalAlignment="Right" Text="Watch Folder" /> <TextBox Grid.Row="1" Grid.Column="1" Margin="0,1,0,1" IsReadOnly="True" Tag="Select Folder ..." Text="{Binding WatchFolder}" /> <Button Grid.Row="1" Grid.Column="2" Margin="2,1,10,1" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" Command="{Binding PickFolderCommand}" Content="ꀁ" FontFamily="{StaticResource Font.Icons}" FontSize="23px" /> <TextBlock x:Name="Bat" Grid.Row="2" Margin="0,0,5,0" HorizontalAlignment="Right" VerticalAlignment="Center" Text="Create Script Filter" /> <TextBox Grid.Row="2" Grid.Column="1" Margin="0,1,0,1" Tag="*.*" Text="{Binding CreateScriptFilter, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" /> <TextBlock x:Name="Cmd" Grid.Row="4" Width="48" Margin="0,0,5,0" HorizontalAlignment="Right" Text="Cmd.exe" /> <TextBox Grid.Row="4" Grid.Column="1" Margin="0,0,0,1" Tag="/c $file_path" Text="{Binding CreateCommand, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" /> <TextBlock x:Name="filter" Grid.Row="5" Height="16" Margin="0,10,5,0" VerticalAlignment="Top" Text="Отслеживать Изменения" /> <Border Grid.Row="5" Grid.Column="1" Height="62" Margin="0,2,0,0" VerticalAlignment="Top" Background="#151515" BorderBrush="#353535" BorderThickness="1" CornerRadius="5"> <UniformGrid Height="60" Columns="4" Rows="2"> <CheckBox x:Name="checkBox" Margin="10,0,0,0" VerticalAlignment="Center" Content="Folder Name" IsChecked="{Binding NotifyFolderName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> <CheckBox x:Name="checkBox1" Margin="10,0,0,0" VerticalAlignment="Center" Content="File Name" IsChecked="{Binding NotifyFileName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> <CheckBox x:Name="checkBox2" Margin="10,0,0,0" VerticalAlignment="Center" Content="Size" IsChecked="{Binding NotifySize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> <CheckBox x:Name="checkBox21" Margin="10,0,0,0" VerticalAlignment="Center" Content="Creation Time" IsChecked="{Binding NotifyCreationTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> <CheckBox x:Name="checkBox_Copy" Margin="10,0,0,0" VerticalAlignment="Center" Content="Last Access" IsChecked="{Binding NotifyLastAccess, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> <CheckBox x:Name="checkBox1_Copy" Margin="10,0,0,0" VerticalAlignment="Center" Content="Last Write" IsChecked="{Binding NotifyLastWrite, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> <CheckBox x:Name="checkBox2_Copy" Margin="10,0,0,0" VerticalAlignment="Center" Content="Attributes" IsChecked="{Binding NotifyAttributes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> <CheckBox x:Name="checkBox_Copy1" Margin="10,0,0,0" VerticalAlignment="Center" Content="Security" IsChecked="{Binding NotifySecurity, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> </UniformGrid> </Border> <TextBox x:Name="DelayBox" Grid.Row="3" Grid.Column="1" Margin="0,2,0,0" Tag="3000" Text="{Binding DelayRunScript, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" /> <TextBlock x:Name="DelayTitle" Grid.Row="3" Width="92" Margin="0,0,5,0" HorizontalAlignment="Right" Text="Delay Run Script" ToolTip="Задержка запуска скрипта в секундах.
В течениие этого времени сообщения группируются в одно." /> </Grid> </UserControl>