Skip to content

Commit b1ac8f3

Browse files
committed
Minor refactoring
1 parent fe626d6 commit b1ac8f3

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

SmartImage/ConsoleMainMenu.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@
1515
namespace SmartImage
1616
{
1717
/// <summary>
18-
/// Contains <see cref="ConsoleInterface"/> and <see cref="ConsoleOption"/> for the main menu
18+
/// Contains <see cref="NConsoleUI"/> and <see cref="NConsoleOption"/> for the main menu
1919
/// </summary>
2020
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
2121
internal static class ConsoleMainMenu
2222
{
23-
private static ConsoleOption[] AllOptions
23+
private static NConsoleOption[] AllOptions
2424
{
2525
get
2626
{
2727
var fields = typeof(ConsoleMainMenu).GetFields(
2828
BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Default)
29-
.Where(f => f.FieldType == typeof(ConsoleOption))
29+
.Where(f => f.FieldType == typeof(NConsoleOption))
3030
.ToArray();
3131

3232

33-
var options = new ConsoleOption[fields.Length];
33+
var options = new NConsoleOption[fields.Length];
3434

3535
for (int i = 0; i < fields.Length; i++) {
36-
options[i] = (ConsoleOption) fields[i].GetValue(null);
36+
options[i] = (NConsoleOption) fields[i].GetValue(null);
3737
}
3838

3939
return options;
@@ -43,7 +43,7 @@ private static ConsoleOption[] AllOptions
4343
/// <summary>
4444
/// Main menu console interface
4545
/// </summary>
46-
internal static ConsoleInterface Interface => new ConsoleInterface(AllOptions, RuntimeInfo.NAME_BANNER, false);
46+
internal static NConsoleUI Interface => new NConsoleUI(AllOptions, RuntimeInfo.NAME_BANNER, false);
4747

4848
/// <summary>
4949
/// Runs when no arguments are given (and when the executable is double-clicked)
@@ -53,7 +53,7 @@ private static ConsoleOption[] AllOptions
5353
/// </remarks>
5454
internal static void Run() => NConsole.IO.HandleOptions(ConsoleMainMenu.Interface);
5555

56-
private static readonly ConsoleOption RunSelectImage = new ConsoleOption()
56+
private static readonly NConsoleOption RunSelectImage = new NConsoleOption()
5757
{
5858
Name = ">>> Select image <<<",
5959
Color = Color.Yellow,
@@ -72,12 +72,12 @@ private static ConsoleOption[] AllOptions
7272
};
7373

7474

75-
private static readonly ConsoleOption ConfigSearchEnginesOption = new ConsoleOption()
75+
private static readonly NConsoleOption ConfigSearchEnginesOption = new NConsoleOption()
7676
{
7777
Name = "Configure search engines",
7878
Function = () =>
7979
{
80-
var rgEnum = ConsoleOption.CreateOptionsFromEnum<SearchEngines>();
80+
var rgEnum = NConsoleOption.CreateOptionsFromEnum<SearchEngines>();
8181
var values = NConsole.IO.HandleOptions(rgEnum, true);
8282

8383
var newValues = Enums.ReadEnumFromSet<SearchEngines>(values);
@@ -93,12 +93,12 @@ private static ConsoleOption[] AllOptions
9393
};
9494

9595

96-
private static readonly ConsoleOption ConfigPriorityEnginesOption = new ConsoleOption()
96+
private static readonly NConsoleOption ConfigPriorityEnginesOption = new NConsoleOption()
9797
{
9898
Name = "Configure priority engines",
9999
Function = () =>
100100
{
101-
var rgEnum = ConsoleOption.CreateOptionsFromEnum<SearchEngines>();
101+
var rgEnum = NConsoleOption.CreateOptionsFromEnum<SearchEngines>();
102102
var values = NConsole.IO.HandleOptions(rgEnum, true);
103103

104104
var newValues = Enums.ReadEnumFromSet<SearchEngines>(values);
@@ -114,7 +114,7 @@ private static ConsoleOption[] AllOptions
114114
};
115115

116116

117-
private static readonly ConsoleOption ConfigSauceNaoAuthOption = new ConsoleOption()
117+
private static readonly NConsoleOption ConfigSauceNaoAuthOption = new NConsoleOption()
118118
{
119119
Name = "Configure SauceNao API authentication",
120120
Function = () =>
@@ -126,7 +126,7 @@ private static ConsoleOption[] AllOptions
126126
}
127127
};
128128

129-
private static readonly ConsoleOption ConfigImgurAuthOption = new ConsoleOption()
129+
private static readonly NConsoleOption ConfigImgurAuthOption = new NConsoleOption()
130130
{
131131
Name = "Configure Imgur API authentication",
132132
Function = () =>
@@ -139,7 +139,7 @@ private static ConsoleOption[] AllOptions
139139
}
140140
};
141141

142-
private static readonly ConsoleOption ConfigUpdateOption = new ConsoleOption()
142+
private static readonly NConsoleOption ConfigUpdateOption = new NConsoleOption()
143143
{
144144
Name = "Update configuration file",
145145
Function = () =>
@@ -151,7 +151,7 @@ private static ConsoleOption[] AllOptions
151151
}
152152
};
153153

154-
private static readonly ConsoleOption ContextMenuOption = new ConsoleOption()
154+
private static readonly NConsoleOption ContextMenuOption = new NConsoleOption()
155155
{
156156
Name = "Add/remove context menu integration",
157157
Function = () =>
@@ -172,7 +172,7 @@ private static ConsoleOption[] AllOptions
172172
}
173173
};
174174

175-
private static readonly ConsoleOption ShowInfoOption = new ConsoleOption()
175+
private static readonly NConsoleOption ShowInfoOption = new NConsoleOption()
176176
{
177177
Name = "Show info",
178178
Function = () =>
@@ -184,7 +184,7 @@ private static ConsoleOption[] AllOptions
184184
}
185185
};
186186

187-
private static readonly ConsoleOption CheckForUpdateOption = new ConsoleOption()
187+
private static readonly NConsoleOption CheckForUpdateOption = new NConsoleOption()
188188
{
189189
Name = "Check for updates",
190190
Function = () =>
@@ -210,7 +210,7 @@ private static ConsoleOption[] AllOptions
210210
}
211211
};
212212

