1
- using Flow . Launcher . Core . Plugin ;
2
- using Flow . Launcher . Infrastructure . Storage ;
1
+ #nullable enable
3
2
using Flow . Launcher . Plugin . Explorer . Search ;
4
3
using Flow . Launcher . Plugin . Explorer . Search . Everything ;
5
4
using Flow . Launcher . Plugin . Explorer . Search . Everything . Exceptions ;
11
10
using System . Diagnostics ;
12
11
using System . IO ;
13
12
using System . Linq ;
14
- using System . Threading . Tasks ;
15
13
using System . Windows ;
16
14
using System . Windows . Forms ;
17
15
using System . Windows . Input ;
@@ -90,9 +88,9 @@ private void InitializeEngineSelection()
90
88
ContentIndexSearchEngines = EnumBindingModel < Settings . ContentIndexSearchEngineOption > . CreateList ( ) ;
91
89
PathEnumerationEngines = EnumBindingModel < Settings . PathEnumerationEngineOption > . CreateList ( ) ;
92
90
93
- SelectedIndexSearchEngine = IndexSearchEngines . FirstOrDefault ( x => x . Value == Settings . IndexSearchEngine ) ;
94
- _selectedContentSearchEngine = ContentIndexSearchEngines . FirstOrDefault ( x => x . Value == Settings . ContentSearchEngine ) ;
95
- _selectedPathEnumerationEngine = PathEnumerationEngines . FirstOrDefault ( x => x . Value == Settings . PathEnumerationEngine ) ;
91
+ SelectedIndexSearchEngine = IndexSearchEngines . First ( x => x . Value == Settings . IndexSearchEngine ) ;
92
+ SelectedContentSearchEngine = ContentIndexSearchEngines . First ( x => x . Value == Settings . ContentSearchEngine ) ;
93
+ SelectedPathEnumerationEngine = PathEnumerationEngines . First ( x => x . Value == Settings . PathEnumerationEngine ) ;
96
94
}
97
95
98
96
#endregion
@@ -120,13 +118,13 @@ private void InitializeActionKeywordModels()
120
118
121
119
public IReadOnlyList < ActionKeywordModel > ActionKeywordsModels { get ; set ; }
122
120
123
- public ActionKeywordModel SelectedActionKeyword { get ; set ; }
121
+ public ActionKeywordModel ? SelectedActionKeyword { get ; set ; }
124
122
125
123
public ICommand EditActionKeywordCommand => new RelayCommand ( EditActionKeyword ) ;
126
124
127
125
private void EditActionKeyword ( object obj )
128
126
{
129
- if ( SelectedActionKeyword is not ActionKeywordModel actionKeyword )
127
+ if ( SelectedActionKeyword is not { } actionKeyword )
130
128
{
131
129
ShowUnselectedMessage ( ) ;
132
130
return ;
@@ -150,7 +148,7 @@ private void EditActionKeyword(object obj)
150
148
Context . API . AddActionKeyword ( Context . CurrentPluginMetadata . ID , actionKeywordWindow . ActionKeyword ) ;
151
149
break ;
152
150
case ( false , true ) :
153
- Context . API . AddActionKeyword ( Context . CurrentPluginMetadata . ID , actionKeyword . Keyword ) ;
151
+ Context . API . AddActionKeyword ( Context . CurrentPluginMetadata . ID , actionKeywordWindow . ActionKeyword ) ;
154
152
break ;
155
153
case ( false , false ) :
156
154
throw new ArgumentException (
@@ -165,8 +163,8 @@ private void EditActionKeyword(object obj)
165
163
166
164
#region AccessLinks
167
165
168
- public AccessLink SelectedQuickAccessLink { get ; set ; }
169
- public AccessLink SelectedIndexSearchExcludedPath { get ; set ; }
166
+ public AccessLink ? SelectedQuickAccessLink { get ; set ; }
167
+ public AccessLink ? SelectedIndexSearchExcludedPath { get ; set ; }
170
168
171
169
172
170
@@ -187,7 +185,7 @@ public void AppendLink(string containerName, AccessLink link)
187
185
188
186
private void EditLink ( object commandParameter )
189
187
{
190
- ( AccessLink selectedLink , ObservableCollection < AccessLink > collection ) = commandParameter switch
188
+ var ( selectedLink , collection ) = commandParameter switch
191
189
{
192
190
"QuickAccessLink" => ( SelectedQuickAccessLink , Settings . QuickAccessLinks ) ,
193
191
"IndexSearchExcludedPaths" => ( SelectedIndexSearchExcludedPath , Settings . IndexSearchExcludedSubdirectoryPaths ) ,
@@ -266,9 +264,9 @@ private void RemoveLink(object obj)
266
264
267
265
#endregion
268
266
269
- private string ? PromptUserSelectPath ( ResultType type , string initialDirectory = null )
267
+ private string ? PromptUserSelectPath ( ResultType type , string ? initialDirectory = null )
270
268
{
271
- string path = null ;
269
+ string ? path = null ;
272
270
273
271
if ( type is ResultType . Folder )
274
272
{
0 commit comments