11using System . Windows ;
2- using Flow . Launcher . Core . Resource ;
32using Flow . Launcher . Plugin ;
43using Flow . Launcher . ViewModel ;
5- using Flow . Launcher . Core ;
64using System . Linq ;
75using System . Collections . Generic ;
86
97namespace Flow . Launcher
108{
119 public partial class ActionKeywords
1210 {
13- private readonly PluginPair plugin ;
14- private readonly Internationalization translater = InternationalizationManager . Instance ;
15- private readonly PluginViewModel pluginViewModel ;
11+ private readonly PluginPair _plugin ;
12+ private readonly PluginViewModel _pluginViewModel ;
1613
1714 public ActionKeywords ( PluginViewModel pluginViewModel )
1815 {
1916 InitializeComponent ( ) ;
20- plugin = pluginViewModel . PluginPair ;
21- this . pluginViewModel = pluginViewModel ;
17+ _plugin = pluginViewModel . PluginPair ;
18+ _pluginViewModel = pluginViewModel ;
2219 }
2320
2421 private void ActionKeyword_OnLoaded ( object sender , RoutedEventArgs e )
2522 {
26- tbOldActionKeyword . Text = string . Join ( Query . ActionKeywordSeparator , plugin . Metadata . ActionKeywords . ToArray ( ) ) ;
23+ tbOldActionKeyword . Text = string . Join ( Query . ActionKeywordSeparator , _plugin . Metadata . ActionKeywords . ToArray ( ) ) ;
2724 tbAction . Focus ( ) ;
2825 }
2926
@@ -34,7 +31,7 @@ private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
3431
3532 private void btnDone_OnClick ( object sender , RoutedEventArgs _ )
3633 {
37- var oldActionKeywords = plugin . Metadata . ActionKeywords ;
34+ var oldActionKeywords = _plugin . Metadata . ActionKeywords ;
3835
3936 var newActionKeywords = tbAction . Text . Split ( Query . ActionKeywordSeparator ) . ToList ( ) ;
4037 newActionKeywords . RemoveAll ( string . IsNullOrEmpty ) ;
@@ -48,7 +45,7 @@ private void btnDone_OnClick(object sender, RoutedEventArgs _)
4845 {
4946 if ( oldActionKeywords . Count != newActionKeywords . Count )
5047 {
51- ReplaceActionKeyword ( plugin . Metadata . ID , removedActionKeywords , addedActionKeywords ) ;
48+ ReplaceActionKeyword ( _plugin . Metadata . ID , removedActionKeywords , addedActionKeywords ) ;
5249 return ;
5350 }
5451
@@ -58,18 +55,16 @@ private void btnDone_OnClick(object sender, RoutedEventArgs _)
5855 if ( sortedOldActionKeywords . SequenceEqual ( sortedNewActionKeywords ) )
5956 {
6057 // User just changes the sequence of action keywords
61- var msg = translater . GetTranslation ( "newActionKeywordsSameAsOld" ) ;
62- MessageBoxEx . Show ( msg ) ;
58+ App . API . ShowMsgBox ( App . API . GetTranslation ( "newActionKeywordsSameAsOld" ) ) ;
6359 }
6460 else
6561 {
66- ReplaceActionKeyword ( plugin . Metadata . ID , removedActionKeywords , addedActionKeywords ) ;
62+ ReplaceActionKeyword ( _plugin . Metadata . ID , removedActionKeywords , addedActionKeywords ) ;
6763 }
6864 }
6965 else
7066 {
71- string msg = translater . GetTranslation ( "newActionKeywordsHasBeenAssigned" ) ;
72- App . API . ShowMsgBox ( msg ) ;
67+ App . API . ShowMsgBox ( App . API . GetTranslation ( "newActionKeywordsHasBeenAssigned" ) ) ;
7368 }
7469 }
7570
@@ -85,7 +80,7 @@ private void ReplaceActionKeyword(string id, IReadOnlyList<string> removedAction
8580 }
8681
8782 // Update action keywords text and close window
88- pluginViewModel . OnActionKeywordsChanged ( ) ;
83+ _pluginViewModel . OnActionKeywordsChanged ( ) ;
8984 Close ( ) ;
9085 }
9186 }
0 commit comments