@@ -76,24 +76,25 @@ public void RestartApp()
76
76
77
77
public void SaveAppAllSettings ( )
78
78
{
79
- SaveAllJsonStorage ( ) ;
79
+ SavePluginSettings ( ) ;
80
80
_mainVM . Save ( ) ;
81
81
_settingsVM . Save ( ) ;
82
- PluginManager . Save ( ) ;
83
82
ImageLoader . Save ( ) ;
84
83
}
85
84
86
85
public Task ReloadAllPluginData ( ) => PluginManager . ReloadData ( ) ;
87
86
88
- public void ShowMsgError ( string title , string subTitle = "" ) => ShowMsg ( title , subTitle , Constant . ErrorIcon , true ) ;
87
+ public void ShowMsgError ( string title , string subTitle = "" ) =>
88
+ ShowMsg ( title , subTitle , Constant . ErrorIcon , true ) ;
89
89
90
- public void ShowMsg ( string title , string subTitle = "" , string iconPath = "" ) => ShowMsg ( title , subTitle , iconPath , true ) ;
90
+ public void ShowMsg ( string title , string subTitle = "" , string iconPath = "" ) =>
91
+ ShowMsg ( title , subTitle , iconPath , true ) ;
91
92
92
93
public void ShowMsg ( string title , string subTitle , string iconPath , bool useMainWindowAsOwner = true )
93
94
{
94
95
Application . Current . Dispatcher . Invoke ( ( ) =>
95
96
{
96
- var msg = useMainWindowAsOwner ? new Msg { Owner = Application . Current . MainWindow } : new Msg ( ) ;
97
+ var msg = useMainWindowAsOwner ? new Msg { Owner = Application . Current . MainWindow } : new Msg ( ) ;
97
98
msg . Show ( title , subTitle , iconPath ) ;
98
99
} ) ;
99
100
}
@@ -114,37 +115,46 @@ public void OpenSettingDialog()
114
115
115
116
public List < PluginPair > GetAllPlugins ( ) => PluginManager . AllPlugins . ToList ( ) ;
116
117
117
- public MatchResult FuzzySearch ( string query , string stringToCompare ) => StringMatcher . FuzzySearch ( query , stringToCompare ) ;
118
+ public MatchResult FuzzySearch ( string query , string stringToCompare ) =>
119
+ StringMatcher . FuzzySearch ( query , stringToCompare ) ;
118
120
119
121
public Task < string > HttpGetStringAsync ( string url , CancellationToken token = default ) => Http . GetAsync ( url ) ;
120
122
121
- public Task < Stream > HttpGetStreamAsync ( string url , CancellationToken token = default ) => Http . GetStreamAsync ( url ) ;
123
+ public Task < Stream > HttpGetStreamAsync ( string url , CancellationToken token = default ) =>
124
+ Http . GetStreamAsync ( url ) ;
122
125
123
- public Task HttpDownloadAsync ( [ NotNull ] string url , [ NotNull ] string filePath , CancellationToken token = default ) => Http . DownloadAsync ( url , filePath , token ) ;
126
+ public Task HttpDownloadAsync ( [ NotNull ] string url , [ NotNull ] string filePath ,
127
+ CancellationToken token = default ) => Http . DownloadAsync ( url , filePath , token ) ;
124
128
125
- public void AddActionKeyword ( string pluginId , string newActionKeyword ) => PluginManager . AddActionKeyword ( pluginId , newActionKeyword ) ;
129
+ public void AddActionKeyword ( string pluginId , string newActionKeyword ) =>
130
+ PluginManager . AddActionKeyword ( pluginId , newActionKeyword ) ;
126
131
127
- public void RemoveActionKeyword ( string pluginId , string oldActionKeyword ) => PluginManager . RemoveActionKeyword ( pluginId , oldActionKeyword ) ;
132
+ public void RemoveActionKeyword ( string pluginId , string oldActionKeyword ) =>
133
+ PluginManager . RemoveActionKeyword ( pluginId , oldActionKeyword ) ;
128
134
129
- public void LogDebug ( string className , string message , [ CallerMemberName ] string methodName = "" ) => Log . Debug ( className , message , methodName ) ;
135
+ public void LogDebug ( string className , string message , [ CallerMemberName ] string methodName = "" ) =>
136
+ Log . Debug ( className , message , methodName ) ;
130
137
131
- public void LogInfo ( string className , string message , [ CallerMemberName ] string methodName = "" ) => Log . Info ( className , message , methodName ) ;
138
+ public void LogInfo ( string className , string message , [ CallerMemberName ] string methodName = "" ) =>
139
+ Log . Info ( className , message , methodName ) ;
132
140
133
- public void LogWarn ( string className , string message , [ CallerMemberName ] string methodName = "" ) => Log . Warn ( className , message , methodName ) ;
141
+ public void LogWarn ( string className , string message , [ CallerMemberName ] string methodName = "" ) =>
142
+ Log . Warn ( className , message , methodName ) ;
134
143
135
- public void LogException ( string className , string message , Exception e , [ CallerMemberName ] string methodName = "" ) => Log . Exception ( className , message , e , methodName ) ;
144
+ public void LogException ( string className , string message , Exception e ,
145
+ [ CallerMemberName ] string methodName = "" ) => Log . Exception ( className , message , e , methodName ) ;
136
146
137
147
private readonly Dictionary < Type , object > _pluginJsonStorages = new ( ) ;
138
148
139
- private void SaveAllJsonStorage ( )
149
+ public void SavePluginSettings ( )
140
150
{
141
151
foreach ( var value in _pluginJsonStorages . Values )
142
152
{
143
153
var method = value . GetType ( ) . GetMethod ( "Save" ) ;
144
154
method ? . Invoke ( value , null ) ;
145
155
}
146
156
}
147
-
157
+
148
158
public T LoadSettingJsonStorage < T > ( ) where T : new ( )
149
159
{
150
160
var type = typeof ( T ) ;
@@ -181,11 +191,12 @@ private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, Spe
181
191
{
182
192
if ( GlobalKeyboardEvent != null )
183
193
{
184
- return GlobalKeyboardEvent ( ( int ) keyevent , vkcode , state ) ;
194
+ return GlobalKeyboardEvent ( ( int ) keyevent , vkcode , state ) ;
185
195
}
196
+
186
197
return true ;
187
198
}
188
199
189
200
#endregion
190
201
}
191
- }
202
+ }
0 commit comments