diff options
| author | AShifter <[email protected]> | 2017-11-17 20:29:46 -0700 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-11-17 20:29:46 -0700 |
| commit | ebdc09fe679b4b06fd149c8fc6539244100ce896 (patch) | |
| tree | 65dfe45bbfd194ddb534cc80107ab8e6d80cf5bc /ShiftOS.Main | |
| parent | 1d0b393e6969d9671daead8049973a374421046f (diff) | |
| parent | 97722fbe9d474adffbba0b92e9727c48a8205234 (diff) | |
| download | shiftos-rewind-ebdc09fe679b4b06fd149c8fc6539244100ce896.tar.gz shiftos-rewind-ebdc09fe679b4b06fd149c8fc6539244100ce896.tar.bz2 shiftos-rewind-ebdc09fe679b4b06fd149c8fc6539244100ce896.zip | |
Merge remote-tracking branch 'refs/remotes/ShiftOS-Rewind/master'
Diffstat (limited to 'ShiftOS.Main')
26 files changed, 1229 insertions, 1154 deletions
diff --git a/ShiftOS.Main/App.config b/ShiftOS.Main/App.config index 8e15646..5c73fc5 100644 --- a/ShiftOS.Main/App.config +++ b/ShiftOS.Main/App.config @@ -1,6 +1,7 @@ -<?xml version="1.0" encoding="utf-8" ?> +<?xml version="1.0" encoding="utf-8"?> + <configuration> - <startup> - <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> - </startup> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> + </startup> </configuration>
\ No newline at end of file diff --git a/ShiftOS.Main/HijackScreen.Designer.cs b/ShiftOS.Main/HijackScreen.Designer.cs deleted file mode 100644 index fab31dc..0000000 --- a/ShiftOS.Main/HijackScreen.Designer.cs +++ /dev/null @@ -1,105 +0,0 @@ -namespace ShiftOS.Main -{ - partial class HijackScreen - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); - this.conversationtimer = new System.Windows.Forms.Timer(this.components); - this.hackeffecttimer = new System.Windows.Forms.Timer(this.components); - this.lblHijack = new System.Windows.Forms.Label(); - this.textgen = new System.Windows.Forms.Timer(this.components); - this.lblhackwords = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // conversationtimer - // - this.conversationtimer.Tick += new System.EventHandler(this.conversationtimer_Tick); - // - // hackeffecttimer - // - this.hackeffecttimer.Interval = 50; - this.hackeffecttimer.Tick += new System.EventHandler(this.hackeffecttimer_Tick); - // - // lblHijack - // - this.lblHijack.Anchor = System.Windows.Forms.AnchorStyles.None; - this.lblHijack.AutoSize = true; - this.lblHijack.BackColor = System.Drawing.Color.WhiteSmoke; - this.lblHijack.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F); - this.lblHijack.ForeColor = System.Drawing.Color.DimGray; - this.lblHijack.Location = new System.Drawing.Point(143, 193); - this.lblHijack.Name = "lblHijack"; - this.lblHijack.Size = new System.Drawing.Size(18, 25); - this.lblHijack.TabIndex = 0; - this.lblHijack.Text = "\\"; - // - // textgen - // - this.textgen.Interval = 20; - this.textgen.Tick += new System.EventHandler(this.textgen_Tick); - // - // lblhackwords - // - this.lblhackwords.AutoSize = true; - this.lblhackwords.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblhackwords.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblhackwords.ForeColor = System.Drawing.SystemColors.ButtonFace; - this.lblhackwords.Location = new System.Drawing.Point(0, 0); - this.lblhackwords.Name = "lblhackwords"; - this.lblhackwords.Size = new System.Drawing.Size(127, 18); - this.lblhackwords.TabIndex = 1; - this.lblhackwords.Text = "Hijack in progress"; - // - // HijackScreen - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Silver; - this.ClientSize = new System.Drawing.Size(636, 418); - this.Controls.Add(this.lblhackwords); - this.Controls.Add(this.lblHijack); - this.Name = "HijackScreen"; - this.Text = "ShiftOS"; - this.TransparencyKey = System.Drawing.Color.White; - this.Load += new System.EventHandler(this.HijackScreen_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.ComponentModel.BackgroundWorker backgroundWorker1; - private System.Windows.Forms.Timer conversationtimer; - private System.Windows.Forms.Timer hackeffecttimer; - private System.Windows.Forms.Label lblHijack; - private System.Windows.Forms.Timer textgen; - private System.Windows.Forms.Label lblhackwords; - } -}
\ No newline at end of file diff --git a/ShiftOS.Main/HijackScreen.cs b/ShiftOS.Main/HijackScreen.cs deleted file mode 100644 index 721d49e..0000000 --- a/ShiftOS.Main/HijackScreen.cs +++ /dev/null @@ -1,612 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.IO; -using System.Media; -using System.Text.RegularExpressions; - -namespace ShiftOS.Main -{ - public partial class HijackScreen : Form - { - public string actualshiftversion = "0.0.1.1"; - string rtext; - string gtexttotype; - int charcount; - int currentletter; - int slashcount; - int conversationcount = 0; - Label textgeninput; - bool needtoclose = false; - string oldversion; - public bool upgraded = false; - SoundPlayer player = new SoundPlayer(); - - FileStream fs; - int hackeffect; - int percentcount; - - static DriveInfo[] cdrives = DriveInfo.GetDrives(); - DriveInfo cdrive = Array.Find(cdrives, c => "C:\\" == "C:\\"); - public HijackScreen() - { - InitializeComponent(); - } - private void PlaySound(Stream path) - { - player.Stream = path; - player.Play(); - player.Stream.Position = 0; - } - private void HijackScreen_Load(object sender, EventArgs e) - { - //extractdlls(); - Control.CheckForIllegalCrossThreadCalls = false; - - this.FormBorderStyle = FormBorderStyle.None; - this.WindowState = FormWindowState.Maximized; - if (Directory.Exists("C:\\ShiftOS-Rewind")) - { - if (File.ReadAllText("C:/ShiftOS-Rewind/Shiftum42/HDAccess.sft") == actualshiftversion) - { - //ShiftOSDesktop.Show(); - conversationtimer.Start(); - needtoclose = true; - } - else - { - if (MessageBox.Show("Your save file is not currently compatible with this version of ShiftOS. Would you like to upgrade your save file so you can continue to play the latest version of ShiftOS without losing your progress? If so click yes below. If you would like to start a new game and wipe all your progress please click no", "Warning: Update your save file", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.Yes) - { - this.Hide(); - //ShiftOS_Save_File_Converter.Show(); - // ShiftOS_Save_File_Converter.BringToFront(); - } - else - { - oldversion = System.IO.File.ReadAllText("C:/ShiftOS-Rewind/Shiftum42/HDAccess.sft"); - upgraded = true; - System.IO.Directory.Delete("C:/ShiftOS-Rewind/", true); - backgroundWorker1.RunWorkerAsync(); - conversationtimer.Start(); - hackeffecttimer.Start(); - } - } - } - else - { - backgroundWorker1.RunWorkerAsync(); - conversationtimer.Start(); - hackeffecttimer.Start(); - } - } - - private void TextType(string texttotype) - { - conversationtimer.Stop(); - charcount = texttotype.Length; - gtexttotype = texttotype; - currentletter = 0; - slashcount = 1; - textgen.Start(); - } - - - private void textgen_Tick(object sender, EventArgs e) - { - switch (slashcount) - { - case 1: - if (currentletter < gtexttotype.Length) - { - textgeninput.Text = rtext + "\\"; - } - - break; - case 2: - if (currentletter < gtexttotype.Length) - { - textgeninput.Text = rtext + "|"; - } - - break; - case 3: - if (currentletter < gtexttotype.Length) - { - textgeninput.Text = rtext + "/"; - } - - break; - case 4: - if (currentletter < gtexttotype.Length) - { - rtext = rtext + Regex.Split(gtexttotype, string.Empty)[currentletter]; - currentletter = currentletter + 1; - textgeninput.Text = rtext; - - } - break; - } - - slashcount = slashcount + 1; - - if (slashcount == 5) - slashcount = 1; - if (currentletter == gtexttotype.Length) - { - gtexttotype = ""; - PlaySound(Properties.Resources.typesound); - conversationtimer.Start(); - textgen.Stop(); - } - - - } - - private void conversationtimer_Tick(object sender, EventArgs e) - { - switch (conversationcount) - { - case 0: - if (needtoclose == true) - this.Close(); - break; - case 1: - - textgeninput = lblHijack; - TextType("Your computer is now being Hijacked "); - conversationtimer.Interval = 1000; - - break; - case 3: - textgeninput = lblhackwords; - textgen.Interval = 10; - rtext = ""; - TextType("Congratulations, " + Environment.UserName + "you have been involuntarily selected to be an Alpha Tester for ShiftOS!" + Environment.NewLine + Environment.NewLine); - break; - case 4: - TextType("At this time, I do not wish to reveal any of my intentions and idenity." + Environment.NewLine + Environment.NewLine); - break; - case 5: - TextType("I just need to use you and your computer as an external test bed to evolve my experimental operating system." + Environment.NewLine + Environment.NewLine); - break; - case 6: - TextType("I need to expand the name of ShiftOS, so I'll work on it, and you'll have the chance to use ShiftOS!" + Environment.NewLine + Environment.NewLine); - break; - case 7: - TextType("Your hard drive will now be formatted in preparation for the installation of ShiftOS." + Environment.NewLine + Environment.NewLine); - break; - case 8: - TextType("Starting Format."); - conversationtimer.Interval = 500; - break; - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - TextType("."); - break; - case 19: - rtext = ""; - break; - case 20: - TextType("Scanning Drive C:\\..."); - break; - case 21: - - TextType(Environment.NewLine + Environment.NewLine + "Drive Label: " + cdrive.VolumeLabel); - break; - case 22: - TextType(Environment.NewLine + "Total Drive Size: " + String.Format((cdrive.TotalSize / 1024 / 1024 / 1024).ToString(), "0.00") + "GB. "); - break; - case 23: - TextType(Environment.NewLine + "Old File System: " + cdrive.DriveFormat + ". "); - break; - case 24: - TextType(Environment.NewLine + "New File System: ShiftFS. "); - break; - case 25: - TextType(Environment.NewLine + Environment.NewLine + "Formatting C:\\... - "); - conversationtimer.Interval = 100; - break; - case 26: // TODO: to 126 - textgeninput.Text = rtext + percentcount + "%"; - if (percentcount < 101) - { - percentcount = percentcount + 1; - PlaySound(Main.Properties.Resources.writesound); - } - break; - case 127: - rtext = rtext + "100%"; - conversationtimer.Interval = 1000; - break; - case 128: - TextType(Environment.NewLine + "Format Complete"); - break; - case 129: - rtext = ""; - percentcount = 0; - TextType("Installing ShiftOS Beta 0.0.1 - "); - conversationtimer.Interval = 200; - break; - case 130: // TODO: to 230 - textgeninput.Text = rtext + percentcount + "%" + Environment.NewLine + Environment.NewLine; - if (percentcount < 101) - { - percentcount = percentcount + 1; - PlaySound(Properties.Resources.writesound); - } - switch (percentcount) - { - case 1: - case 2: - textgeninput.Text = textgeninput.Text + "C:/Home"; - if ((!System.IO.Directory.Exists("C:/ShiftOS-Rewind/Home"))) - System.IO.Directory.CreateDirectory("C:/ShiftOS-Rewind/Home"); - break; - case 3: - case 4: - textgeninput.Text = textgeninput.Text + "C:/Home/Documents"; - if ((!System.IO.Directory.Exists("C:/ShiftOS-Rewind/Home/Documents"))) - System.IO.Directory.CreateDirectory("C:/ShiftOS-Rewind/Home/Documents"); - break; - case 5: - case 6: - case 7: - case 8: - case 9: - textgeninput.Text = textgeninput.Text + "C:/Home/Documents/ShiftOSInfo.txt"; - fs = File.Create("C:/ShiftOS-Rewind/Home/Documents/ShiftOSInfo.txt"); - fs.Close(); - break; - case 10: - case 11: - case 12: - textgeninput.Text = textgeninput.Text + "C:/Home/Music"; - if ((!System.IO.Directory.Exists("C:/ShiftOS-Rewind/Home/Music"))) - System.IO.Directory.CreateDirectory("C:/ShiftOS-Rewind/Home/Music"); - break; - case 13: - case 14: - case 15: - textgeninput.Text = textgeninput.Text + "C:/Home/Pictures"; - if ((!System.IO.Directory.Exists("C:/ShiftOS-Rewind/Home/Pictures"))) - System.IO.Directory.CreateDirectory("C:/ShiftOS-Rewind/Home/Pictures"); - break; - case 16: - case 17: - case 18: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42"; - if ((!System.IO.Directory.Exists("C:/ShiftOS-Rewind/Shiftum42"))) - System.IO.Directory.CreateDirectory("C:/ShiftOS-Rewind/Shiftum42"); - break; - case 19: - case 20: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/Drivers"; - if ((!System.IO.Directory.Exists("C:/ShiftOS-Rewind/Shiftum42/Drivers"))) - System.IO.Directory.CreateDirectory("C:/ShiftOS-Rewind/Shiftum42/Drivers"); - break; - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/Drivers/HDD.dri"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/Drivers/HDD.dri"); - fs.Close(); - break; - case 28: - case 29: - case 30: - case 31: - case 32: - case 33: - case 34: - case 35: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/Drivers/Keyboard.dri"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/Drivers/Keyboard.dri"); - fs.Close(); - break; - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 43: - case 44: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/Drivers/Monitor.dri"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/Drivers/Monitor.dri"); - fs.Close(); - break; - case 45: - case 46: - case 47: - case 48: - case 49: - case 50: - case 51: - case 52: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/Drivers/Mouse.dri"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/Drivers/Mouse.dri"); - fs.Close(); - break; - case 53: - case 54: - case 55: - case 56: - case 57: - case 58: - case 59: - case 60: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/Drivers/Printer.dri"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/Drivers/Printer.dri"); - fs.Close(); - break; - case 61: - case 62: - case 63: - case 64: - case 65: - case 66: - case 67: - case 68: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/Languages/"; - if ((!System.IO.Directory.Exists("C:/ShiftOS-Rewind/Shiftum42/Languages/"))) - System.IO.Directory.CreateDirectory("C:/ShiftOS-Rewind/Shiftum42/Languages/"); - break; - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/Languages/English.lang"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/Languages/English.lang"); - fs.Close(); - break; - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/HDAccess.sft"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/HDAccess.sft"); - fs.Close(); - System.IO.StreamWriter objWriter = new System.IO.StreamWriter("C:/ShiftOS-Rewind/Shiftum42/HDAccess.sft", false); - objWriter.Write(actualshiftversion); - objWriter.Close(); - break; - case 85: - case 86: - case 87: - case 88: - case 89: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/ShiftGUI.sft"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/ShiftGUI.sft"); - fs.Close(); - break; - case 90: - case 91: - case 92: - case 93: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/SKernal.sft"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/SKernal.sft"); - fs.Close(); - break; - case 94: - case 95: - case 96: - case 97: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/SRead.sft"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/SRead.sft"); - fs.Close(); - break; - case 98: - case 99: - case 100: - case 101: - textgeninput.Text = textgeninput.Text + "C:/Shiftum42/SWrite.sft"; - fs = File.Create("C:/ShiftOS-Rewind/Shiftum42/SWrite.sft"); - fs.Close(); - break; - } - - break; - - case 231: - textgeninput.Text = rtext + "100%" + Environment.NewLine + Environment.NewLine + "C:/Shiftum42/SWrite.sft"; - conversationtimer.Interval = 1000; - PlaySound(Properties.Resources.writesound); - break; - case 232: - textgeninput.Text = rtext + "100%" + Environment.NewLine + Environment.NewLine + "ShiftOS Installation Complete!"; - PlaySound(Properties.Resources.typesound); - if ((!System.IO.Directory.Exists("C:/ShiftOS-Rewind/SoftwareData/"))) - System.IO.Directory.CreateDirectory("C:/ShiftOS-Rewind/SoftwareData/"); - if ((!System.IO.Directory.Exists("C:/ShiftOS-Rewind/SoftwareData/KnowledgeInput"))) - System.IO.Directory.CreateDirectory("C:/ShiftOS-Rewind/SoftwareData/KnowledgeInput"); - fs = File.Create("C:/ShiftOS-Rewind/SoftwareData/KnowledgeInput/Animals.lst"); - fs.Close(); - fs = File.Create("C:/ShiftOS-Rewind/SoftwareData/KnowledgeInput/Fruits.lst"); - fs.Close(); - fs = File.Create("C:/ShiftOS-Rewind/SoftwareData/KnowledgeInput/Countries.lst"); - fs.Close(); - break; - case 234: - //ShiftOSDesktop.newgame = true; - //ShiftOSDesktop.Show(); - //Terminal.Show(); - //Terminal.tmrfirstrun.Start(); - //this.Close(); - - break; - } - conversationcount = conversationcount + 1; - } - - private void hackeffecttimer_Tick(object sender, EventArgs e) - { - if (hackeffect < 101) - { - switch (hackeffect) - { - case 1: - case 3: - case 5: - case 7: - case 9: - case 11: - case 13: - case 15: - case 17: - case 19: - case 21: - case 23: - case 25: - case 27: - case 29: - case 31: - case 33: - case 35: - case 37: - case 39: - case 41: - case 43: - case 45: - case 47: - case 49: - case 51: - case 53: - case 55: - case 57: - case 59: - case 61: - case 63: - case 65: - case 67: - case 69: - case 71: - case 73: - case 75: - case 77: - case 79: - case 81: - case 83: - case 85: - case 87: - case 89: - case 91: - case 93: - case 95: - this.BackColor = Color.Black; - PlaySound(Properties.Resources.writesound); - break; - case 2: - case 4: - case 6: - case 8: - case 10: - case 12: - case 14: - case 16: - case 18: - case 20: - case 22: - case 24: - case 26: - case 28: - this.BackColor = Color.White; - PlaySound(Properties.Resources.typesound); - break; - case 30: - case 32: - case 34: - case 36: - case 38: - case 40: - case 42: - case 44: - case 46: - case 48: - case 50: - this.BackColor = Color.Gainsboro; - PlaySound(Properties.Resources.typesound); - break; - case 52: - case 54: - case 56: - case 58: - case 60: - case 62: - case 64: - case 66: - case 68: - case 70: - case 72: - case 74: - case 76: - this.BackColor = Color.Silver; - PlaySound(Properties.Resources.typesound); - break; - case 78: - case 80: - case 82: - case 84: - case 86: - case 88: - case 90: - case 92: - case 94: - this.BackColor = Color.DimGray; - PlaySound(Properties.Resources.typesound); - break; - case 96: - lblHijack.BackColor = Color.LightGray; - break; - case 97: - lblHijack.BackColor = Color.DarkGray; - break; - case 98: - lblHijack.BackColor = Color.DimGray; - break; - case 99: - lblHijack.BackColor = Color.Black; - lblHijack.ForeColor = Color.DimGray; - break; - case 100: - lblHijack.Hide(); - break; - } - } - else - { - hackeffecttimer.Stop(); - } - hackeffect = hackeffect + 1; - } - - } -} - - diff --git a/ShiftOS.Main/Program.cs b/ShiftOS.Main/Program.cs index 10277b0..f7c00eb 100644 --- a/ShiftOS.Main/Program.cs +++ b/ShiftOS.Main/Program.cs @@ -1,24 +1,21 @@ using System; -using System.Threading.Tasks; using System.Windows.Forms; using ShiftOS.Main.ShiftOS; namespace ShiftOS.Main { - static class Program - { - /// <summary> - /// The main entry point for the application. - /// </summary> - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); + static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); - Parallel.Invoke( - () => Application.Run(new TestForm()), - () => Application.Run(new Desktop())); - } - } -} + Application.Run(new Desktop()); + } + } +}
\ No newline at end of file diff --git a/ShiftOS.Main/Properties/AssemblyInfo.cs b/ShiftOS.Main/Properties/AssemblyInfo.cs index 6f85581..bcab0d6 100644 --- a/ShiftOS.Main/Properties/AssemblyInfo.cs +++ b/ShiftOS.Main/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -33,4 +32,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file diff --git a/ShiftOS.Main/Properties/Settings.settings b/ShiftOS.Main/Properties/Settings.settings index 3964565..e04fc63 100644 --- a/ShiftOS.Main/Properties/Settings.settings +++ b/ShiftOS.Main/Properties/Settings.settings @@ -1,7 +1,8 @@ <?xml version='1.0' encoding='utf-8'?> + <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> <Profiles> <Profile Name="(Default)" /> </Profiles> <Settings /> -</SettingsFile> +</SettingsFile>
\ No newline at end of file diff --git a/ShiftOS.Main/Resources/CatalystGrammar.xml b/ShiftOS.Main/Resources/CatalystGrammar.xml index b082a0d..90543d6 100644 --- a/ShiftOS.Main/Resources/CatalystGrammar.xml +++ b/ShiftOS.Main/Resources/CatalystGrammar.xml @@ -1,22 +1,23 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.0" encoding="UTF-8"?> + <grammar version="1.0" xml:lang="en-US" xmlns="http://www.w3.org/2001/06/grammar" tag-format="semantics/1.0" root="Main"> - + <!-- Catalyst Grammar File This file gives Catalyst the ability to recognize audio input and give a proper response. --> - + <rule id="Main"> <item> How much Code Points do I have? </item> - <item>Can you run <ruleref uri="#programs"/>?</item> - <item>Can you minimize <ruleref uri="#programs"/>?</item> - <item>Can you close <ruleref uri="#programs"/>?</item> + <item>Can you run <ruleref uri="#programs" />?</item> + <item>Can you minimize <ruleref uri="#programs" />?</item> + <item>Can you close <ruleref uri="#programs" />?</item> </rule> <rule id="programs" scope="public"> diff --git a/ShiftOS.Main/ShiftOS.Main.csproj b/ShiftOS.Main/ShiftOS.Main.csproj index f511503..6f712cc 100644 --- a/ShiftOS.Main/ShiftOS.Main.csproj +++ b/ShiftOS.Main/ShiftOS.Main.csproj @@ -20,6 +20,7 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <LangVersion>latest</LangVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> @@ -29,6 +30,7 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <LangVersion>latest</LangVersion> </PropertyGroup> <ItemGroup> <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> @@ -47,14 +49,14 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="HijackScreen.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="HijackScreen.Designer.cs"> - <DependentUpon>HijackScreen.cs</DependentUpon> - </Compile> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="ShiftOS\Apps\FileSkimmer.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="ShiftOS\Apps\FileSkimmer.Designer.cs"> + <DependentUpon>FileSkimmer.cs</DependentUpon> + </Compile> <Compile Include="ShiftOS\Apps\ShifterStuff\SelectColor.cs"> <SubType>UserControl</SubType> </Compile> @@ -85,15 +87,18 @@ <Compile Include="ShiftOS\Apps\TestForm.Designer.cs"> <DependentUpon>TestForm.cs</DependentUpon> </Compile> + <Compile Include="ShiftOS\Apps\TextPad.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="ShiftOS\Apps\TextPad.Designer.cs"> + <DependentUpon>TextPad.cs</DependentUpon> + </Compile> <Compile Include="ShiftOS\Desktop.cs"> <SubType>Form</SubType> </Compile> <Compile Include="ShiftOS\Desktop.Designer.cs"> <DependentUpon>Desktop.cs</DependentUpon> </Compile> - <EmbeddedResource Include="HijackScreen.resx"> - <DependentUpon>HijackScreen.cs</DependentUpon> - </EmbeddedResource> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> @@ -104,6 +109,9 @@ <DependentUpon>Resources.resx</DependentUpon> <DesignTime>True</DesignTime> </Compile> + <EmbeddedResource Include="ShiftOS\Apps\FileSkimmer.resx"> + <DependentUpon>FileSkimmer.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="ShiftOS\Apps\ShifterStuff\SelectColor.resx"> <DependentUpon>SelectColor.cs</DependentUpon> </EmbeddedResource> @@ -119,6 +127,9 @@ <EmbeddedResource Include="ShiftOS\Apps\TestForm.resx"> <DependentUpon>TestForm.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="ShiftOS\Apps\TextPad.resx"> + <DependentUpon>TextPad.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="ShiftOS\Desktop.resx"> <DependentUpon>Desktop.cs</DependentUpon> </EmbeddedResource> diff --git a/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.Designer.cs new file mode 100644 index 0000000..f2e0d76 --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.Designer.cs @@ -0,0 +1,257 @@ +using System.Windows.Forms; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + partial class FileSkimmer + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FileSkimmer)); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.breadcrumbsBar = new System.Windows.Forms.ToolStrip(); + this.toolStrip2 = new System.Windows.Forms.ToolStrip(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); + this.largeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.smallIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.detailsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.listToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.listView1 = new System.Windows.Forms.ListView(); + this.textFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1.SuspendLayout(); + this.toolStrip2.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(1541, 33); + this.menuStrip1.TabIndex = 1; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newFileToolStripMenuItem, + this.newFolderToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(50, 29); + this.fileToolStripMenuItem.Text = "File"; + // + // newFileToolStripMenuItem + // + this.newFileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.textFileToolStripMenuItem}); + this.newFileToolStripMenuItem.Name = "newFileToolStripMenuItem"; + this.newFileToolStripMenuItem.Size = new System.Drawing.Size(210, 30); + this.newFileToolStripMenuItem.Text = "New File"; + // + // newFolderToolStripMenuItem + // + this.newFolderToolStripMenuItem.Name = "newFolderToolStripMenuItem"; + this.newFolderToolStripMenuItem.Size = new System.Drawing.Size(210, 30); + this.newFolderToolStripMenuItem.Text = "New Folder"; + // + // breadcrumbsBar + // + this.breadcrumbsBar.ImageScalingSize = new System.Drawing.Size(24, 24); + this.breadcrumbsBar.Location = new System.Drawing.Point(0, 33); + this.breadcrumbsBar.Name = "breadcrumbsBar"; + this.breadcrumbsBar.Size = new System.Drawing.Size(1541, 25); + this.breadcrumbsBar.TabIndex = 2; + this.breadcrumbsBar.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.breadcrumbsBar_ItemClicked); + // + // toolStrip2 + // + this.toolStrip2.ImageScalingSize = new System.Drawing.Size(24, 24); + this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripButton1, + this.toolStripDropDownButton1}); + this.toolStrip2.Location = new System.Drawing.Point(0, 58); + this.toolStrip2.Name = "toolStrip2"; + this.toolStrip2.Size = new System.Drawing.Size(1541, 32); + this.toolStrip2.TabIndex = 3; + this.toolStrip2.Text = "toolbar"; + // + // toolStripButton1 + // + this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); + this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Size = new System.Drawing.Size(28, 29); + this.toolStripButton1.Text = "^"; + this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); + // + // toolStripDropDownButton1 + // + this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.largeIconsToolStripMenuItem, + this.smallIconsToolStripMenuItem, + this.detailsToolStripMenuItem, + this.listToolStripMenuItem, + this.tilesToolStripMenuItem}); + this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image"))); + this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; + this.toolStripDropDownButton1.Size = new System.Drawing.Size(119, 29); + this.toolStripDropDownButton1.Text = "View Mode"; + this.toolStripDropDownButton1.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStripDropDownButton1_DropDownItemClicked); + // + // largeIconsToolStripMenuItem + // + this.largeIconsToolStripMenuItem.Name = "largeIconsToolStripMenuItem"; + this.largeIconsToolStripMenuItem.Size = new System.Drawing.Size(186, 30); + this.largeIconsToolStripMenuItem.Text = "Large Icons"; + // + // smallIconsToolStripMenuItem + // + this.smallIconsToolStripMenuItem.Name = "smallIconsToolStripMenuItem"; + this.smallIconsToolStripMenuItem.Size = new System.Drawing.Size(186, 30); + this.smallIconsToolStripMenuItem.Text = "Small Icons"; + // + // detailsToolStripMenuItem + // + this.detailsToolStripMenuItem.Name = "detailsToolStripMenuItem"; + this.detailsToolStripMenuItem.Size = new System.Drawing.Size(186, 30); + this.detailsToolStripMenuItem.Text = "Details"; + // + // listToolStripMenuItem + // + this.listToolStripMenuItem.Name = "listToolStripMenuItem"; + this.listToolStripMenuItem.Size = new System.Drawing.Size(186, 30); + this.listToolStripMenuItem.Text = "List"; + // + // tilesToolStripMenuItem + // + this.tilesToolStripMenuItem.Name = "tilesToolStripMenuItem"; + this.tilesToolStripMenuItem.Size = new System.Drawing.Size(186, 30); + this.tilesToolStripMenuItem.Text = "Tiles"; + // + // listView1 + // + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.Location = new System.Drawing.Point(0, 90); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(1541, 696); + this.listView1.TabIndex = 4; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseClick); + this.listView1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseDoubleClick); + // + // textFileToolStripMenuItem + // + this.textFileToolStripMenuItem.Name = "textFileToolStripMenuItem"; + this.textFileToolStripMenuItem.Size = new System.Drawing.Size(210, 30); + this.textFileToolStripMenuItem.Text = "Text file"; + this.textFileToolStripMenuItem.Click += new System.EventHandler(this.textFileToolStripMenuItem_Click); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openToolStripMenuItem, + this.renameToolStripMenuItem, + this.deleteToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(148, 94); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(147, 30); + this.openToolStripMenuItem.Text = "Open"; + // + // renameToolStripMenuItem + // + this.renameToolStripMenuItem.Name = "renameToolStripMenuItem"; + this.renameToolStripMenuItem.Size = new System.Drawing.Size(147, 30); + this.renameToolStripMenuItem.Text = "Rename"; + // + // deleteToolStripMenuItem + // + this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + this.deleteToolStripMenuItem.Size = new System.Drawing.Size(147, 30); + this.deleteToolStripMenuItem.Text = "Delete"; + // + // FileSkimmer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView1); + this.Controls.Add(this.toolStrip2); + this.Controls.Add(this.breadcrumbsBar); + this.Controls.Add(this.menuStrip1); + this.Name = "FileSkimmer"; + this.Size = new System.Drawing.Size(1541, 786); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.toolStrip2.ResumeLayout(false); + this.toolStrip2.PerformLayout(); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStrip breadcrumbsBar; + private System.Windows.Forms.ToolStrip toolStrip2; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1; + private System.Windows.Forms.ToolStripMenuItem largeIconsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem smallIconsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem detailsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem listToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem tilesToolStripMenuItem; + private System.Windows.Forms.ToolStripButton toolStripButton1; + private ToolStripMenuItem fileToolStripMenuItem; + private ToolStripMenuItem newFileToolStripMenuItem; + private ToolStripMenuItem newFolderToolStripMenuItem; + private ToolStripMenuItem textFileToolStripMenuItem; + private ContextMenuStrip contextMenuStrip1; + private ToolStripMenuItem openToolStripMenuItem; + private ToolStripMenuItem renameToolStripMenuItem; + private ToolStripMenuItem deleteToolStripMenuItem; + } +} diff --git a/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.cs b/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.cs new file mode 100644 index 0000000..ae26b2d --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Windows.Forms; +using ShiftOS.Engine.Misc; +using ShiftOS.Engine.ShiftFS; +using ShiftOS.Engine.WindowManager; +using System.Linq; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class FileSkimmer : UserControl, IShiftWindowExtensions + { + ShiftDirectory _currentDirectory; + + public FileSkimmer() + { + InitializeComponent(); + } + + public void OnLoaded(ShiftWindow window) + { + Debug.WriteLine(ShiftFS.Drives.Count); + listView1.ShowDrivesList(window); + } + + void toolStripDropDownButton1_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + switch (e.ClickedItem.Text) + { + case "Small Icons": + listView1.View = View.SmallIcon; + break; + case "Details": + listView1.View = View.Details; + break; + case "List": + listView1.View = View.List; + break; + case "Tiles": + listView1.View = View.Tile; + break; + default: + listView1.View = View.LargeIcon; + break; + } + } + + void listView1_MouseDoubleClick(object sender, MouseEventArgs e) + { + var hit = listView1.HitTest(e.Location); + + if (!(hit.Item.Tag is ShiftDirectory dir)) return; + + listView1.Items.Clear(); + listView1.DisplayShiftFolder(dir); + _currentDirectory = dir; + breadcrumbsBar.Items.Add(new ToolStripButton(dir.Name) { Tag = dir }); + } + + void toolStripButton1_Click(object sender, EventArgs e) + { + listView1.Items.Clear(); + if (breadcrumbsBar.Items.Count > 1) + { + breadcrumbsBar.Items.Remove(breadcrumbsBar.Items.OfType<ToolStripItem>().Last()); + var dir = breadcrumbsBar.Items.OfType<ToolStripItem>().Last().Tag as ShiftDirectory; + _currentDirectory = dir; + listView1.DisplayShiftFolder(dir); + } + else + { + breadcrumbsBar.Items.Clear(); + listView1.ShowDrivesList(); + } + } + + void breadcrumbsBar_ItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + var items = new List<ToolStripItem>(breadcrumbsBar.Items.OfType<ToolStripItem>() + .Where((_, y) => y > breadcrumbsBar.Items.IndexOf(e.ClickedItem))); + + foreach (var item in items) + { + breadcrumbsBar.Items.Remove(item); + } + + toolStripButton1_Click(null, EventArgs.Empty); + } + + void textFileToolStripMenuItem_Click(object sender, EventArgs e) + { + _currentDirectory.Add(new ShiftFile<string>("Text file")); + } + + void listView1_MouseClick(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + contextMenuStrip1.Show(MousePosition); + } + } + } +} diff --git a/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.resx b/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.resx new file mode 100644 index 0000000..97a52d3 --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/FileSkimmer.resx @@ -0,0 +1,163 @@ +<?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> + <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>175, 17</value> + </metadata> + <metadata name="breadcrumbsBar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>331, 17</value> + </metadata> + <metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>473, 17</value> + </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== +</value> + </data> + <data name="toolStripDropDownButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== +</value> + </data> + <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>615, 17</value> + </metadata> +</root>
\ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.Designer.cs index 7fd37f0..f8ee8e3 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.Designer.cs @@ -1,4 +1,4 @@ -namespace ShiftOS.Main +namespace ShiftOS.Main.ShiftOS.Apps { partial class ShiftDemo { diff --git a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.cs b/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.cs index 11fc160..ced10d2 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShiftDemo.cs @@ -1,26 +1,18 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +using System.Windows.Forms; using ShiftOS.Engine.WindowManager; -namespace ShiftOS.Main +namespace ShiftOS.Main.ShiftOS.Apps { - public partial class ShiftDemo : UserControl, IShiftWindowExtensions - { - public ShiftDemo() - { - InitializeComponent(); - } + public partial class ShiftDemo : UserControl, IShiftWindowExtensions + { + public ShiftDemo() + { + InitializeComponent(); + } - public void OnLoaded(ShiftWindow window) - { - icon.Image = this.GetShiftWindow().Icon.ToBitmap(); - } + public void OnLoaded(ShiftWindow window) + { + icon.Image = this.GetShiftWindow().Icon.ToBitmap(); + } } -} +}
\ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs index a7473a0..5d50bc0 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.Designer.cs @@ -1,4 +1,4 @@ -namespace ShiftOS.Main.ShiftOS.Apps +namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff { partial class SelectColor { diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/SelectColor.cs index f26fe4d..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.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; - } - - 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 diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs index ac81a5c..2ed43b4 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.Designer.cs @@ -1,4 +1,4 @@ -namespace ShiftOS.Main.ShiftOS.Apps +namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff { partial class Shifter { @@ -94,7 +94,7 @@ this.button4.TabIndex = 4; this.button4.Text = "Set Random Skin"; this.button4.UseVisualStyleBackColor = true; - this.button4.Click += new System.EventHandler(this.setRandomSkin); + this.button4.Click += new System.EventHandler(this.SetRandomSkin); // // button3 // @@ -106,7 +106,7 @@ this.button3.TabIndex = 3; this.button3.Text = "Set Default Skin"; this.button3.UseVisualStyleBackColor = true; - this.button3.Click += new System.EventHandler(this.setDefaultSkin); + this.button3.Click += new System.EventHandler(this.SetDefaultSkin); // // button2 // @@ -118,7 +118,7 @@ this.button2.TabIndex = 2; this.button2.Text = "Set Colorful Skin"; this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.setColorSkin); + this.button2.Click += new System.EventHandler(this.SetColorSkin); // // groupBox1 // diff --git a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs index 609b617..df093f0 100644 --- a/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs +++ b/ShiftOS.Main/ShiftOS/Apps/ShifterStuff/Shifter.cs @@ -1,113 +1,116 @@ using System; -using System.Windows.Forms; -using ShiftOS.Engine; -using ShiftOS.Engine.WindowManager; using System.Drawing; using System.IO; +using System.Windows.Forms; using Newtonsoft.Json; +using ShiftOS.Engine.Misc; +using ShiftOS.Engine.WindowManager; +using ShiftOS.Main.Properties; -namespace ShiftOS.Main.ShiftOS.Apps +namespace ShiftOS.Main.ShiftOS.Apps.ShifterStuff { - public partial class Shifter : UserControl - { - public int colorType; //This is a check to see what option was chosen. - public Shifter() - { - InitializeComponent(); - } + public partial class Shifter : UserControl + { + public int ColorType; //This is a check to see what option was chosen. - private void button1_Click(object sender, EventArgs e) - { - colorType = 1; - ShiftWM.Init(new SelectColor(), "Select a color", Properties.Resources.iconColourPicker_fw.ToIcon()); - } + public Shifter() + { + InitializeComponent(); + } - private void setDefaultSkin(object sender, EventArgs e) - { - setBorderColor(Color.FromArgb(64, 64, 64)); - ShiftSkinData.btnCloseColor = Color.Black; - ShiftSkinData.btnMaxColor = Color.Black; - ShiftSkinData.btnMinColor = Color.Black; - button5_Click(sender, e); - } + void button1_Click(object sender, EventArgs e) + { + ColorType = 1; + ShiftWM.Init(new SelectColor(), "Select a color", Resources.iconColourPicker_fw); + } - private void setColorSkin(object sender, EventArgs e) - { - setBorderColor(Color.Blue); - ShiftSkinData.btnCloseColor = Color.Red; - ShiftSkinData.btnMaxColor = Color.Yellow; - ShiftSkinData.btnMinColor = Color.Green; - ShiftSkinData.btnCloseHoverColor = Color.FromArgb(255, 102, 102); - ShiftSkinData.btnMaxHoverColor = Color.FromArgb(255, 255, 153); - ShiftSkinData.btnMinColor = Color.FromArgb(102, 255, 102); - button5_Click(sender, e); - } + void SetDefaultSkin(object sender, EventArgs e) + { + SetBorderColor(Color.FromArgb(64, 64, 64)); + ShiftSkinData.BtnCloseColor = Color.Black; + ShiftSkinData.BtnMaxColor = Color.Black; + ShiftSkinData.BtnMinColor = Color.Black; + button5_Click(sender, e); + } - private void setRandomSkin(object sender, EventArgs e) - { - Random rnd = new Random(); - setBorderColor(Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255))); - ShiftSkinData.btnCloseColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - ShiftSkinData.btnMaxColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - ShiftSkinData.btnMinColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - ShiftSkinData.btnCloseHoverColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - ShiftSkinData.btnMaxHoverColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - ShiftSkinData.btnMinHoverColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - button5_Click(sender, e); - } + void SetColorSkin(object sender, EventArgs e) + { + SetBorderColor(Color.Blue); + ShiftSkinData.BtnCloseColor = Color.Red; + ShiftSkinData.BtnMaxColor = Color.Yellow; + ShiftSkinData.BtnMinColor = Color.Green; + ShiftSkinData.BtnCloseHoverColor = Color.FromArgb(255, 102, 102); + ShiftSkinData.BtnMaxHoverColor = Color.FromArgb(255, 255, 153); + ShiftSkinData.BtnMinColor = Color.FromArgb(102, 255, 102); + button5_Click(sender, e); + } - // SetBorderColor - public void setBorderColor(Color borderColor) - { - ShiftSkinData.leftTopCornerColor = borderColor; - ShiftSkinData.titleBarColor = borderColor; - ShiftSkinData.rightTopCornerColor = borderColor; - ShiftSkinData.leftSideColor = borderColor; - ShiftSkinData.rightSideColor = borderColor; - ShiftSkinData.leftBottomCornerColor = borderColor; - ShiftSkinData.bottomSideColor = borderColor; - ShiftSkinData.rightBottomCornerColor = borderColor; - } + void SetRandomSkin(object sender, EventArgs e) + { + var rnd = new Random(); + SetBorderColor(Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255))); + ShiftSkinData.BtnCloseColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.BtnMaxColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.BtnMinColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.BtnCloseHoverColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.BtnMaxHoverColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + ShiftSkinData.BtnMinHoverColor = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + button5_Click(sender, e); + } - private void button5_Click(object sender, EventArgs e) - { + // SetBorderColor + public void SetBorderColor(Color borderColor) + { + ShiftSkinData.LeftTopCornerColor = borderColor; + ShiftSkinData.TitleBarColor = borderColor; + ShiftSkinData.RightTopCornerColor = borderColor; + ShiftSkinData.LeftSideColor = borderColor; + ShiftSkinData.RightSideColor = borderColor; + ShiftSkinData.LeftBottomCornerColor = borderColor; + ShiftSkinData.BottomSideColor = borderColor; + ShiftSkinData.RightBottomCornerColor = borderColor; + } - foreach (var window in ShiftWM.Windows) - { - window.Invoke(new Action(() => window.titleBar.BackColor = ShiftSkinData.titleBarColor)); - window.Invoke(new Action(() => window.leftTopCorner.BackColor = ShiftSkinData.leftTopCornerColor)); - window.Invoke(new Action(() => window.rightTopCorner.BackColor = ShiftSkinData.rightTopCornerColor)); - window.Invoke(new Action(() => window.leftSide.BackColor = ShiftSkinData.leftSideColor)); - window.Invoke(new Action(() => window.rightSide.BackColor = ShiftSkinData.rightSideColor)); - window.Invoke(new Action(() => window.leftBottomCorner.BackColor = ShiftSkinData.leftBottomCornerColor)); - window.Invoke(new Action(() => window.bottomSide.BackColor = ShiftSkinData.bottomSideColor)); - window.Invoke(new Action(() => window.rightBottomCorner.BackColor = ShiftSkinData.rightBottomCornerColor)); - window.Invoke(new Action(() => window.btnClose.BackColor = ShiftSkinData.btnCloseColor)); - window.Invoke(new Action(() => window.btnMax.BackColor = ShiftSkinData.btnMaxColor)); - window.Invoke(new Action(() => window.btnMin.BackColor = ShiftSkinData.btnMinColor)); - - } - } + void button5_Click(object sender, EventArgs e) + { + foreach (var window in ShiftWM.Windows) + { + window.Invoke(new Action(() => window.titleBar.BackColor = ShiftSkinData.TitleBarColor)); + window.Invoke(new Action(() => window.leftTopCorner.BackColor = ShiftSkinData.LeftTopCornerColor)); + window.Invoke(new Action(() => window.rightTopCorner.BackColor = ShiftSkinData.RightTopCornerColor)); + window.Invoke(new Action(() => window.leftSide.BackColor = ShiftSkinData.LeftSideColor)); + window.Invoke(new Action(() => window.rightSide.BackColor = ShiftSkinData.RightSideColor)); + window.Invoke(new Action(() => window.leftBottomCorner.BackColor = ShiftSkinData.LeftBottomCornerColor)); + window.Invoke(new Action(() => window.bottomSide.BackColor = ShiftSkinData.BottomSideColor)); + window.Invoke(new Action(() => window.rightBottomCorner.BackColor = ShiftSkinData.RightBottomCornerColor)); + window.Invoke(new Action(() => window.btnClose.BackColor = ShiftSkinData.BtnCloseColor)); + window.Invoke(new Action(() => window.btnMax.BackColor = ShiftSkinData.BtnMaxColor)); + window.Invoke(new Action(() => window.btnMin.BackColor = ShiftSkinData.BtnMinColor)); + } + } - private void btnSave_Click(object sender, EventArgs e) - { - Color[] shiftColors = new Color[14]; - shiftColors[0] = ShiftSkinData.leftTopCornerColor; - shiftColors[1] = ShiftSkinData.titleBarColor; - shiftColors[2] = ShiftSkinData.rightTopCornerColor; - shiftColors[3] = ShiftSkinData.leftSideColor; - shiftColors[4] = ShiftSkinData.rightSideColor; - shiftColors[5] = ShiftSkinData.leftBottomCornerColor; - shiftColors[6] = ShiftSkinData.bottomSideColor; - shiftColors[7] = ShiftSkinData.rightBottomCornerColor; - shiftColors[8] = ShiftSkinData.btnCloseColor; - shiftColors[9] = ShiftSkinData.btnMaxColor; - shiftColors[10] = ShiftSkinData.btnMinColor; - shiftColors[11] = ShiftSkinData.btnCloseHoverColor; - shiftColors[12] = ShiftSkinData.btnMaxHoverColor; - shiftColors[13] = ShiftSkinData.btnMinHoverColor; - File.WriteAllText(@"C:\Users\Public\Documents\Skin.json", JsonConvert.SerializeObject(shiftColors)); - ShiftWM.StartInfoboxSession("Saved Skin", "Saved Skin to C:\\Users\\Public\\Documents\\Skin.json", InfoboxTemplate.ButtonType.Ok); - } - } -} + void btnSave_Click(object sender, EventArgs e) + { + var shiftColors = new Color[14]; + shiftColors[0] = ShiftSkinData.LeftTopCornerColor; + shiftColors[1] = ShiftSkinData.TitleBarColor; + shiftColors[2] = ShiftSkinData.RightTopCornerColor; + shiftColors[3] = ShiftSkinData.LeftSideColor; + shiftColors[4] = ShiftSkinData.RightSideColor; + shiftColors[5] = ShiftSkinData.LeftBottomCornerColor; + shiftColors[6] = ShiftSkinData.BottomSideColor; + shiftColors[7] = ShiftSkinData.RightBottomCornerColor; + shiftColors[8] = ShiftSkinData.BtnCloseColor; + shiftColors[9] = ShiftSkinData.BtnMaxColor; + shiftColors[10] = ShiftSkinData.BtnMinColor; + shiftColors[11] = ShiftSkinData.BtnCloseHoverColor; + shiftColors[12] = ShiftSkinData.BtnMaxHoverColor; + shiftColors[13] = ShiftSkinData.BtnMinHoverColor; + File.WriteAllText(@"C:\Users\Public\Documents\Skin.json", JsonConvert.SerializeObject(shiftColors)); + ShiftWM.StartInfoboxSession( + "Saved Skin", + "Saved Skin to C:\\Users\\Public\\Documents\\Skin.json", + InfoboxTemplate.ButtonType.Ok); + } + } +}
\ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs b/ShiftOS.Main/ShiftOS/Apps/Terminal.cs index a9bd093..4c11136 100644 --- a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs +++ b/ShiftOS.Main/ShiftOS/Apps/Terminal.cs @@ -1,95 +1,80 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -using ShiftOS.Engine; using ShiftOS.Engine.Terminal; namespace ShiftOS.Main.ShiftOS.Apps { - public partial class Terminal : UserControl - { - public string defaulttextBefore = "user> "; - public string defaulttextResult = "user@shiftos> "; // NOT YET IMPLEMENTED!!! - public bool doClear = false; + public partial class Terminal : UserControl + { + public string DefaulttextBefore = "user> "; + string DefaulttextResult = "user@shiftos> "; // NOT YET IMPLEMENTED!!! + bool DoClear = false; - // The below variables makes the terminal... a terminal! - public string OldText = ""; - public int TrackingPosition = 0; + // The below variables makes the terminal... a terminal! + string OldText = ""; - public Terminal() - { - InitializeComponent(); + int TrackingPosition; - termmain.ContextMenuStrip = new ContextMenuStrip(); // Disables the right click of a richtextbox! - } + public Terminal() + { + InitializeComponent(); - public void Print(string text) - { - termmain.AppendText($"\n {text} \n {defaulttextResult}"); - TrackingPosition = termmain.Text.Length; - } + termmain.ContextMenuStrip = new ContextMenuStrip(); // Disables the right click of a richtextbox! + } - private void termmain_KeyDown(object sender, KeyEventArgs e) - { - // The below code disables the ability to paste anything other then text... + void Print(string text) + { + termmain.AppendText($"\n {text} \n {DefaulttextResult}"); + TrackingPosition = termmain.Text.Length; + } - if (e.Control && e.KeyCode == Keys.V) - { - //if (Clipboard.ContainsText()) - // termmain.Paste(DataFormats.GetFormat(DataFormats.Text)); - e.Handled = true; - } else if (e.KeyCode == Keys.Enter) { - Print(TerminalBackend.RunCommand(termmain.Text.Substring(TrackingPosition, termmain.Text.Length - TrackingPosition))); // The most horrific line in the entire application! - e.Handled = true; - } - } + void termmain_KeyDown(object sender, KeyEventArgs e) + { + // The below code disables the ability to paste anything other then text... - private void termmain_TextChanged(object sender, EventArgs e) - { - if (termmain.SelectionStart < TrackingPosition) - { - if (doClear == false) // If it's not clearing the terminal - { - termmain.Text = OldText; - termmain.Select(termmain.Text.Length, 0); - } - } - else - { - OldText = termmain.Text; - } - } + if (e.Control && e.KeyCode == Keys.V) + { + //if (Clipboard.ContainsText()) + // termmain.Paste(DataFormats.GetFormat(DataFormats.Text)); + e.Handled = true; + } + else if (e.KeyCode == Keys.Enter) + { + Print( + TerminalBackend.RunCommand( + termmain.Text.Substring( + TrackingPosition, + termmain.Text.Length - TrackingPosition))); // The most horrific line in the entire application! + e.Handled = true; + } + } - private void termmain_SelectionChanged(object sender, EventArgs e) - { - if (termmain.SelectionStart < TrackingPosition) - { - termmain.Text = OldText; - termmain.Select(termmain.Text.Length, 0); - } - } + void termmain_TextChanged(object sender, EventArgs e) + { + if (termmain.SelectionStart < TrackingPosition) + { + if (DoClear) return; + + termmain.Text = OldText; + termmain.Select(termmain.Text.Length, 0); + } + else + { + OldText = termmain.Text; + } + } - private void Terminal_Load(object sender, EventArgs e) - { - Print("\n"); - } + void termmain_SelectionChanged(object sender, EventArgs e) + { + if (termmain.SelectionStart >= TrackingPosition) return; + + termmain.Text = OldText; + termmain.Select(termmain.Text.Length, 0); + } - public string RunCommand(string command) - { - string ToReturn = ""; - - if (command == "hi") - { - ToReturn = $"{ToReturn} \n Hi!"; - MessageBox.Show("HI!"); - } - return ToReturn; - } - } -} + void Terminal_Load(object sender, EventArgs e) + { + Print("\n"); + } + } +}
\ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs index 50bcb58..b49924e 100644 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Apps/TestForm.Designer.cs @@ -1,4 +1,4 @@ -namespace ShiftOS.Main +namespace ShiftOS.Main.ShiftOS.Apps { partial class TestForm { diff --git a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs index 389f8d1..a0c12c0 100644 --- a/ShiftOS.Main/ShiftOS/Apps/TestForm.cs +++ b/ShiftOS.Main/ShiftOS/Apps/TestForm.cs @@ -1,28 +1,27 @@ using System; -using System.Drawing; -using System.Linq; using System.Windows.Forms; -using ShiftOS.Engine; +using ShiftOS.Engine.Misc; using ShiftOS.Engine.WindowManager; -using ShiftOS.Main.ShiftOS.Apps; +using ShiftOS.Main.Properties; +using ShiftOS.Main.ShiftOS.Apps.ShifterStuff; -namespace ShiftOS.Main +namespace ShiftOS.Main.ShiftOS.Apps { - public partial class TestForm : Form - { - public TestForm() - { - InitializeComponent(); - } + public partial class TestForm : Form + { + public TestForm() + { + InitializeComponent(); + } - private void Button1_Click(object sender, EventArgs e) - { - ShiftDemo demo = new ShiftDemo(); + void Button1_Click(object sender, EventArgs e) + { + var demo = new ShiftDemo(); ShiftWM.Init(demo, textBox1.Text, null); - ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok); - } + ShiftWM.StartInfoboxSession(textBox1.Text, textBox2.Text, InfoboxTemplate.ButtonType.Ok); + } - private void button2_Click(object sender, EventArgs e) - => ShiftWM.Init(new Shifter(), "Shifter", Properties.Resources.iconShifter.ToIcon()); - } -} + void button2_Click(object sender, EventArgs e) + => ShiftWM.Init(new Shifter(), "Shifter", Resources.iconShifter); + } +}
\ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Apps/TextPad.Designer.cs b/ShiftOS.Main/ShiftOS/Apps/TextPad.Designer.cs new file mode 100644 index 0000000..7d83c68 --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/TextPad.Designer.cs @@ -0,0 +1,215 @@ +namespace ShiftOS.Main.ShiftOS.Apps +{ + partial class TextPad + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.wordWrapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.insertToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.timeAndDateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textBox = new System.Windows.Forms.RichTextBox(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.editToolStripMenuItem, + this.insertToolStripMenuItem, + this.helpToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(315, 24); + this.menuStrip1.TabIndex = 0; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem, + this.openToolStripMenuItem, + this.saveToolStripMenuItem, + this.saveAsToolStripMenuItem, + this.toolStripMenuItem1, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.newToolStripMenuItem.Text = "New..."; + this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.openToolStripMenuItem.Text = "Open..."; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveToolStripMenuItem.Text = "Save..."; + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveAsToolStripMenuItem.Text = "Save As..."; + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.exitToolStripMenuItem.Text = "Exit"; + // + // editToolStripMenuItem + // + this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fontToolStripMenuItem, + this.wordWrapToolStripMenuItem}); + this.editToolStripMenuItem.Name = "editToolStripMenuItem"; + this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); + this.editToolStripMenuItem.Text = "Edit"; + // + // fontToolStripMenuItem + // + this.fontToolStripMenuItem.Name = "fontToolStripMenuItem"; + this.fontToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.fontToolStripMenuItem.Text = "Font"; + // + // wordWrapToolStripMenuItem + // + this.wordWrapToolStripMenuItem.Checked = true; + this.wordWrapToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.wordWrapToolStripMenuItem.Name = "wordWrapToolStripMenuItem"; + this.wordWrapToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.wordWrapToolStripMenuItem.Text = "Word Wrap"; + // + // insertToolStripMenuItem + // + this.insertToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.timeAndDateToolStripMenuItem}); + this.insertToolStripMenuItem.Name = "insertToolStripMenuItem"; + this.insertToolStripMenuItem.Size = new System.Drawing.Size(48, 20); + this.insertToolStripMenuItem.Text = "Insert"; + // + // timeAndDateToolStripMenuItem + // + this.timeAndDateToolStripMenuItem.Name = "timeAndDateToolStripMenuItem"; + this.timeAndDateToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.timeAndDateToolStripMenuItem.Text = "Time and Date..."; + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.aboutToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Text = "Help"; + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.aboutToolStripMenuItem.Text = "About..."; + // + // textBox + // + this.textBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox.Location = new System.Drawing.Point(0, 24); + this.textBox.Name = "textBox"; + this.textBox.Size = new System.Drawing.Size(315, 265); + this.textBox.TabIndex = 1; + this.textBox.Text = ""; + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + // + // TextPad + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.textBox); + this.Controls.Add(this.menuStrip1); + this.Name = "TextPad"; + this.Size = new System.Drawing.Size(315, 289); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem fontToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem wordWrapToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem insertToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem timeAndDateToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; + private System.Windows.Forms.RichTextBox textBox; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + } +} diff --git a/ShiftOS.Main/ShiftOS/Apps/TextPad.cs b/ShiftOS.Main/ShiftOS/Apps/TextPad.cs new file mode 100644 index 0000000..e86b1be --- /dev/null +++ b/ShiftOS.Main/ShiftOS/Apps/TextPad.cs @@ -0,0 +1,36 @@ +using System; +using System.IO; +using System.Windows.Forms; + +namespace ShiftOS.Main.ShiftOS.Apps +{ + public partial class TextPad : UserControl + { + readonly string _editedText; + + public TextPad() + { + InitializeComponent(); + _editedText = textBox.Text; + } + + bool IsEdited() => _editedText != textBox.Text; + + void openToolStripMenuItem_Click(object sender, EventArgs e) + { + if (openFileDialog1.ShowDialog() != DialogResult.OK) return; + + var sr = new StreamReader(openFileDialog1.FileName); + textBox.Text = sr.ReadToEnd(); + sr.Close(); + } + + void newToolStripMenuItem_Click(object sender, EventArgs e) + { + if (IsEdited()) + { + MessageBox.Show("yay it works"); + } + } + } +}
\ No newline at end of file diff --git a/ShiftOS.Main/HijackScreen.resx b/ShiftOS.Main/ShiftOS/Apps/TextPad.resx index 84970f0..53f75e1 100644 --- a/ShiftOS.Main/HijackScreen.resx +++ b/ShiftOS.Main/ShiftOS/Apps/TextPad.resx @@ -117,16 +117,13 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> - <metadata name="conversationtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>181, 17</value> + <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>153, 17</value> </metadata> - <metadata name="hackeffecttimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>331, 17</value> + <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>268, 17</value> </metadata> - <metadata name="textgen.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>467, 17</value> + <metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> </metadata> </root>
\ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs b/ShiftOS.Main/ShiftOS/Desktop.Designer.cs index ae2dc17..98cd5e7 100644 --- a/ShiftOS.Main/ShiftOS/Desktop.Designer.cs +++ b/ShiftOS.Main/ShiftOS/Desktop.Designer.cs @@ -28,87 +28,104 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.listView1 = new System.Windows.Forms.ListView(); - this.taskbar = new System.Windows.Forms.ToolStrip(); - this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); - this.taskbarClock = new System.Windows.Forms.ToolStripLabel(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.terminalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.taskbar.SuspendLayout(); - this.SuspendLayout(); - // - // listView1 - // - this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.listView1.Location = new System.Drawing.Point(0, 0); - this.listView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.listView1.Name = "listView1"; - this.listView1.Size = new System.Drawing.Size(1277, 684); - this.listView1.TabIndex = 0; - this.listView1.UseCompatibleStateImageBehavior = false; - // - // taskbar - // - this.taskbar.Dock = System.Windows.Forms.DockStyle.Bottom; - this.taskbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.taskbar.ImageScalingSize = new System.Drawing.Size(24, 24); - this.taskbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + this.listView1 = new System.Windows.Forms.ListView(); + this.taskbar = new System.Windows.Forms.ToolStrip(); + this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); + this.terminalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textPadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.taskbarClock = new System.Windows.Forms.ToolStripLabel(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.fileSkimmerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.taskbar.SuspendLayout(); + this.SuspendLayout(); + // + // listView1 + // + this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(1916, 1052); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + // + // taskbar + // + this.taskbar.Dock = System.Windows.Forms.DockStyle.Bottom; + this.taskbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.taskbar.ImageScalingSize = new System.Drawing.Size(24, 24); + this.taskbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripDropDownButton1, this.taskbarClock}); - this.taskbar.Location = new System.Drawing.Point(0, 653); - this.taskbar.Name = "taskbar"; - this.taskbar.Size = new System.Drawing.Size(1277, 31); - this.taskbar.TabIndex = 1; - this.taskbar.Text = "toolStrip1"; - // - // toolStripDropDownButton1 - // - this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.terminalToolStripMenuItem}); - this.toolStripDropDownButton1.Image = global::ShiftOS.Main.Properties.Resources.iconWebBrowser; - this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; - this.toolStripDropDownButton1.Size = new System.Drawing.Size(95, 28); - this.toolStripDropDownButton1.Tag = ((uint)(0u)); - this.toolStripDropDownButton1.Text = "Programs"; - // - // taskbarClock - // - this.taskbarClock.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.taskbarClock.Image = global::ShiftOS.Main.Properties.Resources.iconClock; - this.taskbarClock.Name = "taskbarClock"; - this.taskbarClock.Size = new System.Drawing.Size(52, 28); - this.taskbarClock.Tag = ((uint)(0u)); - this.taskbarClock.Text = "0:00"; - // - // timer1 - // - this.timer1.Interval = 1000; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // terminalToolStripMenuItem - // - this.terminalToolStripMenuItem.Name = "terminalToolStripMenuItem"; - this.terminalToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.terminalToolStripMenuItem.Text = "Terminal"; - this.terminalToolStripMenuItem.Click += new System.EventHandler(this.terminalToolStripMenuItem_Click); - // - // Desktop - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1277, 684); - this.Controls.Add(this.taskbar); - this.Controls.Add(this.listView1); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.Name = "Desktop"; - this.Text = "Desktop"; - this.taskbar.ResumeLayout(false); - this.taskbar.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.taskbar.Location = new System.Drawing.Point(0, 1020); + this.taskbar.Name = "taskbar"; + this.taskbar.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0); + this.taskbar.Size = new System.Drawing.Size(1916, 32); + this.taskbar.TabIndex = 1; + this.taskbar.Text = "toolStrip1"; + // + // toolStripDropDownButton1 + // + this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.terminalToolStripMenuItem, + this.textPadToolStripMenuItem, + this.fileSkimmerToolStripMenuItem}); + this.toolStripDropDownButton1.Image = global::ShiftOS.Main.Properties.Resources.iconWebBrowser; + this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; + this.toolStripDropDownButton1.Size = new System.Drawing.Size(131, 29); + this.toolStripDropDownButton1.Tag = ((uint)(0u)); + this.toolStripDropDownButton1.Text = "Programs"; + // + // terminalToolStripMenuItem + // + this.terminalToolStripMenuItem.Name = "terminalToolStripMenuItem"; + this.terminalToolStripMenuItem.Size = new System.Drawing.Size(210, 30); + this.terminalToolStripMenuItem.Text = "Terminal"; + this.terminalToolStripMenuItem.Click += new System.EventHandler(this.terminalToolStripMenuItem_Click); + // + // textPadToolStripMenuItem + // + this.textPadToolStripMenuItem.Name = "textPadToolStripMenuItem"; + this.textPadToolStripMenuItem.Size = new System.Drawing.Size(210, 30); + this.textPadToolStripMenuItem.Text = "TextPad"; + this.textPadToolStripMenuItem.Click += new System.EventHandler(this.textPadToolStripMenuItem_Click); + // + // taskbarClock + // + this.taskbarClock.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.taskbarClock.Image = global::ShiftOS.Main.Properties.Resources.iconClock; + this.taskbarClock.Name = "taskbarClock"; + this.taskbarClock.Size = new System.Drawing.Size(70, 29); + this.taskbarClock.Tag = ((uint)(0u)); + this.taskbarClock.Text = "0:00"; + // + // timer1 + // + this.timer1.Interval = 1000; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // fileSkimmerToolStripMenuItem + // + this.fileSkimmerToolStripMenuItem.Name = "fileSkimmerToolStripMenuItem"; + this.fileSkimmerToolStripMenuItem.Size = new System.Drawing.Size(210, 30); + this.fileSkimmerToolStripMenuItem.Text = "File Skimmer"; + this.fileSkimmerToolStripMenuItem.Click += new System.EventHandler(this.fileSkimmerToolStripMenuItem_Click); + // + // Desktop + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1916, 1052); + this.Controls.Add(this.taskbar); + this.Controls.Add(this.listView1); + this.Name = "Desktop"; + this.Text = "Desktop"; + this.taskbar.ResumeLayout(false); + this.taskbar.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -120,5 +137,7 @@ private System.Windows.Forms.ToolStripLabel taskbarClock; private System.Windows.Forms.Timer timer1; private System.Windows.Forms.ToolStripMenuItem terminalToolStripMenuItem; - } + private System.Windows.Forms.ToolStripMenuItem textPadToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem fileSkimmerToolStripMenuItem; + } }
\ No newline at end of file diff --git a/ShiftOS.Main/ShiftOS/Desktop.cs b/ShiftOS.Main/ShiftOS/Desktop.cs index 06f1fc8..95e4d26 100644 --- a/ShiftOS.Main/ShiftOS/Desktop.cs +++ b/ShiftOS.Main/ShiftOS/Desktop.cs @@ -1,13 +1,10 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; +using ShiftOS.Engine.Misc; using ShiftOS.Engine.WindowManager; +using ShiftOS.Main.Properties; +using ShiftOS.Main.ShiftOS.Apps; namespace ShiftOS.Main.ShiftOS { @@ -19,50 +16,60 @@ namespace ShiftOS.Main.ShiftOS timer1.Start(); - this.Closed += (sender, args) => - { - Application.Exit(); - }; + Closed += (sender, args) => { Application.Exit(); }; #region Disgusting taskbar code - ShiftWM.Windows.CollectionChanged += (sender, args) => + ShiftWM.Windows.ItemAdded += (sender, e) => { - args.NewItems?.OfType<ShiftWindow>().ToList().ForEach(window => - { - taskbar.Invoke(new Action(() => - { - taskbar.Items.Add(new ToolStripButton + taskbar.Invoke( + new Action( + () => { - Text = window.Title.Text, - Image = window.Icon.ToBitmap(), - Tag = window.Id - }); - })); - }); - - args.OldItems?.OfType<ShiftWindow>().ToList().ForEach(window => - { - taskbar.Invoke(new Action(() => - { - var tbRemovalList = taskbar.Items.OfType<ToolStripItem>().Where(i => (uint) i.Tag == window.Id); + taskbar.Items.Add( + new ToolStripButton + { + Text = e.Item.Title.Text, + Image = e.Item.Icon.ToBitmap(), + Tag = e.Item.Id + }); + })); + }; - tbRemovalList.ToList().ForEach(p => taskbar.Items.Remove(p)); - })); - }); + ShiftWM.Windows.ItemRemoved += (sender, e) => + { + taskbar.Invoke( + new Action( + () => + { + var tbRemovalList = taskbar.Items.OfType<ToolStripItem>().Where(i => (uint) i.Tag == e.Item.Id); + + tbRemovalList.ToList().ForEach(p => taskbar.Items.Remove(p)); + })); }; #endregion } - private void timer1_Tick(object sender, EventArgs e) => + void timer1_Tick(object sender, EventArgs e) => taskbarClock.Text = $"{DateTime.Now:t}"; - private void terminalToolStripMenuItem_Click(object sender, EventArgs e) - { - Apps.Terminal trm = new Apps.Terminal(); + void terminalToolStripMenuItem_Click(object sender, EventArgs e) + { + var trm = new Terminal(); + ShiftWM.Init(trm, "Terminal", null); + } + + void textPadToolStripMenuItem_Click(object sender, EventArgs e) + { + var tp = new TextPad(); + ShiftWM.Init(tp, "TextPad", Resources.iconTextPad); + } - ShiftWM.Init(trm, "Terminal", null, false, true); - } - } -} + void fileSkimmerToolStripMenuItem_Click(object sender, EventArgs e) + { + var fs = new FileSkimmer(); + ShiftWM.Init(fs, "File Skimmer", Resources.iconFileSkimmer); + } + } +}
\ No newline at end of file diff --git a/ShiftOS.Main/packages.config b/ShiftOS.Main/packages.config index ee51c23..a96650b 100644 --- a/ShiftOS.Main/packages.config +++ b/ShiftOS.Main/packages.config @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> + <packages> <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" /> </packages>
\ No newline at end of file |
