aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-11-18 16:29:54 +0000
committerAlex-TIMEHACK <[email protected]>2017-11-18 16:29:54 +0000
commit4037be53b29a122732cfc10693e9c0027f606bb0 (patch)
tree8533ea9ee0ac8f5f7f696b85cb039f783657ada0 /ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
parent65b7ac2b8cbc4478f6d31a21f106048aeb075078 (diff)
parent97722fbe9d474adffbba0b92e9727c48a8205234 (diff)
downloadshiftos-rewind-4037be53b29a122732cfc10693e9c0027f606bb0.tar.gz
shiftos-rewind-4037be53b29a122732cfc10693e9c0027f606bb0.tar.bz2
shiftos-rewind-4037be53b29a122732cfc10693e9c0027f606bb0.zip
Updated my fork!
Conflicts: ShiftOS.Engine/ShiftOS.Engine.csproj ShiftOS.Engine/Terminal/Commands/Hello.cs ShiftOS.Engine/Terminal/TerminalBackend.cs ShiftOS.Engine/Terminal/TerminalCommand.cs ShiftOS.Main/ShiftOS.Main.csproj ShiftOS.Main/ShiftOS/Apps/Terminal.cs ShiftOS.Main/ShiftOS/Desktop.cs
Diffstat (limited to 'ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs')
-rw-r--r--ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs92
1 files changed, 48 insertions, 44 deletions
diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
index 7a97915..5e335b0 100644
--- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
+++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs
@@ -1,50 +1,54 @@
using System;
using System.Drawing;
+using System.Globalization;
using System.Windows.Forms;
using ShiftOS.Engine.WindowManager;
-namespace ShiftOS.Main.ShiftOS.Apps
+namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff
{
- public partial class SelectColor : UserControl
- {
- Color _finalColor;
- int _colorType1;
- int _colorType2;
- int _colorType3;
- public SelectColor()
- {
- InitializeComponent();
-
- }
-
- private Color setColor()
- {
- _colorType1 = Int32.Parse(redUpDown.Value.ToString());
- _colorType2 = Int32.Parse(greenUpDown.Value.ToString());
- _colorType3 = Int32.Parse(blueUpDown.Value.ToString());
- try
- {
- _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3);
-
- /*
- foreach (var window in ShiftWM.Windows)
-{
- window.Invoke(new Action(() => window.top.BackColor = _finalColor));
- }
- */
-
- ShiftWM.StartInfoboxSession("Success!", $"Changed color to:\r\n{_colorType1}, {_colorType2}, {_colorType3}.", InfoboxTemplate.ButtonType.Ok);
- }
- catch (Exception)
- {
- ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok);
- }
- return _finalColor;
- }
-
- private void btnSetColor_Click(object sender, EventArgs e)
- {
- setColor();
- }
- }
-}
+ public partial class SelectColor : UserControl
+ {
+ int _colorType1;
+ int _colorType2;
+ int _colorType3;
+ Color _finalColor;
+
+ public SelectColor()
+ {
+ InitializeComponent();
+ }
+
+ Color SetColor()
+ {
+ _colorType1 = int.Parse(redUpDown.Value.ToString(CultureInfo.InvariantCulture));
+ _colorType2 = int.Parse(greenUpDown.Value.ToString(CultureInfo.InvariantCulture));
+ _colorType3 = int.Parse(blueUpDown.Value.ToString(CultureInfo.InvariantCulture));
+ try
+ {
+ _finalColor = Color.FromArgb(_colorType1, _colorType2, _colorType3);
+
+
+ foreach (var window in ShiftWM.Windows)
+ {
+ window.Invoke(new Action(() => window.titleBar.BackColor = _finalColor));
+ }
+
+
+ ShiftWM.StartInfoboxSession(
+ "Success!",
+ $"Changed color to:\r\n{_colorType1}, {_colorType2}, {_colorType3}.",
+ InfoboxTemplate.ButtonType.Ok);
+ }
+ catch (Exception)
+ {
+ ShiftWM.StartInfoboxSession("Error!", "An error occured while setting the color.", InfoboxTemplate.ButtonType.Ok);
+ }
+ return _finalColor;
+ }
+
+ void btnSetColor_Click(object sender, EventArgs e)
+ {
+ SetColor();
+ }
+ }
+} \ No newline at end of file