1
1
2
2
using System ;
3
3
using System . Collections . Generic ;
4
+ using System . Linq ;
4
5
using ScipBe . Common . Office . OneNote ;
5
6
6
7
namespace Flow . Launcher . Plugin . OneNote
@@ -45,16 +46,15 @@ public Result CreatePageResult(IOneNoteExtPage page, List<int> highlightingData
45
46
46
47
public Result CreatePageResult ( IOneNotePage page , IOneNoteSection section , IOneNoteNotebook notebook , List < int > highlightingData = null )
47
48
{
48
- var path = GetNicePath ( section , notebook , true ) ;
49
49
return new Result
50
50
{
51
51
Title = page . Name ,
52
- SubTitle = path ,
53
52
TitleToolTip = $ "Created: { page . DateTime } \n Last Modified: { page . LastModified } ",
54
- SubTitleToolTip = path ,
53
+ TitleHighlightData = highlightingData ,
54
+ SubTitle = GetNicePath ( section , notebook , true ) ,
55
+ AutoCompleteText = $ "{ context . CurrentPluginMetadata . ActionKeyword } { Keywords . NotebookExplorer } { LastSelectedNotebook . Name } \\ { section . Name } \\ { page . Name } ",
55
56
IcoPath = Icons . Logo ,
56
57
ContextData = page ,
57
- TitleHighlightData = highlightingData ,
58
58
Action = c =>
59
59
{
60
60
LastSelectedNotebook = null ;
@@ -67,35 +67,41 @@ public Result CreatePageResult(IOneNotePage page, IOneNoteSection section, IOneN
67
67
68
68
public Result CreateSectionResult ( IOneNoteExtSection section , IOneNoteExtNotebook notebook , List < int > highlightData = null )
69
69
{
70
- var path = GetNicePath ( section , notebook , false ) ;
70
+ string path = GetNicePath ( section , notebook , false ) ;
71
+ string autoCompleteText = $ "{ context . CurrentPluginMetadata . ActionKeyword } { Keywords . NotebookExplorer } { LastSelectedNotebook . Name } \\ { section . Name } \\ ";
71
72
return new Result
72
73
{
73
74
Title = section . Name ,
74
- SubTitle = path , // + " | " + section.Pages.Count().ToString(),
75
75
TitleHighlightData = highlightData ,
76
+ SubTitle = path ,
77
+ SubTitleToolTip = $ "{ path } | Number of pages: { section . Pages . Count ( ) } ",
78
+ AutoCompleteText = autoCompleteText ,
76
79
ContextData = section ,
77
80
IcoPath = sectionInfo . GetIcon ( section . Color . Value ) ,
78
81
Action = c =>
79
82
{
80
83
LastSelectedSection = section ;
81
- context . API . ChangeQuery ( $ " { context . CurrentPluginMetadata . ActionKeyword } { Keywords . NotebookExplorer } { LastSelectedNotebook . Name } \\ { section . Name } \\ " ) ;
84
+ context . API . ChangeQuery ( autoCompleteText ) ;
82
85
return false ;
83
86
} ,
84
87
} ;
85
88
}
86
89
87
90
public Result CreateNotebookResult ( IOneNoteExtNotebook notebook , List < int > highlightData = null )
88
91
{
92
+ string autoCompleteText = $ "{ context . CurrentPluginMetadata . ActionKeyword } { Keywords . NotebookExplorer } { notebook . Name } \\ ";
89
93
return new Result
90
94
{
91
95
Title = notebook . Name ,
96
+ TitleToolTip = $ "Number of sections: { notebook . Sections . Count ( ) } ",
92
97
TitleHighlightData = highlightData ,
98
+ AutoCompleteText = autoCompleteText ,
93
99
ContextData = notebook ,
94
100
IcoPath = notebookInfo . GetIcon ( notebook . Color . Value ) ,
95
101
Action = c =>
96
102
{
97
103
LastSelectedNotebook = notebook ;
98
- context . API . ChangeQuery ( $ " { context . CurrentPluginMetadata . ActionKeyword } { Keywords . NotebookExplorer } { notebook . Name } \\ " ) ;
104
+ context . API . ChangeQuery ( autoCompleteText ) ;
99
105
return false ;
100
106
} ,
101
107
} ;
0 commit comments