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 @@ <?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> <PropertyGroup> <ProjectGuid>{D73D960D-7FF8-4F22-A19F-C555AAB7DD52}</ProjectGuid> <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> @@ -8,7 +8,7 @@ <OutputType>WinExe</OutputType> <RootNamespace>CapsLockIndicatorV3</RootNamespace> <AssemblyName>CapsLockIndicatorV3</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion> <AppDesignerFolder>Properties</AppDesignerFolder> <TargetFrameworkProfile /> </PropertyGroup> @@ -55,6 +55,7 @@ <RequiredTargetFramework>4.0</RequiredTargetFramework> </Reference> <Reference Include="System" /> + <Reference Include="System.Configuration" /> <Reference Include="System.Core"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference> @@ -80,6 +81,7 @@ <DependentUpon>DownloadDialog.cs</DependentUpon> </Compile> <Compile Include="DropDownLocale.cs" /> + <Compile Include="ExtensionMethods.cs" /> <Compile Include="HelpWindow.cs"> <SubType>Form</SubType> </Compile> @@ -112,6 +114,7 @@ <Compile Include="MainForm.Designer.cs"> <DependentUpon>MainForm.cs</DependentUpon> </Compile> + <Compile Include="Native.cs" /> <Compile Include="NumberInputDialog.cs"> <SubType>Form</SubType> </Compile> @@ -121,17 +124,13 @@ <Compile Include="Options.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Properties\Settings.Designer.cs"> - <AutoGen>True</AutoGen> - <DesignTimeSharedInput>True</DesignTimeSharedInput> - <DependentUpon>Settings.settings</DependentUpon> - </Compile> <Compile Include="resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>resources.resx</DependentUpon> </Compile> <Compile Include="Settings.cs" /> + <Compile Include="SettingsManager.cs" /> <Compile Include="strings.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> @@ -153,10 +152,6 @@ <SubType>Designer</SubType> </None> <None Include="app.manifest" /> - <None Include="Properties\Settings.settings"> - <Generator>SettingsSingleFileGenerator</Generator> - <LastGenOutput>Settings.Designer.cs</LastGenOutput> - </None> </ItemGroup> <ItemGroup> <EmbeddedResource Include="DownloadDialog.resx"> @@ -198,6 +193,7 @@ </ItemGroup> <ItemGroup> <Content Include="CLIv3_Icon.ico" /> + <None Include="Resources\defaultSettings.txt" /> <None Include="Resources\CLIv3_Scroll_On.ico" /> <None Include="Resources\CLIv3_Scroll_Off.ico" /> <None Include="Resources\CLIv3_Num_On.ico" /> 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<T>(this IEnumerable<T> 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<T, U>(this U list, out T first, out T second, out U rest) where U : IEnumerable<T> + { + 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<int>("indDisplayTime") > 0 ? SettingsManager.Get<int>("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<int>("indOpacity"); opacityLabel.Text = string.Format("{0} %", opacitySlider.Value); - backgroundColourActivatedPreview.BackColor = Properties.Settings.Default.indBgColourActive; - backgroundColourDeactivatedPreview.BackColor = Properties.Settings.Default.indBgColourInactive; + backgroundColourActivatedPreview.BackColor = SettingsManager.Get<Color>("indBgColourActive"); + backgroundColourDeactivatedPreview.BackColor = SettingsManager.Get<Color>("indBgColourInactive"); - foregroundColourActivatedPreview.BackColor = Properties.Settings.Default.indFgColourActive; - foregroundColourDeactivatedPreview.BackColor = Properties.Settings.Default.indFgColourInactive; + foregroundColourActivatedPreview.BackColor = SettingsManager.Get<Color>("indFgColourActive"); + foregroundColourDeactivatedPreview.BackColor = SettingsManager.Get<Color>("indFgColourInactive"); - borderColourActivatedPreview.BackColor = Properties.Settings.Default.indBdColourActive; - borderColourDeactivatedPreview.BackColor = Properties.Settings.Default.indBdColourInactive; + borderColourActivatedPreview.BackColor = SettingsManager.Get<Color>("indBdColourActive"); + borderColourDeactivatedPreview.BackColor = SettingsManager.Get<Color>("indBdColourInactive"); - fontButton.Font = Properties.Settings.Default.indFont; + fontButton.Font = SettingsManager.GetOrDefault<Font>("indFont"); - switch (Properties.Settings.Default.overlayPosition) + onlyShowWhenActiveCheckBox.Checked = SettingsManager.Get<bool>("alwaysShowWhenActive"); + + switch (SettingsManager.Get<IndicatorDisplayPosition>("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<Color>("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<Color>("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<Color>("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<Color>("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<Color>("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<Color>("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<Font>("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<bool>("numIco"); + enableCapsIcon.Checked = SettingsManager.Get<bool>("capsIco"); + enableScrollIcon.Checked = SettingsManager.Get<bool>("scrollIco"); - enableNumInd.Checked = Properties.Settings.Default.numInd; - enableCapsInd.Checked = Properties.Settings.Default.capsInd; - enableScrollInd.Checked = Properties.Settings.Default.scrollInd; + enableNumInd.Checked = SettingsManager.Get<bool>("numInd"); + enableCapsInd.Checked = SettingsManager.Get<bool>("capsInd"); + enableScrollInd.Checked = SettingsManager.Get<bool>("scrollInd"); - showNoIcons.Checked = Properties.Settings.Default.noIco; - showNoNotification.Checked = Properties.Settings.Default.noInd; + showNoIcons.Checked = SettingsManager.Get<bool>("noIco"); + showNoNotification.Checked = SettingsManager.Get<bool>("noInd"); iconsGroup.Enabled = !showNoIcons.Checked; - indicatorGroup.Enabled = !showNoNotification.Checked; - - if (Properties.Settings.Default.beta_enableDarkMode) + indicatorGroup.Enabled = !showNoNotification.Checked; + + if (SettingsManager.Get<bool>("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<bool>("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<bool>("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<int>("selectedUICulture") < 0) localeComboBox.SelectedIndex = selectIndex; - else if (Properties.Settings.Default.selectedUICulture < localeComboBox.Items.Count) - localeComboBox.SelectedIndex = Properties.Settings.Default.selectedUICulture; + else if (SettingsManager.Get<int>("selectedUICulture") < localeComboBox.Items.Count) + localeComboBox.SelectedIndex = SettingsManager.Get<int>("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<IndicatorOverlay>().Any()) + int timeOut = SettingsManager.Get<int>("indDisplayTime"); + var alwaysShow = SettingsManager.Get<bool>("alwaysShowWhenActive") && isActive; + if (Application.OpenForms.OfType<IndicatorOverlay>().Any() && Application.OpenForms.OfType<IndicatorOverlay>().Where(f => !f.IsDisposed).Any()) { - IndicatorOverlay indicatorOverlay = Application.OpenForms.OfType<IndicatorOverlay>().First(); + IndicatorOverlay indicatorOverlay = Application.OpenForms.OfType<IndicatorOverlay>().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<Color>("indBgColourActive") : SettingsManager.Get<Color>("indBgColourInactive") + , isActive ? SettingsManager.Get<Color>("indFgColourActive") : SettingsManager.Get<Color>("indFgColourInactive") + , isActive ? SettingsManager.Get<Color>("indBdColourActive") : SettingsManager.Get<Color>("indBdColourInactive") + , SettingsManager.GetOrDefault<Font>("indFont") + , SettingsManager.Get<IndicatorDisplayPosition>("overlayPosition") + , SettingsManager.Get<int>("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<Color>("indBgColourActive") : SettingsManager.Get<Color>("indBgColourInactive") + , isActive ? SettingsManager.Get<Color>("indFgColourActive") : SettingsManager.Get<Color>("indFgColourInactive") + , isActive ? SettingsManager.Get<Color>("indBdColourActive") : SettingsManager.Get<Color>("indBdColourInactive") + , SettingsManager.GetOrDefault<Font>("indFont") + , SettingsManager.Get<IndicatorDisplayPosition>("overlayPosition") + , SettingsManager.Get<int>("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<bool>("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 @@ <metadata name="hideWindowTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>593, 17</value> </metadata> - <metadata name="mainToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>959, 17</value> - </metadata> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> 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 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// 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. -// </auto-generated> -//------------------------------------------------------------------------------ - -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 @@ -<?xml version='1.0' encoding='utf-8'?> -<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="CapsLockIndicatorV3.Properties" GeneratedClassName="Settings"> - <Profiles /> - <Settings> - <Setting Name="numIco" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">True</Value> - </Setting> - <Setting Name="capsIco" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">True</Value> - </Setting> - <Setting Name="scrollIco" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">True</Value> - </Setting> - <Setting Name="numInd" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">True</Value> - </Setting> - <Setting Name="capsInd" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">True</Value> - </Setting> - <Setting Name="scrollInd" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">True</Value> - </Setting> - <Setting Name="noIco" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">False</Value> - </Setting> - <Setting Name="noInd" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">False</Value> - </Setting> - <Setting Name="beta_enableDarkMode" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">False</Value> - </Setting> - <Setting Name="indDisplayTime" Roaming="true" Type="System.Int32" Scope="User"> - <Value Profile="(Default)">500</Value> - </Setting> - <Setting Name="indBgColourActive" Roaming="true" Type="System.Drawing.Color" Scope="User"> - <Value Profile="(Default)">66, 66, 66</Value> - </Setting> - <Setting Name="indFgColourActive" Roaming="true" Type="System.Drawing.Color" Scope="User"> - <Value Profile="(Default)">White</Value> - </Setting> - <Setting Name="indBdColourActive" Roaming="true" Type="System.Drawing.Color" Scope="User"> - <Value Profile="(Default)">77, 180, 52</Value> - </Setting> - <Setting Name="versionNo" Roaming="true" Type="System.String" Scope="User"> - <Value Profile="(Default)">3.8.0.1</Value> - </Setting> - <Setting Name="hideOnStartup" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">False</Value> - </Setting> - <Setting Name="indFont" Roaming="true" Type="System.Drawing.Font" Scope="User"> - <Value Profile="(Default)">Segoe UI, 12pt</Value> - </Setting> - <Setting Name="indBgColourInactive" Roaming="true" Type="System.Drawing.Color" Scope="User"> - <Value Profile="(Default)">66, 66, 66</Value> - </Setting> - <Setting Name="indFgColourInactive" Roaming="true" Type="System.Drawing.Color" Scope="User"> - <Value Profile="(Default)">White</Value> - </Setting> - <Setting Name="indBdColourInactive" Roaming="true" Type="System.Drawing.Color" Scope="User"> - <Value Profile="(Default)">180, 52, 77</Value> - </Setting> - <Setting Name="checkForUpdates" Roaming="true" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">True</Value> - </Setting> - <Setting Name="selectedUICulture" Type="System.Int32" Scope="User"> - <Value Profile="(Default)">-1</Value> - </Setting> - <Setting Name="overlayPosition" Type="CapsLockIndicatorV3.IndicatorDisplayPosition" Scope="User"> - <Value Profile="(Default)">BottomRight</Value> - </Setting> - <Setting Name="indOpacity" Type="System.Int32" Scope="User"> - <Value Profile="(Default)">100</Value> - </Setting> - <Setting Name="upgradeRequired" Type="System.Boolean" Scope="User"> - <Value Profile="(Default)">True</Value> - </Setting> - </Settings> -</SettingsFile> \ 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<string, (Type, object)> Settings; + + public static void Load() + { + LoadDefaults(); + LoadUser(); + } + + private static void LoadDefaults() + { + var lines = resources.defaultSettings.Split('\n'); + if (Settings == null) + Settings = new Dictionary<string, (Type, object)>(); + + 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<string, (Type, object)>(); + + 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<T>(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<T>(string key) + { + return GetOrDefault(key, default(T)); + } + + public static T GetOrDefault<T>(string key, T defaultValue) + { + if (Settings.ContainsKey(key)) + try + { + return Get<T>(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 @@ -<?xml version="1.0" encoding="utf-8"?> -<configuration> - <configSections> - <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <section name="CapsLockIndicatorV3.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <configSections> + <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <section name="CapsLockIndicatorV3.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> </sectionGroup> - </configSections> - <startup> - <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> - </startup> - <userSettings> + </configSections> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/> + </startup> + <userSettings> <CapsLockIndicatorV3.Properties.Settings> <setting name="numIco" serializeAs="String"> <value>True</value> @@ -82,9 +82,9 @@ <setting name="upgradeRequired" serializeAs="String"> <value>True</value> </setting> - </CapsLockIndicatorV3.Properties.Settings> + </CapsLockIndicatorV3.Properties.Settings> </userSettings> <appSettings> <add key="EnableWindowsFormsHighDpiAutoResizing" value="false"/> </appSettings> -</configuration> +</configuration> 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 @@ //------------------------------------------------------------------------------ // <auto-generated> -// 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. // </auto-generated> //------------------------------------------------------------------------------ @@ -13,13 +13,13 @@ namespace CapsLockIndicatorV3 { /// <summary> - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> - // 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() { } /// <summary> - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal resources() { } /// <summary> - /// Ü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. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal resources() { } /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Version {0} | Copyright {1} ähnelt. + /// Looks up a localized string similar to Version {0} | Copyright {1}. /// </summary> internal static string aboutTextFormat { get { @@ -70,7 +70,7 @@ internal static string aboutTextFormat { } /// <summary> - /// 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). /// </summary> internal static System.Drawing.Icon CLIv3_Caps_Off { get { @@ -80,7 +80,7 @@ internal static System.Drawing.Icon CLIv3_Caps_Off { } /// <summary> - /// 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). /// </summary> internal static System.Drawing.Icon CLIv3_Caps_On { get { @@ -90,7 +90,7 @@ internal static System.Drawing.Icon CLIv3_Caps_On { } /// <summary> - /// 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). /// </summary> internal static System.Drawing.Icon CLIv3_Num_Off { get { @@ -100,7 +100,7 @@ internal static System.Drawing.Icon CLIv3_Num_Off { } /// <summary> - /// 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). /// </summary> internal static System.Drawing.Icon CLIv3_Num_On { get { @@ -110,7 +110,7 @@ internal static System.Drawing.Icon CLIv3_Num_On { } /// <summary> - /// 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). /// </summary> internal static System.Drawing.Icon CLIv3_Scroll_Off { get { @@ -120,7 +120,7 @@ internal static System.Drawing.Icon CLIv3_Scroll_Off { } /// <summary> - /// 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). /// </summary> 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)); } } + + /// <summary> + /// 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]";. + /// </summary> + 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="aboutTextFormat" xml:space="preserve"> - <value>Version {0} | Copyright {1}</value> - </data> - <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> - <data name="CLIv3_Caps_Off" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>Resources\CLIv3_Caps_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> - </data> - <data name="CLIv3_Caps_On" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>Resources\CLIv3_Caps_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> - </data> - <data name="CLIv3_Num_Off" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>Resources\CLIv3_Num_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> - </data> - <data name="CLIv3_Num_On" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>Resources\CLIv3_Num_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> - </data> - <data name="CLIv3_Scroll_Off" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>Resources\CLIv3_Scroll_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> - </data> - <data name="CLIv3_Scroll_On" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>Resources\CLIv3_Scroll_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> - </data> -</root> +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="aboutTextFormat" xml:space="preserve"> + <value>Version {0} | Copyright {1}</value> + </data> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="CLIv3_Caps_Off" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>Resources\CLIv3_Caps_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="CLIv3_Caps_On" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>Resources\CLIv3_Caps_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="CLIv3_Num_Off" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>Resources\CLIv3_Num_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="CLIv3_Num_On" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>Resources\CLIv3_Num_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="CLIv3_Scroll_Off" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>Resources\CLIv3_Scroll_Off.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="CLIv3_Scroll_On" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>Resources\CLIv3_Scroll_On.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="defaultSettings" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>Resources\defaultSettings.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value> + </data> +</root> \ 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 @@ -//------------------------------------------------------------------------------ -// <auto-generated> -// 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. -// </auto-generated> -//------------------------------------------------------------------------------ - -namespace CapsLockIndicatorV3 { - using System; - - - /// <summary> - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// </summary> - // 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() { - } - - /// <summary> - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// </summary> - [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; - } - } - - /// <summary> - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. - /// </summary> - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Background colour activated ähnelt. - /// </summary> - internal static string backgroundColourActivatedButton { - get { - return ResourceManager.GetString("backgroundColourActivatedButton", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Background colour deactivated ähnelt. - /// </summary> - internal static string backgroundColourDeactivatedButton { - get { - return ResourceManager.GetString("backgroundColourDeactivatedButton", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Border colour activated ähnelt. - /// </summary> - internal static string borderColourActivatedButton { - get { - return ResourceManager.GetString("borderColourActivatedButton", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Border colour deactivated ähnelt. - /// </summary> - internal static string borderColourDeactivatedButton { - get { - return ResourceManager.GetString("borderColourDeactivatedButton", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Caps lock ähnelt. - /// </summary> - internal static string capsLock { - get { - return ResourceManager.GetString("capsLock", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Check for &updates ähnelt. - /// </summary> - internal static string checkForUpdates { - get { - return ResourceManager.GetString("checkForUpdates", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Checking for updates... ähnelt. - /// </summary> - internal static string checkingForUpdates { - get { - return ResourceManager.GetString("checkingForUpdates", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Colours ähnelt. - /// </summary> - internal static string coloursGroup { - get { - return ResourceManager.GetString("coloursGroup", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die &Exit ähnelt. - /// </summary> - internal static string contextMenuExit { - get { - return ResourceManager.GetString("contextMenuExit", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die &Show ähnelt. - /// </summary> - internal static string contextMenuShow { - get { - return ResourceManager.GetString("contextMenuShow", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die &Dismiss ähnelt. - /// </summary> - internal static string dismissButton { - get { - return ResourceManager.GetString("dismissButton", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Display time ähnelt. - /// </summary> - internal static string displayTime { - get { - return ResourceManager.GetString("displayTime", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Download &manually ähnelt. - /// </summary> - internal static string downloadManuallyButton { - get { - return ResourceManager.GetString("downloadManuallyButton", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Download more translations... ähnelt. - /// </summary> - internal static string downloadMoreTranslations { - get { - return ResourceManager.GetString("downloadMoreTranslations", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die &Exit Application ähnelt. - /// </summary> - internal static string exitApplication { - get { - return ResourceManager.GetString("exitApplication", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Exiting the application means the icons and notifications are no longer displayed. Exit anyway? ähnelt. - /// </summary> - internal static string exitMessage { - get { - return ResourceManager.GetString("exitMessage", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Font ähnelt. - /// </summary> - internal static string fontGroup { - get { - return ResourceManager.GetString("fontGroup", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Text colour activated ähnelt. - /// </summary> - internal static string foregroundColourActivatedButton { - get { - return ResourceManager.GetString("foregroundColourActivatedButton", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Text colour deactivated ähnelt. - /// </summary> - internal static string foregroundColourDeactivatedButton { - get { - return ResourceManager.GetString("foregroundColourDeactivatedButton", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die You can show CapsLock Indicator again by double clicking on this icon. ähnelt. - /// </summary> - internal static string generalIconBalloonText { - get { - return ResourceManager.GetString("generalIconBalloonText", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Hide on start up ähnelt. - /// </summary> - internal static string hideOnStartup { - get { - return ResourceManager.GetString("hideOnStartup", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die &Hide window ähnelt. - /// </summary> - internal static string hideWindow { - get { - return ResourceManager.GetString("hideWindow", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die {0} changed ähnelt. - /// </summary> - internal static string keyChanged { - get { - return ResourceManager.GetString("keyChanged", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die {0} is off ähnelt. - /// </summary> - internal static string keyIsOff { - get { - return ResourceManager.GetString("keyIsOff", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die {0} is on ähnelt. - /// </summary> - internal static string keyIsOn { - get { - return ResourceManager.GetString("keyIsOn", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die &Notification settings ähnelt. - /// </summary> - internal static string notificationSettings { - get { - return ResourceManager.GetString("notificationSettings", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Notification Settings ähnelt. - /// </summary> - internal static string notificationSettingsTitle { - get { - return ResourceManager.GetString("notificationSettingsTitle", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Num lock ähnelt. - /// </summary> - internal static string numLock { - get { - return ResourceManager.GetString("numLock", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Opacity ähnelt. - /// </summary> - internal static string opacity { - get { - return ResourceManager.GetString("opacity", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Overlay position ähnelt. - /// </summary> - internal static string overlayPositionGroup { - get { - return ResourceManager.GetString("overlayPositionGroup", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Permanently ähnelt. - /// </summary> - internal static string permanentIndicator { - get { - return ResourceManager.GetString("permanentIndicator", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die &Save && close ähnelt. - /// </summary> - internal static string saveAndCloseButton { - get { - return ResourceManager.GetString("saveAndCloseButton", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Scroll lock ähnelt. - /// </summary> - internal static string scrollLock { - get { - return ResourceManager.GetString("scrollLock", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Show icons for... ähnelt. - /// </summary> - internal static string showIconsFor { - get { - return ResourceManager.GetString("showIconsFor", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Show no icons ähnelt. - /// </summary> - internal static string showNoIcons { - get { - return ResourceManager.GetString("showNoIcons", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Show no notification ähnelt. - /// </summary> - internal static string showNoNotification { - get { - return ResourceManager.GetString("showNoNotification", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Show notification when... ähnelt. - /// </summary> - internal static string showNotificationWhen { - get { - return ResourceManager.GetString("showNotificationWhen", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Start on logon ähnelt. - /// </summary> - internal static string startOnLogon { - get { - return ResourceManager.GetString("startOnLogon", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die CapsLock Indicator Update available! ähnelt. - /// </summary> - internal static string updateAvailable { - get { - return ResourceManager.GetString("updateAvailable", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die Version {0}, released {1} ähnelt. - /// </summary> - internal static string updateInfoFormat { - get { - return ResourceManager.GetString("updateInfoFormat", resourceCulture); - } - } - - /// <summary> - /// Sucht eine lokalisierte Zeichenfolge, die &Update now ähnelt. - /// </summary> - internal static string updateNow { - get { - return ResourceManager.GetString("updateNow", resourceCulture); - } - } - } -} +//------------------------------------------------------------------------------ +// <auto-generated> +// 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. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace CapsLockIndicatorV3 { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // 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() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [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; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// <summary> + /// Looks up a localized string similar to Background colour activated. + /// </summary> + internal static string backgroundColourActivatedButton { + get { + return ResourceManager.GetString("backgroundColourActivatedButton", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Background colour deactivated. + /// </summary> + internal static string backgroundColourDeactivatedButton { + get { + return ResourceManager.GetString("backgroundColourDeactivatedButton", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Border colour activated. + /// </summary> + internal static string borderColourActivatedButton { + get { + return ResourceManager.GetString("borderColourActivatedButton", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Border colour deactivated. + /// </summary> + internal static string borderColourDeactivatedButton { + get { + return ResourceManager.GetString("borderColourDeactivatedButton", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Caps lock. + /// </summary> + internal static string capsLock { + get { + return ResourceManager.GetString("capsLock", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Check for &updates. + /// </summary> + internal static string checkForUpdates { + get { + return ResourceManager.GetString("checkForUpdates", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Checking for updates.... + /// </summary> + internal static string checkingForUpdates { + get { + return ResourceManager.GetString("checkingForUpdates", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Colours. + /// </summary> + internal static string coloursGroup { + get { + return ResourceManager.GetString("coloursGroup", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to &Exit. + /// </summary> + internal static string contextMenuExit { + get { + return ResourceManager.GetString("contextMenuExit", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to &Show. + /// </summary> + internal static string contextMenuShow { + get { + return ResourceManager.GetString("contextMenuShow", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to &Dismiss. + /// </summary> + internal static string dismissButton { + get { + return ResourceManager.GetString("dismissButton", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Display time. + /// </summary> + internal static string displayTime { + get { + return ResourceManager.GetString("displayTime", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Download &manually. + /// </summary> + internal static string downloadManuallyButton { + get { + return ResourceManager.GetString("downloadManuallyButton", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Download more translations.... + /// </summary> + internal static string downloadMoreTranslations { + get { + return ResourceManager.GetString("downloadMoreTranslations", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to &Exit Application. + /// </summary> + internal static string exitApplication { + get { + return ResourceManager.GetString("exitApplication", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Exiting the application means the icons and notifications are no longer displayed. Exit anyway?. + /// </summary> + internal static string exitMessage { + get { + return ResourceManager.GetString("exitMessage", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Font. + /// </summary> + internal static string fontGroup { + get { + return ResourceManager.GetString("fontGroup", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Text colour activated. + /// </summary> + internal static string foregroundColourActivatedButton { + get { + return ResourceManager.GetString("foregroundColourActivatedButton", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Text colour deactivated. + /// </summary> + internal static string foregroundColourDeactivatedButton { + get { + return ResourceManager.GetString("foregroundColourDeactivatedButton", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to You can show CapsLock Indicator again by double clicking on this icon.. + /// </summary> + internal static string generalIconBalloonText { + get { + return ResourceManager.GetString("generalIconBalloonText", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Hide on start up. + /// </summary> + internal static string hideOnStartup { + get { + return ResourceManager.GetString("hideOnStartup", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to &Hide window. + /// </summary> + internal static string hideWindow { + get { + return ResourceManager.GetString("hideWindow", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to {0} changed. + /// </summary> + internal static string keyChanged { + get { + return ResourceManager.GetString("keyChanged", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to {0} is off. + /// </summary> + internal static string keyIsOff { + get { + return ResourceManager.GetString("keyIsOff", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to {0} is on. + /// </summary> + internal static string keyIsOn { + get { + return ResourceManager.GetString("keyIsOn", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to &Notification settings. + /// </summary> + internal static string notificationSettings { + get { + return ResourceManager.GetString("notificationSettings", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Notification Settings. + /// </summary> + internal static string notificationSettingsTitle { + get { + return ResourceManager.GetString("notificationSettingsTitle", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Num lock. + /// </summary> + internal static string numLock { + get { + return ResourceManager.GetString("numLock", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Opacity. + /// </summary> + internal static string opacity { + get { + return ResourceManager.GetString("opacity", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Overlay position. + /// </summary> + internal static string overlayPositionGroup { + get { + return ResourceManager.GetString("overlayPositionGroup", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Permanently. + /// </summary> + internal static string permanentIndicator { + get { + return ResourceManager.GetString("permanentIndicator", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to &Save && close. + /// </summary> + internal static string saveAndCloseButton { + get { + return ResourceManager.GetString("saveAndCloseButton", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Scroll lock. + /// </summary> + internal static string scrollLock { + get { + return ResourceManager.GetString("scrollLock", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Show icons for.... + /// </summary> + internal static string showIconsFor { + get { + return ResourceManager.GetString("showIconsFor", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Show no icons. + /// </summary> + internal static string showNoIcons { + get { + return ResourceManager.GetString("showNoIcons", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Show no notification. + /// </summary> + internal static string showNoNotification { + get { + return ResourceManager.GetString("showNoNotification", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Show notification when.... + /// </summary> + internal static string showNotificationWhen { + get { + return ResourceManager.GetString("showNotificationWhen", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Always show overlay when active. + /// </summary> + internal static string showOverlayOnlyWhenActive { + get { + return ResourceManager.GetString("showOverlayOnlyWhenActive", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Start on logon. + /// </summary> + internal static string startOnLogon { + get { + return ResourceManager.GetString("startOnLogon", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to CapsLock Indicator Update available!. + /// </summary> + internal static string updateAvailable { + get { + return ResourceManager.GetString("updateAvailable", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Version {0}, released {1}. + /// </summary> + internal static string updateInfoFormat { + get { + return ResourceManager.GetString("updateInfoFormat", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to &Update now. + /// </summary> + 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="backgroundColourActivatedButton" xml:space="preserve"> - <value>Hintergrund aktiv</value> - </data> - <data name="backgroundColourDeactivatedButton" xml:space="preserve"> - <value>Hintergrund inaktiv</value> - </data> - <data name="borderColourActivatedButton" xml:space="preserve"> - <value>Rand aktiv</value> - </data> - <data name="borderColourDeactivatedButton" xml:space="preserve"> - <value>Rand inaktiv</value> - </data> - <data name="capsLock" xml:space="preserve"> - <value>Feststelltaste</value> - </data> - <data name="checkForUpdates" xml:space="preserve"> - <value>Nach Updates suchen</value> - </data> - <data name="checkingForUpdates" xml:space="preserve"> - <value>Suche nach Updates...</value> - </data> - <data name="coloursGroup" xml:space="preserve"> - <value>Farben</value> - </data> - <data name="contextMenuExit" xml:space="preserve"> - <value>&Verlassen</value> - </data> - <data name="contextMenuShow" xml:space="preserve"> - <value>&Anzeigen</value> - </data> - <data name="dismissButton" xml:space="preserve"> - <value>&Schließen</value> - </data> - <data name="displayTime" xml:space="preserve"> - <value>Anzeigedauer</value> - </data> - <data name="downloadManuallyButton" xml:space="preserve"> - <value>&Manuell runterladen</value> - </data> - <data name="downloadMoreTranslations" xml:space="preserve"> - <value>Mehr Sprachen herunterladen...</value> - </data> - <data name="exitApplication" xml:space="preserve"> - <value>V&erlassen</value> - </data> - <data name="exitMessage" xml:space="preserve"> - <value>Die Anwendung zu verlassen heißt, dass die Icons und Benachrichtigungen nicht länger angezeigt weden. Trotzdem verlassen?</value> - </data> - <data name="fontGroup" xml:space="preserve"> - <value>Schrift</value> - </data> - <data name="foregroundColourActivatedButton" xml:space="preserve"> - <value>Text aktiv</value> - </data> - <data name="foregroundColourDeactivatedButton" xml:space="preserve"> - <value>Text inaktiv</value> - </data> - <data name="generalIconBalloonText" xml:space="preserve"> - <value>CapsLock Indicator kann wieder angezeigt werden, wenn Sie auf dieses Symbol doppelklicken.</value> - </data> - <data name="hideOnStartup" xml:space="preserve"> - <value>Beim Starten verstecken</value> - </data> - <data name="hideWindow" xml:space="preserve"> - <value>Verstecken</value> - </data> - <data name="keyChanged" xml:space="preserve"> - <value>{0} sich ändert</value> - </data> - <data name="keyIsOff" xml:space="preserve"> - <value>{0} ist aus</value> - </data> - <data name="keyIsOn" xml:space="preserve"> - <value>{0} ist an</value> - </data> - <data name="notificationSettings" xml:space="preserve"> - <value>Benachr.-Einst.</value> - </data> - <data name="notificationSettingsTitle" xml:space="preserve"> - <value>Benachrichtiguns-Einstellungen</value> - </data> - <data name="numLock" xml:space="preserve"> - <value>Num-Lock</value> - </data> - <data name="opacity" xml:space="preserve"> - <value>Deckkraft</value> - </data> - <data name="overlayPositionGroup" xml:space="preserve"> - <value>Benachrichtigungsposition</value> - </data> - <data name="permanentIndicator" xml:space="preserve"> - <value>Dauerhaft</value> - </data> - <data name="saveAndCloseButton" xml:space="preserve"> - <value>&Speichern && schließen</value> - </data> - <data name="scrollLock" xml:space="preserve"> - <value>Rollen</value> - </data> - <data name="showIconsFor" xml:space="preserve"> - <value>Icons zeigen für...</value> - </data> - <data name="showNoIcons" xml:space="preserve"> - <value>Keine Icons zeigen</value> - </data> - <data name="showNoNotification" xml:space="preserve"> - <value>Keine Benachr. anzeigen</value> - </data> - <data name="showNotificationWhen" xml:space="preserve"> - <value>Zeige Benachr., wenn...</value> - </data> - <data name="startOnLogon" xml:space="preserve"> - <value>Autostart</value> - </data> - <data name="updateAvailable" xml:space="preserve"> - <value>CapsLock Indicator Update verfügbar!</value> - </data> - <data name="updateInfoFormat" xml:space="preserve"> - <value>Version {0}, erschienen {1}</value> - </data> - <data name="updateNow" xml:space="preserve"> - <value>Jetzt update&n</value> - </data> +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="backgroundColourActivatedButton" xml:space="preserve"> + <value>Hintergrund aktiv</value> + </data> + <data name="backgroundColourDeactivatedButton" xml:space="preserve"> + <value>Hintergrund inaktiv</value> + </data> + <data name="borderColourActivatedButton" xml:space="preserve"> + <value>Rand aktiv</value> + </data> + <data name="borderColourDeactivatedButton" xml:space="preserve"> + <value>Rand inaktiv</value> + </data> + <data name="capsLock" xml:space="preserve"> + <value>Feststelltaste</value> + </data> + <data name="checkForUpdates" xml:space="preserve"> + <value>Nach Updates suchen</value> + </data> + <data name="checkingForUpdates" xml:space="preserve"> + <value>Suche nach Updates...</value> + </data> + <data name="coloursGroup" xml:space="preserve"> + <value>Farben</value> + </data> + <data name="contextMenuExit" xml:space="preserve"> + <value>&Verlassen</value> + </data> + <data name="contextMenuShow" xml:space="preserve"> + <value>&Anzeigen</value> + </data> + <data name="dismissButton" xml:space="preserve"> + <value>&Schließen</value> + </data> + <data name="displayTime" xml:space="preserve"> + <value>Anzeigedauer</value> + </data> + <data name="downloadManuallyButton" xml:space="preserve"> + <value>&Manuell runterladen</value> + </data> + <data name="downloadMoreTranslations" xml:space="preserve"> + <value>Mehr Sprachen herunterladen...</value> + </data> + <data name="exitApplication" xml:space="preserve"> + <value>V&erlassen</value> + </data> + <data name="exitMessage" xml:space="preserve"> + <value>Die Anwendung zu verlassen heißt, dass die Icons und Benachrichtigungen nicht länger angezeigt weden. Trotzdem verlassen?</value> + </data> + <data name="fontGroup" xml:space="preserve"> + <value>Schrift</value> + </data> + <data name="foregroundColourActivatedButton" xml:space="preserve"> + <value>Text aktiv</value> + </data> + <data name="foregroundColourDeactivatedButton" xml:space="preserve"> + <value>Text inaktiv</value> + </data> + <data name="generalIconBalloonText" xml:space="preserve"> + <value>CapsLock Indicator kann wieder angezeigt werden, wenn Sie auf dieses Symbol doppelklicken.</value> + </data> + <data name="hideOnStartup" xml:space="preserve"> + <value>Beim Starten verstecken</value> + </data> + <data name="hideWindow" xml:space="preserve"> + <value>Verstecken</value> + </data> + <data name="keyChanged" xml:space="preserve"> + <value>{0} sich ändert</value> + </data> + <data name="keyIsOff" xml:space="preserve"> + <value>{0} ist aus</value> + </data> + <data name="keyIsOn" xml:space="preserve"> + <value>{0} ist an</value> + </data> + <data name="notificationSettings" xml:space="preserve"> + <value>Benachr.-Einst.</value> + </data> + <data name="notificationSettingsTitle" xml:space="preserve"> + <value>Benachrichtiguns-Einstellungen</value> + </data> + <data name="numLock" xml:space="preserve"> + <value>Num-Lock</value> + </data> + <data name="opacity" xml:space="preserve"> + <value>Deckkraft</value> + </data> + <data name="overlayPositionGroup" xml:space="preserve"> + <value>Benachrichtigungsposition</value> + </data> + <data name="permanentIndicator" xml:space="preserve"> + <value>Dauerhaft</value> + </data> + <data name="saveAndCloseButton" xml:space="preserve"> + <value>&Speichern && schließen</value> + </data> + <data name="scrollLock" xml:space="preserve"> + <value>Rollen</value> + </data> + <data name="showIconsFor" xml:space="preserve"> + <value>Icons zeigen für...</value> + </data> + <data name="showNoIcons" xml:space="preserve"> + <value>Keine Icons zeigen</value> + </data> + <data name="showNoNotification" xml:space="preserve"> + <value>Keine Benachr. anzeigen</value> + </data> + <data name="showNotificationWhen" xml:space="preserve"> + <value>Zeige Benachr., wenn...</value> + </data> + <data name="showOverlayOnlyWhenActive" xml:space="preserve"> + <value>Benachrichtigung immer anz., wenn aktiv</value> + </data> + <data name="startOnLogon" xml:space="preserve"> + <value>Autostart</value> + </data> + <data name="updateAvailable" xml:space="preserve"> + <value>CapsLock Indicator Update verfügbar!</value> + </data> + <data name="updateInfoFormat" xml:space="preserve"> + <value>Version {0}, erschienen {1}</value> + </data> + <data name="updateNow" xml:space="preserve"> + <value>Jetzt update&n</value> + </data> </root> \ 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="backgroundColourActivatedButton" xml:space="preserve"> - <value>Background colour activated</value> - <comment>The caption for the "Background colour activated" button.</comment> - </data> - <data name="backgroundColourDeactivatedButton" xml:space="preserve"> - <value>Background colour deactivated</value> - <comment>The caption for the "Background colour deactivated" button.</comment> - </data> - <data name="borderColourActivatedButton" xml:space="preserve"> - <value>Border colour activated</value> - <comment>The caption for the "Border colour activated" button.</comment> - </data> - <data name="borderColourDeactivatedButton" xml:space="preserve"> - <value>Border colour deactivated</value> - <comment>The caption for the "Border colour deactivated" button.</comment> - </data> - <data name="capsLock" xml:space="preserve"> - <value>Caps lock</value> - <comment>The name of the caps lock key</comment> - </data> - <data name="checkForUpdates" xml:space="preserve"> - <value>Check for &updates</value> - <comment>The caption for the button that manually checks for updates. The character after the "&" is the hotkey that is used with the ALT key.</comment> - </data> - <data name="checkingForUpdates" xml:space="preserve"> - <value>Checking for updates...</value> - <comment>The caption for the "Check for updates" button when it's searching for updates.</comment> - </data> - <data name="coloursGroup" xml:space="preserve"> - <value>Colours</value> - <comment>The title for the "Colours" group box</comment> - </data> - <data name="contextMenuExit" xml:space="preserve"> - <value>&Exit</value> - <comment>Used in the context menu of the CLI tray icon.</comment> - </data> - <data name="contextMenuShow" xml:space="preserve"> - <value>&Show</value> - <comment>Used in the context menu of the CLI tray icon.</comment> - </data> - <data name="dismissButton" xml:space="preserve"> - <value>&Dismiss</value> - <comment>The caption for the "Dismiss" button. The character after the "&" is the hotkey that is used with the ALT key.</comment> - </data> - <data name="displayTime" xml:space="preserve"> - <value>Display time</value> - <comment>The title for the "Display time" group box</comment> - </data> - <data name="downloadManuallyButton" xml:space="preserve"> - <value>Download &manually</value> - <comment>The caption for the "Download manually" button. The character after the "&" is the hotkey that is used with the ALT key.</comment> - </data> - <data name="downloadMoreTranslations" xml:space="preserve"> - <value>Download more translations...</value> - <comment>The last dropdown item in the locale dropdown.</comment> - </data> - <data name="exitApplication" xml:space="preserve"> - <value>&Exit Application</value> - <comment>The caption for the button that exits the application. The character after the "&" is the hotkey that is used with the ALT key.</comment> - </data> - <data name="exitMessage" xml:space="preserve"> - <value>Exiting the application means the icons and notifications are no longer displayed. Exit anyway?</value> - <comment>The message to display on application exit</comment> - </data> - <data name="fontGroup" xml:space="preserve"> - <value>Font</value> - <comment>The title for the "Font" group box</comment> - </data> - <data name="foregroundColourActivatedButton" xml:space="preserve"> - <value>Text colour activated</value> - <comment>The caption for the "Text colour activated" button.</comment> - </data> - <data name="foregroundColourDeactivatedButton" xml:space="preserve"> - <value>Text colour deactivated</value> - <comment>The caption for the "Text colour deactivated" button.</comment> - </data> - <data name="generalIconBalloonText" xml:space="preserve"> - <value>You can show CapsLock Indicator again by double clicking on this icon.</value> - <comment>The text that is shown in the icon balloon tip when CLI is being hidden.</comment> - </data> - <data name="hideOnStartup" xml:space="preserve"> - <value>Hide on start up</value> - <comment>Used for the hide on startup checkbox</comment> - </data> - <data name="hideWindow" xml:space="preserve"> - <value>&Hide window</value> - <comment>The caption for the button that hides the window. The character after the "&" is the hotkey that is used with the ALT key.</comment> - </data> - <data name="keyChanged" xml:space="preserve"> - <value>{0} changed</value> - <comment>Used for the check boxes in the "Show notification when..." group box. "{0}" will be replaced with the key name</comment> - </data> - <data name="keyIsOff" xml:space="preserve"> - <value>{0} is off</value> - <comment>The text to display in the notification when a key is off. "{0}" will be replaced with the key name</comment> - </data> - <data name="keyIsOn" xml:space="preserve"> - <value>{0} is on</value> - <comment>The text to display in the notification when a key is on. "{0}" will be replaced with the key name</comment> - </data> - <data name="notificationSettings" xml:space="preserve"> - <value>&Notification settings</value> - <comment>The caption for the button that opens the notification settings. The character after the "&" is the hotkey that is used with the ALT key.</comment> - </data> - <data name="notificationSettingsTitle" xml:space="preserve"> - <value>Notification Settings</value> - <comment>The caption of the notification settings window</comment> - </data> - <data name="numLock" xml:space="preserve"> - <value>Num lock</value> - <comment>The name of the num lock key</comment> - </data> - <data name="opacity" xml:space="preserve"> - <value>Opacity</value> - <comment>The title for the "Opacity" group box</comment> - </data> - <data name="overlayPositionGroup" xml:space="preserve"> - <value>Overlay position</value> - <comment>The title for the "Overlay position" group box</comment> - </data> - <data name="permanentIndicator" xml:space="preserve"> - <value>Permanently</value> - <comment>Text to display instead of the time if indicator overlay display is set to permanently.</comment> - </data> - <data name="saveAndCloseButton" xml:space="preserve"> - <value>&Save && close</value> - <comment>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</comment> - </data> - <data name="scrollLock" xml:space="preserve"> - <value>Scroll lock</value> - <comment>The name of the scroll lock key</comment> - </data> - <data name="showIconsFor" xml:space="preserve"> - <value>Show icons for...</value> - <comment>The title for the "Show icons for..." group box</comment> - </data> - <data name="showNoIcons" xml:space="preserve"> - <value>Show no icons</value> - <comment>The label for the check box that enables or disables all icons</comment> - </data> - <data name="showNoNotification" xml:space="preserve"> - <value>Show no notification</value> - <comment>The label for the check box that enables or disables all notifications</comment> - </data> - <data name="showNotificationWhen" xml:space="preserve"> - <value>Show notification when...</value> - <comment>The title for the "Show notification when..." group box</comment> - </data> - <data name="startOnLogon" xml:space="preserve"> - <value>Start on logon</value> - <comment>The label for the check box that enables or disabled the auto start.</comment> - </data> - <data name="updateAvailable" xml:space="preserve"> - <value>CapsLock Indicator Update available!</value> - <comment>The title for the update window.</comment> - </data> - <data name="updateInfoFormat" xml:space="preserve"> - <value>Version {0}, released {1}</value> - <comment>Displayed in the "Update Available" dialog. {0} is the version, {1} is the release date and time.</comment> - </data> - <data name="updateNow" xml:space="preserve"> - <value>&Update now</value> - <comment>The caption for the "Update now" button. The character after the "&" is the hotkey that is used with the ALT key.</comment> - </data> +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="backgroundColourActivatedButton" xml:space="preserve"> + <value>Background colour activated</value> + <comment>The caption for the "Background colour activated" button.</comment> + </data> + <data name="backgroundColourDeactivatedButton" xml:space="preserve"> + <value>Background colour deactivated</value> + <comment>The caption for the "Background colour deactivated" button.</comment> + </data> + <data name="borderColourActivatedButton" xml:space="preserve"> + <value>Border colour activated</value> + <comment>The caption for the "Border colour activated" button.</comment> + </data> + <data name="borderColourDeactivatedButton" xml:space="preserve"> + <value>Border colour deactivated</value> + <comment>The caption for the "Border colour deactivated" button.</comment> + </data> + <data name="capsLock" xml:space="preserve"> + <value>Caps lock</value> + <comment>The name of the caps lock key</comment> + </data> + <data name="checkForUpdates" xml:space="preserve"> + <value>Check for &updates</value> + <comment>The caption for the button that manually checks for updates. The character after the "&" is the hotkey that is used with the ALT key.</comment> + </data> + <data name="checkingForUpdates" xml:space="preserve"> + <value>Checking for updates...</value> + <comment>The caption for the "Check for updates" button when it's searching for updates.</comment> + </data> + <data name="coloursGroup" xml:space="preserve"> + <value>Colours</value> + <comment>The title for the "Colours" group box</comment> + </data> + <data name="contextMenuExit" xml:space="preserve"> + <value>&Exit</value> + <comment>Used in the context menu of the CLI tray icon.</comment> + </data> + <data name="contextMenuShow" xml:space="preserve"> + <value>&Show</value> + <comment>Used in the context menu of the CLI tray icon.</comment> + </data> + <data name="dismissButton" xml:space="preserve"> + <value>&Dismiss</value> + <comment>The caption for the "Dismiss" button. The character after the "&" is the hotkey that is used with the ALT key.</comment> + </data> + <data name="displayTime" xml:space="preserve"> + <value>Display time</value> + <comment>The title for the "Display time" group box</comment> + </data> + <data name="downloadManuallyButton" xml:space="preserve"> + <value>Download &manually</value> + <comment>The caption for the "Download manually" button. The character after the "&" is the hotkey that is used with the ALT key.</comment> + </data> + <data name="downloadMoreTranslations" xml:space="preserve"> + <value>Download more translations...</value> + <comment>The last dropdown item in the locale dropdown.</comment> + </data> + <data name="exitApplication" xml:space="preserve"> + <value>&Exit Application</value> + <comment>The caption for the button that exits the application. The character after the "&" is the hotkey that is used with the ALT key.</comment> + </data> + <data name="exitMessage" xml:space="preserve"> + <value>Exiting the application means the icons and notifications are no longer displayed. Exit anyway?</value> + <comment>The message to display on application exit</comment> + </data> + <data name="fontGroup" xml:space="preserve"> + <value>Font</value> + <comment>The title for the "Font" group box</comment> + </data> + <data name="foregroundColourActivatedButton" xml:space="preserve"> + <value>Text colour activated</value> + <comment>The caption for the "Text colour activated" button.</comment> + </data> + <data name="foregroundColourDeactivatedButton" xml:space="preserve"> + <value>Text colour deactivated</value> + <comment>The caption for the "Text colour deactivated" button.</comment> + </data> + <data name="generalIconBalloonText" xml:space="preserve"> + <value>You can show CapsLock Indicator again by double clicking on this icon.</value> + <comment>The text that is shown in the icon balloon tip when CLI is being hidden.</comment> + </data> + <data name="hideOnStartup" xml:space="preserve"> + <value>Hide on start up</value> + <comment>Used for the hide on startup checkbox</comment> + </data> + <data name="hideWindow" xml:space="preserve"> + <value>&Hide window</value> + <comment>The caption for the button that hides the window. The character after the "&" is the hotkey that is used with the ALT key.</comment> + </data> + <data name="keyChanged" xml:space="preserve"> + <value>{0} changed</value> + <comment>Used for the check boxes in the "Show notification when..." group box. "{0}" will be replaced with the key name</comment> + </data> + <data name="keyIsOff" xml:space="preserve"> + <value>{0} is off</value> + <comment>The text to display in the notification when a key is off. "{0}" will be replaced with the key name</comment> + </data> + <data name="keyIsOn" xml:space="preserve"> + <value>{0} is on</value> + <comment>The text to display in the notification when a key is on. "{0}" will be replaced with the key name</comment> + </data> + <data name="notificationSettings" xml:space="preserve"> + <value>&Notification settings</value> + <comment>The caption for the button that opens the notification settings. The character after the "&" is the hotkey that is used with the ALT key.</comment> + </data> + <data name="notificationSettingsTitle" xml:space="preserve"> + <value>Notification Settings</value> + <comment>The caption of the notification settings window</comment> + </data> + <data name="numLock" xml:space="preserve"> + <value>Num lock</value> + <comment>The name of the num lock key</comment> + </data> + <data name="opacity" xml:space="preserve"> + <value>Opacity</value> + <comment>The title for the "Opacity" group box</comment> + </data> + <data name="overlayPositionGroup" xml:space="preserve"> + <value>Overlay position</value> + <comment>The title for the "Overlay position" group box</comment> + </data> + <data name="permanentIndicator" xml:space="preserve"> + <value>Permanently</value> + <comment>Text to display instead of the time if indicator overlay display is set to permanently.</comment> + </data> + <data name="saveAndCloseButton" xml:space="preserve"> + <value>&Save && close</value> + <comment>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</comment> + </data> + <data name="scrollLock" xml:space="preserve"> + <value>Scroll lock</value> + <comment>The name of the scroll lock key</comment> + </data> + <data name="showIconsFor" xml:space="preserve"> + <value>Show icons for...</value> + <comment>The title for the "Show icons for..." group box</comment> + </data> + <data name="showNoIcons" xml:space="preserve"> + <value>Show no icons</value> + <comment>The label for the check box that enables or disables all icons</comment> + </data> + <data name="showNoNotification" xml:space="preserve"> + <value>Show no notification</value> + <comment>The label for the check box that enables or disables all notifications</comment> + </data> + <data name="showNotificationWhen" xml:space="preserve"> + <value>Show notification when...</value> + <comment>The title for the "Show notification when..." group box</comment> + </data> + <data name="showOverlayOnlyWhenActive" xml:space="preserve"> + <value>Always show overlay when active</value> + <comment>The label for the check box that indicates whether overlay should only be shown when active</comment> + </data> + <data name="startOnLogon" xml:space="preserve"> + <value>Start on logon</value> + <comment>The label for the check box that enables or disabled the auto start.</comment> + </data> + <data name="updateAvailable" xml:space="preserve"> + <value>CapsLock Indicator Update available!</value> + <comment>The title for the update window.</comment> + </data> + <data name="updateInfoFormat" xml:space="preserve"> + <value>Version {0}, released {1}</value> + <comment>Displayed in the "Update Available" dialog. {0} is the version, {1} is the release date and time.</comment> + </data> + <data name="updateNow" xml:space="preserve"> + <value>&Update now</value> + <comment>The caption for the "Update now" button. The character after the "&" is the hotkey that is used with the ALT key.</comment> + </data> </root> \ No newline at end of file