@@ -85,7 +85,7 @@ public List<Result> EmptyQuery()
85
85
AutoCompleteText = $ "{ ActionKeyword } { settings . Keywords . RecentPages } ",
86
86
IcoPath = iconProvider . Recent ,
87
87
Score = - 1000 ,
88
- Action = c =>
88
+ Action = _ =>
89
89
{
90
90
context . API . ChangeQuery ( $ "{ ActionKeyword } { settings . Keywords . RecentPages } ", true ) ;
91
91
return false ;
@@ -96,8 +96,8 @@ public List<Result> EmptyQuery()
96
96
Title = "New quick note" ,
97
97
IcoPath = iconProvider . QuickNote ,
98
98
Score = - 4000 ,
99
- PreviewPanel = new Lazy < UserControl > ( ( ) => new NewOneNotePagePreviewPanel ( context , null , null ) ) ,
100
- Action = c =>
99
+ PreviewPanel = GetNewPagePreviewPanel ( null , null ) ,
100
+ Action = _ =>
101
101
{
102
102
OneNoteApplication . CreateQuickNote ( true ) ;
103
103
WindowHelper . FocusOneNote ( ) ;
@@ -109,7 +109,7 @@ public List<Result> EmptyQuery()
109
109
Title = "Open and sync notebooks" ,
110
110
IcoPath = iconProvider . Sync ,
111
111
Score = int . MinValue ,
112
- Action = c =>
112
+ Action = _ =>
113
113
{
114
114
var notebooks = OneNoteApplication . GetNotebooks ( ) ;
115
115
foreach ( var notebook in notebooks )
@@ -240,8 +240,8 @@ public Result CreateNewPageResult(string newPageName, OneNoteSection section)
240
240
SubTitle = $ "Path: { GetNicePath ( section ) } { PathSeparator } { newPageName } ",
241
241
AutoCompleteText = $ "{ GetAutoCompleteText } { newPageName } ",
242
242
IcoPath = iconProvider . NewPage ,
243
- PreviewPanel = new Lazy < UserControl > ( ( ) => new NewOneNotePagePreviewPanel ( context , section , newPageName ) ) ,
244
- Action = c =>
243
+ PreviewPanel = GetNewPagePreviewPanel ( section , newPageName ) ,
244
+ Action = _ =>
245
245
{
246
246
OneNoteApplication . CreatePage ( section , newPageName , true ) ;
247
247
Main . ForceReQuery ( ) ;
@@ -264,7 +264,7 @@ public Result CreateNewSectionResult(string newSectionName, IOneNoteItem parent)
264
264
: $ "Section names cannot contain: { string . Join ( ' ' , OneNoteApplication . InvalidSectionChars ) } ",
265
265
AutoCompleteText = $ "{ GetAutoCompleteText } { newSectionName } ",
266
266
IcoPath = iconProvider . NewSection ,
267
- Action = c =>
267
+ Action = _ =>
268
268
{
269
269
if ( ! validTitle )
270
270
{
@@ -301,7 +301,7 @@ public Result CreateNewSectionGroupResult(string newSectionGroupName, IOneNoteIt
301
301
: $ "Section group names cannot contain: { string . Join ( ' ' , OneNoteApplication . InvalidSectionGroupChars ) } ",
302
302
AutoCompleteText = $ "{ GetAutoCompleteText } { newSectionGroupName } ",
303
303
IcoPath = iconProvider . NewSectionGroup ,
304
- Action = c =>
304
+ Action = _ =>
305
305
{
306
306
if ( ! validTitle )
307
307
{
@@ -338,7 +338,7 @@ public Result CreateNewNotebookResult(string newNotebookName)
338
338
: $ "Notebook names cannot contain: { string . Join ( ' ' , OneNoteApplication . InvalidNotebookChars ) } ",
339
339
AutoCompleteText = $ "{ GetAutoCompleteText } { newNotebookName } ",
340
340
IcoPath = iconProvider . NewNotebook ,
341
- Action = c =>
341
+ Action = _ =>
342
342
{
343
343
if ( ! validTitle )
344
344
{
@@ -411,10 +411,14 @@ Result NoItemsInCollectionResult(string title, string iconPath, string subTitle
411
411
Title = $ "Create { title } : \" \" ",
412
412
SubTitle = $ "No { subTitle ?? title } s found. Type a valid title to create one",
413
413
IcoPath = iconPath ,
414
- PreviewPanel = section != null ? new Lazy < UserControl > ( ( ) => new NewOneNotePagePreviewPanel ( context , section , null ) ) : null ,
414
+ PreviewPanel = section != null ? GetNewPagePreviewPanel ( section , null ) : null ,
415
415
} ;
416
416
}
417
417
}
418
+
419
+ private Lazy < UserControl > GetNewPagePreviewPanel ( OneNoteSection section , string pageTitle ) =>
420
+ new ( ( ) => new NewOneNotePagePreviewPanel ( context , section , pageTitle ) ) ;
421
+
418
422
public static List < Result > NoMatchesFound ( )
419
423
{
420
424
return SingleResult ( "No matches found" ,
0 commit comments