diff --git a/DnsServer.sln b/DnsServer.sln
index 05141d60..ebfb955e 100644
--- a/DnsServer.sln
+++ b/DnsServer.sln
@@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DnsServerApp", "DnsServerAp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DnsServerApp.NETCore", "DnsServerApp.NETCore\DnsServerApp.NETCore.csproj", "{ADE80805-9FA7-4F66-8A18-57B98F8C0B0F}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DnsServerTrayIcon", "DnsServerTrayIcon\DnsServerTrayIcon.csproj", "{2F91BD07-2CEE-47FA-8486-457B54612B4C}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -37,6 +39,10 @@ Global
{ADE80805-9FA7-4F66-8A18-57B98F8C0B0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADE80805-9FA7-4F66-8A18-57B98F8C0B0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADE80805-9FA7-4F66-8A18-57B98F8C0B0F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2F91BD07-2CEE-47FA-8486-457B54612B4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2F91BD07-2CEE-47FA-8486-457B54612B4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2F91BD07-2CEE-47FA-8486-457B54612B4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2F91BD07-2CEE-47FA-8486-457B54612B4C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/DnsServerTrayIcon/AboutForm.Designer.cs b/DnsServerTrayIcon/AboutForm.Designer.cs
new file mode 100644
index 00000000..82fe6e6b
--- /dev/null
+++ b/DnsServerTrayIcon/AboutForm.Designer.cs
@@ -0,0 +1,64 @@
+namespace DnsServerTrayIcon
+{
+ partial class AboutForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm));
+ this.VersionLabel = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // VersionLabel
+ //
+ this.VersionLabel.AutoSize = true;
+ this.VersionLabel.Location = new System.Drawing.Point(24, 23);
+ this.VersionLabel.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+ this.VersionLabel.Name = "VersionLabel";
+ this.VersionLabel.Size = new System.Drawing.Size(0, 25);
+ this.VersionLabel.TabIndex = 0;
+ //
+ // AboutForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(656, 142);
+ this.Controls.Add(this.VersionLabel);
+ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+ this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+ this.Name = "AboutForm";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "About";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label VersionLabel;
+ }
+}
\ No newline at end of file
diff --git a/DnsServerTrayIcon/AboutForm.cs b/DnsServerTrayIcon/AboutForm.cs
new file mode 100644
index 00000000..ae1890ef
--- /dev/null
+++ b/DnsServerTrayIcon/AboutForm.cs
@@ -0,0 +1,33 @@
+using DnsServerTrayIcon.Properties;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
+using System.Reflection;
+using System.Windows.Forms;
+
+namespace DnsServerTrayIcon
+{
+ public partial class AboutForm : Form
+ {
+ public AboutForm()
+ {
+ InitializeComponent();
+
+ Image image = Image.FromFile("Favicon.ico");
+ var bitmap = new Bitmap(image);
+ Icon = Icon.FromHandle(bitmap.GetHicon());
+
+ VersionLabel.Text = Resources.ServiceName;
+ VersionLabel.Text += "\r\n";
+ VersionLabel.Text += GetLegalCopyright();
+ VersionLabel.Text += "\r\n";
+ VersionLabel.Text += Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName) + " " + Assembly.GetExecutingAssembly().GetBuildVersion();
+ }
+
+ private string GetLegalCopyright()
+ {
+ var versionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);
+ return versionInfo.LegalCopyright;
+ }
+ }
+}
diff --git a/DnsServerTrayIcon/AboutForm.resx b/DnsServerTrayIcon/AboutForm.resx
new file mode 100644
index 00000000..f6702292
--- /dev/null
+++ b/DnsServerTrayIcon/AboutForm.resx
@@ -0,0 +1,267 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+
+ AAABAAUAICAQAAAAAADoAgAAVgAAACAgAAAAAAAAqAgAAD4DAAAwMAAAAAAAAKgOAADmCwAAEBAQAAAA
+ AAAoAQAAjhoAABAQAAAAAAAAaAUAALYbAAAoAAAAIAAAAEAAAAABAAQAAAAAAIACAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAAAAD/AAD/AAAA//8A/wAAAP8A
+ /wD//wAA////AMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzP//zP//////////////zMz/
+ /8z//////////////8zM///M///////////////MzP//zP//////////////zMz//8zMzMzMzMz//8zM
+ zMzM///MzMzMzMzM///MzMzMzP//////////zP//zP//zMz//////////8z//8z//8zM///////////M
+ ///M///MzP//////////zP//zP//zMz//8zMzMzMzMz//8z//8zM///MzMzMzMzM///M///MzP//zP//
+ zMzMzP//zP//zMz//8z//8zMzMz//8z//8zM///M///MzMzM///M///MzP//zP//zMzMzP//zP//zMz/
+ /8z//8zMzMzMzMz//8zM///M///MzMzMzMzM///MzP//zP//zP//////////zMz//8z//8z/////////
+ /8zM///M///M///////////MzP//zP//zP//////////zMzMzMz//8zMzMzMzMz//8zMzMzM///MzMzM
+ zMzM///MzP//////////////zP//zMz//////////////8z//8zM///////////////M///MzP//////
+ ////////zP//zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAIAAAAEAA
+ AAABAAgAAAAAAIAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDA
+ wADA3MAA8MqmAAQEBAAICAgADAwMABEREQAWFhYAHBwcACIiIgApKSkAVVVVAE1NTQBCQkIAOTk5AIB8
+ /wBQUP8AkwDWAP/szADG1u8A1ufnAJCprQAAADMAAABmAAAAmQAAAMwAADMAAAAzMwAAM2YAADOZAAAz
+ zAAAM/8AAGYAAAB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A/2b/AP//
+ ZgAhAKUAX19fAHd3dwCGhoYAlpaWAMvLywCysrIA19fXAN3d3QDj4+MA6urqAPHx8QD4+PgA8Pv/AKSg
+ oACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////ANXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV
+ 1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1f/////V1f//////////////////
+ ///////////V1dXV/////9XV/////////////////////////////9XV1dX/////1dX/////////////
+ ////////////////1dXV1f/////V1f/////////////////////////////V1dXV/////9XV1dXV1dXV
+ 1dXV1dXV/////9XV1dXV1dXV1dX/////1dXV1dXV1dXV1dXV1dX/////1dXV1dXV1dXV1f//////////
+ ///////////V1f/////V1f/////V1dXV/////////////////////9XV/////9XV/////9XV1dX/////
+ ////////////////1dX/////1dX/////1dXV1f/////////////////////V1f/////V1f/////V1dXV
+ /////9XV1dXV1dXV1dXV1dXV/////9XV/////9XV1dX/////1dXV1dXV1dXV1dXV1dX/////1dX/////
+ 1dXV1f/////V1f/////V1dXV1dXV1f/////V1f/////V1dXV/////9XV/////9XV1dXV1dXV/////9XV
+ /////9XV1dX/////1dX/////1dXV1dXV1dX/////1dX/////1dXV1f/////V1f/////V1dXV1dXV1f//
+ ///V1f/////V1dXV/////9XV/////9XV1dXV1dXV1dXV1dXV/////9XV1dX/////1dX/////1dXV1dXV
+ 1dXV1dXV1dX/////1dXV1f/////V1f/////V1f/////////////////////V1dXV/////9XV/////9XV
+ /////////////////////9XV1dX/////1dX/////1dX/////////////////////1dXV1f/////V1f//
+ ///V1f/////////////////////V1dXV1dXV1dXV/////9XV1dXV1dXV1dXV1dXV/////9XV1dXV1dXV
+ 1dX/////1dXV1dXV1dXV1dXV1dX/////1dXV1f/////////////////////////////V1f/////V1dXV
+ /////////////////////////////9XV/////9XV1dX/////////////////////////////1dX/////
+ 1dXV1f/////////////////////////////V1f/////V1dXV1dXV1dXV1dXV1dXV1dX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/wCZZgAAmWYzAJkzZgCZZpkAmWbMAJkz
+ /wCZmTMAmZlmAJmZmQCZmcwAmZn/AJnMAACZzDMAZsxmAJnMmQCZzMwAmcz/AJn/AACZ/zMAmcxmAJn/
+ mQCZ/8wAmf//AMwAAACZADMAzABmAMwAmQDMAMwAmTMAAMwzMwDMM2YAzDOZAMwzzADMM/8AzGYAAMxm
+ MwCZZmYAzGaZAMxmzACZZv8AzJkAAMyZMwDMmWYAzJmZAMyZzADMmf8AzMwAAMzMMwDMzGYAzMyZAMzM
+ zADMzP8AzP8AAMz/MwCZ/2YAzP+ZAMz/zADM//8AzAAzAP8AZgD/AJkAzDMAAP8zMwD/M2YA/zOZAP8z
+ zAD/M/8A/2YAAP9mMwDMZmYA/2aZAP9mzADMZv8A/5kAAP+ZMwD/mWYA/5mZAP+ZzAD/mf8A/8wAAP/M
+ MwD/zGYA/8yZAP/MzAD/zP8A//8zAMz/ZgD//5kA///MAGZm/wBm/2YAZv//AP9mZgD/Zv8A//9mACEA
+ pQBfX18Ad3d3AIaGhgCWlpYAy8vLALKysgDX19cA3d3dAOPj4wDq6uoA8fHxAPj4+ADw+/8ApKCgAICA
+ gAAAAP8AAP8AAAD//wD/AAAA/wD/AP//AAD///8A1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV
+ 1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV
+ 1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV////
+ ////1dXV////////////////////////////////////////////1dXV1dXV////////1dXV////////
+ ////////////////////////////////////1dXV1dXV////////1dXV////////////////////////
+ ////////////////////1dXV1dXV////////1dXV////////////////////////////////////////
+ ////1dXV1dXV////////1dXV////////////////////////////////////////////1dXV1dXV////
+ ////1dXV////////////////////////////////////////////1dXV1dXV////////1dXV1dXV1dXV
+ 1dXV1dXV1dXV1dXV////////1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV1dXV1dXV1dXV1dXV1dXV
+ ////////1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV
+ 1dXV1dXV1dXV////////////////////////////////1dXV////////1dXV////////1dXV1dXV////
+ ////////////////////////////1dXV////////1dXV////////1dXV1dXV////////////////////
+ ////////////1dXV////////1dXV////////1dXV1dXV////////////////////////////////1dXV
+ ////////1dXV////////1dXV1dXV////////////////////////////////1dXV////////1dXV////
+ ////1dXV1dXV////////////////////////////////1dXV////////1dXV////////1dXV1dXV////
+ ////1dXV1dXV1dXV1dXV1dXV1dXV1dXV////////1dXV////////1dXV1dXV////////1dXV1dXV1dXV
+ 1dXV1dXV1dXV1dXV////////1dXV////////1dXV1dXV////////1dXV1dXV1dXV1dXV1dXV1dXV1dXV
+ ////////1dXV////////1dXV1dXV////////1dXV////////1dXV1dXV1dXV1dXV////////1dXV////
+ ////1dXV1dXV////////1dXV////////1dXV1dXV1dXV1dXV////////1dXV////////1dXV1dXV////
+ ////1dXV////////1dXV1dXV1dXV1dXV////////1dXV////////1dXV1dXV////////1dXV////////
+ 1dXV1dXV1dXV1dXV////////1dXV////////1dXV1dXV////////1dXV////////1dXV1dXV1dXV1dXV
+ ////////1dXV////////1dXV1dXV////////1dXV////////1dXV1dXV1dXV1dXV////////1dXV////
+ ////1dXV1dXV////////1dXV////////1dXV1dXV1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV////
+ ////1dXV////////1dXV1dXV1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV////////1dXV////////
+ 1dXV1dXV1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV////////1dXV////////1dXV////////////
+ ////////////////////1dXV1dXV////////1dXV////////1dXV////////////////////////////
+ ////1dXV1dXV////////1dXV////////1dXV////////////////////////////////1dXV1dXV////
+ ////1dXV////////1dXV////////////////////////////////1dXV1dXV////////1dXV////////
+ 1dXV////////////////////////////////1dXV1dXV////////1dXV////////1dXV////////////
+ ////////////////////1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV1dXV1dXV1dXV1dXV1dXV////
+ ////1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV1dXV
+ 1dXV1dXV////////1dXV1dXV1dXV1dXV1dXV1dXV1dXV////////1dXV1dXV////////////////////
+ ////////////////////////1dXV////////1dXV1dXV////////////////////////////////////
+ ////////1dXV////////1dXV1dXV////////////////////////////////////////////1dXV////
+ ////1dXV1dXV////////////////////////////////////////////1dXV////////1dXV1dXV////
+ ////////////////////////////////////////1dXV////////1dXV1dXV////////////////////
+ ////////////////////////1dXV////////1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV
+ 1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV
+ 1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXVAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAA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1f//
+ 1f//////////1dXV1dX//9XV1dXV1dX//9XV///////////////V///V1f//////////////1f//1dXV
+ 1dXV1dXV1dXV1dXV1dUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAA
+
+
+
\ No newline at end of file
diff --git a/DnsServerTrayIcon/App.config b/DnsServerTrayIcon/App.config
new file mode 100644
index 00000000..731f6de6
--- /dev/null
+++ b/DnsServerTrayIcon/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DnsServerTrayIcon/BuildAssemblyExtensions.cs b/DnsServerTrayIcon/BuildAssemblyExtensions.cs
new file mode 100644
index 00000000..70b1014c
--- /dev/null
+++ b/DnsServerTrayIcon/BuildAssemblyExtensions.cs
@@ -0,0 +1,39 @@
+using System;
+using System.IO;
+using System.Reflection;
+
+namespace DnsServerTrayIcon
+{
+ public static class BuildAssemblyExtensions
+ {
+ public static DateTime GetLinkerTime(this Assembly assembly, TimeZoneInfo target = null)
+ {
+ var filePath = assembly.Location;
+ const int c_PeHeaderOffset = 60;
+ const int c_LinkerTimestampOffset = 8;
+
+ var buffer = new byte[2048];
+
+ using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
+ stream.Read(buffer, 0, 2048);
+
+ var offset = BitConverter.ToInt32(buffer, c_PeHeaderOffset);
+ var secondsSince1970 = BitConverter.ToInt32(buffer, offset + c_LinkerTimestampOffset);
+ var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+
+ var linkTimeUtc = epoch.AddSeconds(secondsSince1970);
+
+ var tz = target ?? TimeZoneInfo.Local;
+ var localTime = TimeZoneInfo.ConvertTimeFromUtc(linkTimeUtc, tz);
+
+ return localTime;
+ }
+
+ public static string GetBuildVersion(this Assembly assembly)
+ {
+ var linkTimeLocal = assembly.GetLinkerTime(TimeZoneInfo.Utc);
+ return new Version(1, 0, 0,
+ ((int)new TimeSpan(linkTimeLocal.Hour, linkTimeLocal.Minute, linkTimeLocal.Second).TotalSeconds) / 2).ToString();
+ }
+ }
+}
diff --git a/DnsServerTrayIcon/ContextMenuNotifyIconExtensions.cs b/DnsServerTrayIcon/ContextMenuNotifyIconExtensions.cs
new file mode 100644
index 00000000..d16bf286
--- /dev/null
+++ b/DnsServerTrayIcon/ContextMenuNotifyIconExtensions.cs
@@ -0,0 +1,14 @@
+using System.Reflection;
+using System.Windows.Forms;
+
+namespace DnsServerTrayIcon
+{
+ public static class ContextMenuNotifyIconExtensions
+ {
+ public static void ShowContextMenu(this NotifyIcon notifyIcon)
+ {
+ MethodInfo methodInfo = typeof(NotifyIcon).GetMethod("ShowContextMenu", BindingFlags.Instance | BindingFlags.NonPublic);
+ methodInfo.Invoke(notifyIcon, null);
+ }
+ }
+}
diff --git a/DnsServerTrayIcon/DnsServerTrayIcon.csproj b/DnsServerTrayIcon/DnsServerTrayIcon.csproj
new file mode 100644
index 00000000..7e27f5d0
--- /dev/null
+++ b/DnsServerTrayIcon/DnsServerTrayIcon.csproj
@@ -0,0 +1,100 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {2F91BD07-2CEE-47FA-8486-457B54612B4C}
+ WinExe
+ DnsServerTrayIcon
+ DnsServerTrayIcon
+ v4.6.1
+ 512
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ AboutForm.cs
+
+
+
+
+
+
+
+
+ AboutForm.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+ Always
+
+
+
+
+ {7873b2b8-01ba-48bc-b4b0-0857ffd873c9}
+ DnsService
+
+
+
+
\ No newline at end of file
diff --git a/DnsServerTrayIcon/Favicon.ico b/DnsServerTrayIcon/Favicon.ico
new file mode 100644
index 00000000..67432fd8
Binary files /dev/null and b/DnsServerTrayIcon/Favicon.ico differ
diff --git a/DnsServerTrayIcon/MainApplicationContext.cs b/DnsServerTrayIcon/MainApplicationContext.cs
new file mode 100644
index 00000000..43f03271
--- /dev/null
+++ b/DnsServerTrayIcon/MainApplicationContext.cs
@@ -0,0 +1,199 @@
+using DnsServerTrayIcon.Properties;
+using System;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace DnsServerTrayIcon
+{
+ public class MainApplicationContext : ApplicationContext
+ {
+ private readonly WindowsServiceController _service = new WindowsServiceController("DnsService");
+
+ private NotifyIcon TrayIcon;
+ private ContextMenuStrip TrayIconContextMenu;
+ private ToolStripMenuItem DashboardMenuItem;
+ private ToolStripMenuItem ServiceMenuItem;
+ private ToolStripMenuItem StartServiceMenuItem;
+ private ToolStripMenuItem RestartServiceMenuItem;
+ private ToolStripMenuItem StopServiceMenuItem;
+ private ToolStripMenuItem AboutMenuItem;
+ private ToolStripSeparator DividerMenuItem;
+ private ToolStripMenuItem ExitMenuItem;
+
+ public MainApplicationContext()
+ {
+ Application.ApplicationExit += new EventHandler(OnApplicationExit);
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ //
+ // TrayIconContextMenu
+ //
+ TrayIconContextMenu = new ContextMenuStrip();
+ TrayIconContextMenu.SuspendLayout();
+
+ //
+ // TrayIcon
+ //
+ var resources = new ComponentResourceManager(typeof(AboutForm));
+ TrayIcon = new NotifyIcon();
+ TrayIcon.Icon = (Icon)resources.GetObject("$this.Icon");
+ TrayIcon.Visible = true;
+ TrayIcon.MouseUp += TrayIcon_MouseUp;
+ TrayIcon.ContextMenuStrip = TrayIconContextMenu;
+ TrayIcon.Text = Resources.ServiceName;
+
+ //
+ // DashboardMenuItem
+ //
+ DashboardMenuItem = new ToolStripMenuItem();
+ DashboardMenuItem.Name = "DashboardMenuItem";
+ DashboardMenuItem.Text = Resources.DashboardMenuItem;
+ DashboardMenuItem.Click += new EventHandler(DashboardMenuItem_Click);
+
+ //
+ // ServiceMenuItem
+ //
+ ServiceMenuItem = new ToolStripMenuItem();
+ ServiceMenuItem.Name = "ServiceMenuItem";
+ ServiceMenuItem.Text = Resources.ServiceMenuItem;
+ ServiceMenuItem.MouseHover += new EventHandler(ServiceMenuItem_MouseHover);
+ // Prove the user feedback that there is a sub menu.
+ ServiceMenuItem.DropDownItems.Add(new ToolStripMenuItem());
+
+ StartServiceMenuItem = new ToolStripMenuItem(Resources.ServiceStartMenuItem);
+ StartServiceMenuItem.Click += new EventHandler(StartServiceMenuItem_Click);
+
+ RestartServiceMenuItem = new ToolStripMenuItem(Resources.ServiceRestartMenuItem);
+ RestartServiceMenuItem.Click += new EventHandler(RestartServiceMenuItem_Click);
+
+ StopServiceMenuItem = new ToolStripMenuItem(Resources.ServiceStopMenuItem);
+ StopServiceMenuItem.Click += new EventHandler(StopServiceMenuItem_Click);
+
+ //
+ // AboutMenuItem
+ //
+ AboutMenuItem = new ToolStripMenuItem();
+ AboutMenuItem.Name = "AboutMenuItem";
+ AboutMenuItem.Text = Resources.AboutMenuItem;
+ AboutMenuItem.Click += new EventHandler(AboutMenuItem_Click);
+
+ //
+ // DividerMenuItem
+ //
+ DividerMenuItem = new ToolStripSeparator();
+
+ //
+ // CloseMenuItem
+ //
+ ExitMenuItem = new ToolStripMenuItem();
+ ExitMenuItem.Name = "ExitMenuItem";
+ ExitMenuItem.Text = Resources.ExitMenuItem;
+ ExitMenuItem.Click += new EventHandler(ExitMenuItem_Click);
+
+ TrayIconContextMenu.ResumeLayout(false);
+ }
+
+ private void TrayIcon_MouseUp(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Right)
+ {
+ BuildContextMenu();
+ TrayIcon.ShowContextMenu();
+ }
+ }
+
+ private void BuildContextMenu()
+ {
+ TrayIconContextMenu.Hide();
+ TrayIconContextMenu.Items.Clear();
+
+ TrayIconContextMenu.Items.Add(DashboardMenuItem);
+
+ if (_service.IsInstalled)
+ TrayIconContextMenu.Items.Add(ServiceMenuItem);
+
+ TrayIconContextMenu.Items.AddRange(new ToolStripItem[]
+ {
+ DividerMenuItem,
+ AboutMenuItem,
+ DividerMenuItem,
+ ExitMenuItem
+ });
+ }
+
+ private void ServiceMenuItem_MouseHover(object sender, EventArgs e)
+ {
+ ServiceMenuItem.DropDownItems.Clear();
+ if (_service.IsRunning)
+ {
+ ServiceMenuItem.DropDownItems.Add(RestartServiceMenuItem);
+ ServiceMenuItem.DropDownItems.Add(StopServiceMenuItem);
+ }
+ else
+ {
+ ServiceMenuItem.DropDownItems.Add(StartServiceMenuItem);
+ }
+ ServiceMenuItem.ShowDropDown();
+ }
+
+ private void StartServiceMenuItem_Click(object sender, EventArgs e)
+ {
+ _service.Start();
+ }
+
+ private void RestartServiceMenuItem_Click(object sender, EventArgs e)
+ {
+ _service.Restart();
+ }
+
+ private void StopServiceMenuItem_Click(object sender, EventArgs e)
+ {
+ _service.Stop();
+ }
+
+ private void OnApplicationExit(object sender, EventArgs e)
+ {
+ try
+ {
+ // Clean up so that the icon will be removed when the application is closed.
+ TrayIcon.Visible = false;
+ }
+ catch (NullReferenceException)
+ {
+ // The application is probably closing so safe to ignore.
+ }
+ }
+
+ private void DashboardMenuItem_Click(object sender, EventArgs e)
+ {
+ //TODO: Parse the config file to determine the port.
+ Process.Start("http://127.0.0.1:5380");
+ }
+
+ private void AboutMenuItem_Click(object sender, EventArgs e)
+ {
+ var aboutForm = new AboutForm();
+ aboutForm.ShowDialog();
+ }
+
+ private void ExitMenuItem_Click(object sender, EventArgs e)
+ {
+ DialogResult dialogResult = MessageBox.Show(
+ Resources.AreYouSureYouWantToQuit,
+ Resources.Quit,
+ MessageBoxButtons.YesNo,
+ MessageBoxIcon.None,
+ MessageBoxDefaultButton.Button2);
+
+ if (dialogResult == DialogResult.Yes)
+ {
+ Application.Exit();
+ }
+ }
+ }
+}
diff --git a/DnsServerTrayIcon/Program.cs b/DnsServerTrayIcon/Program.cs
new file mode 100644
index 00000000..08263543
--- /dev/null
+++ b/DnsServerTrayIcon/Program.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Windows.Forms;
+
+namespace DnsServerTrayIcon
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.Run(new MainApplicationContext());
+ }
+ }
+}
diff --git a/DnsServerTrayIcon/Properties/AssemblyInfo.cs b/DnsServerTrayIcon/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..22adc516
--- /dev/null
+++ b/DnsServerTrayIcon/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("DnsServerTrayIcon")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Technitium")]
+[assembly: AssemblyProduct("DnsServerTrayIcon")]
+[assembly: AssemblyCopyright("Copyright © Technitium 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2f91bd07-2cee-47fa-8486-457b54612b4c")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/DnsServerTrayIcon/Properties/Resources.Designer.cs b/DnsServerTrayIcon/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..dbbbaed5
--- /dev/null
+++ b/DnsServerTrayIcon/Properties/Resources.Designer.cs
@@ -0,0 +1,162 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace DnsServerTrayIcon.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DnsServerTrayIcon.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to A&bout....
+ ///
+ internal static string AboutMenuItem {
+ get {
+ return ResourceManager.GetString("AboutMenuItem", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to If you quit Technitium DNS Server Tray Icon, Technitium DNS Server will continue to run in the background, are you sure you want to quit?.
+ ///
+ internal static string AreYouSureYouWantToQuit {
+ get {
+ return ResourceManager.GetString("AreYouSureYouWantToQuit", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to D&ashboard....
+ ///
+ internal static string DashboardMenuItem {
+ get {
+ return ResourceManager.GetString("DashboardMenuItem", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to .
+ ///
+ internal static string ErrorOccurred {
+ get {
+ return ResourceManager.GetString("ErrorOccurred", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to E&xit.
+ ///
+ internal static string ExitMenuItem {
+ get {
+ return ResourceManager.GetString("ExitMenuItem", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Quit Technitium DNS Server Tray Icon?.
+ ///
+ internal static string Quit {
+ get {
+ return ResourceManager.GetString("Quit", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Service.
+ ///
+ internal static string ServiceMenuItem {
+ get {
+ return ResourceManager.GetString("ServiceMenuItem", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Technitium DNS Server.
+ ///
+ internal static string ServiceName {
+ get {
+ return ResourceManager.GetString("ServiceName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Restart.
+ ///
+ internal static string ServiceRestartMenuItem {
+ get {
+ return ResourceManager.GetString("ServiceRestartMenuItem", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Start.
+ ///
+ internal static string ServiceStartMenuItem {
+ get {
+ return ResourceManager.GetString("ServiceStartMenuItem", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Stop.
+ ///
+ internal static string ServiceStopMenuItem {
+ get {
+ return ResourceManager.GetString("ServiceStopMenuItem", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/DnsServerTrayIcon/Properties/Resources.resx b/DnsServerTrayIcon/Properties/Resources.resx
new file mode 100644
index 00000000..e914f67a
--- /dev/null
+++ b/DnsServerTrayIcon/Properties/Resources.resx
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ A&bout...
+
+
+ If you quit Technitium DNS Server Tray Icon, Technitium DNS Server will continue to run in the background, are you sure you want to quit?
+
+
+ D&ashboard...
+
+
+
+
+
+ E&xit
+
+
+ Quit Technitium DNS Server Tray Icon?
+
+
+ Service
+
+
+ Technitium DNS Server
+
+
+ Restart
+
+
+ Start
+
+
+ Stop
+
+
\ No newline at end of file
diff --git a/DnsServerTrayIcon/Properties/Settings.Designer.cs b/DnsServerTrayIcon/Properties/Settings.Designer.cs
new file mode 100644
index 00000000..6940fec6
--- /dev/null
+++ b/DnsServerTrayIcon/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace DnsServerTrayIcon.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/DnsServerTrayIcon/Properties/Settings.settings b/DnsServerTrayIcon/Properties/Settings.settings
new file mode 100644
index 00000000..39645652
--- /dev/null
+++ b/DnsServerTrayIcon/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/DnsServerTrayIcon/WindowsServiceController.cs b/DnsServerTrayIcon/WindowsServiceController.cs
new file mode 100644
index 00000000..5e048b73
--- /dev/null
+++ b/DnsServerTrayIcon/WindowsServiceController.cs
@@ -0,0 +1,72 @@
+using System.Linq;
+using System.ServiceProcess;
+
+namespace DnsServerTrayIcon
+{
+ public class WindowsServiceController
+ {
+ private readonly string _serviceName;
+
+ public WindowsServiceController(string serviceName)
+ {
+ _serviceName = serviceName;
+ }
+
+ public void Restart()
+ {
+ Stop();
+ Start();
+ }
+
+ public void Stop()
+ {
+ try
+ {
+ using (var service = new ServiceController(_serviceName))
+ {
+ service.Stop();
+ service.WaitForStatus(ServiceControllerStatus.Stopped);
+ }
+ }
+ catch
+ { }
+ }
+
+ public void Start()
+ {
+ try
+ {
+ using (var service = new ServiceController(_serviceName))
+ {
+ service.Start();
+ service.WaitForStatus(ServiceControllerStatus.Running);
+ }
+ }
+ catch
+ { }
+ }
+
+ public bool IsRunning => Status == ServiceControllerStatus.Running;
+
+ public bool IsStopped => Status == ServiceControllerStatus.Stopped;
+
+ public ServiceControllerStatus Status
+ {
+ get
+ {
+ using (var service = new ServiceController(_serviceName))
+ {
+ return service.Status;
+ }
+ }
+ }
+
+ public bool IsInstalled
+ {
+ get
+ {
+ return ServiceController.GetServices().Any(s => s.ServiceName == _serviceName);
+ }
+ }
+ }
+}