From f839f24965c763c878aff363defb6ba285f7be2b Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Fri, 18 Dec 2020 15:31:41 +0100 Subject: [PATCH] Updated to version 3.9.0.0 --- .../CapsLockIndicatorV3.csproj | 18 +- CapsLockIndicatorV3/ExtensionMethods.cs | 24 + .../IndSettingsWindow.Designer.cs | 31 +- CapsLockIndicatorV3/IndSettingsWindow.cs | 70 +- CapsLockIndicatorV3/IndicatorOverlay.cs | 8 +- CapsLockIndicatorV3/MainForm.Designer.cs | 68 +- CapsLockIndicatorV3/MainForm.cs | 183 ++-- CapsLockIndicatorV3/MainForm.resx | 3 - CapsLockIndicatorV3/Native.cs | 128 +++ CapsLockIndicatorV3/Program.cs | 25 +- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/Settings.Designer.cs | 334 ------- .../Properties/Settings.settings | 78 -- .../Resources/defaultSettings.txt | 25 + CapsLockIndicatorV3/SettingsManager.cs | 175 ++++ CapsLockIndicatorV3/app.config | 24 +- CapsLockIndicatorV3/resources.Designer.cs | 72 +- CapsLockIndicatorV3/resources.resx | 287 +++--- CapsLockIndicatorV3/strings.Designer.cs | 873 +++++++++--------- CapsLockIndicatorV3/strings.de.resx | 487 +++++----- CapsLockIndicatorV3/strings.resx | 570 ++++++------ 21 files changed, 1762 insertions(+), 1725 deletions(-) create mode 100644 CapsLockIndicatorV3/ExtensionMethods.cs create mode 100644 CapsLockIndicatorV3/Native.cs delete mode 100644 CapsLockIndicatorV3/Properties/Settings.Designer.cs delete mode 100644 CapsLockIndicatorV3/Properties/Settings.settings create mode 100644 CapsLockIndicatorV3/Resources/defaultSettings.txt create mode 100644 CapsLockIndicatorV3/SettingsManager.cs diff --git a/CapsLockIndicatorV3/CapsLockIndicatorV3.csproj b/CapsLockIndicatorV3/CapsLockIndicatorV3.csproj index bde82bf..72b3f46 100644 --- a/CapsLockIndicatorV3/CapsLockIndicatorV3.csproj +++ b/CapsLockIndicatorV3/CapsLockIndicatorV3.csproj @@ -1,5 +1,5 @@  - + {D73D960D-7FF8-4F22-A19F-C555AAB7DD52} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -8,7 +8,7 @@ WinExe CapsLockIndicatorV3 CapsLockIndicatorV3 - v4.5 + v4.7.1 Properties @@ -55,6 +55,7 @@ 4.0 + 3.5 @@ -80,6 +81,7 @@ DownloadDialog.cs + Form @@ -112,6 +114,7 @@ MainForm.cs + Form @@ -121,17 +124,13 @@ - - True - True - Settings.settings - True True resources.resx + True True @@ -153,10 +152,6 @@ Designer - - SettingsSingleFileGenerator - Settings.Designer.cs - @@ -198,6 +193,7 @@ + diff --git a/CapsLockIndicatorV3/ExtensionMethods.cs b/CapsLockIndicatorV3/ExtensionMethods.cs new file mode 100644 index 0000000..e416bdf --- /dev/null +++ b/CapsLockIndicatorV3/ExtensionMethods.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapsLockIndicatorV3 +{ + public static class ExtensionMethods + { + public static void Deconstruct(this IEnumerable list, out T first, out T second) + { + first = list.Count() > 0 ? list.ElementAt(0) : default(T); + second = list.Count() > 1 ? list.ElementAt(1) : default(T); + } + + public static void Deconstruct(this U list, out T first, out T second, out U rest) where U : IEnumerable + { + first = list.Count() > 0 ? list.ElementAt(0) : default(T); + second = list.Count() > 1 ? list.ElementAt(1) : default(T); + rest = (U)list.Skip(2); + } + } +} diff --git a/CapsLockIndicatorV3/IndSettingsWindow.Designer.cs b/CapsLockIndicatorV3/IndSettingsWindow.Designer.cs index c345fcf..bd880cf 100644 --- a/CapsLockIndicatorV3/IndSettingsWindow.Designer.cs +++ b/CapsLockIndicatorV3/IndSettingsWindow.Designer.cs @@ -30,6 +30,7 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(IndSettingsWindow)); this.displayTimeGroup = new System.Windows.Forms.GroupBox(); + this.onlyShowWhenActiveCheckBox = new System.Windows.Forms.CheckBox(); this.displayTimeLabel = new System.Windows.Forms.Label(); this.displayTimeSlider = new System.Windows.Forms.TrackBar(); this.saveButton = new System.Windows.Forms.Button(); @@ -82,22 +83,35 @@ private void InitializeComponent() // // displayTimeGroup // + this.displayTimeGroup.Controls.Add(this.onlyShowWhenActiveCheckBox); this.displayTimeGroup.Controls.Add(this.displayTimeLabel); this.displayTimeGroup.Controls.Add(this.displayTimeSlider); this.displayTimeGroup.Location = new System.Drawing.Point(12, 12); this.displayTimeGroup.Name = "displayTimeGroup"; - this.displayTimeGroup.Size = new System.Drawing.Size(244, 70); + this.displayTimeGroup.Size = new System.Drawing.Size(244, 95); this.displayTimeGroup.TabIndex = 0; this.displayTimeGroup.TabStop = false; this.displayTimeGroup.Text = "Display time"; // + // onlyShowWhenActiveCheckBox + // + this.onlyShowWhenActiveCheckBox.AutoSize = true; + this.onlyShowWhenActiveCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.onlyShowWhenActiveCheckBox.Location = new System.Drawing.Point(6, 70); + this.onlyShowWhenActiveCheckBox.Name = "onlyShowWhenActiveCheckBox"; + this.onlyShowWhenActiveCheckBox.Size = new System.Drawing.Size(195, 20); + this.onlyShowWhenActiveCheckBox.TabIndex = 2; + this.onlyShowWhenActiveCheckBox.Text = "Only show overlay when active"; + this.onlyShowWhenActiveCheckBox.UseVisualStyleBackColor = true; + this.onlyShowWhenActiveCheckBox.CheckedChanged += new System.EventHandler(this.onlyShowWhenActiveCheckBox_CheckedChanged); + // // displayTimeLabel // this.displayTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.displayTimeLabel.Location = new System.Drawing.Point(159, 35); this.displayTimeLabel.Name = "displayTimeLabel"; - this.displayTimeLabel.Size = new System.Drawing.Size(76, 15); + this.displayTimeLabel.Size = new System.Drawing.Size(76, 40); this.displayTimeLabel.TabIndex = 1; this.displayTimeLabel.Text = "500 ms"; this.displayTimeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; @@ -122,7 +136,7 @@ private void InitializeComponent() this.saveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.saveButton.AutoSize = true; this.saveButton.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.saveButton.Location = new System.Drawing.Point(374, 316); + this.saveButton.Location = new System.Drawing.Point(374, 344); this.saveButton.Name = "saveButton"; this.saveButton.Size = new System.Drawing.Size(132, 24); this.saveButton.TabIndex = 10; @@ -280,7 +294,7 @@ private void InitializeComponent() // fontGroupBox // this.fontGroupBox.Controls.Add(this.fontButton); - this.fontGroupBox.Location = new System.Drawing.Point(12, 88); + this.fontGroupBox.Location = new System.Drawing.Point(12, 113); this.fontGroupBox.Name = "fontGroupBox"; this.fontGroupBox.Size = new System.Drawing.Size(244, 70); this.fontGroupBox.TabIndex = 2; @@ -311,7 +325,7 @@ private void InitializeComponent() // positionGroup // this.positionGroup.Controls.Add(this.positionButtonLayout); - this.positionGroup.Location = new System.Drawing.Point(12, 164); + this.positionGroup.Location = new System.Drawing.Point(12, 189); this.positionGroup.Name = "positionGroup"; this.positionGroup.Size = new System.Drawing.Size(244, 100); this.positionGroup.TabIndex = 11; @@ -464,7 +478,7 @@ private void InitializeComponent() // this.opacityGroup.Controls.Add(this.opacityLabel); this.opacityGroup.Controls.Add(this.opacitySlider); - this.opacityGroup.Location = new System.Drawing.Point(12, 270); + this.opacityGroup.Location = new System.Drawing.Point(12, 298); this.opacityGroup.Name = "opacityGroup"; this.opacityGroup.Size = new System.Drawing.Size(244, 70); this.opacityGroup.TabIndex = 2; @@ -503,7 +517,7 @@ private void InitializeComponent() this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(518, 352); + this.ClientSize = new System.Drawing.Size(518, 380); this.Controls.Add(this.opacityGroup); this.Controls.Add(this.positionGroup); this.Controls.Add(this.fontGroupBox); @@ -576,6 +590,7 @@ private void InitializeComponent() private System.Windows.Forms.RadioButton positionTopLeft; private System.Windows.Forms.GroupBox opacityGroup; private System.Windows.Forms.Label opacityLabel; - private System.Windows.Forms.TrackBar opacitySlider; + private System.Windows.Forms.TrackBar opacitySlider; + private System.Windows.Forms.CheckBox onlyShowWhenActiveCheckBox; } } diff --git a/CapsLockIndicatorV3/IndSettingsWindow.cs b/CapsLockIndicatorV3/IndSettingsWindow.cs index 8e5e883..b469b9e 100644 --- a/CapsLockIndicatorV3/IndSettingsWindow.cs +++ b/CapsLockIndicatorV3/IndSettingsWindow.cs @@ -13,24 +13,26 @@ public IndSettingsWindow() MaximumSize = new Size(int.MaxValue, Screen.FromControl(this).WorkingArea.Height); AutoScroll = true; - displayTimeSlider.Value = Properties.Settings.Default.indDisplayTime > 0 ? Properties.Settings.Default.indDisplayTime : 2001; + displayTimeSlider.Value = SettingsManager.Get("indDisplayTime") > 0 ? SettingsManager.Get("indDisplayTime") : 2001; displayTimeLabel.Text = displayTimeSlider.Value < 2001 ? string.Format("{0} ms", displayTimeSlider.Value) : strings.permanentIndicator; - opacitySlider.Value = Properties.Settings.Default.indOpacity; + opacitySlider.Value = SettingsManager.Get("indOpacity"); opacityLabel.Text = string.Format("{0} %", opacitySlider.Value); - backgroundColourActivatedPreview.BackColor = Properties.Settings.Default.indBgColourActive; - backgroundColourDeactivatedPreview.BackColor = Properties.Settings.Default.indBgColourInactive; + backgroundColourActivatedPreview.BackColor = SettingsManager.Get("indBgColourActive"); + backgroundColourDeactivatedPreview.BackColor = SettingsManager.Get("indBgColourInactive"); - foregroundColourActivatedPreview.BackColor = Properties.Settings.Default.indFgColourActive; - foregroundColourDeactivatedPreview.BackColor = Properties.Settings.Default.indFgColourInactive; + foregroundColourActivatedPreview.BackColor = SettingsManager.Get("indFgColourActive"); + foregroundColourDeactivatedPreview.BackColor = SettingsManager.Get("indFgColourInactive"); - borderColourActivatedPreview.BackColor = Properties.Settings.Default.indBdColourActive; - borderColourDeactivatedPreview.BackColor = Properties.Settings.Default.indBdColourInactive; + borderColourActivatedPreview.BackColor = SettingsManager.Get("indBdColourActive"); + borderColourDeactivatedPreview.BackColor = SettingsManager.Get("indBdColourInactive"); - fontButton.Font = Properties.Settings.Default.indFont; + fontButton.Font = SettingsManager.GetOrDefault("indFont"); - switch (Properties.Settings.Default.overlayPosition) + onlyShowWhenActiveCheckBox.Checked = SettingsManager.Get("alwaysShowWhenActive"); + + switch (SettingsManager.Get("overlayPosition")) { case IndicatorDisplayPosition.TopLeft: positionTopLeft.Checked = true; @@ -77,18 +79,19 @@ public IndSettingsWindow() foregroundColourActivatedButton.Text = strings.foregroundColourActivatedButton; foregroundColourDeactivatedButton.Text = strings.foregroundColourDeactivatedButton; positionGroup.Text = strings.overlayPositionGroup; + onlyShowWhenActiveCheckBox.Text = strings.showOverlayOnlyWhenActive; } private void displayTimeSlider_Scroll(object sender, EventArgs e) { - Properties.Settings.Default.indDisplayTime = displayTimeSlider.Value < 2001 ? displayTimeSlider.Value : -1; + SettingsManager.Set("indDisplayTime", displayTimeSlider.Value < 2001 ? displayTimeSlider.Value : -1); displayTimeLabel.Text = displayTimeSlider.Value < 2001 ? string.Format("{0} ms", displayTimeSlider.Value) : strings.permanentIndicator; } private void button1_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; - Properties.Settings.Default.Save(); + SettingsManager.Save(); Close(); } @@ -100,77 +103,77 @@ private void displayTimeLabel_Click(object sender, EventArgs e) if (numberInputDialog.ShowDialog() == DialogResult.OK) { displayTimeSlider.Value = numberInputDialog.Value; - Properties.Settings.Default.indDisplayTime = numberInputDialog.Value; + SettingsManager.Set("indDisplayTime", numberInputDialog.Value); displayTimeLabel.Text = string.Format("{0} ms", displayTimeSlider.Value); } } private void backgroundColourActivatedButton_Click(object sender, EventArgs e) { - mainColourPicker.Color = Properties.Settings.Default.indBgColourActive; + mainColourPicker.Color = SettingsManager.Get("indBgColourActive"); if (mainColourPicker.ShowDialog() == DialogResult.OK) { - Properties.Settings.Default.indBgColourActive = mainColourPicker.Color; + SettingsManager.Set("indBgColourActive", mainColourPicker.Color); } backgroundColourActivatedPreview.BackColor = mainColourPicker.Color; } private void backgroundColourDeactivatedButton_Click(object sender, EventArgs e) { - mainColourPicker.Color = Properties.Settings.Default.indBgColourInactive; + mainColourPicker.Color = SettingsManager.Get("indBgColourInactive"); if (mainColourPicker.ShowDialog() == DialogResult.OK) { - Properties.Settings.Default.indBgColourInactive = mainColourPicker.Color; + SettingsManager.Set("indBgColourInactive", mainColourPicker.Color); } backgroundColourDeactivatedPreview.BackColor = mainColourPicker.Color; } private void foregroundColourActivatedButton_Click(object sender, EventArgs e) { - mainColourPicker.Color = Properties.Settings.Default.indFgColourActive; + mainColourPicker.Color = SettingsManager.Get("indFgColourActive"); if (mainColourPicker.ShowDialog() == DialogResult.OK) { - Properties.Settings.Default.indFgColourActive = mainColourPicker.Color; + SettingsManager.Set("indFgColourActive", mainColourPicker.Color); } foregroundColourActivatedPreview.BackColor = mainColourPicker.Color; } private void foregroundColourDeactivatedButton_Click(object sender, EventArgs e) { - mainColourPicker.Color = Properties.Settings.Default.indFgColourInactive; + mainColourPicker.Color = SettingsManager.Get("indFgColourInactive"); if (mainColourPicker.ShowDialog() == DialogResult.OK) { - Properties.Settings.Default.indFgColourInactive = mainColourPicker.Color; + SettingsManager.Set("indFgColourInactive", mainColourPicker.Color); } foregroundColourDeactivatedPreview.BackColor = mainColourPicker.Color; } private void borderColourActivatedButton_Click(object sender, EventArgs e) { - mainColourPicker.Color = Properties.Settings.Default.indBdColourActive; + mainColourPicker.Color = SettingsManager.Get("indBdColourActive"); if (mainColourPicker.ShowDialog() == DialogResult.OK) { - Properties.Settings.Default.indBdColourActive = mainColourPicker.Color; + SettingsManager.Set("indBdColourActive", mainColourPicker.Color); } borderColourActivatedPreview.BackColor = mainColourPicker.Color; } private void borderColourDeactivatedButton_Click(object sender, EventArgs e) { - mainColourPicker.Color = Properties.Settings.Default.indBdColourInactive; + mainColourPicker.Color = SettingsManager.Get("indBdColourInactive"); if (mainColourPicker.ShowDialog() == DialogResult.OK) { - Properties.Settings.Default.indBdColourInactive = mainColourPicker.Color; + SettingsManager.Set("indBdColourInactive", mainColourPicker.Color); } borderColourDeactivatedPreview.BackColor = mainColourPicker.Color; } private void fontButton_Click(object sender, EventArgs e) { - indFontChooser.Font = Properties.Settings.Default.indFont; + indFontChooser.Font = SettingsManager.GetOrDefault("indFont"); if (indFontChooser.ShowDialog() == DialogResult.OK) { - Properties.Settings.Default.indFont = indFontChooser.Font; + SettingsManager.Set("indFont", indFontChooser.Font); fontButton.Font = indFontChooser.Font; } } @@ -185,7 +188,7 @@ private void positionButton_CheckedChanged(object sender, EventArgs e) RadioButton _sender = sender as RadioButton; string posName = _sender.Name.Substring(8); Enum.TryParse(posName, out IndicatorDisplayPosition position); - Properties.Settings.Default.overlayPosition = position; + SettingsManager.Set("overlayPosition", position); } private void opacityLabel_Click(object sender, EventArgs e) @@ -194,15 +197,20 @@ private void opacityLabel_Click(object sender, EventArgs e) if (numberInputDialog.ShowDialog() == DialogResult.OK) { opacitySlider.Value = numberInputDialog.Value; - Properties.Settings.Default.indOpacity = numberInputDialog.Value; + SettingsManager.Set("indOpacity", numberInputDialog.Value); opacityLabel.Text = string.Format("{0} %", opacitySlider.Value); } } private void opacitySlider_Scroll(object sender, EventArgs e) { - Properties.Settings.Default.indOpacity = opacitySlider.Value; + SettingsManager.Set("indOpacity", opacitySlider.Value); opacityLabel.Text = string.Format("{0} %", opacitySlider.Value); - } + } + + private void onlyShowWhenActiveCheckBox_CheckedChanged(object sender, EventArgs e) + { + SettingsManager.Set("alwaysShowWhenActive", onlyShowWhenActiveCheckBox.Checked); + } } } diff --git a/CapsLockIndicatorV3/IndicatorOverlay.cs b/CapsLockIndicatorV3/IndicatorOverlay.cs index d0eb286..10b93f3 100644 --- a/CapsLockIndicatorV3/IndicatorOverlay.cs +++ b/CapsLockIndicatorV3/IndicatorOverlay.cs @@ -193,7 +193,7 @@ public IndicatorOverlay(string content, int timeoutInMs, IndicatorDisplayPositio ClickThroughWindow(); } - public IndicatorOverlay(string content, int timeoutInMs, Color bgColour, Color fgColour, Color bdColour, Font font, IndicatorDisplayPosition position, int indOpacity) + public IndicatorOverlay(string content, int timeoutInMs, Color bgColour, Color fgColour, Color bdColour, Font font, IndicatorDisplayPosition position, int indOpacity, bool alwaysShow) { pos = position; InitializeComponent(); @@ -206,7 +206,7 @@ public IndicatorOverlay(string content, int timeoutInMs, Color bgColour, Color f var op = indOpacity / 100d; lastOpacity = op; SetOpacity(op); - if (timeoutInMs < 0) + if (timeoutInMs < 0 || alwaysShow) { windowCloseTimer.Enabled = false; fadeTimer.Enabled = false; @@ -263,7 +263,7 @@ public void UpdateIndicator(string content, int timeoutInMs, IndicatorDisplayPos UpdatePosition(); } - public void UpdateIndicator(string content, int timeoutInMs, Color bgColour, Color fgColour, Color bdColour, Font font, IndicatorDisplayPosition position, int indOpacity) + public void UpdateIndicator(string content, int timeoutInMs, Color bgColour, Color fgColour, Color bdColour, Font font, IndicatorDisplayPosition position, int indOpacity, bool alwaysShow) { pos = position; var op = indOpacity / 100d; @@ -272,7 +272,7 @@ public void UpdateIndicator(string content, int timeoutInMs, Color bgColour, Col contentLabel.Text = content; Font = font; opacity_timer_value = 2.0; - if (timeoutInMs < 0) + if (timeoutInMs < 0 || alwaysShow) { windowCloseTimer.Enabled = false; fadeTimer.Enabled = false; diff --git a/CapsLockIndicatorV3/MainForm.Designer.cs b/CapsLockIndicatorV3/MainForm.Designer.cs index c8827f3..174022b 100644 --- a/CapsLockIndicatorV3/MainForm.Designer.cs +++ b/CapsLockIndicatorV3/MainForm.Designer.cs @@ -77,6 +77,8 @@ private void InitializeComponent() this.showNoIcons = new System.Windows.Forms.CheckBox(); this.showNoNotification = new System.Windows.Forms.CheckBox(); this.aboutPanel = new System.Windows.Forms.Panel(); + this.appNameLabel = new CapsLockIndicatorV3.LnkLabel(); + this.logo = new CapsLockIndicatorV3.LnkLabel(); this.aboutPanelTopBorder = new System.Windows.Forms.PictureBox(); this.aboutText = new System.Windows.Forms.Label(); this.hideWindow = new System.Windows.Forms.Button(); @@ -90,8 +92,6 @@ private void InitializeComponent() this.mainToolTip = new System.Windows.Forms.ToolTip(this.components); this.checkForUpdatedCheckBox = new System.Windows.Forms.CheckBox(); this.localeComboBox = new CapsLockIndicatorV3.LnComboBox(); - this.appNameLabel = new CapsLockIndicatorV3.LnkLabel(); - this.logo = new CapsLockIndicatorV3.LnkLabel(); this.generalIconContextMenuStrip.SuspendLayout(); this.iconsGroup.SuspendLayout(); this.indicatorGroup.SuspendLayout(); @@ -298,6 +298,34 @@ private void InitializeComponent() this.aboutPanel.Size = new System.Drawing.Size(306, 66); this.aboutPanel.TabIndex = 4; // + // appNameLabel + // + this.appNameLabel.ActiveLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(52)))), ((int)(((byte)(77)))), ((int)(((byte)(180))))); + this.appNameLabel.AutoSize = true; + this.appNameLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold); + this.appNameLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline; + this.appNameLabel.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(52)))), ((int)(((byte)(77)))), ((int)(((byte)(180))))); + this.appNameLabel.Location = new System.Drawing.Point(63, 10); + this.appNameLabel.Name = "appNameLabel"; + this.appNameLabel.Size = new System.Drawing.Size(111, 15); + this.appNameLabel.TabIndex = 5; + this.appNameLabel.TabStop = true; + this.appNameLabel.Text = "CapsLock Indicator"; + this.mainToolTip.SetToolTip(this.appNameLabel, "Visit CapsLock Indicator website"); + this.appNameLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.appNameLabel_LinkClicked); + // + // logo + // + this.logo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.logo.Image = ((System.Drawing.Image)(resources.GetObject("logo.Image"))); + this.logo.Location = new System.Drawing.Point(9, 10); + this.logo.Name = "logo"; + this.logo.Size = new System.Drawing.Size(48, 48); + this.logo.TabIndex = 4; + this.logo.Click += new System.EventHandler(this.lnkLabel1_Click); + // // aboutPanelTopBorder // this.aboutPanelTopBorder.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(52)))), ((int)(((byte)(77)))), ((int)(((byte)(180))))); @@ -325,7 +353,7 @@ private void InitializeComponent() this.hideWindow.FlatStyle = System.Windows.Forms.FlatStyle.System; this.hideWindow.Location = new System.Drawing.Point(58, 199); this.hideWindow.Name = "hideWindow"; - this.hideWindow.Size = new System.Drawing.Size(94, 24); + this.hideWindow.Size = new System.Drawing.Size(94, 25); this.hideWindow.TabIndex = 5; this.hideWindow.Text = "&Hide window"; this.hideWindow.UseVisualStyleBackColor = true; @@ -337,7 +365,7 @@ private void InitializeComponent() this.exitApplication.FlatStyle = System.Windows.Forms.FlatStyle.System; this.exitApplication.Location = new System.Drawing.Point(159, 199); this.exitApplication.Name = "exitApplication"; - this.exitApplication.Size = new System.Drawing.Size(102, 24); + this.exitApplication.Size = new System.Drawing.Size(102, 25); this.exitApplication.TabIndex = 6; this.exitApplication.Text = "&Exit application"; this.exitApplication.UseVisualStyleBackColor = true; @@ -359,7 +387,7 @@ private void InitializeComponent() this.indSettings.FlatStyle = System.Windows.Forms.FlatStyle.System; this.indSettings.Location = new System.Drawing.Point(58, 229); this.indSettings.Name = "indSettings"; - this.indSettings.Size = new System.Drawing.Size(202, 24); + this.indSettings.Size = new System.Drawing.Size(202, 25); this.indSettings.TabIndex = 7; this.indSettings.Text = "&Notification settings"; this.indSettings.UseVisualStyleBackColor = true; @@ -371,7 +399,7 @@ private void InitializeComponent() this.checkForUpdatesButton.FlatStyle = System.Windows.Forms.FlatStyle.System; this.checkForUpdatesButton.Location = new System.Drawing.Point(79, 259); this.checkForUpdatesButton.Name = "checkForUpdatesButton"; - this.checkForUpdatesButton.Size = new System.Drawing.Size(181, 24); + this.checkForUpdatesButton.Size = new System.Drawing.Size(181, 25); this.checkForUpdatesButton.TabIndex = 9; this.checkForUpdatesButton.Text = "Check for &updates"; this.checkForUpdatesButton.UseVisualStyleBackColor = true; @@ -429,34 +457,6 @@ private void InitializeComponent() this.localeComboBox.SelectedIndexChanged += new System.EventHandler(this.localeComboBox_SelectedIndexChanged); this.localeComboBox.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.localeComboBox_Format); // - // appNameLabel - // - this.appNameLabel.ActiveLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(52)))), ((int)(((byte)(77)))), ((int)(((byte)(180))))); - this.appNameLabel.AutoSize = true; - this.appNameLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold); - this.appNameLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline; - this.appNameLabel.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(52)))), ((int)(((byte)(77)))), ((int)(((byte)(180))))); - this.appNameLabel.Location = new System.Drawing.Point(63, 10); - this.appNameLabel.Name = "appNameLabel"; - this.appNameLabel.Size = new System.Drawing.Size(111, 15); - this.appNameLabel.TabIndex = 5; - this.appNameLabel.TabStop = true; - this.appNameLabel.Text = "CapsLock Indicator"; - this.mainToolTip.SetToolTip(this.appNameLabel, "Visit CapsLock Indicator website"); - this.appNameLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.appNameLabel_LinkClicked); - // - // logo - // - this.logo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.logo.Image = ((System.Drawing.Image)(resources.GetObject("logo.Image"))); - this.logo.Location = new System.Drawing.Point(9, 10); - this.logo.Name = "logo"; - this.logo.Size = new System.Drawing.Size(48, 48); - this.logo.TabIndex = 4; - this.logo.Click += new System.EventHandler(this.lnkLabel1_Click); - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); diff --git a/CapsLockIndicatorV3/MainForm.cs b/CapsLockIndicatorV3/MainForm.cs index ea83e82..180158b 100644 --- a/CapsLockIndicatorV3/MainForm.cs +++ b/CapsLockIndicatorV3/MainForm.cs @@ -54,16 +54,6 @@ public MainForm() Assembly assembly = Assembly.GetExecutingAssembly(); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); string version = fvi.FileVersion; - if (Properties.Settings.Default.upgradeRequired) - { - Properties.Settings.Default.Upgrade(); - Properties.Settings.Default.upgradeRequired = false; - Properties.Settings.Default.Save(); - } - - - Properties.Settings.Default.beta_enableDarkMode = Properties.Settings.Default.beta_enableDarkMode; - Properties.Settings.Default.Save(); // Initialize component InitializeComponent(); @@ -83,52 +73,84 @@ public MainForm() scrollState = KeyHelper.isScrolllockActive; // Load settings - enableNumIcon.Checked = Properties.Settings.Default.numIco; - enableCapsIcon.Checked = Properties.Settings.Default.capsIco; - enableScrollIcon.Checked = Properties.Settings.Default.scrollIco; + enableNumIcon.Checked = SettingsManager.Get("numIco"); + enableCapsIcon.Checked = SettingsManager.Get("capsIco"); + enableScrollIcon.Checked = SettingsManager.Get("scrollIco"); - enableNumInd.Checked = Properties.Settings.Default.numInd; - enableCapsInd.Checked = Properties.Settings.Default.capsInd; - enableScrollInd.Checked = Properties.Settings.Default.scrollInd; + enableNumInd.Checked = SettingsManager.Get("numInd"); + enableCapsInd.Checked = SettingsManager.Get("capsInd"); + enableScrollInd.Checked = SettingsManager.Get("scrollInd"); - showNoIcons.Checked = Properties.Settings.Default.noIco; - showNoNotification.Checked = Properties.Settings.Default.noInd; + showNoIcons.Checked = SettingsManager.Get("noIco"); + showNoNotification.Checked = SettingsManager.Get("noInd"); iconsGroup.Enabled = !showNoIcons.Checked; - indicatorGroup.Enabled = !showNoNotification.Checked; - - if (Properties.Settings.Default.beta_enableDarkMode) + indicatorGroup.Enabled = !showNoNotification.Checked; + + if (SettingsManager.Get("beta_enableDarkMode")) { - const int value = 0x00000042; - BackColor = Color.FromArgb(0x000000FF, value, value, value); + HandleCreated += MainForm_HandleCreated; + + iconsGroup.ForeColor = + indicatorGroup.ForeColor = + enableNumInd.ForeColor = + enableCapsInd.ForeColor = + enableScrollInd.ForeColor = + enableNumIcon.ForeColor = + enableCapsIcon.ForeColor = + enableScrollIcon.ForeColor = + Color.White; + + BackColor = Color.FromArgb(255, 32, 32, 32); ForeColor = Color.White; - iconsGroup.ForeColor = Color.White; - indicatorGroup.ForeColor = Color.White; + ControlScheduleSetDarkMode(checkForUpdatesButton); + ControlScheduleSetDarkMode(indSettings); + ControlScheduleSetDarkMode(exitApplication); + ControlScheduleSetDarkMode(hideWindow); + ControlScheduleSetDarkMode(enableNumInd); + ControlScheduleSetDarkMode(enableCapsInd); + ControlScheduleSetDarkMode(enableScrollInd); + ControlScheduleSetDarkMode(enableNumIcon); + ControlScheduleSetDarkMode(enableCapsIcon); + ControlScheduleSetDarkMode(enableScrollIcon); } // Check if application is in startup startonlogonCheckBox.Checked = Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "CapsLock Indicator", null) != null; // Hides the window on startup if enabled - if (Properties.Settings.Default.hideOnStartup) + if (SettingsManager.Get("hideOnStartup")) { hideOnStartupCheckBox.Checked = true; hideWindowTimer.Start(); } - else - { - Opacity = 1; - ShowInTaskbar = true; + else + { + Opacity = 1; + ShowInTaskbar = true; } - checkForUpdatedCheckBox.Checked = Properties.Settings.Default.checkForUpdates; + checkForUpdatedCheckBox.Checked = SettingsManager.Get("checkForUpdates"); AddCultures(); ApplyLocales(); - } - + } + + private void MainForm_HandleCreated(object sender, EventArgs e) + { + Native.UseImmersiveDarkModeColors(Handle, true); + } + + private void ControlScheduleSetDarkMode(Control control) + { + control.HandleCreated += (sender, e) => + { + Native.ControlSetDarkMode(control, true); + }; + } + private void ReloadIcons() { CapsOff = File.Exists("caps0.ico") ? Icon.ExtractAssociatedIcon("caps0.ico") : (Icon)resources.GetObject("CLIv3_Caps_Off"); @@ -165,10 +187,10 @@ private void AddCultures() } } - if (Properties.Settings.Default.selectedUICulture < 0) + if (SettingsManager.Get("selectedUICulture") < 0) localeComboBox.SelectedIndex = selectIndex; - else if (Properties.Settings.Default.selectedUICulture < localeComboBox.Items.Count) - localeComboBox.SelectedIndex = Properties.Settings.Default.selectedUICulture; + else if (SettingsManager.Get("selectedUICulture") < localeComboBox.Items.Count) + localeComboBox.SelectedIndex = SettingsManager.Get("selectedUICulture"); else localeComboBox.SelectedIndex = 0; @@ -230,7 +252,7 @@ void UpdateTimerTick(object sender, EventArgs e) else scrollLockIcon.Icon = null; - generalIcon.Visible = + generalIcon.Visible = !(enableNumIcon.Checked && !showNoIcons.Checked) && !(enableCapsIcon.Checked && !showNoIcons.Checked) && !(enableScrollIcon.Checked && !showNoIcons.Checked) @@ -255,19 +277,21 @@ void UpdateTimerTick(object sender, EventArgs e) void ShowOverlay(string message, bool isActive) { - int timeOut = Properties.Settings.Default.indDisplayTime; - if (Application.OpenForms.OfType().Any()) + int timeOut = SettingsManager.Get("indDisplayTime"); + var alwaysShow = SettingsManager.Get("alwaysShowWhenActive") && isActive; + if (Application.OpenForms.OfType().Any() && Application.OpenForms.OfType().Where(f => !f.IsDisposed).Any()) { - IndicatorOverlay indicatorOverlay = Application.OpenForms.OfType().First(); + IndicatorOverlay indicatorOverlay = Application.OpenForms.OfType().Where(f => !f.IsDisposed).First(); indicatorOverlay.UpdateIndicator( message , timeOut - , isActive ? Properties.Settings.Default.indBgColourActive : Properties.Settings.Default.indBgColourInactive - , isActive ? Properties.Settings.Default.indFgColourActive : Properties.Settings.Default.indFgColourInactive - , isActive ? Properties.Settings.Default.indBdColourActive : Properties.Settings.Default.indBdColourInactive - , Properties.Settings.Default.indFont - , Properties.Settings.Default.overlayPosition - , Properties.Settings.Default.indOpacity + , isActive ? SettingsManager.Get("indBgColourActive") : SettingsManager.Get("indBgColourInactive") + , isActive ? SettingsManager.Get("indFgColourActive") : SettingsManager.Get("indFgColourInactive") + , isActive ? SettingsManager.Get("indBdColourActive") : SettingsManager.Get("indBdColourInactive") + , SettingsManager.GetOrDefault("indFont") + , SettingsManager.Get("overlayPosition") + , SettingsManager.Get("indOpacity") + , alwaysShow ); } else @@ -275,12 +299,13 @@ void ShowOverlay(string message, bool isActive) IndicatorOverlay indicatorOverlay = new IndicatorOverlay( message , timeOut - , isActive ? Properties.Settings.Default.indBgColourActive : Properties.Settings.Default.indBgColourInactive - , isActive ? Properties.Settings.Default.indFgColourActive : Properties.Settings.Default.indFgColourInactive - , isActive ? Properties.Settings.Default.indBdColourActive : Properties.Settings.Default.indBdColourInactive - , Properties.Settings.Default.indFont - , Properties.Settings.Default.overlayPosition - , Properties.Settings.Default.indOpacity + , isActive ? SettingsManager.Get("indBgColourActive") : SettingsManager.Get("indBgColourInactive") + , isActive ? SettingsManager.Get("indFgColourActive") : SettingsManager.Get("indFgColourInactive") + , isActive ? SettingsManager.Get("indBdColourActive") : SettingsManager.Get("indBdColourInactive") + , SettingsManager.GetOrDefault("indFont") + , SettingsManager.Get("overlayPosition") + , SettingsManager.Get("indOpacity") + , alwaysShow ); indicatorOverlay.Show(); } @@ -288,14 +313,14 @@ void ShowOverlay(string message, bool isActive) void ShowNoIconsCheckedChanged(object sender, EventArgs e) { iconsGroup.Enabled = !showNoIcons.Checked; - Properties.Settings.Default.noIco = showNoIcons.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("noIco", showNoIcons.Checked); + SettingsManager.Save(); } void ShowNoNotificationCheckedChanged(object sender, EventArgs e) { indicatorGroup.Enabled = !showNoNotification.Checked; - Properties.Settings.Default.noInd = showNoNotification.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("noInd", showNoNotification.Checked); + SettingsManager.Save(); } void handleVersion(string xmlData) @@ -336,9 +361,9 @@ void handleVersion(string xmlData) .Value; Version cVersion = new Version(currentVersion); - Version lVersion = new Version(latestVersion); + Version lVersion = new Version(latestVersion); - if (lVersion > cVersion) + if (lVersion > cVersion) { UpdateDialog ud = new UpdateDialog(); ud.ShowInTaskbar = isHidden; @@ -381,7 +406,7 @@ void MainFormLoad(object sender, EventArgs e) string copyright = fvi.LegalCopyright; aboutText.Text = string.Format(resources.GetString("aboutTextFormat"), version, copyright); - if (Properties.Settings.Default.checkForUpdates) + if (SettingsManager.Get("checkForUpdates")) doVersionCheck(false); } @@ -412,44 +437,44 @@ void GeneralIconMouseDoubleClick(object sender, MouseEventArgs e) Show(); Focus(); generalIcon.Visible = false; - isHidden = false; + isHidden = false; ShowInTaskbar = true; } private void enableNumIcon_CheckedChanged(object sender, EventArgs e) { - Properties.Settings.Default.numIco = enableNumIcon.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("numIco", enableNumIcon.Checked); + SettingsManager.Save(); } private void enableCapsIcon_CheckedChanged(object sender, EventArgs e) { - Properties.Settings.Default.capsIco = enableCapsIcon.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("capsIco", enableCapsIcon.Checked); + SettingsManager.Save(); } private void enableScrollIcon_CheckedChanged(object sender, EventArgs e) { - Properties.Settings.Default.scrollIco = enableScrollIcon.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("scrollIco", enableScrollIcon.Checked); + SettingsManager.Save(); } private void enableNumInd_CheckedChanged(object sender, EventArgs e) { - Properties.Settings.Default.numInd = enableNumInd.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("numInd", enableNumInd.Checked); + SettingsManager.Save(); } private void enableCapsInd_CheckedChanged(object sender, EventArgs e) { - Properties.Settings.Default.capsInd = enableCapsInd.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("capsInd", enableCapsInd.Checked); + SettingsManager.Save(); } private void enableScrollInd_CheckedChanged(object sender, EventArgs e) { - Properties.Settings.Default.scrollInd = enableScrollInd.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("scrollInd", enableScrollInd.Checked); + SettingsManager.Save(); } private void indSettings_Click(object sender, EventArgs e) @@ -477,8 +502,8 @@ private void startonlogonCheckBox_CheckedChanged(object sender, EventArgs e) private void hideOnStartupCheckBox_CheckedChanged(object sender, EventArgs e) { - Properties.Settings.Default.hideOnStartup = hideOnStartupCheckBox.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("hideOnStartup", hideOnStartupCheckBox.Checked); + SettingsManager.Save(); } @@ -508,7 +533,7 @@ private void showToolStripMenuItem_Click(object sender, EventArgs e) Show(); Focus(); generalIcon.Visible = false; - isHidden = false; + isHidden = false; ShowInTaskbar = true; } @@ -525,8 +550,8 @@ private void appNameLabel_LinkClicked(object sender, LinkLabelLinkClickedEventAr private void checkForUpdatedCheckBox_CheckedChanged(object sender, EventArgs e) { - Properties.Settings.Default.checkForUpdates = checkForUpdatedCheckBox.Checked; - Properties.Settings.Default.Save(); + SettingsManager.Set("checkForUpdates", checkForUpdatedCheckBox.Checked); + SettingsManager.Save(); } private void localeComboBox_SelectedIndexChanged(object sender, EventArgs e) @@ -549,8 +574,8 @@ private void localeComboBox_SelectedIndexChanged(object sender, EventArgs e) previousLocaleIndex = localeComboBox.SelectedIndex; } - Properties.Settings.Default.selectedUICulture = localeComboBox.SelectedIndex; - Properties.Settings.Default.Save(); + SettingsManager.Set("selectedUICulture", localeComboBox.SelectedIndex); + SettingsManager.Save(); ApplyLocales(); } diff --git a/CapsLockIndicatorV3/MainForm.resx b/CapsLockIndicatorV3/MainForm.resx index 27f9adb..d34a5f6 100644 --- a/CapsLockIndicatorV3/MainForm.resx +++ b/CapsLockIndicatorV3/MainForm.resx @@ -184,9 +184,6 @@ 593, 17 - - 959, 17 - AAABAAUAAAAAAAEAIADHJAAAVgAAADAwAAABACAAqCUAAB0lAAAgIAAAAQAgAKgQAADFSgAAGBgAAAEA diff --git a/CapsLockIndicatorV3/Native.cs b/CapsLockIndicatorV3/Native.cs new file mode 100644 index 0000000..789d4ed --- /dev/null +++ b/CapsLockIndicatorV3/Native.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace CapsLockIndicatorV3 +{ + internal static class Native + { + [DllImport("uxtheme.dll", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)] + public static extern int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList); + + [DllImport("user32.dll")] + static extern bool SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data); + + [DllImport("uxtheme.dll", EntryPoint = "#133")] + public static extern bool AllowDarkModeForWindow(IntPtr hWnd, bool allow); + + [DllImport("uxtheme.dll", EntryPoint = "#135")] + static extern int SetPreferredAppMode(int i); + + [DllImport("dwmapi.dll")] + static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize); + + [DllImport("gdi32.dll")] + static extern int GetDeviceCaps(IntPtr hdc, int nIndex); + + const int DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19; + const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20; + const int PREFFERED_APP_MODE__ALLOW_DARK = 1; + const int PREFFERED_APP_MODE__DEFAULT = 0; + + public enum DeviceCap + { + VERTRES = 10, + DESKTOPVERTRES = 117, + + // http://pinvoke.net/default.aspx/gdi32/GetDeviceCaps.html + } + + [StructLayout(LayoutKind.Sequential)] + struct WindowCompositionAttributeData + { + public WindowCompositionAttribute Attribute; + public IntPtr Data; + public int SizeOfData; + } + + public static void ControlSetDarkMode(Control control, bool v) + { + SetWindowTheme(control.Handle, v ? "DarkMode_Explorer" : "Explorer", null); + if (control is Button) + ((Button)control).FlatStyle = FlatStyle.System; + } + + enum WindowCompositionAttribute + { + WCA_ACCENT_POLICY = 19, + WCA_USEDARKMODECOLORS = 26 + } + + internal static bool UseImmersiveDarkModeColors(IntPtr handle, bool dark) + { + var size = Marshal.SizeOf(typeof(int)); + IntPtr pBool = Marshal.AllocHGlobal(size); + Marshal.WriteInt32(pBool, 0, dark ? 1 : 0); + var data = new WindowCompositionAttributeData() + { + Attribute = WindowCompositionAttribute.WCA_USEDARKMODECOLORS, + Data = pBool, + SizeOfData = size + }; + var res = SetWindowCompositionAttribute(handle, ref data); + + Marshal.FreeHGlobal(pBool); + + return res; + } + + public static void SetPrefferDarkMode(bool dark) + { + SetPreferredAppMode(dark ? PREFFERED_APP_MODE__ALLOW_DARK : PREFFERED_APP_MODE__DEFAULT); + } + + public static bool UseImmersiveDarkMode(IntPtr handle, bool enabled) + { + if (IsWindows10OrGreater(17763)) + { + + var attribute = DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1; + if (IsWindows10OrGreater(18985)) + { + attribute = DWMWA_USE_IMMERSIVE_DARK_MODE; + } + + int useImmersiveDarkMode = enabled ? 1 : 0; + return DwmSetWindowAttribute(handle, attribute, ref useImmersiveDarkMode, sizeof(int)) == 0; + } + + return false; + } + + public static bool IsWindows10OrGreater(int build = -1) + { + return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= build; + } + + public static float GetScalingFactor() + { + float ScreenScalingFactor; + + using (var g = Graphics.FromHwnd(IntPtr.Zero)) + { + var desktop = g.GetHdc(); + var LogicalScreenHeight = GetDeviceCaps(desktop, (int)DeviceCap.VERTRES); + var PhysicalScreenHeight = GetDeviceCaps(desktop, (int)DeviceCap.DESKTOPVERTRES); + + ScreenScalingFactor = PhysicalScreenHeight / (float)LogicalScreenHeight; + } + + return ScreenScalingFactor; + } + } +} diff --git a/CapsLockIndicatorV3/Program.cs b/CapsLockIndicatorV3/Program.cs index d9105f8..312392c 100644 --- a/CapsLockIndicatorV3/Program.cs +++ b/CapsLockIndicatorV3/Program.cs @@ -37,14 +37,14 @@ static void SetDisplay(DisplayType type, int keys) switch (type) { case DisplayType.Icon: - Properties.Settings.Default.numIco = (keys & (int)KeyType.NumLock) != 0; - Properties.Settings.Default.capsIco = (keys & (int)KeyType.CapsLock) != 0; - Properties.Settings.Default.scrollIco = (keys & (int)KeyType.ScrollLock) != 0; + SettingsManager.Set("numIco" , (keys & (int)KeyType.NumLock) != 0); + SettingsManager.Set("capsIco" , (keys & (int)KeyType.CapsLock) != 0); + SettingsManager.Set("scrollIco" , (keys & (int)KeyType.ScrollLock) != 0); break; case DisplayType.Notification: - Properties.Settings.Default.numInd = (keys & (int)KeyType.NumLock) != 0; - Properties.Settings.Default.capsInd = (keys & (int)KeyType.CapsLock) != 0; - Properties.Settings.Default.scrollInd = (keys & (int)KeyType.ScrollLock) != 0; + SettingsManager.Set("numInd" , (keys & (int)KeyType.NumLock) != 0); + SettingsManager.Set("capsInd" , (keys & (int)KeyType.CapsLock) != 0); + SettingsManager.Set("scrollInd" , (keys & (int)KeyType.ScrollLock) != 0); break; default: break; @@ -52,7 +52,7 @@ static void SetDisplay(DisplayType type, int keys) } static void SetHideStartup(bool v) { - Properties.Settings.Default.hideOnStartup = v; + SettingsManager.Set("hideOnStartup", v); } static void SetStartup(bool v) { @@ -65,7 +65,7 @@ static void SetStartup(bool v) } static void SetVerCheck(bool v) { - Properties.Settings.Default.checkForUpdates = v; + SettingsManager.Set("checkForUpdates", v); } static void DisplayHelp(OptionSet p) { @@ -95,7 +95,7 @@ static void SetLocale(string l) static void SetDisplayLocation(string v) { if (Enum.TryParse(v, out IndicatorDisplayPosition position)) - Properties.Settings.Default.overlayPosition = position; + SettingsManager.Set("overlayPosition", position); } // Create a mutex to check if an instance is already running @@ -103,6 +103,9 @@ static void SetDisplayLocation(string v) [STAThread] private static void Main(string[] args) { + //__FIXME__.SettingsKey = Environment.ExpandEnvironmentVariables(@"%appdata%\Jonas Kohl\CapsLock Indicator\settings\any\user.config"); + SettingsManager.Load(); + if (mutex.WaitOne(TimeSpan.Zero, true)) // No instance is open { Application.EnableVisualStyles(); @@ -140,7 +143,7 @@ private static void Main(string[] args) return; } - Properties.Settings.Default.Save(); + SettingsManager.Save(); #endregion @@ -152,6 +155,8 @@ private static void Main(string[] args) // Release the mutex mutex.ReleaseMutex(); + + SettingsManager.Save(); } else // An instance is already open { diff --git a/CapsLockIndicatorV3/Properties/AssemblyInfo.cs b/CapsLockIndicatorV3/Properties/AssemblyInfo.cs index f1c4453..c83f693 100644 --- a/CapsLockIndicatorV3/Properties/AssemblyInfo.cs +++ b/CapsLockIndicatorV3/Properties/AssemblyInfo.cs @@ -24,6 +24,6 @@ // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("3.8.0.1")] -[assembly: AssemblyFileVersion("3.8.0.1")] +[assembly: AssemblyVersion("3.9.0.0")] +[assembly: AssemblyFileVersion("3.9.0.0")] [assembly: Guid ("6f54c357-0542-4d7d-9225-338bc3cd7834")] diff --git a/CapsLockIndicatorV3/Properties/Settings.Designer.cs b/CapsLockIndicatorV3/Properties/Settings.Designer.cs deleted file mode 100644 index 6e3a587..0000000 --- a/CapsLockIndicatorV3/Properties/Settings.Designer.cs +++ /dev/null @@ -1,334 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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 CapsLockIndicatorV3.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.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; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool numIco { - get { - return ((bool)(this["numIco"])); - } - set { - this["numIco"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool capsIco { - get { - return ((bool)(this["capsIco"])); - } - set { - this["capsIco"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool scrollIco { - get { - return ((bool)(this["scrollIco"])); - } - set { - this["scrollIco"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool numInd { - get { - return ((bool)(this["numInd"])); - } - set { - this["numInd"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool capsInd { - get { - return ((bool)(this["capsInd"])); - } - set { - this["capsInd"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool scrollInd { - get { - return ((bool)(this["scrollInd"])); - } - set { - this["scrollInd"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool noIco { - get { - return ((bool)(this["noIco"])); - } - set { - this["noIco"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool noInd { - get { - return ((bool)(this["noInd"])); - } - set { - this["noInd"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool beta_enableDarkMode { - get { - return ((bool)(this["beta_enableDarkMode"])); - } - set { - this["beta_enableDarkMode"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("500")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public int indDisplayTime { - get { - return ((int)(this["indDisplayTime"])); - } - set { - this["indDisplayTime"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("66, 66, 66")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public global::System.Drawing.Color indBgColourActive { - get { - return ((global::System.Drawing.Color)(this["indBgColourActive"])); - } - set { - this["indBgColourActive"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("White")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public global::System.Drawing.Color indFgColourActive { - get { - return ((global::System.Drawing.Color)(this["indFgColourActive"])); - } - set { - this["indFgColourActive"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("77, 180, 52")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public global::System.Drawing.Color indBdColourActive { - get { - return ((global::System.Drawing.Color)(this["indBdColourActive"])); - } - set { - this["indBdColourActive"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("3.8.0.1")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public string versionNo { - get { - return ((string)(this["versionNo"])); - } - set { - this["versionNo"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool hideOnStartup { - get { - return ((bool)(this["hideOnStartup"])); - } - set { - this["hideOnStartup"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("Segoe UI, 12pt")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public global::System.Drawing.Font indFont { - get { - return ((global::System.Drawing.Font)(this["indFont"])); - } - set { - this["indFont"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("66, 66, 66")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public global::System.Drawing.Color indBgColourInactive { - get { - return ((global::System.Drawing.Color)(this["indBgColourInactive"])); - } - set { - this["indBgColourInactive"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("White")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public global::System.Drawing.Color indFgColourInactive { - get { - return ((global::System.Drawing.Color)(this["indFgColourInactive"])); - } - set { - this["indFgColourInactive"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("180, 52, 77")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public global::System.Drawing.Color indBdColourInactive { - get { - return ((global::System.Drawing.Color)(this["indBdColourInactive"])); - } - set { - this["indBdColourInactive"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)] - public bool checkForUpdates { - get { - return ((bool)(this["checkForUpdates"])); - } - set { - this["checkForUpdates"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("-1")] - public int selectedUICulture { - get { - return ((int)(this["selectedUICulture"])); - } - set { - this["selectedUICulture"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("BottomRight")] - public global::CapsLockIndicatorV3.IndicatorDisplayPosition overlayPosition { - get { - return ((global::CapsLockIndicatorV3.IndicatorDisplayPosition)(this["overlayPosition"])); - } - set { - this["overlayPosition"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("100")] - public int indOpacity { - get { - return ((int)(this["indOpacity"])); - } - set { - this["indOpacity"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool upgradeRequired { - get { - return ((bool)(this["upgradeRequired"])); - } - set { - this["upgradeRequired"] = value; - } - } - } -} diff --git a/CapsLockIndicatorV3/Properties/Settings.settings b/CapsLockIndicatorV3/Properties/Settings.settings deleted file mode 100644 index eceee77..0000000 --- a/CapsLockIndicatorV3/Properties/Settings.settings +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - True - - - True - - - True - - - True - - - True - - - True - - - False - - - False - - - False - - - 500 - - - 66, 66, 66 - - - White - - - 77, 180, 52 - - - 3.8.0.1 - - - False - - - Segoe UI, 12pt - - - 66, 66, 66 - - - White - - - 180, 52, 77 - - - True - - - -1 - - - BottomRight - - - 100 - - - True - - - \ No newline at end of file diff --git a/CapsLockIndicatorV3/Resources/defaultSettings.txt b/CapsLockIndicatorV3/Resources/defaultSettings.txt new file mode 100644 index 0000000..41cc460 --- /dev/null +++ b/CapsLockIndicatorV3/Resources/defaultSettings.txt @@ -0,0 +1,25 @@ +b:numIco=True +b:capsIco=True +b:scrollIco=True +b:numInd=True +b:capsInd=True +b:scrollInd=True +b:noIco=False +b:noInd=False +b:beta_enableDarkMode=False +b:hideOnStartup=False +b:checkForUpdates=True +b:upgradeRequired=True +b:alwaysShowWhenActive=False +c:indBgColourActive=255;66;66;66 +c:indFgColourActive=255;255;255;255 +c:indBdColourActive=255;77;180;52 +c:indBgColourInactive=255;66;66;66 +c:indFgColourInactive=255;255;255;255 +c:indBdColourInactive=255;180;52;77 +f:indFont=Segoe UI; 12pt +i:indDisplayTime=500 +i:selectedUICulture=1 +i:indOpacity=100 +s:versionNo=3.9.0.0 +s:overlayPosition=BottomRight diff --git a/CapsLockIndicatorV3/SettingsManager.cs b/CapsLockIndicatorV3/SettingsManager.cs new file mode 100644 index 0000000..0ded781 --- /dev/null +++ b/CapsLockIndicatorV3/SettingsManager.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CapsLockIndicatorV3 +{ + public static class SettingsManager + { + public static string SettingsFilePath => Environment.ExpandEnvironmentVariables(@"%appdata%\Jonas Kohl\CapsLock Indicator\settings\any\usercfg"); + + private static Dictionary Settings; + + public static void Load() + { + LoadDefaults(); + LoadUser(); + } + + private static void LoadDefaults() + { + var lines = resources.defaultSettings.Split('\n'); + if (Settings == null) + Settings = new Dictionary(); + + foreach (var ln in lines) + { + if (ln.Length < 1) continue; + var (typeAndKey, value) = ln.Split(new char[] { '=' }, 2, StringSplitOptions.None); + var (type, key) = typeAndKey.Split(new char[] { ':' }, 2, StringSplitOptions.None); + var t = GetSettingsType(type); + + Settings[key] = (t, Cast(value, t)); + } + } + + private static void LoadUser() + { + if (!File.Exists(SettingsFilePath)) + return; + + var lines = File.ReadAllLines(SettingsFilePath); + if (Settings == null) + Settings = new Dictionary(); + + foreach (var ln in lines) + { + if (ln.Length < 1) continue; + var (typeAndKey, value) = ln.Split(new char[] { '=' }, 2, StringSplitOptions.None); + var (type, key) = typeAndKey.Split(new char[] { ':' }, 2, StringSplitOptions.None); + var t = GetSettingsType(type); + + Settings[key] = (t, Cast(value, t)); + } + } + + public static object Get(string key) + { + var d = Settings[key]; + return Convert.ChangeType(d.Item2, d.Item1); + } + + public static T Get(string key) + { + var d = Settings[key]; + if (typeof(T).IsEnum) + return (T)Enum.Parse(typeof(T), d.Item2.ToString()); + return (T)d.Item2; + } + + public static T GetOrDefault(string key) + { + return GetOrDefault(key, default(T)); + } + + public static T GetOrDefault(string key, T defaultValue) + { + if (Settings.ContainsKey(key)) + try + { + return Get(key); + } + catch + { + return defaultValue; + } + return defaultValue; + } + + public static void Save() + { + var sb = new StringBuilder(); + + foreach (var s in Settings) + sb.AppendFormat("{0}:{1}={2}\n", GetSettingsTypeIndicator(s.Value.Item1), s.Key, ConvertToString(s.Value.Item2)); + + if (!Directory.Exists(Path.GetDirectoryName(SettingsFilePath))) + Directory.CreateDirectory(Path.GetDirectoryName(SettingsFilePath)); + File.WriteAllText(SettingsFilePath, sb.ToString()); + } + + private static object Cast(string value, Type type) + { + if (type == typeof(Color)) + { + if (value.Contains(";")) + { + var parts = value.Split(';'); + var parsedParts = parts.Select(p => byte.Parse(p)).ToArray(); + if (parts.Length > 3) + return Color.FromArgb(parsedParts[0], parsedParts[1], parsedParts[2], parsedParts[3]); + else + return Color.FromArgb(255, parsedParts[0], parsedParts[1], parsedParts[2]); + } + else + return Color.FromName(value); + } + else if (type == typeof(Font)) + return new FontConverter().ConvertFromString(value); + return Convert.ChangeType(value, type); + } + + private static string ConvertToString(object value) + { + if (value.GetType() == typeof(Color)) + return string.Join(";", new byte[] { ((Color)value).A, ((Color)value).R, ((Color)value).G, ((Color)value).B }); + else if (value.GetType() == typeof(Font)) + return new FontConverter().ConvertToString((Font)value); + return value.ToString(); + } + + private static string GetSettingsTypeIndicator(Type type) + { + if (type == typeof(bool)) + return "b"; + else if (type == typeof(int)) + return "i"; + else if (type == typeof(string)) + return "s"; + else if (type == typeof(Color)) + return "c"; + else if (type == typeof(Font)) + return "f"; + else + return "o"; + } + + private static Type GetSettingsType(string type) + { + switch (type) + { + case "b": + return typeof(bool); + case "i": + return typeof(int); + case "s": + return typeof(string); + case "c": + return typeof(Color); + case "f": + return typeof(Font); + default: + return typeof(object); + } + } + + public static void Set(string key, object value) + { + Settings[key] = (value.GetType(), value); + } + } +} diff --git a/CapsLockIndicatorV3/app.config b/CapsLockIndicatorV3/app.config index 43d9faf..6ab1ee0 100644 --- a/CapsLockIndicatorV3/app.config +++ b/CapsLockIndicatorV3/app.config @@ -1,14 +1,14 @@ - - - - -
+ + + + +
- - - - - + + + + + True @@ -82,9 +82,9 @@ True - + - + diff --git a/CapsLockIndicatorV3/resources.Designer.cs b/CapsLockIndicatorV3/resources.Designer.cs index 762e240..ab62dea 100644 --- a/CapsLockIndicatorV3/resources.Designer.cs +++ b/CapsLockIndicatorV3/resources.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -13,13 +13,13 @@ namespace CapsLockIndicatorV3 { /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + // 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", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class resources { @@ -33,7 +33,7 @@ internal resources() { } /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// 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 { @@ -47,8 +47,8 @@ internal resources() { } /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// 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 { @@ -61,7 +61,7 @@ internal resources() { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Version {0} | Copyright {1} ähnelt. + /// Looks up a localized string similar to Version {0} | Copyright {1}. /// internal static string aboutTextFormat { get { @@ -70,7 +70,7 @@ internal static string aboutTextFormat { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// internal static System.Drawing.Icon CLIv3_Caps_Off { get { @@ -80,7 +80,7 @@ internal static System.Drawing.Icon CLIv3_Caps_Off { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// internal static System.Drawing.Icon CLIv3_Caps_On { get { @@ -90,7 +90,7 @@ internal static System.Drawing.Icon CLIv3_Caps_On { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// internal static System.Drawing.Icon CLIv3_Num_Off { get { @@ -100,7 +100,7 @@ internal static System.Drawing.Icon CLIv3_Num_Off { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// internal static System.Drawing.Icon CLIv3_Num_On { get { @@ -110,7 +110,7 @@ internal static System.Drawing.Icon CLIv3_Num_On { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// internal static System.Drawing.Icon CLIv3_Scroll_Off { get { @@ -120,7 +120,7 @@ internal static System.Drawing.Icon CLIv3_Scroll_Off { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// internal static System.Drawing.Icon CLIv3_Scroll_On { get { @@ -128,5 +128,37 @@ internal static System.Drawing.Icon CLIv3_Scroll_On { return ((System.Drawing.Icon)(obj)); } } + + /// + /// Looks up a localized string similar to b:numIco=true + ///b:capsIco=true + ///b:scrollIco=true + ///b:numInd=true + ///b:capsInd=true + ///b:scrollInd=true + ///b:noIco=false + ///b:noInd=false + ///b:beta_enableDarkMode=false + ///b:hideOnStartup=false + ///b:checkForUpdates=true + ///b:upgradeRequired=true + ///c:indBgColourActive=66,66,66 + ///c:indFgColourActive=255,255,255 + ///c:indBgColourActive=77,180,52 + ///c:indBgColourInactive=66,66,66 + ///c:indFgColourInactive=255,255,255 + ///c:indBgColourInactive=180,52,77 + ///i:indDisplayTime=500 + ///i:selectedUICulture=-1 + ///i:indOpacity=100 + ///s:versionNo=3.9.0.0 + ///s:indFont=Segoe UI; 12pt + ///s: [rest of string was truncated]";. + /// + internal static string defaultSettings { + get { + return ResourceManager.GetString("defaultSettings", resourceCulture); + } + } } } diff --git a/CapsLockIndicatorV3/resources.resx b/CapsLockIndicatorV3/resources.resx index 19e279e..422a029 100644 --- a/CapsLockIndicatorV3/resources.resx +++ b/CapsLockIndicatorV3/resources.resx @@ -1,142 +1,145 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - Version {0} | Copyright {1} - - - - Resources\CLIv3_Caps_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Resources\CLIv3_Caps_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Resources\CLIv3_Num_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Resources\CLIv3_Num_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Resources\CLIv3_Scroll_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Resources\CLIv3_Scroll_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Version {0} | Copyright {1} + + + + Resources\CLIv3_Caps_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\CLIv3_Caps_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\CLIv3_Num_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\CLIv3_Num_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\CLIv3_Scroll_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\CLIv3_Scroll_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\defaultSettings.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + \ No newline at end of file diff --git a/CapsLockIndicatorV3/strings.Designer.cs b/CapsLockIndicatorV3/strings.Designer.cs index ebc0212..b817c7b 100644 --- a/CapsLockIndicatorV3/strings.Designer.cs +++ b/CapsLockIndicatorV3/strings.Designer.cs @@ -1,432 +1,441 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace CapsLockIndicatorV3 { - using System; - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class strings { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal strings() { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [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("CapsLockIndicatorV3.strings", typeof(strings).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Background colour activated ähnelt. - /// - internal static string backgroundColourActivatedButton { - get { - return ResourceManager.GetString("backgroundColourActivatedButton", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Background colour deactivated ähnelt. - /// - internal static string backgroundColourDeactivatedButton { - get { - return ResourceManager.GetString("backgroundColourDeactivatedButton", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Border colour activated ähnelt. - /// - internal static string borderColourActivatedButton { - get { - return ResourceManager.GetString("borderColourActivatedButton", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Border colour deactivated ähnelt. - /// - internal static string borderColourDeactivatedButton { - get { - return ResourceManager.GetString("borderColourDeactivatedButton", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Caps lock ähnelt. - /// - internal static string capsLock { - get { - return ResourceManager.GetString("capsLock", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Check for &updates ähnelt. - /// - internal static string checkForUpdates { - get { - return ResourceManager.GetString("checkForUpdates", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Checking for updates... ähnelt. - /// - internal static string checkingForUpdates { - get { - return ResourceManager.GetString("checkingForUpdates", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Colours ähnelt. - /// - internal static string coloursGroup { - get { - return ResourceManager.GetString("coloursGroup", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die &Exit ähnelt. - /// - internal static string contextMenuExit { - get { - return ResourceManager.GetString("contextMenuExit", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die &Show ähnelt. - /// - internal static string contextMenuShow { - get { - return ResourceManager.GetString("contextMenuShow", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die &Dismiss ähnelt. - /// - internal static string dismissButton { - get { - return ResourceManager.GetString("dismissButton", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Display time ähnelt. - /// - internal static string displayTime { - get { - return ResourceManager.GetString("displayTime", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Download &manually ähnelt. - /// - internal static string downloadManuallyButton { - get { - return ResourceManager.GetString("downloadManuallyButton", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Download more translations... ähnelt. - /// - internal static string downloadMoreTranslations { - get { - return ResourceManager.GetString("downloadMoreTranslations", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die &Exit Application ähnelt. - /// - internal static string exitApplication { - get { - return ResourceManager.GetString("exitApplication", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Exiting the application means the icons and notifications are no longer displayed. Exit anyway? ähnelt. - /// - internal static string exitMessage { - get { - return ResourceManager.GetString("exitMessage", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Font ähnelt. - /// - internal static string fontGroup { - get { - return ResourceManager.GetString("fontGroup", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Text colour activated ähnelt. - /// - internal static string foregroundColourActivatedButton { - get { - return ResourceManager.GetString("foregroundColourActivatedButton", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Text colour deactivated ähnelt. - /// - internal static string foregroundColourDeactivatedButton { - get { - return ResourceManager.GetString("foregroundColourDeactivatedButton", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die You can show CapsLock Indicator again by double clicking on this icon. ähnelt. - /// - internal static string generalIconBalloonText { - get { - return ResourceManager.GetString("generalIconBalloonText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Hide on start up ähnelt. - /// - internal static string hideOnStartup { - get { - return ResourceManager.GetString("hideOnStartup", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die &Hide window ähnelt. - /// - internal static string hideWindow { - get { - return ResourceManager.GetString("hideWindow", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die {0} changed ähnelt. - /// - internal static string keyChanged { - get { - return ResourceManager.GetString("keyChanged", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die {0} is off ähnelt. - /// - internal static string keyIsOff { - get { - return ResourceManager.GetString("keyIsOff", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die {0} is on ähnelt. - /// - internal static string keyIsOn { - get { - return ResourceManager.GetString("keyIsOn", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die &Notification settings ähnelt. - /// - internal static string notificationSettings { - get { - return ResourceManager.GetString("notificationSettings", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Notification Settings ähnelt. - /// - internal static string notificationSettingsTitle { - get { - return ResourceManager.GetString("notificationSettingsTitle", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Num lock ähnelt. - /// - internal static string numLock { - get { - return ResourceManager.GetString("numLock", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Opacity ähnelt. - /// - internal static string opacity { - get { - return ResourceManager.GetString("opacity", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Overlay position ähnelt. - /// - internal static string overlayPositionGroup { - get { - return ResourceManager.GetString("overlayPositionGroup", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Permanently ähnelt. - /// - internal static string permanentIndicator { - get { - return ResourceManager.GetString("permanentIndicator", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die &Save && close ähnelt. - /// - internal static string saveAndCloseButton { - get { - return ResourceManager.GetString("saveAndCloseButton", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Scroll lock ähnelt. - /// - internal static string scrollLock { - get { - return ResourceManager.GetString("scrollLock", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Show icons for... ähnelt. - /// - internal static string showIconsFor { - get { - return ResourceManager.GetString("showIconsFor", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Show no icons ähnelt. - /// - internal static string showNoIcons { - get { - return ResourceManager.GetString("showNoIcons", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Show no notification ähnelt. - /// - internal static string showNoNotification { - get { - return ResourceManager.GetString("showNoNotification", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Show notification when... ähnelt. - /// - internal static string showNotificationWhen { - get { - return ResourceManager.GetString("showNotificationWhen", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Start on logon ähnelt. - /// - internal static string startOnLogon { - get { - return ResourceManager.GetString("startOnLogon", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die CapsLock Indicator Update available! ähnelt. - /// - internal static string updateAvailable { - get { - return ResourceManager.GetString("updateAvailable", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Version {0}, released {1} ähnelt. - /// - internal static string updateInfoFormat { - get { - return ResourceManager.GetString("updateInfoFormat", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die &Update now ähnelt. - /// - internal static string updateNow { - get { - return ResourceManager.GetString("updateNow", resourceCulture); - } - } - } -} +//------------------------------------------------------------------------------ +// +// 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 CapsLockIndicatorV3 { + 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", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal strings() { + } + + /// + /// 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("CapsLockIndicatorV3.strings", typeof(strings).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 Background colour activated. + /// + internal static string backgroundColourActivatedButton { + get { + return ResourceManager.GetString("backgroundColourActivatedButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Background colour deactivated. + /// + internal static string backgroundColourDeactivatedButton { + get { + return ResourceManager.GetString("backgroundColourDeactivatedButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Border colour activated. + /// + internal static string borderColourActivatedButton { + get { + return ResourceManager.GetString("borderColourActivatedButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Border colour deactivated. + /// + internal static string borderColourDeactivatedButton { + get { + return ResourceManager.GetString("borderColourDeactivatedButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Caps lock. + /// + internal static string capsLock { + get { + return ResourceManager.GetString("capsLock", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Check for &updates. + /// + internal static string checkForUpdates { + get { + return ResourceManager.GetString("checkForUpdates", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Checking for updates.... + /// + internal static string checkingForUpdates { + get { + return ResourceManager.GetString("checkingForUpdates", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Colours. + /// + internal static string coloursGroup { + get { + return ResourceManager.GetString("coloursGroup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Exit. + /// + internal static string contextMenuExit { + get { + return ResourceManager.GetString("contextMenuExit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Show. + /// + internal static string contextMenuShow { + get { + return ResourceManager.GetString("contextMenuShow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Dismiss. + /// + internal static string dismissButton { + get { + return ResourceManager.GetString("dismissButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Display time. + /// + internal static string displayTime { + get { + return ResourceManager.GetString("displayTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Download &manually. + /// + internal static string downloadManuallyButton { + get { + return ResourceManager.GetString("downloadManuallyButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Download more translations.... + /// + internal static string downloadMoreTranslations { + get { + return ResourceManager.GetString("downloadMoreTranslations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Exit Application. + /// + internal static string exitApplication { + get { + return ResourceManager.GetString("exitApplication", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exiting the application means the icons and notifications are no longer displayed. Exit anyway?. + /// + internal static string exitMessage { + get { + return ResourceManager.GetString("exitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Font. + /// + internal static string fontGroup { + get { + return ResourceManager.GetString("fontGroup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Text colour activated. + /// + internal static string foregroundColourActivatedButton { + get { + return ResourceManager.GetString("foregroundColourActivatedButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Text colour deactivated. + /// + internal static string foregroundColourDeactivatedButton { + get { + return ResourceManager.GetString("foregroundColourDeactivatedButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You can show CapsLock Indicator again by double clicking on this icon.. + /// + internal static string generalIconBalloonText { + get { + return ResourceManager.GetString("generalIconBalloonText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hide on start up. + /// + internal static string hideOnStartup { + get { + return ResourceManager.GetString("hideOnStartup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Hide window. + /// + internal static string hideWindow { + get { + return ResourceManager.GetString("hideWindow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} changed. + /// + internal static string keyChanged { + get { + return ResourceManager.GetString("keyChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is off. + /// + internal static string keyIsOff { + get { + return ResourceManager.GetString("keyIsOff", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is on. + /// + internal static string keyIsOn { + get { + return ResourceManager.GetString("keyIsOn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Notification settings. + /// + internal static string notificationSettings { + get { + return ResourceManager.GetString("notificationSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Notification Settings. + /// + internal static string notificationSettingsTitle { + get { + return ResourceManager.GetString("notificationSettingsTitle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Num lock. + /// + internal static string numLock { + get { + return ResourceManager.GetString("numLock", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Opacity. + /// + internal static string opacity { + get { + return ResourceManager.GetString("opacity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Overlay position. + /// + internal static string overlayPositionGroup { + get { + return ResourceManager.GetString("overlayPositionGroup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Permanently. + /// + internal static string permanentIndicator { + get { + return ResourceManager.GetString("permanentIndicator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Save && close. + /// + internal static string saveAndCloseButton { + get { + return ResourceManager.GetString("saveAndCloseButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scroll lock. + /// + internal static string scrollLock { + get { + return ResourceManager.GetString("scrollLock", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show icons for.... + /// + internal static string showIconsFor { + get { + return ResourceManager.GetString("showIconsFor", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show no icons. + /// + internal static string showNoIcons { + get { + return ResourceManager.GetString("showNoIcons", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show no notification. + /// + internal static string showNoNotification { + get { + return ResourceManager.GetString("showNoNotification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show notification when.... + /// + internal static string showNotificationWhen { + get { + return ResourceManager.GetString("showNotificationWhen", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Always show overlay when active. + /// + internal static string showOverlayOnlyWhenActive { + get { + return ResourceManager.GetString("showOverlayOnlyWhenActive", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start on logon. + /// + internal static string startOnLogon { + get { + return ResourceManager.GetString("startOnLogon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CapsLock Indicator Update available!. + /// + internal static string updateAvailable { + get { + return ResourceManager.GetString("updateAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Version {0}, released {1}. + /// + internal static string updateInfoFormat { + get { + return ResourceManager.GetString("updateInfoFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Update now. + /// + internal static string updateNow { + get { + return ResourceManager.GetString("updateNow", resourceCulture); + } + } + } +} diff --git a/CapsLockIndicatorV3/strings.de.resx b/CapsLockIndicatorV3/strings.de.resx index 9fe649b..9886bef 100644 --- a/CapsLockIndicatorV3/strings.de.resx +++ b/CapsLockIndicatorV3/strings.de.resx @@ -1,243 +1,246 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - Hintergrund aktiv - - - Hintergrund inaktiv - - - Rand aktiv - - - Rand inaktiv - - - Feststelltaste - - - Nach Updates suchen - - - Suche nach Updates... - - - Farben - - - &Verlassen - - - &Anzeigen - - - &Schließen - - - Anzeigedauer - - - &Manuell runterladen - - - Mehr Sprachen herunterladen... - - - V&erlassen - - - Die Anwendung zu verlassen heißt, dass die Icons und Benachrichtigungen nicht länger angezeigt weden. Trotzdem verlassen? - - - Schrift - - - Text aktiv - - - Text inaktiv - - - CapsLock Indicator kann wieder angezeigt werden, wenn Sie auf dieses Symbol doppelklicken. - - - Beim Starten verstecken - - - Verstecken - - - {0} sich ändert - - - {0} ist aus - - - {0} ist an - - - Benachr.-Einst. - - - Benachrichtiguns-Einstellungen - - - Num-Lock - - - Deckkraft - - - Benachrichtigungsposition - - - Dauerhaft - - - &Speichern && schließen - - - Rollen - - - Icons zeigen für... - - - Keine Icons zeigen - - - Keine Benachr. anzeigen - - - Zeige Benachr., wenn... - - - Autostart - - - CapsLock Indicator Update verfügbar! - - - Version {0}, erschienen {1} - - - Jetzt update&n - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Hintergrund aktiv + + + Hintergrund inaktiv + + + Rand aktiv + + + Rand inaktiv + + + Feststelltaste + + + Nach Updates suchen + + + Suche nach Updates... + + + Farben + + + &Verlassen + + + &Anzeigen + + + &Schließen + + + Anzeigedauer + + + &Manuell runterladen + + + Mehr Sprachen herunterladen... + + + V&erlassen + + + Die Anwendung zu verlassen heißt, dass die Icons und Benachrichtigungen nicht länger angezeigt weden. Trotzdem verlassen? + + + Schrift + + + Text aktiv + + + Text inaktiv + + + CapsLock Indicator kann wieder angezeigt werden, wenn Sie auf dieses Symbol doppelklicken. + + + Beim Starten verstecken + + + Verstecken + + + {0} sich ändert + + + {0} ist aus + + + {0} ist an + + + Benachr.-Einst. + + + Benachrichtiguns-Einstellungen + + + Num-Lock + + + Deckkraft + + + Benachrichtigungsposition + + + Dauerhaft + + + &Speichern && schließen + + + Rollen + + + Icons zeigen für... + + + Keine Icons zeigen + + + Keine Benachr. anzeigen + + + Zeige Benachr., wenn... + + + Benachrichtigung immer anz., wenn aktiv + + + Autostart + + + CapsLock Indicator Update verfügbar! + + + Version {0}, erschienen {1} + + + Jetzt update&n + \ No newline at end of file diff --git a/CapsLockIndicatorV3/strings.resx b/CapsLockIndicatorV3/strings.resx index 49f605e..d7f4281 100644 --- a/CapsLockIndicatorV3/strings.resx +++ b/CapsLockIndicatorV3/strings.resx @@ -1,284 +1,288 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - Background colour activated - The caption for the "Background colour activated" button. - - - Background colour deactivated - The caption for the "Background colour deactivated" button. - - - Border colour activated - The caption for the "Border colour activated" button. - - - Border colour deactivated - The caption for the "Border colour deactivated" button. - - - Caps lock - The name of the caps lock key - - - Check for &updates - The caption for the button that manually checks for updates. The character after the "&" is the hotkey that is used with the ALT key. - - - Checking for updates... - The caption for the "Check for updates" button when it's searching for updates. - - - Colours - The title for the "Colours" group box - - - &Exit - Used in the context menu of the CLI tray icon. - - - &Show - Used in the context menu of the CLI tray icon. - - - &Dismiss - The caption for the "Dismiss" button. The character after the "&" is the hotkey that is used with the ALT key. - - - Display time - The title for the "Display time" group box - - - Download &manually - The caption for the "Download manually" button. The character after the "&" is the hotkey that is used with the ALT key. - - - Download more translations... - The last dropdown item in the locale dropdown. - - - &Exit Application - The caption for the button that exits the application. The character after the "&" is the hotkey that is used with the ALT key. - - - Exiting the application means the icons and notifications are no longer displayed. Exit anyway? - The message to display on application exit - - - Font - The title for the "Font" group box - - - Text colour activated - The caption for the "Text colour activated" button. - - - Text colour deactivated - The caption for the "Text colour deactivated" button. - - - You can show CapsLock Indicator again by double clicking on this icon. - The text that is shown in the icon balloon tip when CLI is being hidden. - - - Hide on start up - Used for the hide on startup checkbox - - - &Hide window - The caption for the button that hides the window. The character after the "&" is the hotkey that is used with the ALT key. - - - {0} changed - Used for the check boxes in the "Show notification when..." group box. "{0}" will be replaced with the key name - - - {0} is off - The text to display in the notification when a key is off. "{0}" will be replaced with the key name - - - {0} is on - The text to display in the notification when a key is on. "{0}" will be replaced with the key name - - - &Notification settings - The caption for the button that opens the notification settings. The character after the "&" is the hotkey that is used with the ALT key. - - - Notification Settings - The caption of the notification settings window - - - Num lock - The name of the num lock key - - - Opacity - The title for the "Opacity" group box - - - Overlay position - The title for the "Overlay position" group box - - - Permanently - Text to display instead of the time if indicator overlay display is set to permanently. - - - &Save && close - The caption for the "Save & Close" button. The character after the "&" is the hotkey that is used with the ALT key. Use two "&" to display a "&" character - - - Scroll lock - The name of the scroll lock key - - - Show icons for... - The title for the "Show icons for..." group box - - - Show no icons - The label for the check box that enables or disables all icons - - - Show no notification - The label for the check box that enables or disables all notifications - - - Show notification when... - The title for the "Show notification when..." group box - - - Start on logon - The label for the check box that enables or disabled the auto start. - - - CapsLock Indicator Update available! - The title for the update window. - - - Version {0}, released {1} - Displayed in the "Update Available" dialog. {0} is the version, {1} is the release date and time. - - - &Update now - The caption for the "Update now" button. The character after the "&" is the hotkey that is used with the ALT key. - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Background colour activated + The caption for the "Background colour activated" button. + + + Background colour deactivated + The caption for the "Background colour deactivated" button. + + + Border colour activated + The caption for the "Border colour activated" button. + + + Border colour deactivated + The caption for the "Border colour deactivated" button. + + + Caps lock + The name of the caps lock key + + + Check for &updates + The caption for the button that manually checks for updates. The character after the "&" is the hotkey that is used with the ALT key. + + + Checking for updates... + The caption for the "Check for updates" button when it's searching for updates. + + + Colours + The title for the "Colours" group box + + + &Exit + Used in the context menu of the CLI tray icon. + + + &Show + Used in the context menu of the CLI tray icon. + + + &Dismiss + The caption for the "Dismiss" button. The character after the "&" is the hotkey that is used with the ALT key. + + + Display time + The title for the "Display time" group box + + + Download &manually + The caption for the "Download manually" button. The character after the "&" is the hotkey that is used with the ALT key. + + + Download more translations... + The last dropdown item in the locale dropdown. + + + &Exit Application + The caption for the button that exits the application. The character after the "&" is the hotkey that is used with the ALT key. + + + Exiting the application means the icons and notifications are no longer displayed. Exit anyway? + The message to display on application exit + + + Font + The title for the "Font" group box + + + Text colour activated + The caption for the "Text colour activated" button. + + + Text colour deactivated + The caption for the "Text colour deactivated" button. + + + You can show CapsLock Indicator again by double clicking on this icon. + The text that is shown in the icon balloon tip when CLI is being hidden. + + + Hide on start up + Used for the hide on startup checkbox + + + &Hide window + The caption for the button that hides the window. The character after the "&" is the hotkey that is used with the ALT key. + + + {0} changed + Used for the check boxes in the "Show notification when..." group box. "{0}" will be replaced with the key name + + + {0} is off + The text to display in the notification when a key is off. "{0}" will be replaced with the key name + + + {0} is on + The text to display in the notification when a key is on. "{0}" will be replaced with the key name + + + &Notification settings + The caption for the button that opens the notification settings. The character after the "&" is the hotkey that is used with the ALT key. + + + Notification Settings + The caption of the notification settings window + + + Num lock + The name of the num lock key + + + Opacity + The title for the "Opacity" group box + + + Overlay position + The title for the "Overlay position" group box + + + Permanently + Text to display instead of the time if indicator overlay display is set to permanently. + + + &Save && close + The caption for the "Save & Close" button. The character after the "&" is the hotkey that is used with the ALT key. Use two "&" to display a "&" character + + + Scroll lock + The name of the scroll lock key + + + Show icons for... + The title for the "Show icons for..." group box + + + Show no icons + The label for the check box that enables or disables all icons + + + Show no notification + The label for the check box that enables or disables all notifications + + + Show notification when... + The title for the "Show notification when..." group box + + + Always show overlay when active + The label for the check box that indicates whether overlay should only be shown when active + + + Start on logon + The label for the check box that enables or disabled the auto start. + + + CapsLock Indicator Update available! + The title for the update window. + + + Version {0}, released {1} + Displayed in the "Update Available" dialog. {0} is the version, {1} is the release date and time. + + + &Update now + The caption for the "Update now" button. The character after the "&" is the hotkey that is used with the ALT key. + \ No newline at end of file