|
7 | 7 | using Wox.Plugin; |
8 | 8 | using Wox.Plugin.Logger; |
9 | 9 | using Wox.Infrastructure.Storage; |
| 10 | +using System.Windows.Documents; |
10 | 11 |
|
11 | 12 | namespace Community.PowerToys.Run.Plugin.CurrencyConverter |
12 | 13 | { |
@@ -133,15 +134,56 @@ public List<Result> Query(Query query) |
133 | 134 | results.AddRange(_updater.GetResults()); |
134 | 135 | } |
135 | 136 |
|
136 | | - if (!(string.IsNullOrEmpty(query.ActionKeyword) || string.IsNullOrEmpty(query.Search.Trim()))) |
137 | | - results.Add(new Result |
| 137 | + if (!string.IsNullOrEmpty(query.ActionKeyword)) |
| 138 | + { |
| 139 | + if (string.IsNullOrEmpty(query.Search.Trim())) |
| 140 | + { |
| 141 | + results.AddRange([ |
| 142 | + new Result() |
| 143 | + { |
| 144 | + Title = "Start typing to convert currencies", |
| 145 | + SubTitle = "Few examples are listed below", |
| 146 | + IcoPath = _iconPath, |
| 147 | + ContextData = new Dictionary<string, string> { { "externalLink", GithubReadmeURL } }, |
| 148 | + Action = _ => Helper.PerformAction("externalLink", GithubReadmeURL) |
| 149 | + }, |
| 150 | + new Result() |
| 151 | + { |
| 152 | + Title = "100 USD to INR", |
| 153 | + SubTitle = "Convert 100 US Dollars to Indian Rupees", |
| 154 | + IcoPath = _iconPath, |
| 155 | + ContextData = new Dictionary<string, string> { { "copy", "100 USD to INR" } }, |
| 156 | + Action = _ => Helper.PerformAction("copy", "100 USD to INR") |
| 157 | + }, |
| 158 | + new Result() |
| 159 | + { |
| 160 | + Title = "$100 to €", |
| 161 | + SubTitle = "Convert 100 US Dollars to Euros", |
| 162 | + IcoPath = _iconPath, |
| 163 | + ContextData = new Dictionary<string, string> { { "copy", "$100 to €" } }, |
| 164 | + Action = _ => Helper.PerformAction("copy", "$100 to €") |
| 165 | + }, |
| 166 | + new Result() |
| 167 | + { |
| 168 | + Title = "₽100", |
| 169 | + SubTitle = "Convert 100 Russian Rubles", |
| 170 | + IcoPath = _iconPath, |
| 171 | + ContextData = new Dictionary<string, string> { { "copy", "₽100" } }, |
| 172 | + Action = _ => Helper.PerformAction("copy", "₽100") |
| 173 | + } |
| 174 | + ]); |
| 175 | + } else |
138 | 176 | { |
139 | | - Title = "Loading...", |
140 | | - SubTitle = "Please open an issue if needed.", |
141 | | - IcoPath = _iconPath, |
142 | | - ContextData = new Dictionary<string, string> { { "externalLink", GithubReadmeURL } }, |
143 | | - Action = _ => Helper.PerformAction("externalLink", GithubReadmeURL) |
144 | | - }); |
| 177 | + results.Add(new Result |
| 178 | + { |
| 179 | + Title = "Loading...", |
| 180 | + SubTitle = "Please open an issue if needed.", |
| 181 | + IcoPath = _iconPath, |
| 182 | + ContextData = new Dictionary<string, string> { { "externalLink", GithubReadmeURL } }, |
| 183 | + Action = _ => Helper.PerformAction("externalLink", GithubReadmeURL) |
| 184 | + }); |
| 185 | + } |
| 186 | + } |
145 | 187 |
|
146 | 188 | return results; |
147 | 189 | } |
|
0 commit comments