维护更新

This commit is contained in:
GG Z
2026-02-17 22:17:23 +08:00
parent b3479d1f39
commit 3816edbdb4
72 changed files with 272 additions and 2976 deletions

View File

@@ -1,14 +1,14 @@
<ms:MelWindow
Height="700"
Title="DaVinci Resolve drfx 字体替换"
Width="1000"
mc:Ignorable="d"
x:Class="ShrlAlgoStudio.DrfxFontFixer"
x:Class="ShrlAlgoStudio.DrfxFontFixerView"
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:ms="https://github.com/ShrlAlgo/Melskin"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
Title="DaVinci Resolve drfx 字体替换"
Width="1000"
Height="700"
mc:Ignorable="d">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
@@ -22,55 +22,55 @@
<ColumnDefinition Width="1.5*" />
</Grid.ColumnDefinitions>
<GroupBox Grid.Row="0" Header="添加需要处理的 drfx 文件">
<ListBox BorderThickness="1" x:Name="FileListBox" />
<ListBox x:Name="FileListBox" BorderThickness="1" />
</GroupBox>
<ms:FlexibleRowPanel Grid.Column="0" Grid.Row="1">
<ms:FlexibleRowPanel Grid.Row="1" Grid.Column="0">
<Button
x:Name="AddFilesButton"
Click="AddFilesButton_Click"
Content="添加drfx文件"
x:Name="AddFilesButton" />
Content="添加drfx文件" />
<Button
x:Name="ClearListButton"
Click="ClearListButton_Click"
Content="清空处理列表"
x:Name="ClearListButton" />
Content="清空处理列表" />
</ms:FlexibleRowPanel>
<ms:FlexibleRowPanel
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="2">
<TextBox ms:FlexibleRowPanel.Span="2" x:Name="OutputPath" />
Grid.ColumnSpan="2">
<TextBox x:Name="OutputPath" ms:FlexibleRowPanel.Span="2" />
<Button
x:Name="BrowserOutputPathButton"
Click="BrowserOutputPathButton_Click"
Content="选择输出路径"
x:Name="BrowserOutputPathButton" />
Content="选择输出路径" />
<Button
x:Name="OpenOutputButton"
Click="OpenOutputButton_Click"
Content="打开输出目录"
IsEnabled="False"
x:Name="OpenOutputButton" />
IsEnabled="False" />
</ms:FlexibleRowPanel>
<GroupBox
FontWeight="Bold"
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="3"
FontWeight="Bold"
Header="处理日志">
<ScrollViewer VerticalScrollBarVisibility="Auto" x:Name="LogScrollViewer">
<ScrollViewer x:Name="LogScrollViewer" VerticalScrollBarVisibility="Auto">
<TextBlock
FontFamily="Consolas"
x:Name="LogTextBlock"
Margin="5"
TextWrapping="Wrap"
x:Name="LogTextBlock" />
FontFamily="Consolas"
TextWrapping="Wrap" />
</ScrollViewer>
</GroupBox>
<GroupBox
Grid.Column="1"
Grid.Row="0"
Grid.Column="1"
Header="扫描文件并定义字体/样式替换规则">
<DataGrid
x:Name="MappingDataGrid"
AutoGenerateColumns="False"
CanUserAddRows="False"
x:Name="MappingDataGrid">
CanUserAddRows="False">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="ToolTipService.ShowDuration" Value="30000" />
@@ -79,16 +79,16 @@
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn
Width="*"
Binding="{Binding OriginalFont}"
Header="原始字体"
IsReadOnly="True"
Width="*" />
IsReadOnly="True" />
<DataGridTextColumn
Width="*"
Binding="{Binding OriginalStyle}"
Header="原始样式"
IsReadOnly="True"
Width="*" />
<DataGridTemplateColumn Header="新字体" Width="*">
IsReadOnly="True" />
<DataGridTemplateColumn Width="*" Header="新字体">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<!-- 注意我们仍然保留LostFocus因为它能最好地处理“手动输入”文本的场景 -->
@@ -100,7 +100,7 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="新样式" Width="*">
<DataGridTemplateColumn Width="*" Header="新样式">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ContentControl>
@@ -137,43 +137,43 @@
</DataGrid>
</GroupBox>
<StackPanel
Grid.Column="1"
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Right"
Orientation="Horizontal"
VerticalAlignment="Bottom">
VerticalAlignment="Bottom"
Orientation="Horizontal">
<Button
x:Name="ScanFilesButton"
Click="ScanFilesButton_Click"
Content="扫描文件并更新映射表"
x:Name="ScanFilesButton" />
Content="扫描文件并更新映射表" />
<Button
x:Name="LoadMapButton"
Click="LoadMapButton_Click"
Content="加载映射表"
x:Name="LoadMapButton" />
Content="加载映射表" />
<Button
x:Name="SaveMapButton"
Click="SaveMapButton_Click"
Content="保存映射表"
x:Name="SaveMapButton" />
Content="保存映射表" />
<Button
x:Name="ClearMapButton"
Click="ClearMapButton_Click"
Content="清空映射表"
x:Name="ClearMapButton" />
Content="清空映射表" />
</StackPanel>
<Grid Grid.ColumnSpan="2" Grid.Row="5">
<Grid Grid.Row="5" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ProgressBar
x:Name="MainProgressBar"
Grid.Column="0"
Height="35"
x:Name="MainProgressBar" />
Height="35" />
<Button
Click="StartButton_Click"
Content="开始处理"
x:Name="StartButton"
Grid.Column="1"
x:Name="StartButton" />
Click="StartButton_Click"
Content="开始处理" />
</Grid>
</Grid>
</ms:MelWindow>