213-
private static readonly ConsoleOption ResetOption = new ConsoleOption()
213+
private static readonly NConsoleOption ResetOption = new NConsoleOption()
214214
{
215215
Name = "Reset all configuration and integrations",
216216
Function = () =>
@@ -222,7 +222,7 @@ private static ConsoleOption[] AllOptions
222222
}
223223
};
224224

225-
private static readonly ConsoleOption UninstallOption = new ConsoleOption()
225+
private static readonly NConsoleOption UninstallOption = new NConsoleOption()
226226
{
227227
Name = "Uninstall",
228228
Function = () =>
@@ -252,7 +252,7 @@ private static ConsoleOption[] AllOptions
252252
"Test3.png"
253253
};
254254

255-
private static readonly ConsoleOption DebugTestOption = new ConsoleOption()
255+
private static readonly NConsoleOption DebugTestOption = new NConsoleOption()
256256
{
257257
Name = "[DEBUG] Run test",
258258
Function = () =>

SmartImage/Integration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Text;
88
using Microsoft.Win32;
99
using SimpleCore.CommandLine;
10+
using SimpleCore.CommandLine.Shell;
1011
using SimpleCore.Win32;
1112
using SmartImage.Utilities;
1213

SmartImage/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private static void Main(string[] args)
4545
Console.OutputEncoding = Encoding.Unicode;
4646
Console.Clear();
4747

48-
ConsoleInterface.DefaultName = RuntimeInfo.NAME_BANNER;
48+
NConsoleUI.DefaultName = RuntimeInfo.NAME_BANNER;
4949

5050
/*
5151
* Run search

SmartImage/Searching/SearchResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace SmartImage.Searching
1414
/// <summary>
1515
/// Contains search result and information
1616
/// </summary>
17-
public sealed class SearchResult : ConsoleOption, ISearchResult
17+
public sealed class SearchResult : NConsoleOption, ISearchResult
1818
{
1919
public SearchResult(ISearchEngine engine, string url, float? similarity = null)
2020
: this(engine.Color, engine.Name, url, similarity) { }

SmartImage/Utilities/Common.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ namespace SmartImage.Utilities
99
// todo
1010
internal static class Common
1111
{
12-
13-
1412
public static void WriteMap(IDictionary<string, string> d, string filename)
1513
{
1614
string[] lines = d.Select(kvp => kvp.Key + "=" + kvp.Value).ToArray();

SmartImage/Utilities/UpdateInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Net;
55
using SimpleCore.CommandLine;
6+
using SimpleCore.CommandLine.Shell;
67

78
namespace SmartImage.Utilities
89
{

0 commit comments

Comments
 (0)