File tree Expand file tree Collapse file tree
IME WL Converter Win/Forms
ImeWlConverter.Abstractions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818using System ;
1919using System . ComponentModel ;
2020using System . Windows . Forms ;
21+ using ImeWlConverter . Abstractions . Enums ;
2122using ImeWlConverter . Abstractions . Options ;
2223
2324namespace Studyzy . IMEWLConverter ;
Original file line number Diff line number Diff line change 2424using System . Threading ;
2525using System . Windows . Forms ;
2626using ImeWlConverter . Abstractions . Contracts ;
27+ using ImeWlConverter . Abstractions . Enums ;
2728using ImeWlConverter . Abstractions . Models ;
2829using ImeWlConverter . Abstractions . Options ;
2930using ImeWlConverter . Core . Helpers ;
Original file line number Diff line number Diff line change 1+ namespace ImeWlConverter . Abstractions . Enums ;
2+
3+ /// <summary>Chinese conversion modes.</summary>
4+ public enum ChineseConversionMode
5+ {
6+ /// <summary>No conversion.</summary>
7+ None = 0 ,
8+
9+ /// <summary>Convert simplified Chinese to traditional.</summary>
10+ SimplifiedToTraditional ,
11+
12+ /// <summary>Convert traditional Chinese to simplified.</summary>
13+ TraditionalToSimplified
14+ }
Original file line number Diff line number Diff line change @@ -20,16 +20,3 @@ public sealed class ConversionOptions
2020 /// <summary>Chinese simplified/traditional conversion mode.</summary>
2121 public ChineseConversionMode ChineseConversion { get ; init ; } = ChineseConversionMode . None ;
2222}
23-
24- /// <summary>Chinese conversion modes.</summary>
25- public enum ChineseConversionMode
26- {
27- /// <summary>No conversion.</summary>
28- None = 0 ,
29-
30- /// <summary>Convert simplified Chinese to traditional.</summary>
31- SimplifiedToTraditional ,
32-
33- /// <summary>Convert traditional Chinese to simplified.</summary>
34- TraditionalToSimplified
35- }
Original file line number Diff line number Diff line change 1616 </ItemGroup >
1717 <ItemGroup >
1818 <PackageReference Include =" Microsoft.Extensions.DependencyInjection.Abstractions" Version =" 10.0.7" />
19- <PackageReference Include =" SharpZipLib" Version =" 1.4.2" />
20- <PackageReference Include =" UTF.Unknown" Version =" 2.5.1" />
2119 </ItemGroup >
2220</Project >
Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ private sealed class ConsoleProgress : IProgress<ProgressInfo>
332332 public void Report ( ProgressInfo value )
333333 {
334334 if ( ! string . IsNullOrEmpty ( value . Message ) )
335- Console . Error . Write ( $ "\r { value . Message } ") ;
335+ Console . Error . Write ( $ "\r { value . Message , - 80 } ") ;
336336 }
337337 }
338338}
Original file line number Diff line number Diff line change 1010using Avalonia . Controls ;
1111using Avalonia . Platform . Storage ;
1212using ImeWlConverter . Abstractions . Contracts ;
13+ using ImeWlConverter . Abstractions . Enums ;
1314using ImeWlConverter . Abstractions . Models ;
1415using ImeWlConverter . Abstractions . Options ;
1516using Microsoft . Extensions . DependencyInjection ;
@@ -614,24 +615,3 @@ private void RaiseCanExecuteChanged()
614615
615616 #endregion
616617}
617-
618- // 简单的命令实现
619- public class RelayCommand : ICommand
620- {
621- private readonly Action _execute ;
622- private readonly Func < bool > ? _canExecute ;
623-
624- public RelayCommand ( Action execute , Func < bool > ? canExecute = null )
625- {
626- _execute = execute ?? throw new ArgumentNullException ( nameof ( execute ) ) ;
627- _canExecute = canExecute ;
628- }
629-
630- public event EventHandler ? CanExecuteChanged ;
631-
632- public bool CanExecute ( object ? parameter ) => _canExecute ? . Invoke ( ) ?? true ;
633-
634- public void Execute ( object ? parameter ) => _execute ( ) ;
635-
636- public void RaiseCanExecuteChanged ( ) => CanExecuteChanged ? . Invoke ( this , EventArgs . Empty ) ;
637- }
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Windows . Input ;
3+
4+ namespace ImeWlConverterMac . ViewModels ;
5+
6+ /// <summary>Simple ICommand implementation for MVVM binding.</summary>
7+ public class RelayCommand : ICommand
8+ {
9+ private readonly Action _execute ;
10+ private readonly Func < bool > ? _canExecute ;
11+
12+ public RelayCommand ( Action execute , Func < bool > ? canExecute = null )
13+ {
14+ _execute = execute ?? throw new ArgumentNullException ( nameof ( execute ) ) ;
15+ _canExecute = canExecute ;
16+ }
17+
18+ public event EventHandler ? CanExecuteChanged ;
19+
20+ public bool CanExecute ( object ? parameter ) => _canExecute ? . Invoke ( ) ?? true ;
21+
22+ public void Execute ( object ? parameter ) => _execute ( ) ;
23+
24+ public void RaiseCanExecuteChanged ( ) => CanExecuteChanged ? . Invoke ( this , EventArgs . Empty ) ;
25+ }
Original file line number Diff line number Diff line change 11using Avalonia . Controls ;
22using Avalonia . Interactivity ;
3+ using ImeWlConverter . Abstractions . Enums ;
34using ImeWlConverter . Abstractions . Options ;
45
56namespace ImeWlConverterMac . Views ;
You can’t perform that action at this time.
0 commit comments