diff --git a/CustomRules.ruleset b/CustomRules.ruleset
new file mode 100644
index 0000000..c6f6e51
--- /dev/null
+++ b/CustomRules.ruleset
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Installer/Setup.nsi b/Installer/Setup.nsi
index 4468774..cb52f35 100644
--- a/Installer/Setup.nsi
+++ b/Installer/Setup.nsi
@@ -60,6 +60,7 @@ Name "${APPNAME} (${FILE_ARCHITECTURE})"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Russian"
+!insertmacro MUI_LANGUAGE "German"
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
diff --git a/README.md b/README.md
index d26b2a8..cf66f47 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,17 @@
# WTManager
-[](https://ci.appveyor.com/project/segrived/wtmanager)
+[](https://ci.appveyor.com/project/gschafra/wtmanager)
+[](https://www.codacy.com/manual/gschafra/WTManager?utm_source=github.com&utm_medium=referral&utm_content=gschafra/WTManager&utm_campaign=Badge_Grade)
+
+**This is an active fork of the great work of [@segrived](https://github.com/segrived)'s [WTManager](https://github.com/segrived/wtmanager) with some private modifiations/enhancements**
Windows tray manager. Manage your windows services with tray!
-**NOTE: EARLY ALPHA VERSION**
+**NOTE: ACCORDING TO [@segrived](https://github.com/segrived) STILL EARLY ALPHA VERSION, BUT I'VE GOT THIS RUNNING STABLE FOR YEARS NOW :wink:**

## Installation
-You can get latest build [here](https://ci.appveyor.com/project/segrived/wtmanager/build/artifacts)
+You can get latest build [here](https://ci.appveyor.com/project/gschafra/wtmanager/build/artifacts)
## License
Copyright (c) segrived 2015
@@ -21,6 +24,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## Credits
+- [@segrived](https://github.com/segrived) - of course :wink:
- [@conradoqg](https://github.com/conradoqg) - some useful improvements
- Menu icons from "[Elysium Icons Pack (by HazelDev)](https://www.iconfinder.com/iconsets/elysium-icons)"
- Tray and executable icon from "[One bit Pack (by Icojam)](https://www.iconfinder.com/iconsets/onebit)"
diff --git a/WTManager.Resources/Resources/Images/dialog/add.png b/WTManager.Resources/Images/dialog/add.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/dialog/add.png
rename to WTManager.Resources/Images/dialog/add.png
diff --git a/WTManager.Resources/Images/dialog/apply.png b/WTManager.Resources/Images/dialog/apply.png
new file mode 100644
index 0000000..c25e5f7
Binary files /dev/null and b/WTManager.Resources/Images/dialog/apply.png differ
diff --git a/WTManager.Resources/Resources/Images/dialog/cancel.png b/WTManager.Resources/Images/dialog/cancel.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/dialog/cancel.png
rename to WTManager.Resources/Images/dialog/cancel.png
diff --git a/WTManager.Resources/Resources/Images/dialog/down.png b/WTManager.Resources/Images/dialog/down.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/dialog/down.png
rename to WTManager.Resources/Images/dialog/down.png
diff --git a/WTManager.Resources/Resources/Images/dialog/edit.png b/WTManager.Resources/Images/dialog/edit.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/dialog/edit.png
rename to WTManager.Resources/Images/dialog/edit.png
diff --git a/WTManager.Resources/Resources/Images/dialog/ok.png b/WTManager.Resources/Images/dialog/ok.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/dialog/ok.png
rename to WTManager.Resources/Images/dialog/ok.png
diff --git a/WTManager.Resources/Resources/Images/dialog/remove.png b/WTManager.Resources/Images/dialog/remove.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/dialog/remove.png
rename to WTManager.Resources/Images/dialog/remove.png
diff --git a/WTManager.Resources/Resources/Images/dialog/up.png b/WTManager.Resources/Images/dialog/up.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/dialog/up.png
rename to WTManager.Resources/Images/dialog/up.png
diff --git a/WTManager.Resources/Resources/Images/menu/app-exit.png b/WTManager.Resources/Images/menu/app-exit.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/app-exit.png
rename to WTManager.Resources/Images/menu/app-exit.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-config.png b/WTManager.Resources/Images/menu/service-config.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-config.png
rename to WTManager.Resources/Images/menu/service-config.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-edit-config.png b/WTManager.Resources/Images/menu/service-edit-config.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-edit-config.png
rename to WTManager.Resources/Images/menu/service-edit-config.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-group.png b/WTManager.Resources/Images/menu/service-group.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-group.png
rename to WTManager.Resources/Images/menu/service-group.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-open-browser.png b/WTManager.Resources/Images/menu/service-open-browser.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-open-browser.png
rename to WTManager.Resources/Images/menu/service-open-browser.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-open-data-directory.png b/WTManager.Resources/Images/menu/service-open-data-directory.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-open-data-directory.png
rename to WTManager.Resources/Images/menu/service-open-data-directory.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-restart.png b/WTManager.Resources/Images/menu/service-restart.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-restart.png
rename to WTManager.Resources/Images/menu/service-restart.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-show-log.png b/WTManager.Resources/Images/menu/service-show-log.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-show-log.png
rename to WTManager.Resources/Images/menu/service-show-log.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-start.png b/WTManager.Resources/Images/menu/service-start.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-start.png
rename to WTManager.Resources/Images/menu/service-start.png
diff --git a/WTManager.Resources/Images/menu/service-status-na.png b/WTManager.Resources/Images/menu/service-status-na.png
new file mode 100644
index 0000000..0898953
Binary files /dev/null and b/WTManager.Resources/Images/menu/service-status-na.png differ
diff --git a/WTManager.Resources/Resources/Images/menu/service-status-pending.png b/WTManager.Resources/Images/menu/service-status-pending.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-status-pending.png
rename to WTManager.Resources/Images/menu/service-status-pending.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-status-started.png b/WTManager.Resources/Images/menu/service-status-started.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-status-started.png
rename to WTManager.Resources/Images/menu/service-status-started.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-status-stopped.png b/WTManager.Resources/Images/menu/service-status-stopped.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-status-stopped.png
rename to WTManager.Resources/Images/menu/service-status-stopped.png
diff --git a/WTManager.Resources/Resources/Images/menu/service-stop.png b/WTManager.Resources/Images/menu/service-stop.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/service-stop.png
rename to WTManager.Resources/Images/menu/service-stop.png
diff --git a/WTManager.Resources/Images/menu/services-scheduler.png b/WTManager.Resources/Images/menu/services-scheduler.png
new file mode 100644
index 0000000..106e0af
Binary files /dev/null and b/WTManager.Resources/Images/menu/services-scheduler.png differ
diff --git a/WTManager.Resources/Resources/Images/menu/settings-manager.png b/WTManager.Resources/Images/menu/settings-manager.png
similarity index 100%
rename from WTManager.Resources/Resources/Images/menu/settings-manager.png
rename to WTManager.Resources/Images/menu/settings-manager.png
diff --git a/WTManager.Resources/Images/menu/system-services-manager.png b/WTManager.Resources/Images/menu/system-services-manager.png
new file mode 100644
index 0000000..a855064
Binary files /dev/null and b/WTManager.Resources/Images/menu/system-services-manager.png differ
diff --git a/WTManager.Resources/Resources/Images/tray.ico b/WTManager.Resources/Images/tray.ico
similarity index 100%
rename from WTManager.Resources/Resources/Images/tray.ico
rename to WTManager.Resources/Images/tray.ico
diff --git a/WTManager.Resources/Locales/english.ini b/WTManager.Resources/Locales/english.ini
new file mode 100644
index 0000000..1777a52
--- /dev/null
+++ b/WTManager.Resources/Locales/english.ini
@@ -0,0 +1,55 @@
+[Meta]
+Code=en
+Language=English
+Author=Babaev Evgeniy
+
+[Localization]
+TrayMenu.ServiceEdit=Edit {serviceName}
+TrayMenu.ServiceOpenDataDirectory=Open data directory…
+TrayMenu.ServiceOpenInBrower=Open in browser…
+TrayMenu.ServiceEditConfiguration=Edit configuration
+TrayMenu.ServiceStart=Start service
+TrayMenu.ServiceStop=Stop service
+TrayMenu.ServiceRestart=Restart service
+TrayMenu.ServiceGroup.Ungrouped=Ungrouped
+TrayMenu.ServiceGroupStart=Start service group
+TrayMenu.ServiceGroupStop=Stop service group
+TrayMenu.ServiceGroupRestart=Restart service group
+TrayMenu.ServiceGroupLogFiles=Log files
+TrayMenu.ServiceGroupConfigFiles=Config files
+TrayMenu.ServiceScheduler=Service scheduler
+TrayMenu.SystemServiceManager=System service manager
+TrayMenu.ProgramConfiguration=Program configuration
+TrayMenu.AppExit=Exit
+VisualItem.Configuration.ConfigEditorPath=Config editor path
+VisualItem.Configuration.UseInternalLogViewer=Use internal log viewer
+VisualItem.Configuration.LogViewerPath=Log viewer path
+VisualItem.Configuration.Language=Language
+VisualItem.Configuration.RunOnStart=Run WTManager on start
+VisualItem.Configuration.MenuFont=Tray menu font
+VisualItem.Configuration.MenuTitleFont=Tray menu title font
+VisualItem.Configuration.ThemeName=Theme name
+VisualItem.Configuration.ShowPopup=Show tray menu popups
+VisualItem.Configuration.ShowMenuBeyoundTaskbar=Show menu beyound taskbar
+VisualItem.Configuration.OpenTrayMenuOnLeftClick=Open tray menu on left click
+VisualItem.Configuration.UseNestedServiceGroups=Use nested service groups in menu
+VisualItem.Configuration.ShowServiceGroupOperations=Show service group operations in nested menu (experimental)
+VisualItem.Configuration.Services=Services
+VisualItem.Configuration.Tasks=Scheduled tasks
+VisualItem.ServiceTask.TaskName=Task name
+VisualItem.ServiceTask.ServiceName=Service name
+VisualItem.ServiceTask.OperationType=Operation type
+VisualItem.ServiceTask.ExecuteTime=Trigger execute time
+VisualItem.Service.ServiceName=Service name
+VisualItem.Service.DisplayName=Display name
+VisualItem.Service.Group=Service group (optional)
+VisualItem.Service.ConfigFiles=Config files
+VisualItem.Service.LogFiles=Log files
+VisualItem.Service.DataDirectory=Data directory
+VisualItem.Service.BrowserUrl=Browser URL
+DialogButtons.Ok=Ok
+DialogButtons.Apply=Apply
+DialogButtons.Cancel=Cancel
+Enums.ServiceGroupOperationType.Start=Start
+Enums.ServiceGroupOperationType.Stop=Stop
+Enums.ServiceGroupOperationType.Restart=Restart
\ No newline at end of file
diff --git a/WTManager.Resources/Locales/german.ini b/WTManager.Resources/Locales/german.ini
new file mode 100644
index 0000000..c0aa218
--- /dev/null
+++ b/WTManager.Resources/Locales/german.ini
@@ -0,0 +1,55 @@
+[Meta]
+Code=de
+Language=German
+Author=Gnter Schafranek
+
+[Localization]
+TrayMenu.ServiceEdit={serviceName} bearbeiten
+TrayMenu.ServiceOpenDataDirectory=Datenverzeichnis ffnen
+TrayMenu.ServiceOpenInBrower=Im Browser ffnen
+TrayMenu.ServiceEditConfiguration=Konfiguration bearbeiten
+TrayMenu.ServiceStart=Dienst starten
+TrayMenu.ServiceStop=Dienst beenden
+TrayMenu.ServiceRestart=Dienst neu starten
+TrayMenu.ServiceGroup.Ungrouped=Nicht gruppiert
+TrayMenu.ServiceGroupStart=Dienste in Gruppe starten
+TrayMenu.ServiceGroupStop=Dienste in Gruppe beeenden
+TrayMenu.ServiceGroupRestart=Dienste in Gruppe neu starten
+TrayMenu.ServiceGroupLogFiles=Log-Dateien
+TrayMenu.ServiceGroupConfigFiles=Konfigurations-Dateien
+TrayMenu.ServiceScheduler=Service scheduler
+TrayMenu.SystemServiceManager=Verwaltung lokaler Dienste
+TrayMenu.ProgramConfiguration=Programm-Konfiguration
+TrayMenu.AppExit=Beenden
+VisualItem.Configuration.ConfigEditorPath=Pfad zum Konfigurations-Editor
+VisualItem.Configuration.UseInternalLogViewer=Internen Log-Viewer verwenden
+VisualItem.Configuration.LogViewerPath=Pfad zum Log-Viewer
+VisualItem.Configuration.Language=Sprache
+VisualItem.Configuration.RunOnStart=WTManager automatisch starten
+VisualItem.Configuration.MenuFont=Schriftart des Tray-Mens
+VisualItem.Configuration.MenuTitleFont=Schriftart des Tray-Men-Titels
+VisualItem.Configuration.ThemeName=Theme-Name
+VisualItem.Configuration.ShowPopup=Tray-Men-Popups anzeigen
+VisualItem.Configuration.ShowMenuBeyoundTaskbar=Men ber die Taskleiste anzeigen
+VisualItem.Configuration.OpenTrayMenuOnLeftClick=ffnen Sie das Tray-Men mit einem Linksklick
+VisualItem.Configuration.UseNestedServiceGroups=Verschachtelte Dienstgruppen im Men verwenden
+VisualItem.Configuration.ShowServiceGroupOperations=Anzeigen von Servicegruppenoperationen im verschachtelten Men (experimentell)
+VisualItem.Configuration.Services=Dienste
+VisualItem.Configuration.Tasks=Geplante Aufgaben
+VisualItem.ServiceTask.TaskName=Aufgabenname
+VisualItem.ServiceTask.ServiceName=Name des Dienstes
+VisualItem.ServiceTask.OperationType=Betriebsart
+VisualItem.ServiceTask.ExecuteTime=Ausfhrungszeit
+VisualItem.Service.ServiceName=Name des Dienstes
+VisualItem.Service.DisplayName=Anzeigename
+VisualItem.Service.Group=Dienst-Gruppe (optional)
+VisualItem.Service.ConfigFiles=Konfigurationsdateien
+VisualItem.Service.LogFiles=Log-Dateien
+VisualItem.Service.DataDirectory=Datenverzeichnis
+VisualItem.Service.BrowserUrl=Browser URL
+DialogButtons.Ok=Ok
+DialogButtons.Apply=Anwenden
+DialogButtons.Cancel=Abbrechen
+Enums.ServiceGroupOperationType.Start=Starten
+Enums.ServiceGroupOperationType.Stop=Beenden
+Enums.ServiceGroupOperationType.Restart=Neu starte
\ No newline at end of file
diff --git a/WTManager.Resources/Locales/russian.ini b/WTManager.Resources/Locales/russian.ini
new file mode 100644
index 0000000..35b17a6
--- /dev/null
+++ b/WTManager.Resources/Locales/russian.ini
@@ -0,0 +1,55 @@
+[Meta]
+Code=ru_RU
+Language=Russian
+Author=Babaev Evgeniy
+
+[Localization]
+TrayMenu.ServiceEdit=Edit {serviceName}
+TrayMenu.ServiceOpenDataDirectory=Открыть папку с данными…
+TrayMenu.ServiceOpenInBrower=Открыть в браузере…
+TrayMenu.ServiceEditConfiguration=Редактировать конфигурацию
+TrayMenu.ServiceStart=Запустить сервис
+TrayMenu.ServiceStop=Остановить сервис
+TrayMenu.ServiceRestart=Перезапустить сервис
+TrayMenu.ServiceGroup.Ungrouped=Без группы
+TrayMenu.ServiceGroupStart=Запустить группу сервисов
+TrayMenu.ServiceGroupStop=Остановить группу сервисов
+TrayMenu.ServiceGroupRestart=Перезапустить группу сервисов
+TrayMenu.ServiceGroupLogFiles=Лог файлы
+TrayMenu.ServiceGroupConfigFiles=Конфигурационные файлы
+TrayMenu.ServiceScheduler=Планировщик сервисов
+TrayMenu.SystemServiceManager=Системный менеджер сервисов
+TrayMenu.ProgramConfiguration=Настройки программы
+TrayMenu.AppExit=Выход
+VisualItem.Configuration.ConfigEditorPath=Пусть к редактору конфигов
+VisualItem.Configuration.UseInternalLogViewer=Использовать встроенный просмотрщик логов
+VisualItem.Configuration.LogViewerPath=Пусть к просмотрщику логов
+VisualItem.Configuration.Language=Язык
+VisualItem.Configuration.RunOnStart=Запускать WTManager при запуске системы
+VisualItem.Configuration.MenuFont=Шрифт меню трея
+VisualItem.Configuration.MenuTitleFont=Шрифт заголовков меню трея
+VisualItem.Configuration.ThemeName=Тема
+VisualItem.Configuration.ShowPopup=Покащывать сообщения около трея
+VisualItem.Configuration.ShowMenuBeyoundTaskbar=Показывать меню над панелью задач
+VisualItem.Configuration.OpenTrayMenuOnLeftClick=Открывать меню по левому клику
+VisualItem.Configuration.UseNestedServiceGroups=Использовать вложенные меню для групп
+VisualItem.Configuration.ShowServiceGroupOperations=Показывать групповые операции во вложенных меню
+VisualItem.Configuration.Services=Сервисы
+VisualItem.Configuration.Tasks=Запланированные задачи
+VisualItem.ServiceTask.TaskName=Название задачи
+VisualItem.ServiceTask.ServiceName=Имя сервиса
+VisualItem.ServiceTask.OperationType=Тип операции
+VisualItem.ServiceTask.ExecuteTime=Время исполнения
+VisualItem.Service.ServiceName=Сервис
+VisualItem.Service.DisplayName=Оторбажаемое имя
+VisualItem.Service.Group=Груупа сервиса (опционально)
+VisualItem.Service.ConfigFiles=Конфиги
+VisualItem.Service.LogFiles=Логи
+VisualItem.Service.DataDirectory=Директория с данными
+VisualItem.Service.BrowserUrl=URL браузера
+DialogButtons.Ok=Ok
+DialogButtons.Apply=Применить
+DialogButtons.Cancel=Отменить
+Enums.ServiceGroupOperationType.Start=Запуск
+Enums.ServiceGroupOperationType.Stop=Остановка
+Enums.ServiceGroupOperationType.Restart=Перезапуск
\ No newline at end of file
diff --git a/WTManager.Resources/LocalizationManager.cs b/WTManager.Resources/LocalizationManager.cs
new file mode 100644
index 0000000..4a06fe2
--- /dev/null
+++ b/WTManager.Resources/LocalizationManager.cs
@@ -0,0 +1,52 @@
+using System.Collections.Generic;
+using IniParser.Model;
+using IniParser.Parser;
+
+namespace WtManager.Resources
+{
+ public static class LocalizationManager
+ {
+ private static LocalizationItem _item;
+
+ public static readonly List LocalesList = new List { "english", "russian", "german" };
+
+ static LocalizationManager()
+ {
+ UpdateLocale("english");
+ }
+
+ public static void UpdateLocale(string locale)
+ {
+ var localization = ResourcesProcessor.GetLocalizationFile(locale);
+ _item = new LocalizationItem(localization);
+ }
+
+ public static string Get(string key, params string[] parameters)
+ {
+ try
+ {
+ return _item.GetValue(key) ?? key;
+ }
+ catch
+ {
+ return key;
+ }
+ }
+ }
+
+ public class LocalizationItem
+ {
+ private IniData _localizationData;
+
+ public LocalizationItem(string inputStream)
+ {
+ var parser = new IniDataParser();
+ this._localizationData = parser.Parse(inputStream);
+ }
+
+ public string GetValue(string key)
+ {
+ return this._localizationData["Localization"][key];
+ }
+ }
+}
\ No newline at end of file
diff --git a/WTManager.Resources/ResourcesHelper.cs b/WTManager.Resources/ResourcesHelper.cs
new file mode 100644
index 0000000..8e9f3ea
--- /dev/null
+++ b/WTManager.Resources/ResourcesHelper.cs
@@ -0,0 +1,7 @@
+namespace WtManager.Resources
+{
+ class ResourcesHelper
+ {
+
+ }
+}
diff --git a/WTManager.Resources/ResourcesProcessor.cs b/WTManager.Resources/ResourcesProcessor.cs
index b611ded..746007b 100644
--- a/WTManager.Resources/ResourcesProcessor.cs
+++ b/WTManager.Resources/ResourcesProcessor.cs
@@ -4,10 +4,12 @@
using System.IO;
using System.Reflection;
-namespace WTManager.Resources
+namespace WtManager.Resources
{
public static class ResourcesProcessor
{
+ private const string THEMES_DIRECTORY = "themes";
+
private static readonly Dictionary ResourcesCache;
public static event Action ThemeChanged;
@@ -41,11 +43,8 @@ private static Stream GetResourceStream(string baseCategory, string resourceName
if (ThemeName != null)
resourceStream = GetThemeFileStream(baseCategory, resourceName);
- if (resourceStream != null)
- return resourceStream;
-
- // fallback to default embedded resource
- return GetEmbeddedFileStream(baseCategory, resourceName);
+ // fallback to default embedded resource if theme file is not exist
+ return resourceStream ?? GetEmbeddedFileStream(baseCategory, resourceName);
}
public static string GetThemesRootDirectory()
@@ -57,7 +56,7 @@ public static string GetThemesRootDirectory()
if (assemblyFolder == null)
return null;
- return Path.Combine(assemblyFolder, "themes");
+ return Path.Combine(assemblyFolder, THEMES_DIRECTORY);
}
private static Stream GetThemeFileStream(string baseCategory, string resourceName)
@@ -86,7 +85,7 @@ private static Stream GetEmbeddedFileStream(string baseCategory, string resource
var assembly = Assembly.GetExecutingAssembly();
string defaultNamespace = assembly.GetName().Name;
- return assembly.GetManifestResourceStream($"{defaultNamespace}.Resources.{baseCategory}.{resourceName}");
+ return assembly.GetManifestResourceStream($"{defaultNamespace}.{baseCategory}.{resourceName}");
}
private static T GetResource(string resourceName, string baseCategory, Func objectProducer)
@@ -126,6 +125,11 @@ public static Image GetImage(string imageName)
return GetResource(imageName + ".png", "Images", stream => new Bitmap(stream));
}
+ public static string GetLocalizationFile(string language)
+ {
+ return GetResource(language + ".ini", "Locales", stream => new StreamReader(stream).ReadToEnd());
+ }
+
public static IEnumerable GetThemesList()
{
if (! Directory.Exists(GetThemesRootDirectory()))
diff --git a/WTManager.Resources/WTManager.Resources.csproj b/WTManager.Resources/WTManager.Resources.csproj
index ff78091..f67edd9 100644
--- a/WTManager.Resources/WTManager.Resources.csproj
+++ b/WTManager.Resources/WTManager.Resources.csproj
@@ -30,61 +30,82 @@
4
+
+ ..\packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WTManager.Resources/WtManager.Resources.csproj b/WTManager.Resources/WtManager.Resources.csproj
new file mode 100644
index 0000000..f67edd9
--- /dev/null
+++ b/WTManager.Resources/WtManager.Resources.csproj
@@ -0,0 +1,111 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {8E6C262C-AB2C-4B32-B761-1CAFB8DC4E93}
+ Library
+ Properties
+ WTManager.Resources
+ WTManager.Resources
+ v4.5
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WTManager.Resources/packages.config b/WTManager.Resources/packages.config
new file mode 100644
index 0000000..80cf4be
--- /dev/null
+++ b/WTManager.Resources/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/WTManager.sln b/WTManager.sln
index bf4d125..d3f71cf 100644
--- a/WTManager.sln
+++ b/WTManager.sln
@@ -1,9 +1,9 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26430.16
+VisualStudioVersion = 15.0.26730.12
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WTManager", "WTManager\WTManager.csproj", "{9FAD443F-F504-47FA-802C-6470413097D0}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WtManager", "WTManager\WtManager.csproj", "{9FAD443F-F504-47FA-802C-6470413097D0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FAA71F4E-669C-468A-BFCB-74572827DE48}"
ProjectSection(SolutionItems) = preProject
@@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Installer\Setup.nsi = Installer\Setup.nsi
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WTManager.Resources", "WTManager.Resources\WTManager.Resources.csproj", "{8E6C262C-AB2C-4B32-B761-1CAFB8DC4E93}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WtManager.Resources", "WTManager.Resources\WtManager.Resources.csproj", "{8E6C262C-AB2C-4B32-B761-1CAFB8DC4E93}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -52,4 +52,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {8FAB0BF1-0C24-4801-B244-A218716D15EF}
+ EndGlobalSection
EndGlobal
diff --git a/WTManager/Program.cs b/WTManager/Program.cs
index 085bf46..07b7cf0 100644
--- a/WTManager/Program.cs
+++ b/WTManager/Program.cs
@@ -1,10 +1,10 @@
using System;
using System.Threading;
using System.Windows.Forms;
-using WTManager.Forms;
-using WTManager.Helpers;
+using WtManager.Forms;
+using WtManager.Helpers;
-namespace WTManager
+namespace WtManager
{
internal static class Program
{
@@ -20,15 +20,21 @@ private static void Main(string[] args)
case "/installtask":
SchedulerHelpers.AutoStartTaskState = true;
break;
+
case "/removetask":
SchedulerHelpers.AutoStartTaskState = false;
break;
+
+ default:
+ throw new InvalidOperationException("Invalid command line argument " + args[0]);
}
Environment.Exit(0);
}
if (!AppMutex.WaitOne(TimeSpan.Zero, true))
+ {
return;
+ }
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
diff --git a/WTManager/Properties/AssemblyInfo.cs b/WTManager/Properties/AssemblyInfo.cs
index 3da6274..9af7906 100644
--- a/WTManager/Properties/AssemblyInfo.cs
+++ b/WTManager/Properties/AssemblyInfo.cs
@@ -1,11 +1,11 @@
using System.Reflection;
using System.Runtime.InteropServices;
-[assembly: AssemblyTitle("WTManager")]
+[assembly: AssemblyTitle("WtManager")]
[assembly: AssemblyDescription("Control your Windows services with tray")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Babaev Evgeniy")]
-[assembly: AssemblyProduct("WTManager")]
+[assembly: AssemblyProduct("WtManager")]
[assembly: AssemblyCopyright("Copyright © 2015-2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/WTManager/Properties/Resources.Designer.cs b/WTManager/Properties/Resources.Designer.cs
index cb18db5..a097e50 100644
--- a/WTManager/Properties/Resources.Designer.cs
+++ b/WTManager/Properties/Resources.Designer.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-namespace WTManager.Properties {
+namespace WtManager.Properties {
using System;
@@ -39,7 +39,7 @@ internal Resources() {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WTManager.Properties.Resources", typeof(Resources).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WtManager.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
diff --git a/WTManager/WTManager.csproj b/WTManager/WTManager.csproj
index 447407e..89ac596 100644
--- a/WTManager/WTManager.csproj
+++ b/WTManager/WTManager.csproj
@@ -1,5 +1,10 @@
+
+
+
+
+
Debug
@@ -7,8 +12,8 @@
{9FAD443F-F504-47FA-802C-6470413097D0}
WinExe
Properties
- WTManager
- WTManager
+ WtManager
+ WtManager
v4.5
512
true
@@ -20,6 +25,8 @@
None.None.Increment.DeltaDayStamp
Properties\AssemblyInfo.cs
false
+
+
publish\
true
Disk
@@ -72,7 +79,7 @@
x64
default
prompt
- MinimumRecommendedRules.ruleset
+ ..\CustomRules.ruleset
bin\x64\Release\
@@ -82,7 +89,9 @@
x64
default
prompt
- MinimumRecommendedRules.ruleset
+ ..\CustomRules.ruleset
+ false
+ false
true
@@ -105,18 +114,20 @@
MinimumRecommendedRules.ruleset
- WTManager.Program
+ WtManager.Program
-
- ..\packages\TaskScheduler.2.5.28\lib\net40\Microsoft.Win32.TaskScheduler.dll
+
+
+ ..\packages\TaskScheduler.2.8.15\lib\net40\Microsoft.Win32.TaskScheduler.dll
-
- ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll
+
+ ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll
+
@@ -133,21 +144,34 @@
-
-
+
UserControl
+
+ Form
+
+
+ WtDialog.cs
+
Component
+
+ UserControl
+
+
+ WtTimeSpanSelector.cs
+
+
+
-
+
Component
@@ -179,7 +203,7 @@
-
+
UserControl
@@ -200,34 +224,32 @@
-
- Form
-
-
- AddEditServiceForm.cs
-
-
- Form
-
-
- ConfigurationForm.cs
-
+
ResXFileCodeGenerator
Resources.Designer.cs
+
+ WtConfiguratorControl.cs
+
+
+ WtDialog.cs
+
WtItemEditor.cs
WtSelector.cs
+
+ WtTimeSpanSelector.cs
+
LogFileViewerForm.cs
Designer
@@ -236,14 +258,6 @@
MainForm.cs
Designer
-
- AddEditServiceForm.cs
- Designer
-
-
- ConfigurationForm.cs
- Designer
-
Designer
@@ -263,15 +277,34 @@
-
+
{8e6c262c-ab2c-4b32-b761-1cafb8dc4e93}
- WTManager.Resources
+ WtManager.Resources
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WTManager/packages.config b/WTManager/packages.config
index 78d5092..5b939c1 100644
--- a/WTManager/packages.config
+++ b/WTManager/packages.config
@@ -1,5 +1,10 @@
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WTManager/src/Config/ConfigManager.cs b/WTManager/src/Config/ConfigManager.cs
index be2ddfb..5a834b5 100644
--- a/WTManager/src/Config/ConfigManager.cs
+++ b/WTManager/src/Config/ConfigManager.cs
@@ -1,8 +1,9 @@
using System;
using System.IO;
using Newtonsoft.Json;
+using WtManager.Resources;
-namespace WTManager.Config
+namespace WtManager.Config
{
public class ConfigManager
{
@@ -13,9 +14,22 @@ public class ConfigManager
public Configuration Config { get; private set; }
+ ///
+ /// Configuration was loaded from file
+ ///
+ public event Action ConfigLoaded;
+
+ ///
+ /// Cofiguration was saved to file
+ ///
public event Action ConfigSaved;
private ConfigManager()
+ {
+ this.Config = this.LoadConfig();
+ }
+
+ public Configuration LoadConfig()
{
var resultObj = new Configuration();
@@ -26,11 +40,14 @@ private ConfigManager()
{
string fileContent = File.ReadAllText(configFileName);
resultObj = JsonConvert.DeserializeObject(fileContent);
+
+ this.PostProcessConfig(resultObj);
+ this.ConfigLoaded?.Invoke(resultObj);
}
}
catch { /* ... */ }
- this.Config = resultObj;
+ return resultObj;
}
public void SaveConfig()
@@ -38,10 +55,29 @@ public void SaveConfig()
try
{
string configFileName = this.GetConfigFileName();
+
+ var configDirectory = Path.GetDirectoryName(configFileName);
+
+ if (!Directory.Exists(configDirectory))
+ {
+ Directory.CreateDirectory(configDirectory);
+ }
+
File.WriteAllText(configFileName, JsonConvert.SerializeObject(this.Config, Formatting.Indented));
+
+ this.PostProcessConfig(this.Config);
this.ConfigSaved?.Invoke(this.Config);
}
- catch { /* ... */ }
+ catch { /* ... */ }
+ }
+
+ ///
+ /// Executes after every load/save config operation
+ ///
+ private void PostProcessConfig(Configuration config)
+ {
+ ResourcesProcessor.ThemeName = config.ThemeName;
+ LocalizationManager.UpdateLocale(config.Language);
}
#region Utils
@@ -52,6 +88,6 @@ private string GetConfigFileName()
return Path.Combine(appDataDir, "WTManager", "config.json");
}
- #endregion
+ #endregion Utils
}
-}
+}
\ No newline at end of file
diff --git a/WTManager/src/Config/Configuration.cs b/WTManager/src/Config/Configuration.cs
index f82b124..0124aae 100644
--- a/WTManager/src/Config/Configuration.cs
+++ b/WTManager/src/Config/Configuration.cs
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Drawing;
+using System.ServiceProcess;
using Newtonsoft.Json;
-using WTManager.Controls.WtStyle.WtConfigurator;
-using WTManager.Helpers;
-using WTManager.VisualItemRenderers;
+using WtManager.Controls.WtStyle.WtConfigurator;
+using WtManager.Helpers;
+using WtManager.VisualItemRenderers;
// ReSharper disable ArgumentsStyleLiteral
// ReSharper disable UnusedMember.Global
@@ -13,14 +15,15 @@
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable CollectionNeverUpdated.Global
-namespace WTManager.Config
+namespace WtManager.Config
{
[Serializable]
- public class Configuration : IVisualProviderObject
+ public class Configuration : IVisualSourceObject
{
public const string GROUP_GENERAL = "General";
public const string GROUP_UI = "UI settings";
public const string GROUP_SERVICES = "Services";
+ public const string GROUP_TASKS = "Service tasks";
public const string GROUP_SYSTEM = "System";
public Configuration()
@@ -36,21 +39,31 @@ public Configuration()
///
/// Path to configuration files executable file editor
///
- [VisualItem(typeof(VisualFileSelectorRenderer), "Config editor path", GROUP_GENERAL)]
+ [VisualItem(typeof(VisualFileSelectorRenderer), GROUP_GENERAL)]
public string ConfigEditorPath { get; set; }
+ [VisualItem(typeof(VisualCheckboxRenderer), GROUP_GENERAL)]
+ public bool UseInternalLogViewer { get; set; }
+
///
/// Path to log viewer executable file editor
///
- [VisualItem(typeof(VisualFileSelectorRenderer), "Log viewer path", GROUP_GENERAL)]
+ [VisualItem(typeof(VisualFileSelectorRenderer), GROUP_GENERAL)]
+ [VisualItemDependentOn(nameof(UseInternalLogViewer), reverseDependent: true)]
public string LogViewerPath { get; set; }
+ ///
+ /// Path to log viewer executable file editor
+ ///
+ [VisualItem(typeof(VisualLanguageSelectorRenderer), GROUP_GENERAL)]
+ public string Language { get; set; }
+
#endregion
#region System settings
[JsonIgnore]
- [VisualItem(typeof(VisualCheckboxRenderer), "Run WTManager on start", GROUP_SYSTEM)]
+ [VisualItem(typeof(VisualCheckboxRenderer), GROUP_SYSTEM)]
public bool RunOnStart
{
get { return SchedulerHelpers.AutoStartTaskState; }
@@ -65,35 +78,35 @@ public bool RunOnStart
/// Tray menu item font, except group titles
///
[JsonConverter(typeof(Converters.FontConverter))]
- [VisualItem(typeof(VisualFontSelectorRenderer), "Tray menu font", GROUP_UI)]
+ [VisualItem(typeof(VisualFontSelectorRenderer), GROUP_UI)]
public Font MenuFont { get; set; }
///
/// Tray menu group title items font
///
[JsonConverter(typeof(Converters.FontConverter))]
- [VisualItem(typeof(VisualFontSelectorRenderer), "Tray menu title font", GROUP_UI)]
+ [VisualItem(typeof(VisualFontSelectorRenderer), GROUP_UI)]
public Font MenuTitleFont { get; set; }
///
/// Current icons theme name
///
- [VisualItem(typeof(VisualThemeSelectorRenderer), "Theme name", GROUP_UI)]
+ [VisualItem(typeof(VisualThemeSelectorRenderer), GROUP_UI)]
public string ThemeName { get; set; }
- [VisualItem(typeof(VisualCheckboxRenderer), "Show tray menu popups", GROUP_UI)]
+ [VisualItem(typeof(VisualCheckboxRenderer), GROUP_UI)]
public bool ShowPopup { get; set; }
- [VisualItem(typeof(VisualCheckboxRenderer), "Show menu beyound taskbar", GROUP_UI)]
+ [VisualItem(typeof(VisualCheckboxRenderer), GROUP_UI)]
public bool ShowMenuBeyoundTaskbar { get; set; }
- [VisualItem(typeof(VisualCheckboxRenderer), "Open tray menu on left click", GROUP_UI)]
+ [VisualItem(typeof(VisualCheckboxRenderer), GROUP_UI)]
public bool OpenTrayMenuOnLeftClick { get; set; }
- [VisualItem(typeof(VisualCheckboxRenderer), "Use nested service groups in menu", GROUP_UI)]
+ [VisualItem(typeof(VisualCheckboxRenderer), GROUP_UI)]
public bool UseNestedServiceGroups { get; set; }
- [VisualItem(typeof(VisualCheckboxRenderer), "Show service group operations in nested menu (experimental)", GROUP_UI)]
+ [VisualItem(typeof(VisualCheckboxRenderer), GROUP_UI)]
[VisualItemDependentOn(nameof(UseNestedServiceGroups))]
public bool ShowServiceGroupOperations { get; set; }
@@ -101,15 +114,45 @@ public bool RunOnStart
#region Services settings
- [VisualItem(typeof(VisualServicesItemsEditorRenderer), "Services", GROUP_SERVICES)]
+ [VisualItem(typeof(VisualDialogItemsEditorRenderer), GROUP_SERVICES)]
public IEnumerable Services { get; set; }
#endregion
+
+ [VisualItem(typeof(VisualDialogItemsEditorRenderer), GROUP_TASKS)]
+ public IEnumerable Tasks { get; set; }
+
+ public string LocalizationPrefix => "Configuration";
}
+ [Serializable]
+ public class ServiceTask : IVisualSourceObject
+ {
+ public const string GROUP_GENERAL = "General configuration";
+ public const string GROUP_REPEAT = "Repeat process cofiguration";
+
+ [VisualItem(typeof(VisualTextRenderer), GROUP_GENERAL)]
+ public string TaskName { get; set; }
+
+ [VisualItem(typeof(VisualServiceSelectorRenderer), GROUP_GENERAL)]
+ public string ServiceName { get; set; }
+
+ [VisualItem(typeof(VisualEnumSelectorType), GROUP_GENERAL)]
+ public ServiceGroupOperationType OperationType { get; set; }
+
+ [VisualItem(typeof(VisualDateTimeRenderer), GROUP_GENERAL)]
+ public DateTime ExecuteTime { get; set; }
+
+ public override string ToString()
+ {
+ return $"{this.TaskName} (Service: {this.ServiceName}, operation: {this.OperationType}, trigger on {this.ExecuteTime})";
+ }
+
+ public string LocalizationPrefix => "ServiceTask";
+ }
[Serializable]
- public class Service : IVisualProviderObject
+ public class Service : IVisualSourceObject
{
public const string GROUP_GENERAL = "Basic service configuration";
public const string GROUP_LOGCONFIG = "Logs and config";
@@ -124,50 +167,67 @@ public Service()
///
/// Service name
///
- [VisualItem(typeof(VisualServiceSelectorRenderer), "Service name", GROUP_GENERAL)]
+ [VisualItem(typeof(VisualServiceSelectorRenderer), GROUP_GENERAL)]
public string ServiceName { get; set; }
///
/// Service display name (will be displayed in menu)
///
- [VisualItem(typeof(VisualTextRenderer), "Service display name", GROUP_GENERAL)]
+ [VisualItem(typeof(VisualTextRenderer), GROUP_GENERAL)]
public string DisplayName { get; set; }
///
/// Service group (for menu generation)
///
- [VisualItem(typeof(VisualServiceGroupSelectorRenderer), "Service group (optional)", GROUP_GENERAL)]
+ [VisualItem(typeof(VisualServiceGroupSelectorRenderer), GROUP_GENERAL)]
public string Group { get; set; }
///
/// Service configuration files
///
- [VisualItem(typeof(VisualFilesItemsEditorRenderer), "Config files", GROUP_LOGCONFIG)]
+ [VisualItem(typeof(VisualFilesItemsEditorRenderer), GROUP_LOGCONFIG)]
[VisualItemCustomization(customHeight: 80)]
public IEnumerable ConfigFiles { get; set; }
///
/// Service log files
///
- [VisualItem(typeof(VisualFilesItemsEditorRenderer), "Log files", GROUP_LOGCONFIG)]
+ [VisualItem(typeof(VisualFilesItemsEditorRenderer), GROUP_LOGCONFIG)]
[VisualItemCustomization(customHeight: 80)]
public IEnumerable LogFiles { get; set; }
///
/// Service data directory (for example WWW for web-servers)
///
- [VisualItem(typeof(VisualDirectorySelectorRenderer), "Data directory", GROUP_ADDITIONAL)]
+ [VisualItem(typeof(VisualDirectorySelectorRenderer), GROUP_ADDITIONAL)]
public string DataDirectory { get; set; }
///
/// Browser URL
///
- [VisualItem(typeof(VisualFileSelectorRenderer), "Browser URL", GROUP_ADDITIONAL)]
+ [VisualItem(typeof(VisualFileSelectorRenderer), GROUP_ADDITIONAL)]
public string BrowserUrl { get; set; }
public override string ToString()
{
return this.DisplayName;
}
+
+ [JsonIgnore]
+ public ServiceController Controller => ServiceHelpers.GetServiceController(this.ServiceName);
+
+ public string LocalizationPrefix => "Service";
+ }
+
+ public enum ServiceGroupOperationType
+ {
+ [Description("Start")]
+ Start,
+
+ [Description("Stop")]
+ Stop,
+
+ [Description("Restart")]
+ Restart
}
}
diff --git a/WTManager/src/Controls/WTManagerForm.cs b/WTManager/src/Controls/WTManagerForm.cs
index 1979062..a5fed27 100644
--- a/WTManager/src/Controls/WTManagerForm.cs
+++ b/WTManager/src/Controls/WTManagerForm.cs
@@ -1,10 +1,10 @@
using System;
using System.Drawing;
using System.Windows.Forms;
-using WTManager.Config;
-using WTManager.Resources;
+using WtManager.Config;
+using WtManager.Resources;
-namespace WTManager.Controls
+namespace WtManager.Controls
{
[System.ComponentModel.DesignerCategory("")]
public class WtManagerForm : Form, IConfigurableForm
diff --git a/WTManager/src/Controls/WtManagerMainForm.cs b/WTManager/src/Controls/WtManagerMainForm.cs
index d14029a..4469172 100644
--- a/WTManager/src/Controls/WtManagerMainForm.cs
+++ b/WTManager/src/Controls/WtManagerMainForm.cs
@@ -1,4 +1,4 @@
-namespace WTManager.Controls
+namespace WtManager.Controls
{
[System.ComponentModel.DesignerCategory("")]
public class WtManagerMainForm : WtManagerForm
diff --git a/WTManager/src/Controls/WtStyle/WtCheckBox.cs b/WTManager/src/Controls/WtStyle/WtCheckBox.cs
index ee87216..b05c676 100644
--- a/WTManager/src/Controls/WtStyle/WtCheckBox.cs
+++ b/WTManager/src/Controls/WtStyle/WtCheckBox.cs
@@ -1,6 +1,6 @@
using System.Windows.Forms;
-namespace WTManager.Controls.WtStyle
+namespace WtManager.Controls.WtStyle
{
public class WtCheckBox : CheckBox
{
diff --git a/WTManager/src/Controls/WtStyle/WtComboBox.cs b/WTManager/src/Controls/WtStyle/WtComboBox.cs
index c24a25b..3931a54 100644
--- a/WTManager/src/Controls/WtStyle/WtComboBox.cs
+++ b/WTManager/src/Controls/WtStyle/WtComboBox.cs
@@ -2,31 +2,36 @@
using System.Collections;
using System.Linq;
using System.Windows.Forms;
-using WTManager.Lib;
+using WtManager.Lib;
-namespace WTManager.Controls.WtStyle
+namespace WtManager.Controls.WtStyle
{
public class WtComboBox : ComboBox
{
public object GetSelectedValue()
{
- var comboItem = this.SelectedItem as ComboBoxItem;
-
- if (comboItem != null)
+ if (this.SelectedItem is ComboBoxItem comboItem)
+ {
return comboItem.Value;
+ }
- if (this.SelectedItem != null)
- return this.SelectedItem;
-
- return this.Text;
+ return this.SelectedItem ?? this.Text;
}
public void SetItems(IEnumerable items)
{
this.Items.Clear();
this.Items.AddRange(items.Cast