mirror of
https://github.com/yck1509/ConfuserEx
synced 2026-06-08 18:29:44 +00:00
85 lines
4.8 KiB
XML
85 lines
4.8 KiB
XML
<Window x:Class="ConfuserEx.Views.ProjectRuleView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="clr-namespace:ConfuserEx"
|
|
xmlns:core="clr-namespace:Confuser.Core;assembly=Confuser.Core"
|
|
xmlns:proj="clr-namespace:Confuser.Core.Project;assembly=Confuser.Core"
|
|
Title="Edit rule..." Height="600" Width="400" x:Name="View"
|
|
Style="{StaticResource DarkWindow}" ShowInTaskbar="False" ResizeMode="NoResize">
|
|
<Grid Margin="5">
|
|
<Grid.Resources>
|
|
<local:ComponentConverter x:Key="ProtConverter"
|
|
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
|
PresentationOptions:Freeze="True"
|
|
Components="{Binding Project.Protections}" />
|
|
</Grid.Resources>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="36px" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="25px" />
|
|
<RowDefinition Height="36px" />
|
|
<RowDefinition Height="36px" />
|
|
<RowDefinition Height="25px" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="40px" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Label Grid.Row="0" Grid.ColumnSpan="2" Content="Pattern:" VerticalAlignment="Center"
|
|
HorizontalAlignment="Left" />
|
|
|
|
<TextBox x:Name="pattern" Grid.Row="1" Grid.ColumnSpan="2"
|
|
Text="{Binding Pattern, UpdateSourceTrigger=PropertyChanged}" FontFamily="Consolas" Margin="5"
|
|
VerticalContentAlignment="Center" />
|
|
<Image x:Name="errorImg" Grid.Row="1" Grid.ColumnSpan="2" Source="{StaticResource Error}"
|
|
Width="16px" Height="16px" ToolTip="{Binding ExpressionError}" Margin="0,0,10,0"
|
|
Visibility="Hidden" HorizontalAlignment="Right" />
|
|
|
|
<DockPanel Grid.Row="2" Grid.ColumnSpan="2" LastChildFill="False">
|
|
<Label DockPanel.Dock="Left" Content="Preset : " VerticalAlignment="Center" />
|
|
<ComboBox DockPanel.Dock="Left" SelectedItem="{Binding Preset, UpdateSourceTrigger=PropertyChanged}"
|
|
Margin="5" Width="100" VerticalAlignment="Center"
|
|
ItemsSource="{local:EnumValues {x:Type core:ProtectionPreset}}" />
|
|
<CheckBox DockPanel.Dock="Right" Content="Inherit protections"
|
|
IsChecked="{Binding Inherit}" Margin="5" VerticalAlignment="Center" />
|
|
</DockPanel>
|
|
|
|
<Label Grid.Row="3" Content="Protections:" VerticalAlignment="Center"
|
|
HorizontalAlignment="Left" />
|
|
|
|
<ListBox x:Name="prots" Grid.Row="4" Margin="5"
|
|
ItemsSource="{Binding Protections}" Grid.IsSharedSizeScope="True">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition SharedSizeGroup="Action" />
|
|
<ColumnDefinition Width="10px" />
|
|
<ColumnDefinition SharedSizeGroup="Protection" />
|
|
</Grid.ColumnDefinitions>
|
|
<ComboBox Grid.Column="0" Width="80" SelectedItem="{Binding Action}" IsEnabled="True"
|
|
ItemsSource="{local:EnumValues {x:Type proj:SettingItemAction}}" />
|
|
<local:CompComboBox Grid.Column="2" Width="150"
|
|
Components="{Binding Project.Protections, ElementName=View}"
|
|
SelectedComponent="{Binding Id, Converter={StaticResource ProtConverter}, Mode=TwoWay}" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<DockPanel Grid.Row="4" Grid.Column="1" LastChildFill="False">
|
|
<Button Height="26" Margin="5" DockPanel.Dock="Top" x:Name="AddBtn">
|
|
<TextBlock FontSize="14px" FontFamily="{DynamicResource FontAwesome}" Text="" Height="12px"
|
|
TextOptions.TextRenderingMode="GrayScale" />
|
|
</Button>
|
|
<Button Height="26" Margin="5" DockPanel.Dock="Top" x:Name="RemoveBtn">
|
|
<TextBlock FontSize="14px" FontFamily="{DynamicResource FontAwesome}" Text="" Height="12px"
|
|
TextOptions.TextRenderingMode="GrayScale" />
|
|
</Button>
|
|
</DockPanel>
|
|
|
|
<Button Grid.Row="5" Grid.ColumnSpan="2" HorizontalAlignment="Right"
|
|
Margin="5" Width="70" Content="Done" Click="Done" />
|
|
</Grid>
|
|
</Window> |