View File

@@ -99,7 +99,7 @@ namespace ShrlAlgoStudio
protected void OnPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
public partial class DrfxFontFixer
public partial class DrfxFontFixerView
{
public ObservableCollection<FullMapping> FullMappings { get; set; } = new ObservableCollection<FullMapping>();
public List<string> SystemFonts { get; set; } = new List<string>();
@@ -107,7 +107,7 @@ namespace ShrlAlgoStudio
private bool isProcessingComplete = false;
private string lastOutputDirectory = "";
public DrfxFontFixer()
public DrfxFontFixerView()
{
InitializeComponent();
this.DataContext = this;

View File

@@ -1,10 +1,11 @@
<Window
<ms:MelWindow
x:Class="ShrlAlgoStudio.GuidGeneratorView"
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:ShrlAlgoStudio"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ms="https://github.com/ShrlAlgo/Melskin"
Title="GUID 生成工具"
Width="800"
Height="450"
@@ -91,4 +92,4 @@
Content="复制到剪贴板" />
</Grid>
</Grid>
</Window>
</ms:MelWindow>

View File

@@ -17,7 +17,7 @@ namespace ShrlAlgoStudio
/// <summary>
/// GuidGeneratorView.xaml 的交互逻辑
/// </summary>
public partial class GuidGeneratorView : Window
public partial class GuidGeneratorView
{
public GuidGeneratorView()
{

View File

@@ -1,10 +1,11 @@
<Window
<ms:MelWindow
x:Class="ShrlAlgoStudio.Iconfont2CSharpView"
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:ShrlAlgoStudio"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ms="https://github.com/ShrlAlgo/Melskin"
Title="字体转C#"
Width="800"
Height="450"
@@ -126,4 +127,4 @@
</Grid>
</GroupBox>
</Grid>
</Window>
</ms:MelWindow>

View File

@@ -23,7 +23,7 @@ namespace ShrlAlgoStudio
/// <summary>
/// Iconfont2CSharpView.xaml 的交互逻辑
/// </summary>
public partial class Iconfont2CSharpView : Window
public partial class Iconfont2CSharpView
{
public ObservableCollection<IconItem> Icons { get; set; } = new ObservableCollection<IconItem>();

View File

@@ -1,16 +1,19 @@
<ms:MelWindow
Height="450"
Title="LicenseGen"
Title="许可生成"
Width="800"
mc:Ignorable="d"
x:Class="ShrlAlgoStudio.LicenseGen"
x:Class="ShrlAlgoStudio.LicenseGenView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ms="https://github.com/ShrlAlgo/Melskin"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<ms:StackPanel HorizontalAlignment="Center" Width="600">
<ms:StackPanel
HorizontalAlignment="Center"
Spacing="5"
Width="600">
<UniformGrid Rows="1">
<TextBox ms:InputAssist.Prefix="私钥:" x:Name="PrivateKeyTextBox" />
<TextBox ms:InputAssist.Prefix="公钥:" x:Name="PublicKeyTextBox" />

View File

@@ -5,15 +5,17 @@ using System.Security.Cryptography;
using System.Text;
using System.Windows;
using Melskin.Controls;
namespace ShrlAlgoStudio;
/// <summary>
/// Interaction logic for LicenseGen.xaml
/// Interaction logic for LicenseGenView.xaml
/// </summary>
public partial class LicenseGen
public partial class LicenseGenView
{
private static string _privateKey = string.Empty;
public LicenseGen()
public LicenseGenView()
{
InitializeComponent();
}

View File

@@ -1,9 +1,10 @@
using System.Reflection;
using System;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using Microsoft.Win32;
namespace KeyGen
namespace ShrlAlgoStudio
{
internal class LicenseManager
{

View File

@@ -1,11 +1,12 @@
<Window
<ms:MelWindow
x:Class="ShrlAlgoStudio.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:ShrlAlgoStudio"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ms="https://github.com/ShrlAlgo/Melskin"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="MainWindow"
Width="800"
Height="450"
@@ -16,6 +17,7 @@
<Button Click="RevitCipher_Click" Content="加解密Revit文件" />
<Button Click="GuidGenerate_Click" Content="GUID生成" />
<Button Click="IconFont_Click" Content="图表字体转C#代码" />
<Button Click="LicenseGen_Click" Content="许可生成" />
</ms:StackPanel>
</Grid>
</Window>
</ms:MelWindow>

View File

@@ -1,10 +1,8 @@
using System.Windows;
using FileProcessor;
namespace ShrlAlgoStudio
{
public partial class MainWindow : Window
public partial class MainWindow
{
public MainWindow()
{
@@ -13,25 +11,30 @@ namespace ShrlAlgoStudio
private void RevitCipher_Click(object sender, RoutedEventArgs e)
{
RevitFileCipher cipher=new RevitFileCipher();
cipher.ShowDialog();
new RevitFileCipherView().ShowDialog();
}
private void ReplaceFont_Click(object sender, RoutedEventArgs e)
{
DrfxFontFixer fixer=new DrfxFontFixer();
fixer.ShowDialog();
DrfxFontFixerView fixerView=new DrfxFontFixerView();
fixerView.ShowDialog();
}
private void GuidGenerate_Click(object sender, RoutedEventArgs e)
{
GuidGeneratorView fixer=new GuidGeneratorView();
fixer.ShowDialog();
GuidGeneratorView guidView=new GuidGeneratorView();
guidView.ShowDialog();
}
private void IconFont_Click(object sender, RoutedEventArgs e)
{
Iconfont2CSharpView fixer=new Iconfont2CSharpView();
fixer.ShowDialog();
Iconfont2CSharpView iconfont2CSharp=new Iconfont2CSharpView();
iconfont2CSharp.ShowDialog();
}
private void LicenseGen_Click(object sender, RoutedEventArgs e)
{
LicenseGenView licenseGen=new LicenseGenView();
licenseGen.ShowDialog();
}
}
}

View File

@@ -1,45 +1,45 @@
<ms:MelWindow
x:Class="FileProcessor.RevitFileCipher"
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:FileProcessor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ms="https://github.com/ShrlAlgo/Melskin"
Height="150"
Title="解密"
Width="320"
Height="150"
mc:Ignorable="d">
mc:Ignorable="d"
x:Class="ShrlAlgoStudio.RevitFileCipherView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ShrlAlgoStudio"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ms="https://github.com/ShrlAlgo/Melskin"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<UniformGrid Margin="5" Rows="2">
<Button
Padding="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Click="IsDecrypt_Click"
Content="判断是否加密" />
<Button
Padding="10"
Content="判断是否加密"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Padding="10"
VerticalAlignment="Center" />
<Button
Click="DecryptButton_Click"
Content="解密文件" />
<Button
Padding="10"
Content="解密文件"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Padding="10"
VerticalAlignment="Center" />
<Button
Click="DecryptFolderButton_Click"
Content="解密文件夹" />
<Button
Padding="10"
Content="解密文件夹"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Padding="10"
VerticalAlignment="Center" />
<Button
Click="EncryptButton_Click"
Content="加密文件" />
<Button
Padding="10"
Content="加密文件"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Padding="10"
VerticalAlignment="Center" />
<Button
Click="EncryptFolderButton_Click"
Content="加密文件夹" />
Content="加密文件夹"
HorizontalAlignment="Center"
Padding="10"
VerticalAlignment="Center" />
</UniformGrid>
</ms:MelWindow>

View File

@@ -9,11 +9,11 @@ using Microsoft.Win32;
namespace ShrlAlgoStudio
{
/// <summary>
/// RevitFileCipher.xaml 的交互逻辑
/// RevitFileCipherView.xaml 的交互逻辑
/// </summary>
public partial class RevitFileCipher
public partial class RevitFileCipherView
{
public RevitFileCipher()
public RevitFileCipherView()
{
InitializeComponent();
}

View File

@@ -15,10 +15,6 @@
</ItemGroup>
<ItemGroup>
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<Compile Update="RevitFileCipher.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Reference Include="System.Management" />
</ItemGroup>
</Project>

View File

@@ -1,8 +1,9 @@
using System.Globalization;
using System;
using System.Globalization;
using System.IO;
using System.Net;
namespace KeyGen
namespace ShrlAlgoStudio
{
internal static class TimeHelper
{