diff options
Diffstat (limited to 'Microbit')
| -rw-r--r-- | Microbit/Debug.Designer.cs | 76 | ||||
| -rw-r--r-- | Microbit/Debug.cs | 31 | ||||
| -rw-r--r-- | Microbit/Debug.resx | 120 | ||||
| -rw-r--r-- | Microbit/Desktop.Designer.cs | 120 | ||||
| -rw-r--r-- | Microbit/Desktop.cs | 30 | ||||
| -rw-r--r-- | Microbit/Desktop.resx | 139 | ||||
| -rw-r--r-- | Microbit/MainMenu.Designer.cs | 18 | ||||
| -rw-r--r-- | Microbit/MainMenu.cs | 51 | ||||
| -rw-r--r-- | Microbit/Microbit.Main.csproj | 36 | ||||
| -rw-r--r-- | Microbit/packages.config | 7 |
10 files changed, 606 insertions, 22 deletions
diff --git a/Microbit/Debug.Designer.cs b/Microbit/Debug.Designer.cs new file mode 100644 index 0000000..2443681 --- /dev/null +++ b/Microbit/Debug.Designer.cs @@ -0,0 +1,76 @@ +namespace Microbit.Main +{ + partial class Debug + { + /// <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.label1 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Consolas", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(12, 23); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(480, 54); + this.label1.TabIndex = 0; + this.label1.Text = "Welcome to Debug Mode!\r\nThis is where you get easy access to the Microbit softwar" + + "e.\r\nLike Desktop, Settings and more!"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(34, 105); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 1; + this.button1.Text = "Desktop"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Debug + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(494, 388); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.Name = "Debug"; + this.Text = "Debug"; + this.Load += new System.EventHandler(this.Debug_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button1; + } +}
\ No newline at end of file diff --git a/Microbit/Debug.cs b/Microbit/Debug.cs new file mode 100644 index 0000000..abe96fa --- /dev/null +++ b/Microbit/Debug.cs @@ -0,0 +1,31 @@ +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; + +namespace Microbit.Main +{ + public partial class Debug : Form + { + public Debug() + { + InitializeComponent(); + } + + private void Debug_Load(object sender, EventArgs e) + { + + } + + private void button1_Click(object sender, EventArgs e) + { + Desktop desktop = new Desktop(); + desktop.Show(); + } + } +} diff --git a/Microbit/Debug.resx b/Microbit/Debug.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Microbit/Debug.resx @@ -0,0 +1,120 @@ +<?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> +</root>
\ No newline at end of file diff --git a/Microbit/Desktop.Designer.cs b/Microbit/Desktop.Designer.cs new file mode 100644 index 0000000..485d5d7 --- /dev/null +++ b/Microbit/Desktop.Designer.cs @@ -0,0 +1,120 @@ +namespace Microbit.Main +{ + partial class Desktop + { + /// <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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Desktop)); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); + this.programsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.shutdownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // toolStrip1 + // + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripDropDownButton1}); + this.toolStrip1.Location = new System.Drawing.Point(0, 0); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Padding = new System.Windows.Forms.Padding(0, 0, 2, 0); + this.toolStrip1.Size = new System.Drawing.Size(748, 25); + this.toolStrip1.TabIndex = 0; + this.toolStrip1.Text = "toolStrip1"; + // + // toolStripDropDownButton1 + // + this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.programsToolStripMenuItem, + this.settingsToolStripMenuItem, + this.toolStripSeparator1, + this.shutdownToolStripMenuItem}); + 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(51, 22); + this.toolStripDropDownButton1.Text = "Menu"; + // + // programsToolStripMenuItem + // + this.programsToolStripMenuItem.Name = "programsToolStripMenuItem"; + this.programsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.programsToolStripMenuItem.Text = "Programs"; + // + // settingsToolStripMenuItem + // + this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; + this.settingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.settingsToolStripMenuItem.Text = "Settings"; + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); + // + // shutdownToolStripMenuItem + // + this.shutdownToolStripMenuItem.Name = "shutdownToolStripMenuItem"; + this.shutdownToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.shutdownToolStripMenuItem.Text = "Shutdown"; + this.shutdownToolStripMenuItem.Click += new System.EventHandler(this.shutdownToolStripMenuItem_Click); + // + // Desktop + // + this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 22F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Black; + this.ClientSize = new System.Drawing.Size(748, 520); + this.Controls.Add(this.toolStrip1); + this.Font = new System.Drawing.Font("Consolas", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.Name = "Desktop"; + this.Text = "Desktop"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.Load += new System.EventHandler(this.Desktop_Load); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1; + private System.Windows.Forms.ToolStripMenuItem programsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem shutdownToolStripMenuItem; + } +}
\ No newline at end of file diff --git a/Microbit/Desktop.cs b/Microbit/Desktop.cs new file mode 100644 index 0000000..2761b89 --- /dev/null +++ b/Microbit/Desktop.cs @@ -0,0 +1,30 @@ +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; + +namespace Microbit.Main +{ + public partial class Desktop : Form + { + public Desktop() + { + InitializeComponent(); + } + + private void Desktop_Load(object sender, EventArgs e) + { + + } + + private void shutdownToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/Microbit/Desktop.resx b/Microbit/Desktop.resx new file mode 100644 index 0000000..30a20f7 --- /dev/null +++ b/Microbit/Desktop.resx @@ -0,0 +1,139 @@ +<?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="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="toolStripDropDownButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + 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> +</root>
\ No newline at end of file diff --git a/Microbit/MainMenu.Designer.cs b/Microbit/MainMenu.Designer.cs index d2b4011..3ba5ad4 100644 --- a/Microbit/MainMenu.Designer.cs +++ b/Microbit/MainMenu.Designer.cs @@ -33,6 +33,7 @@ this.wbLauncher = new System.Windows.Forms.WebBrowser(); this.btnReset = new System.Windows.Forms.Button(); this.btnExit = new System.Windows.Forms.Button(); + this.btnDebug = new System.Windows.Forms.Button(); this.SuspendLayout(); // // lbTitle @@ -101,6 +102,21 @@ this.btnExit.UseVisualStyleBackColor = true; this.btnExit.Click += new System.EventHandler(this.btnExit_Click); // + // btnDebug + // + this.btnDebug.Enabled = false; + this.btnDebug.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnDebug.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnDebug.ForeColor = System.Drawing.Color.White; + this.btnDebug.Location = new System.Drawing.Point(117, 63); + this.btnDebug.Name = "btnDebug"; + this.btnDebug.Size = new System.Drawing.Size(90, 32); + this.btnDebug.TabIndex = 5; + this.btnDebug.Text = "{{DEBUG}}"; + this.btnDebug.UseVisualStyleBackColor = true; + this.btnDebug.Visible = false; + this.btnDebug.Click += new System.EventHandler(this.btnDebug_Click); + // // MainMenu // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -108,6 +124,7 @@ this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(800, 450); this.ControlBox = false; + this.Controls.Add(this.btnDebug); this.Controls.Add(this.btnExit); this.Controls.Add(this.btnReset); this.Controls.Add(this.wbLauncher); @@ -128,6 +145,7 @@ private System.Windows.Forms.WebBrowser wbLauncher; private System.Windows.Forms.Button btnReset; private System.Windows.Forms.Button btnExit; + private System.Windows.Forms.Button btnDebug; } } diff --git a/Microbit/MainMenu.cs b/Microbit/MainMenu.cs index be78120..981d1bd 100644 --- a/Microbit/MainMenu.cs +++ b/Microbit/MainMenu.cs @@ -18,6 +18,10 @@ * ****************************************************************************/ using System; +using Microbit.Main; +using System.IO; +using Microbit.Kernel; +using Newtonsoft.Json; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -38,22 +42,59 @@ namespace Microbit private void MainMenu_Load(object sender, EventArgs e) { - +#if DEBUG + btnDebug.Visible = true; + btnDebug.Enabled = true; +#endif + if (Directory.Exists(MicroFS.MicrobitFolder)) + { + btnReset.Enabled = true; + } + else + { + btnReset.Enabled = false; + MicroFS.CreateSystemFiles(); + } } - private void btnExit_Click(object sender, EventArgs e) + private void btnStart_Click(object sender, EventArgs e) { - this.Close(); + } - private void btnStart_Click(object sender, EventArgs e) + private void btnReset_Click(object sender, EventArgs e) { + MessageBoxButtons buttons = MessageBoxButtons.YesNo; + DialogResult result; + result = MessageBox.Show("Are you sure that you want to reset this OS?\nTHIS ACTION WILL DESTROY YOUR FILES AND RESTORE TO THE DEFAULT SETTINGS.", "Are you sure?", buttons); + if (result == System.Windows.Forms.DialogResult.Yes) + { + foreach (string file in Directory.GetFiles(MicroFS.MicrobitFolder)) + { + File.Delete(file); + } + foreach (string directory in Directory.GetDirectories(MicroFS.MicrobitFolder)) + { + Directory.Delete(directory); + } + + Directory.Delete(MicroFS.MicrobitFolder); + } + btnReset.Enabled = false; + MessageBox.Show("OS has been restored to the default settings and all files are deleted."); } - private void btnReset_Click(object sender, EventArgs e) + private void btnDebug_Click(object sender, EventArgs e) { + Debug debug = new Debug(); + debug.Show(); + } + private void btnExit_Click(object sender, EventArgs e) + { + this.Close(); } + } } diff --git a/Microbit/Microbit.Main.csproj b/Microbit/Microbit.Main.csproj index 5014e47..82cf32b 100644 --- a/Microbit/Microbit.Main.csproj +++ b/Microbit/Microbit.Main.csproj @@ -32,25 +32,19 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Discord.Net.Core, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\Discord.Net.Core.1.0.2\lib\net45\Discord.Net.Core.dll</HintPath> - </Reference> - <Reference Include="Discord.Net.Rest, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\Discord.Net.Rest.1.0.2\lib\net45\Discord.Net.Rest.dll</HintPath> - </Reference> - <Reference Include="Discord.Net.Rpc, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\Discord.Net.Rpc.1.0.2\lib\net45\Discord.Net.Rpc.dll</HintPath> + <Reference Include="Microbit.Kernel"> + <HintPath>..\Microbit.Kernel\bin\Debug\Microbit.Kernel.dll</HintPath> </Reference> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> </Reference> <Reference Include="System" /> - <Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath> + <Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath> </Reference> <Reference Include="System.Core" /> - <Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath> + <Reference Include="System.Interactive.Async, Version=3.2.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Interactive.Async.3.2.0\lib\net45\System.Interactive.Async.dll</HintPath> </Reference> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> @@ -63,6 +57,18 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="Debug.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Debug.Designer.cs"> + <DependentUpon>Debug.cs</DependentUpon> + </Compile> + <Compile Include="Desktop.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Desktop.Designer.cs"> + <DependentUpon>Desktop.cs</DependentUpon> + </Compile> <Compile Include="MainMenu.cs"> <SubType>Form</SubType> </Compile> @@ -71,6 +77,12 @@ </Compile> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> + <EmbeddedResource Include="Debug.resx"> + <DependentUpon>Debug.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="Desktop.resx"> + <DependentUpon>Desktop.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="MainMenu.resx"> <DependentUpon>MainMenu.cs</DependentUpon> </EmbeddedResource> diff --git a/Microbit/packages.config b/Microbit/packages.config index e732a0b..1a5a8cb 100644 --- a/Microbit/packages.config +++ b/Microbit/packages.config @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Discord.Net.Core" version="1.0.2" targetFramework="net45" /> - <package id="Discord.Net.Rest" version="1.0.2" targetFramework="net45" /> - <package id="Discord.Net.Rpc" version="1.0.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net45" /> - <package id="System.Collections.Immutable" version="1.3.1" targetFramework="net45" /> - <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" /> + <package id="System.Collections.Immutable" version="1.5.0" targetFramework="net45" /> + <package id="System.Interactive.Async" version="3.2.0" targetFramework="net45" /> </packages>
\ No newline at end of file |
