├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── IMAGES.md ├── LICENSE ├── MoonShell.sln ├── MoonShell ├── AboutForm.cs ├── AboutForm.designer.cs ├── AboutForm.resx ├── App.config ├── ConsoleControl │ ├── ConsoleControl.cs │ ├── ConsoleControl.designer.cs │ ├── ConsoleControl.resx │ ├── ConsoleEventArgs.cs │ └── KeyMapping.cs ├── ConsoleControlAPI │ ├── Imports.cs │ ├── ProcessEventArgs.cs │ └── ProcessInterface.cs ├── EmbeddedAssembly.cs ├── Enums.cs ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── MoonShell.csproj ├── Newtonsoft.Json.dll ├── Options.cs ├── OptionsForm.cs ├── OptionsForm.designer.cs ├── OptionsForm.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ThemesForm.cs ├── ThemesForm.designer.cs ├── ThemesForm.resx ├── ToolStripRendererMaterial.cs ├── Utilities.cs ├── moonshell.ico └── packages.config ├── README.md ├── images ├── 1.PNG └── 2.PNG └── version.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MoonShell Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [2.2] - 2018-09-12 6 | - Removed: SSH support, because of too many bugs 7 | 8 | ## [2.1] - 2017-12-22 9 | - Save SSH configuration upon exiting (except password) 10 | - Paste only text, without formatting fixed 11 | 12 | ## [2.0] - 2017-12-20 13 | - Added SSH support 14 | 15 | ## [1.9] - 2017-11-25 16 | - New: Places, quick access to your favorite directories 17 | - New: Export logs 18 | - New: Change starting directory 19 | - Window state persistence added 20 | 21 | ## [1.8] - 2017-10-26 22 | - General improvements 23 | 24 | ## [1.7] - 2017-04-03 25 | - Added CTRL+T shortcut to add new tab 26 | - Added CTRL+W shortcut to remove a tab 27 | - Added command '!!' to execute last command 28 | 29 | ## [1.6] - 2017-02-17 30 | - Minor bug fixes 31 | 32 | ## [1.5] - 2017-02-01 33 | - Console shell totally re-designed 34 | - Performance improvements 35 | - Drag n' drop support for files/folders 36 | 37 | ## [1.4] - 2016-12-14 38 | - Addressed various issues 39 | 40 | ## [1.3] - 2016-12-05 41 | - Minor visual fixes 42 | 43 | ## [1.2] - 2016-11-24 44 | - Added theming support 45 | - Cosmetic changes 46 | 47 | ## [1.1] - 2016-11-18 48 | - Major bug fixes 49 | 50 | ## [1.0] - 2016-11-12 51 | - Initial release 52 | -------------------------------------------------------------------------------- /IMAGES.md: -------------------------------------------------------------------------------- 1 | ![alt](https://raw.githubusercontent.com/hellzerg/moonshell/master/images/1.PNG) 2 | ![alt](https://raw.githubusercontent.com/hellzerg/moonshell/master/images/2.PNG) -------------------------------------------------------------------------------- /MoonShell.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoonShell", "MoonShell\MoonShell.csproj", "{1891C8ED-CADC-4DA6-A95D-1E6620CFF804}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {1891C8ED-CADC-4DA6-A95D-1E6620CFF804}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {1891C8ED-CADC-4DA6-A95D-1E6620CFF804}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {1891C8ED-CADC-4DA6-A95D-1E6620CFF804}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {1891C8ED-CADC-4DA6-A95D-1E6620CFF804}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /MoonShell/AboutForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Diagnostics; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace MoonShell 13 | { 14 | public partial class AboutForm : Form 15 | { 16 | public AboutForm() 17 | { 18 | InitializeComponent(); 19 | Options.ApplyTheme(this); 20 | } 21 | 22 | private void button7_Click(object sender, EventArgs e) 23 | { 24 | this.Close(); 25 | } 26 | 27 | private void About_Load(object sender, EventArgs e) 28 | { 29 | CheckForIllegalCrossThreadCalls = false; 30 | 31 | infoBox.AppendText("Type 'add' or 'remove' to add or remove tabs\n"); 32 | infoBox.AppendText("Press CTRL+T or CTRL+W to add or remove tabs\n"); 33 | infoBox.AppendText("Type 'clear' or 'cls' to clear current tab\n"); 34 | infoBox.AppendText("Type '!!' to execute the last command\n"); 35 | infoBox.AppendText("Type 'addplace' to bookmark current directory\n"); 36 | infoBox.AppendText("Type 'removeplace ' to remove a specific place\n"); 37 | infoBox.AppendText("Type 'verifyplaces' to remove invalid places\n"); 38 | infoBox.AppendText("Type 'clearplaces' to remove all places\n"); 39 | infoBox.AppendText("Type 'exportlog' to export a log file\n"); 40 | infoBox.AppendText("Type 'options' to show options\n"); 41 | infoBox.AppendText("Type 'themes' to show available themes\n"); 42 | infoBox.AppendText("Type 'theme ' to change theme\n"); 43 | infoBox.AppendText("Type 'help' or 'about' to show available commands\n"); 44 | infoBox.AppendText("Type 'new' to launch a new instance\n"); 45 | infoBox.AppendText("Type 'admin' to launch a new privileged instance\n"); 46 | infoBox.AppendText("Type 'exit' or 'quit' to close MoonShell"); 47 | 48 | t1.Interval = 50; 49 | t2.Interval = 50; 50 | 51 | t1.Start(); 52 | } 53 | 54 | private void t1_Tick(object sender, EventArgs e) 55 | { 56 | const string s0 = ""; 57 | const string s1 = "M"; 58 | const string s2 = "Mo"; 59 | const string s3 = "Moo"; 60 | const string s4 = "Moon"; 61 | const string s5 = "MoonS"; 62 | const string s6 = "MoonSh"; 63 | const string s7 = "MoonShe"; 64 | const string s8 = "MoonShel"; 65 | const string s9 = "MoonShell"; 66 | 67 | switch (l1.Text) 68 | { 69 | case s0: 70 | l1.Text = s1; 71 | break; 72 | case s1: 73 | l1.Text = s2; 74 | break; 75 | case s2: 76 | l1.Text = s3; 77 | break; 78 | case s3: 79 | l1.Text = s4; 80 | break; 81 | case s4: 82 | l1.Text = s5; 83 | break; 84 | case s5: 85 | l1.Text = s6; 86 | break; 87 | case s6: 88 | l1.Text = s7; 89 | 90 | break; 91 | case s7: 92 | l1.Text = s8; 93 | break; 94 | case s8: 95 | l1.Text = s9; 96 | t1.Stop(); 97 | t2.Start(); 98 | break; 99 | case s9: 100 | l1.Text = s0; 101 | break; 102 | } 103 | } 104 | 105 | private void t2_Tick(object sender, EventArgs e) 106 | { 107 | string s0 = ""; 108 | string s1 = "d"; 109 | string s2 = "de"; 110 | string s3 = "dea"; 111 | string s4 = "dead"; 112 | string s5 = "deadm"; 113 | string s6 = "deadmo"; 114 | string s7 = "deadmoo"; 115 | string s8 = "deadmoon"; 116 | string s9 = "deadmoon © "; 117 | string s10 = "deadmoon © 2"; 118 | string s11 = "deadmoon © 20"; 119 | string s12 = "deadmoon © 201"; 120 | string s13 = "deadmoon © 2017"; 121 | 122 | switch (l2.Text) 123 | { 124 | case "": 125 | l2.Text = s1; 126 | break; 127 | case "d": 128 | l2.Text = s2; 129 | break; 130 | case "de": 131 | l2.Text = s3; 132 | break; 133 | case "dea": 134 | l2.Text = s4; 135 | break; 136 | case "dead": 137 | l2.Text = s5; 138 | break; 139 | case "deadm": 140 | l2.Text = s6; 141 | break; 142 | case "deadmo": 143 | l2.Text = s7; 144 | break; 145 | case "deadmoo": 146 | l2.Text = s8; 147 | break; 148 | case "deadmoon": 149 | l2.Text = s9; 150 | break; 151 | case "deadmoon © ": 152 | l2.Text = s10; 153 | break; 154 | case "deadmoon © 2": 155 | l2.Text = s11; 156 | break; 157 | case "deadmoon © 20": 158 | l2.Text = s12; 159 | break; 160 | case "deadmoon © 201": 161 | l2.Text = s13; 162 | t2.Stop(); 163 | //t1.Start(); 164 | break; 165 | case "deadmoon © 2017": 166 | l2.Text = s0; 167 | break; 168 | } 169 | } 170 | 171 | private void l2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 172 | { 173 | Process.Start("https://carcinos.eu/deadmoon"); 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /MoonShell/AboutForm.designer.cs: -------------------------------------------------------------------------------- 1 | namespace MoonShell 2 | { 3 | partial class AboutForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm)); 33 | this.button7 = new System.Windows.Forms.Button(); 34 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 35 | this.t1 = new System.Windows.Forms.Timer(this.components); 36 | this.t2 = new System.Windows.Forms.Timer(this.components); 37 | this.infoBox = new System.Windows.Forms.TextBox(); 38 | this.l1 = new System.Windows.Forms.Label(); 39 | this.l2 = new System.Windows.Forms.LinkLabel(); 40 | this.panel1 = new System.Windows.Forms.Panel(); 41 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 42 | this.panel1.SuspendLayout(); 43 | this.SuspendLayout(); 44 | // 45 | // button7 46 | // 47 | this.button7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 48 | this.button7.BackColor = System.Drawing.Color.DodgerBlue; 49 | this.button7.DialogResult = System.Windows.Forms.DialogResult.Cancel; 50 | this.button7.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 51 | this.button7.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 52 | this.button7.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 53 | this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 54 | this.button7.ForeColor = System.Drawing.Color.White; 55 | this.button7.Location = new System.Drawing.Point(508, 12); 56 | this.button7.Margin = new System.Windows.Forms.Padding(2); 57 | this.button7.Name = "button7"; 58 | this.button7.Size = new System.Drawing.Size(89, 39); 59 | this.button7.TabIndex = 39; 60 | this.button7.Tag = "themeable"; 61 | this.button7.Text = "OK"; 62 | this.button7.UseVisualStyleBackColor = false; 63 | this.button7.Click += new System.EventHandler(this.button7_Click); 64 | // 65 | // pictureBox1 66 | // 67 | this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); 68 | this.pictureBox1.Location = new System.Drawing.Point(12, 12); 69 | this.pictureBox1.Margin = new System.Windows.Forms.Padding(2); 70 | this.pictureBox1.Name = "pictureBox1"; 71 | this.pictureBox1.Size = new System.Drawing.Size(110, 108); 72 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 73 | this.pictureBox1.TabIndex = 38; 74 | this.pictureBox1.TabStop = false; 75 | // 76 | // t1 77 | // 78 | this.t1.Interval = 350; 79 | this.t1.Tick += new System.EventHandler(this.t1_Tick); 80 | // 81 | // t2 82 | // 83 | this.t2.Interval = 350; 84 | this.t2.Tick += new System.EventHandler(this.t2_Tick); 85 | // 86 | // infoBox 87 | // 88 | this.infoBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 89 | this.infoBox.BorderStyle = System.Windows.Forms.BorderStyle.None; 90 | this.infoBox.Dock = System.Windows.Forms.DockStyle.Fill; 91 | this.infoBox.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 92 | this.infoBox.ForeColor = System.Drawing.Color.White; 93 | this.infoBox.Location = new System.Drawing.Point(0, 0); 94 | this.infoBox.Margin = new System.Windows.Forms.Padding(2); 95 | this.infoBox.Multiline = true; 96 | this.infoBox.Name = "infoBox"; 97 | this.infoBox.ReadOnly = true; 98 | this.infoBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; 99 | this.infoBox.Size = new System.Drawing.Size(579, 319); 100 | this.infoBox.TabIndex = 40; 101 | // 102 | // l1 103 | // 104 | this.l1.AutoSize = true; 105 | this.l1.Font = new System.Drawing.Font("Segoe UI Semibold", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 106 | this.l1.ForeColor = System.Drawing.Color.White; 107 | this.l1.Location = new System.Drawing.Point(128, 12); 108 | this.l1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); 109 | this.l1.Name = "l1"; 110 | this.l1.Size = new System.Drawing.Size(0, 32); 111 | this.l1.TabIndex = 57; 112 | // 113 | // l2 114 | // 115 | this.l2.ActiveLinkColor = System.Drawing.Color.RoyalBlue; 116 | this.l2.AutoSize = true; 117 | this.l2.Font = new System.Drawing.Font("Segoe UI Semibold", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 118 | this.l2.LinkColor = System.Drawing.Color.DodgerBlue; 119 | this.l2.Location = new System.Drawing.Point(128, 88); 120 | this.l2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); 121 | this.l2.Name = "l2"; 122 | this.l2.Size = new System.Drawing.Size(0, 32); 123 | this.l2.TabIndex = 58; 124 | this.l2.Tag = "themeable"; 125 | this.l2.VisitedLinkColor = System.Drawing.Color.DodgerBlue; 126 | this.l2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.l2_LinkClicked); 127 | // 128 | // panel1 129 | // 130 | this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 131 | | System.Windows.Forms.AnchorStyles.Left) 132 | | System.Windows.Forms.AnchorStyles.Right))); 133 | this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 134 | this.panel1.Controls.Add(this.infoBox); 135 | this.panel1.Location = new System.Drawing.Point(15, 141); 136 | this.panel1.Margin = new System.Windows.Forms.Padding(4); 137 | this.panel1.Name = "panel1"; 138 | this.panel1.Size = new System.Drawing.Size(581, 321); 139 | this.panel1.TabIndex = 59; 140 | // 141 | // AboutForm 142 | // 143 | this.AcceptButton = this.button7; 144 | this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); 145 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 146 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 147 | this.CancelButton = this.button7; 148 | this.ClientSize = new System.Drawing.Size(609, 477); 149 | this.Controls.Add(this.panel1); 150 | this.Controls.Add(this.l2); 151 | this.Controls.Add(this.l1); 152 | this.Controls.Add(this.button7); 153 | this.Controls.Add(this.pictureBox1); 154 | this.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 155 | this.ForeColor = System.Drawing.Color.White; 156 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 157 | this.Margin = new System.Windows.Forms.Padding(2, 4, 2, 4); 158 | this.MaximizeBox = false; 159 | this.MinimizeBox = false; 160 | this.Name = "AboutForm"; 161 | this.ShowIcon = false; 162 | this.ShowInTaskbar = false; 163 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 164 | this.Text = "About MoonShell"; 165 | this.Load += new System.EventHandler(this.About_Load); 166 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 167 | this.panel1.ResumeLayout(false); 168 | this.panel1.PerformLayout(); 169 | this.ResumeLayout(false); 170 | this.PerformLayout(); 171 | 172 | } 173 | 174 | #endregion 175 | 176 | private System.Windows.Forms.Button button7; 177 | private System.Windows.Forms.PictureBox pictureBox1; 178 | private System.Windows.Forms.Timer t1; 179 | private System.Windows.Forms.Timer t2; 180 | private System.Windows.Forms.TextBox infoBox; 181 | private System.Windows.Forms.Label l1; 182 | private System.Windows.Forms.LinkLabel l2; 183 | private System.Windows.Forms.Panel panel1; 184 | } 185 | } -------------------------------------------------------------------------------- /MoonShell/AboutForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL 124 | EgAACxIB0t1+/AAABGJJREFUeF7t3V1O20wYxXH6sQAuCBAChI8EEIgiEALETZG6hqr3XWa30QV0JWja 125 | M5ohk+QBnNiUxz7n4ifoKLaT9/njOCGvWAkhCDFzUXiYi8LDXBQe5qLwMBeFh7koPMxF4WEuCg9zUXiY 126 | i8LDXPzng3TS3KznFoSLufjr++8g3TM7Z5hd+Iiv1sbSfmnGn9PX6OmbRAF0WJqxAmCVZqwAWKUZKwBW 127 | acYKgFWasQJglWZcP4DT09Nwc3MTrq+vxQHM4ujoyJxVKc24fgA/v4zD/v5+GA6H4sDBwUH48+OrOatS 128 | mnH9APr9fixuNBqJA8fHx+HbaGjOqpRmXD+Azc3NMB6Pw+HhoTiAH0acla1ZldKMFUDXKAByCoCcAiDn 129 | PgDcVsG8HdcB4GUKXjYOBoO4De4s1qzbynLcBoBB442KvB0i6PV6YWdnRzE0yG0AuM3Gxsbc9vf39/Gs 130 | sL6+HgPBA1AMy3MdAG5r7SO7urqKISAUvL2MB1Nl3zLR6gBKZ2dn8SkC2+D9bcVQTWcCKGHbtbW1sLW1 131 | FZ8aFMPzOhlAaW9vL8awvb1tHoed2wAAp3Kc2q39LAP7s47DzHUAgIs7XOThYu/y8tLc5yLyr6OtYzFy 132 | H0B+Dge87EMIGCJeDlr7fw1iUgAT7gMolRd0u7u78aq/fLOoCgUwrVUBQI4An2TB99jf6upq3Kd1vFkK 133 | YFprAsA2uLO4kMM+8FRwfn5uHuMlCmCa+wDybfGaHi/n8JNv7bcqhKMAJlwHgFM8LvjwWt7a16Jub2/j 134 | NQP2ax2PkdsAcBu8eWPtY1EnJyfx7KHhz3MdAJ6vrX1UcXFxEU/3OF7+RZGGP891ALittY/n4BSPbTB4 135 | PG3gwb02+HybplR5bJ7gPrc6gIeHh6cPi+C9AWyHB1Xlpx2vKBALtm0KrlnadKZxHcBLTwF4Ps+/5Flk 136 | 6BmeFvD/KVr7rgtnn7ZE4DoAvPQrt8V/VAwdP/H4Hne+yr5mYVucLe7u7qb23xTc72Xu13twG0CGYeWL 137 | Ofx72aGXcgC4ZrDuY135Q6zWsb1xHwA0MfSSAphoRQBNe+unAAXwAi8B4EKtic8XWPDRdRzDOrY3lAFk 138 | eBmICza8dGsCHlvbPnpGHQDgvjTNOo5X9AGwUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQ 139 | UwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAOQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQA 140 | OQVATgGQUwDkFAA5BUBOAZBTAOQUADkFQE4BkFMA5BQAuf8eAP5AA/4ANCKQ94c/qzse9M1ZldKM6wcA 141 | +KsaCEHeH/68jTWjWWnGzQQg7ZNmrABYpRkrAFZpxgqAVZqxAmCVZqwAWKUZKwBWacYKgFWa8af0NXr6 142 | pvT4+CgdZM3aXBQe5qLwMBeFh7koPMxF4WEuCg9zUXiYi8LDXBQe5qLwMBeFh7koPMxFYRFW/gIomWey 143 | ZShI6QAAAABJRU5ErkJggg== 144 | 145 | 146 | 147 | 328, 17 148 | 149 | 150 | 398, 17 151 | 152 | -------------------------------------------------------------------------------- /MoonShell/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MoonShell/ConsoleControl/ConsoleControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Linq; 6 | using System.Windows.Forms; 7 | using System.Collections; 8 | using System.Threading; 9 | using System.Globalization; 10 | 11 | namespace MoonShell 12 | { 13 | public delegate void ConsoleEventHandler(object sender, ConsoleEventArgs args); 14 | 15 | public partial class ConsoleControl : UserControl 16 | { 17 | MainForm _mainForm; 18 | 19 | // Stores the current line. 20 | // Used while navigating the previous commands list. 21 | // static int? currentLine = null; 22 | 23 | // Stores all the used commands. 24 | // public static ArrayList History = new ArrayList(); 25 | 26 | // Stores the last used command. 27 | string _lastCommand = string.Empty; 28 | 29 | // Helper for adding a place 30 | bool _addPlace = false; 31 | 32 | public ConsoleControl(MainForm mainForm) 33 | { 34 | InitializeComponent(); 35 | 36 | _mainForm = mainForm; 37 | 38 | ShowDiagnostics = false; 39 | 40 | ForeColor = Color.Lime; 41 | 42 | BackColor = Color.Black; 43 | 44 | ErrorColor = Color.Tomato; 45 | 46 | DiagnosticsColor = Color.Yellow; 47 | 48 | IsInputEnabled = true; 49 | 50 | SendKeyboardCommandsToProcess = false; 51 | 52 | InitializeKeyMappings(); 53 | 54 | processInterface.OnProcessOutput += processInterace_OnProcessOutput; 55 | processInterface.OnProcessError += processInterace_OnProcessError; 56 | processInterface.OnProcessInput += processInterace_OnProcessInput; 57 | processInterface.OnProcessExit += processInterace_OnProcessExit; 58 | 59 | richTextBoxConsole.KeyDown += richTextBoxConsole_KeyDown; 60 | } 61 | 62 | private void AddPlace() 63 | { 64 | if (_addPlace) 65 | { 66 | string place = InternalRichTextBox.Lines.Last().Replace(">", string.Empty).Trim(); 67 | 68 | if (!string.IsNullOrEmpty(place)) 69 | { 70 | Options.CurrentOptions.Places.Add(place); 71 | _mainForm.LoadPlaces(); 72 | 73 | _addPlace = false; 74 | } 75 | } 76 | } 77 | 78 | void processInterace_OnProcessError(object sender, ProcessEventArgs args) 79 | { 80 | WriteOutput(args.Content, ErrorColor); 81 | 82 | FireConsoleOutputEvent(args.Content); 83 | } 84 | 85 | void processInterace_OnProcessOutput(object sender, ProcessEventArgs args) 86 | { 87 | WriteOutput(args.Content, ForeColor); 88 | FireConsoleOutputEvent(args.Content); 89 | 90 | AddPlace(); 91 | } 92 | 93 | void processInterace_OnProcessInput(object sender, ProcessEventArgs args) 94 | { 95 | throw new NotImplementedException(); 96 | } 97 | 98 | void processInterace_OnProcessExit(object sender, ProcessEventArgs args) 99 | { 100 | if (ShowDiagnostics) 101 | { 102 | WriteOutput(Environment.NewLine + processInterface.ProcessFileName + " exited.", DiagnosticsColor); 103 | } 104 | 105 | if (!this.IsHandleCreated) 106 | return; 107 | 108 | Invoke((Action)(() => 109 | { 110 | richTextBoxConsole.ReadOnly = true; 111 | })); 112 | } 113 | 114 | private void InitializeKeyMappings() 115 | { 116 | // Map 'tab'. 117 | keyMappings.Add(new KeyMapping(false, false, false, Keys.Tab, "{TAB}", "\t")); 118 | 119 | // Map 'Ctrl-C'. 120 | keyMappings.Add(new KeyMapping(true, false, false, Keys.C, "^(c)", "\x03\r\n")); 121 | } 122 | 123 | void richTextBoxConsole_KeyDown(object sender, KeyEventArgs e) 124 | { 125 | _addPlace = false; 126 | bool isInReadOnlyZone = richTextBoxConsole.SelectionStart < inputStart; 127 | 128 | if (SendKeyboardCommandsToProcess && IsProcessRunning) 129 | { 130 | var mappings = from k in keyMappings 131 | where 132 | (k.KeyCode == e.KeyCode && 133 | k.IsAltPressed == e.Alt && 134 | k.IsControlPressed == e.Control && 135 | k.IsShiftPressed == e.Shift) 136 | select k; 137 | 138 | //foreach (var mapping in mappings) 139 | //{ 140 | // SendKeysEx.SendKeys(CurrentProcessHwnd, mapping.SendKeysMapping); 141 | // inputWriter.WriteLine(mapping.StreamMapping); 142 | // WriteInput("\x3", ForeColor, false); 143 | //} 144 | 145 | if (mappings.Any()) 146 | { 147 | e.SuppressKeyPress = true; 148 | return; 149 | } 150 | } 151 | 152 | if ((richTextBoxConsole.SelectionStart <= inputStart) && e.KeyCode == Keys.Back) 153 | { 154 | e.SuppressKeyPress = true; 155 | } 156 | 157 | 158 | if (isInReadOnlyZone) 159 | { 160 | // Allow arrows and Ctrl-C. 161 | if (!(e.KeyCode == Keys.Left || 162 | e.KeyCode == Keys.Right || 163 | e.KeyCode == Keys.Up || 164 | e.KeyCode == Keys.Down || 165 | (e.KeyCode == Keys.C && e.Control))) 166 | { 167 | e.SuppressKeyPress = true; 168 | } 169 | } 170 | 171 | if (e.Control && e.KeyCode == Keys.V) 172 | { 173 | ((RichTextBox)sender).Paste(DataFormats.GetFormat("Text")); 174 | e.Handled = true; 175 | } 176 | 177 | if (e.KeyCode == Keys.Return && !isInReadOnlyZone) 178 | { 179 | string input = string.Empty; 180 | 181 | try 182 | { 183 | input = richTextBoxConsole.Text.Substring(inputStart, (richTextBoxConsole.SelectionStart) - inputStart).Trim(); 184 | } 185 | catch 186 | { 187 | e.SuppressKeyPress = true; 188 | return; 189 | } 190 | 191 | // Custom command processing 192 | 193 | //if (!string.IsNullOrEmpty(input)) 194 | //{ 195 | // History.Add(input); 196 | //} 197 | 198 | if (input == "!!") 199 | { 200 | if (!string.IsNullOrEmpty(_lastCommand)) 201 | { 202 | input = _lastCommand; 203 | } 204 | else 205 | { 206 | input = string.Empty; 207 | } 208 | } 209 | 210 | if (input == "addplace") 211 | { 212 | input = string.Empty; 213 | _addPlace = true; 214 | } 215 | 216 | if (input.StartsWith("removeplace ")) 217 | { 218 | int i = -1; 219 | int.TryParse(input.Replace("removeplace ", string.Empty), out i); 220 | 221 | input = string.Empty; 222 | 223 | if (i > 0 && Options.CurrentOptions.Places.Count > 0) 224 | { 225 | try 226 | { 227 | Options.CurrentOptions.Places.RemoveAt(i - 1); 228 | _mainForm.LoadPlaces(); 229 | } 230 | catch { } 231 | } 232 | } 233 | 234 | if (input == "verifyplaces") 235 | { 236 | input = string.Empty; 237 | Options.VerifyPlaces(); 238 | _mainForm.LoadPlaces(); 239 | } 240 | 241 | if (input == "clearplaces") 242 | { 243 | input = string.Empty; 244 | Options.CurrentOptions.Places.Clear(); 245 | _mainForm.LoadPlaces(); 246 | } 247 | 248 | if (input == "exportlog") 249 | { 250 | input = string.Empty; 251 | _mainForm.ExportLog(); 252 | } 253 | 254 | if (input == "ls") 255 | { 256 | input = "dir"; 257 | } 258 | 259 | if (input == "exit" || input == "quit") 260 | { 261 | input = string.Empty; 262 | Application.Exit(); 263 | } 264 | 265 | if (input == "clear" || input == "cls") 266 | { 267 | ClearOutput(); 268 | return; 269 | } 270 | 271 | if (input == "add") 272 | { 273 | input = string.Empty; 274 | _mainForm.AddTab(); 275 | } 276 | 277 | if (input == "remove") 278 | { 279 | input = string.Empty; 280 | _mainForm.RemoveTab(); 281 | } 282 | 283 | if (input == "new") 284 | { 285 | input = string.Empty; 286 | _mainForm.NewWindow(); 287 | } 288 | 289 | if (input == "admin") 290 | { 291 | input = string.Empty; 292 | _mainForm.NewWindowAdmin(); 293 | } 294 | 295 | if (input == "options") 296 | { 297 | input = string.Empty; 298 | _mainForm.ShowOptions(); 299 | } 300 | 301 | if (input == "themes") 302 | { 303 | input = string.Empty; 304 | _mainForm.ShowThemes(); 305 | } 306 | 307 | if (input == "help" || input == "about") 308 | { 309 | input = string.Empty; 310 | _mainForm.ShowAboutDialog(); 311 | } 312 | 313 | if (input == "theme zerg") 314 | { 315 | input = string.Empty; 316 | Options.CurrentOptions.Color = Theme.Zerg; 317 | Options.ApplyTheme(_mainForm); 318 | } 319 | 320 | if (input == "theme ocean") 321 | { 322 | input = string.Empty; 323 | Options.CurrentOptions.Color = Theme.Ocean; 324 | Options.ApplyTheme(_mainForm); 325 | } 326 | 327 | if (input == "theme caramel") 328 | { 329 | input = string.Empty; 330 | Options.CurrentOptions.Color = Theme.Caramel; 331 | Options.ApplyTheme(_mainForm); 332 | } 333 | 334 | if (input == "theme lime") 335 | { 336 | input = string.Empty; 337 | Options.CurrentOptions.Color = Theme.Lime; 338 | Options.ApplyTheme(_mainForm); 339 | } 340 | 341 | if (input == "theme magma") 342 | { 343 | input = string.Empty; 344 | Options.CurrentOptions.Color = Theme.Magma; 345 | Options.ApplyTheme(_mainForm); 346 | } 347 | 348 | if (input == "theme minimal") 349 | { 350 | input = string.Empty; 351 | Options.CurrentOptions.Color = Theme.Minimal; 352 | Options.ApplyTheme(_mainForm); 353 | } 354 | 355 | WriteInput(input, ForeColor, false); 356 | 357 | if (input != "!!") _lastCommand = input; 358 | } 359 | } 360 | 361 | public void WriteOutput(string output, Color color) 362 | { 363 | if (string.IsNullOrEmpty(output)) return; 364 | 365 | if (string.IsNullOrEmpty(lastInput) == false && 366 | (output == lastInput || output.Replace("\r\n", "") == lastInput)) 367 | return; 368 | 369 | if (!this.IsHandleCreated) 370 | return; 371 | 372 | Invoke((Action)(() => 373 | { 374 | richTextBoxConsole.SelectionColor = color; 375 | richTextBoxConsole.SelectedText += output; 376 | inputStart = richTextBoxConsole.SelectionStart; 377 | })); 378 | } 379 | 380 | public void ClearOutput() 381 | { 382 | richTextBoxConsole.Clear(); 383 | inputStart = 0; 384 | //WriteInput(string.Empty, ForeColor, false); 385 | } 386 | 387 | public void WriteInput(string input, Color color, bool echo) 388 | { 389 | Invoke((Action)(() => 390 | { 391 | if (echo) 392 | { 393 | richTextBoxConsole.SelectionColor = color; 394 | richTextBoxConsole.SelectedText += input; 395 | inputStart = richTextBoxConsole.SelectionStart; 396 | } 397 | 398 | lastInput = input; 399 | 400 | processInterface.WriteInput(input); 401 | FireConsoleInputEvent(input); 402 | })); 403 | } 404 | 405 | public void StartProcess(string workingDir) 406 | { 407 | if (ShowDiagnostics) 408 | { 409 | WriteOutput("Preparing to run CMD with working directory " + workingDir, DiagnosticsColor); 410 | } 411 | 412 | processInterface.StartProcess(workingDir); 413 | 414 | if (IsInputEnabled) 415 | richTextBoxConsole.ReadOnly = false; 416 | } 417 | 418 | public void StopProcess() 419 | { 420 | processInterface.StopProcess(); 421 | } 422 | 423 | private void FireConsoleOutputEvent(string content) 424 | { 425 | var theEvent = OnConsoleOutput; 426 | if (theEvent != null) 427 | theEvent(this, new ConsoleEventArgs(content)); 428 | } 429 | 430 | private void FireConsoleInputEvent(string content) 431 | { 432 | var theEvent = OnConsoleInput; 433 | if (theEvent != null) 434 | theEvent(this, new ConsoleEventArgs(content)); 435 | } 436 | 437 | private readonly ProcessInterface processInterface = new ProcessInterface(); 438 | 439 | int inputStart = -1; 440 | 441 | private bool isInputEnabled = true; 442 | 443 | private string lastInput; 444 | 445 | private List keyMappings = new List(); 446 | 447 | public event ConsoleEventHandler OnConsoleOutput; 448 | 449 | public event ConsoleEventHandler OnConsoleInput; 450 | 451 | [Category("Console Control"), Description("Show diagnostic information, such as exceptions.")] 452 | public bool ShowDiagnostics 453 | { 454 | get; 455 | set; 456 | } 457 | 458 | [Category("Console Control"), Description("If true, the user can key in input.")] 459 | public bool IsInputEnabled 460 | { 461 | get { return isInputEnabled; } 462 | set 463 | { 464 | isInputEnabled = value; 465 | if (IsProcessRunning) 466 | richTextBoxConsole.ReadOnly = !value; 467 | } 468 | } 469 | 470 | [Category("Console Control"), Description("If true, special keyboard commands like Ctrl-C and tab are sent to the process.")] 471 | public bool SendKeyboardCommandsToProcess 472 | { 473 | get; 474 | set; 475 | } 476 | 477 | [Category("Console Control"), Description("Sets the text color for errors.")] 478 | public Color ErrorColor 479 | { 480 | get; 481 | set; 482 | } 483 | 484 | [Category("Console Control"), Description("Sets the text color for diagnostics.")] 485 | public Color DiagnosticsColor 486 | { 487 | get; 488 | set; 489 | } 490 | 491 | [Browsable(false)] 492 | public bool IsProcessRunning 493 | { 494 | get { return processInterface.IsProcessRunning; } 495 | } 496 | 497 | [Browsable(false)] 498 | public RichTextBox InternalRichTextBox 499 | { 500 | get { return richTextBoxConsole; } 501 | } 502 | 503 | [Browsable(false)] 504 | public ProcessInterface ProcessInterface 505 | { 506 | get { return processInterface; } 507 | } 508 | 509 | [Browsable(false)] 510 | public List KeyMappings 511 | { 512 | get { return keyMappings; } 513 | } 514 | 515 | /// 516 | /// 517 | /// 518 | /// 519 | /// 520 | /// 521 | public override Font Font 522 | { 523 | get 524 | { 525 | return base.Font; 526 | } 527 | set 528 | { 529 | base.Font = value; 530 | richTextBoxConsole.Font = value; 531 | } 532 | } 533 | 534 | /// 535 | /// 536 | /// 537 | public override Color BackColor 538 | { 539 | get 540 | { 541 | return base.BackColor; 542 | } 543 | set 544 | { 545 | base.BackColor = value; 546 | richTextBoxConsole.BackColor = value; 547 | } 548 | } 549 | 550 | public override Color ForeColor 551 | { 552 | get 553 | { 554 | return base.ForeColor; 555 | } 556 | 557 | set 558 | { 559 | base.ForeColor = value; 560 | richTextBoxConsole.ForeColor = value; 561 | } 562 | } 563 | } 564 | 565 | public class Resfinder { } 566 | } 567 | -------------------------------------------------------------------------------- /MoonShell/ConsoleControl/ConsoleControl.designer.cs: -------------------------------------------------------------------------------- 1 | namespace MoonShell 2 | { 3 | partial class ConsoleControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.richTextBoxConsole = new System.Windows.Forms.RichTextBox(); 32 | this.SuspendLayout(); 33 | // 34 | // richTextBoxConsole 35 | // 36 | this.richTextBoxConsole.AcceptsTab = true; 37 | this.richTextBoxConsole.BackColor = System.Drawing.Color.Black; 38 | this.richTextBoxConsole.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 39 | this.richTextBoxConsole.DetectUrls = false; 40 | this.richTextBoxConsole.Dock = System.Windows.Forms.DockStyle.Fill; 41 | this.richTextBoxConsole.Font = new System.Drawing.Font("Consolas", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 42 | this.richTextBoxConsole.ForeColor = System.Drawing.Color.LimeGreen; 43 | this.richTextBoxConsole.Location = new System.Drawing.Point(0, 0); 44 | this.richTextBoxConsole.Margin = new System.Windows.Forms.Padding(4); 45 | this.richTextBoxConsole.Name = "richTextBoxConsole"; 46 | this.richTextBoxConsole.ReadOnly = true; 47 | this.richTextBoxConsole.Size = new System.Drawing.Size(200, 185); 48 | this.richTextBoxConsole.TabIndex = 0; 49 | this.richTextBoxConsole.Text = ""; 50 | // 51 | // ConsoleControl 52 | // 53 | this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); 54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 55 | this.Controls.Add(this.richTextBoxConsole); 56 | this.Margin = new System.Windows.Forms.Padding(4); 57 | this.Name = "ConsoleControl"; 58 | this.Size = new System.Drawing.Size(200, 185); 59 | this.ResumeLayout(false); 60 | 61 | } 62 | 63 | #endregion 64 | 65 | private System.Windows.Forms.RichTextBox richTextBoxConsole; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /MoonShell/ConsoleControl/ConsoleControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /MoonShell/ConsoleControl/ConsoleEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MoonShell 4 | { 5 | public class ConsoleEventArgs : EventArgs 6 | { 7 | 8 | public ConsoleEventArgs() { } 9 | 10 | public ConsoleEventArgs(string content) 11 | { 12 | Content = content; 13 | } 14 | 15 | public string Content 16 | { 17 | get; 18 | private set; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MoonShell/ConsoleControl/KeyMapping.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace MoonShell 4 | { 5 | public class KeyMapping 6 | { 7 | public KeyMapping() { } 8 | 9 | public KeyMapping(bool control, bool alt, bool shift, Keys keyCode, string sendKeysMapping, string streamMapping) 10 | { 11 | IsControlPressed = control; 12 | IsAltPressed = alt; 13 | IsShiftPressed = shift; 14 | KeyCode = keyCode; 15 | SendKeysMapping = sendKeysMapping; 16 | StreamMapping = streamMapping; 17 | } 18 | 19 | public bool IsControlPressed 20 | { 21 | get; 22 | set; 23 | } 24 | 25 | public bool IsAltPressed 26 | { 27 | get; 28 | set; 29 | } 30 | 31 | public bool IsShiftPressed 32 | { 33 | get; 34 | set; 35 | } 36 | 37 | public Keys KeyCode 38 | { 39 | get; 40 | set; 41 | } 42 | 43 | public string SendKeysMapping 44 | { 45 | get; 46 | set; 47 | } 48 | 49 | public string StreamMapping 50 | { 51 | get; 52 | set; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /MoonShell/ConsoleControlAPI/Imports.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace MoonShell 5 | { 6 | internal static class Imports 7 | { 8 | [DllImport("Kernel32.dll")] 9 | public static extern bool GenerateConsoleCtrlEvent(CTRL_EVENT dwCtrlEvent, UInt32 dwProcessGroupId); 10 | } 11 | 12 | internal enum CTRL_EVENT : uint 13 | { 14 | CTRL_C_EVENT = 0, 15 | CTRL_BREAK_EVENT = 1 16 | } 17 | } -------------------------------------------------------------------------------- /MoonShell/ConsoleControlAPI/ProcessEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MoonShell 4 | { 5 | public class ProcessEventArgs : EventArgs 6 | { 7 | public ProcessEventArgs() { } 8 | 9 | public ProcessEventArgs(string content) 10 | { 11 | Content = content; 12 | } 13 | 14 | public ProcessEventArgs(int code) 15 | { 16 | Code = code; 17 | } 18 | 19 | public ProcessEventArgs(string content, int code) 20 | { 21 | Content = content; 22 | Code = code; 23 | } 24 | 25 | public string Content { get; private set; } 26 | 27 | public int? Code { get; private set; } 28 | } 29 | } -------------------------------------------------------------------------------- /MoonShell/ConsoleControlAPI/ProcessInterface.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Diagnostics; 4 | using System.ComponentModel; 5 | using System.IO; 6 | using System.Windows.Forms; 7 | using System.Globalization; 8 | 9 | namespace MoonShell 10 | { 11 | public delegate void ProcessEventHanlder(object sender, ProcessEventArgs args); 12 | 13 | public class ProcessInterface 14 | { 15 | const string CMD_FILE = "cmd.exe"; 16 | 17 | // used for UTF-8 encoding for output 18 | const string DEFAULT_ARGUMENT = "/c chcp 65001 > nul && cmd.exe"; 19 | 20 | public ProcessInterface() 21 | { 22 | outputWorker.WorkerReportsProgress = true; 23 | outputWorker.WorkerSupportsCancellation = true; 24 | outputWorker.DoWork += outputWorker_DoWork; 25 | outputWorker.ProgressChanged += outputWorker_ProgressChanged; 26 | 27 | errorWorker.WorkerReportsProgress = true; 28 | errorWorker.WorkerSupportsCancellation = true; 29 | errorWorker.DoWork += errorWorker_DoWork; 30 | errorWorker.ProgressChanged += errorWorker_ProgressChanged; 31 | } 32 | 33 | void outputWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) 34 | { 35 | if (e.UserState is string) 36 | { 37 | //Console.WriteLine(e.UserState + " - [outputWorker_ProgressChanged]"); 38 | FireProcessOutputEvent(e.UserState as string); 39 | } 40 | } 41 | 42 | void outputWorker_DoWork(object sender, DoWorkEventArgs e) 43 | { 44 | while (outputWorker.CancellationPending == false) 45 | { 46 | int count; 47 | var buffer = new char[1024]; 48 | do 49 | { 50 | var builder = new StringBuilder(); 51 | count = outputReader.Read(buffer, 0, 1024); 52 | 53 | builder.Append(buffer, 0, count); 54 | outputWorker.ReportProgress(0, builder.ToString()); 55 | } while (count > 0); 56 | 57 | System.Threading.Thread.Sleep(200); 58 | } 59 | } 60 | 61 | void errorWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) 62 | { 63 | if (e.UserState is string) 64 | { 65 | FireProcessErrorEvent(e.UserState as string); 66 | } 67 | } 68 | 69 | void errorWorker_DoWork(object sender, DoWorkEventArgs e) 70 | { 71 | while (errorWorker.CancellationPending == false) 72 | { 73 | int count; 74 | var buffer = new char[1024]; 75 | do 76 | { 77 | var builder = new StringBuilder(); 78 | count = errorReader.Read(buffer, 0, 1024); 79 | builder.Append(buffer, 0, count); 80 | errorWorker.ReportProgress(0, builder.ToString()); 81 | } while (count > 0); 82 | 83 | System.Threading.Thread.Sleep(200); 84 | } 85 | } 86 | 87 | public void StartProcess(string workingDir) 88 | { 89 | var shellOptions = new ProcessStartInfo(CMD_FILE); 90 | 91 | shellOptions.Arguments = DEFAULT_ARGUMENT; 92 | shellOptions.WorkingDirectory = workingDir; 93 | 94 | shellOptions.UseShellExecute = false; 95 | shellOptions.ErrorDialog = false; 96 | shellOptions.CreateNoWindow = true; 97 | 98 | shellOptions.RedirectStandardError = true; 99 | shellOptions.RedirectStandardInput = true; 100 | shellOptions.RedirectStandardOutput = true; 101 | 102 | shellOptions.StandardErrorEncoding = Encoding.UTF8; 103 | shellOptions.StandardOutputEncoding = Encoding.UTF8; 104 | 105 | process = new Process(); 106 | process.EnableRaisingEvents = true; 107 | 108 | process.StartInfo = shellOptions; 109 | process.Exited += currentProcess_Exited; 110 | 111 | processFileName = CMD_FILE; 112 | processArguments = DEFAULT_ARGUMENT; 113 | 114 | try 115 | { 116 | process.Start(); 117 | } 118 | catch (Exception e) 119 | { 120 | Trace.WriteLine("Failed to start process CMD"); 121 | Trace.WriteLine(e.ToString()); 122 | return; 123 | } 124 | 125 | 126 | 127 | inputWriter = process.StandardInput; 128 | 129 | outputReader = TextReader.Synchronized(process.StandardOutput); 130 | errorReader = TextReader.Synchronized(process.StandardError); 131 | 132 | outputWorker.RunWorkerAsync(); 133 | errorWorker.RunWorkerAsync(); 134 | } 135 | 136 | public void StopProcess() 137 | { 138 | if (IsProcessRunning == false) 139 | return; 140 | 141 | process.Kill(); 142 | } 143 | 144 | void currentProcess_Exited(object sender, EventArgs e) 145 | { 146 | FireProcessExitEvent(process.ExitCode); 147 | 148 | outputWorker.CancelAsync(); 149 | errorWorker.CancelAsync(); 150 | inputWriter = null; 151 | outputReader = null; 152 | errorReader = null; 153 | process = null; 154 | processFileName = null; 155 | processArguments = null; 156 | } 157 | 158 | private void FireProcessOutputEvent(string content) 159 | { 160 | //Console.WriteLine(content + " - [FireProcessOutputEvent]"); 161 | var theEvent = OnProcessOutput; 162 | if (theEvent != null) 163 | theEvent(this, new ProcessEventArgs(content)); 164 | } 165 | 166 | private void FireProcessErrorEvent(string content) 167 | { 168 | var theEvent = OnProcessError; 169 | if (theEvent != null) 170 | theEvent(this, new ProcessEventArgs(content)); 171 | } 172 | 173 | private void FireProcessInputEvent(string content) 174 | { 175 | var theEvent = OnProcessInput; 176 | if (theEvent != null) 177 | theEvent(this, new ProcessEventArgs(content)); 178 | } 179 | 180 | private void FireProcessExitEvent(int code) 181 | { 182 | var theEvent = OnProcessExit; 183 | if (theEvent != null) 184 | theEvent(this, new ProcessEventArgs(code)); 185 | } 186 | 187 | public void WriteInput(string input) 188 | { 189 | if (IsProcessRunning) 190 | { 191 | inputWriter.WriteLine(input); 192 | inputWriter.Flush(); 193 | } 194 | } 195 | 196 | //~ProcessInterface() 197 | //{ 198 | // Dispose(true); 199 | //} 200 | 201 | //protected void Dispose(bool native) 202 | //{ 203 | // if (outputWorker != null) 204 | // { 205 | // outputWorker.Dispose(); 206 | // outputWorker = null; 207 | // } 208 | // if (errorWorker != null) 209 | // { 210 | // errorWorker.Dispose(); 211 | // errorWorker = null; 212 | // } 213 | // if (process != null) 214 | // { 215 | // process.Dispose(); 216 | // process = null; 217 | // } 218 | // if (inputWriter != null) 219 | // { 220 | // inputWriter.Dispose(); 221 | // inputWriter = null; 222 | // } 223 | // if (outputReader != null) 224 | // { 225 | // outputReader.Dispose(); 226 | // outputReader = null; 227 | // } 228 | // if (errorReader != null) 229 | // { 230 | // errorReader.Dispose(); 231 | // errorReader = null; 232 | // } 233 | //} 234 | 235 | //public void Dispose() 236 | //{ 237 | // Dispose(true); 238 | // GC.SuppressFinalize(this); 239 | //} 240 | 241 | private Process process; 242 | 243 | private StreamWriter inputWriter; 244 | 245 | private TextReader outputReader; 246 | 247 | private TextReader errorReader; 248 | 249 | private BackgroundWorker outputWorker = new BackgroundWorker(); 250 | 251 | private BackgroundWorker errorWorker = new BackgroundWorker(); 252 | 253 | private string processFileName; 254 | 255 | private string processArguments; 256 | 257 | public event ProcessEventHanlder OnProcessOutput; 258 | 259 | public event ProcessEventHanlder OnProcessError; 260 | 261 | public event ProcessEventHanlder OnProcessInput; 262 | 263 | public event ProcessEventHanlder OnProcessExit; 264 | 265 | public bool IsProcessRunning 266 | { 267 | get 268 | { 269 | try 270 | { 271 | return (process != null && process.HasExited == false); 272 | } 273 | catch 274 | { 275 | return false; 276 | } 277 | } 278 | } 279 | 280 | public Process Process 281 | { 282 | get { return process; } 283 | } 284 | 285 | public string ProcessFileName 286 | { 287 | get { return processFileName; } 288 | } 289 | 290 | public string ProcessArguments 291 | { 292 | get { return processArguments; } 293 | } 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /MoonShell/EmbeddedAssembly.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Reflection; 5 | using System.Security.Cryptography; 6 | 7 | namespace MoonShell 8 | { 9 | internal class EmbeddedAssembly 10 | { 11 | static Dictionary _dictionary; 12 | 13 | internal static void Load(string embeddedResource, string fileName) 14 | { 15 | if (_dictionary == null) _dictionary = new Dictionary(); 16 | 17 | byte[] bytes = null; 18 | Assembly assembly = null; 19 | Assembly currentAssembly = Assembly.GetExecutingAssembly(); 20 | 21 | using (Stream stream = currentAssembly.GetManifestResourceStream(embeddedResource)) 22 | { 23 | if (stream == null) throw new Exception(embeddedResource + " is not found in Embedded Resources."); 24 | 25 | bytes = new byte[(int)stream.Length]; 26 | stream.Read(bytes, 0, (int)stream.Length); 27 | 28 | try 29 | { 30 | assembly = Assembly.Load(bytes); 31 | 32 | _dictionary.Add(assembly.FullName, assembly); 33 | return; 34 | } 35 | catch { } 36 | } 37 | 38 | bool fileOk = false; 39 | string tempFile = string.Empty; 40 | 41 | using (SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider()) 42 | { 43 | string fileHash = BitConverter.ToString(sha1.ComputeHash(bytes)).Replace("-", string.Empty); 44 | 45 | tempFile = Path.GetTempPath() + fileName; 46 | 47 | if (File.Exists(tempFile)) 48 | { 49 | byte[] byteArray = File.ReadAllBytes(tempFile); 50 | string fileHash2 = BitConverter.ToString(sha1.ComputeHash(byteArray)).Replace("-", string.Empty); 51 | 52 | if (fileHash == fileHash2) 53 | { 54 | fileOk = true; 55 | } 56 | } 57 | else 58 | { 59 | fileOk = false; 60 | } 61 | } 62 | 63 | if (!fileOk) 64 | { 65 | File.WriteAllBytes(tempFile, bytes); 66 | } 67 | 68 | assembly = Assembly.LoadFile(tempFile); 69 | 70 | _dictionary.Add(assembly.FullName, assembly); 71 | } 72 | 73 | internal static Assembly Get(string assemblyFullName) 74 | { 75 | if (_dictionary == null || _dictionary.Count == 0) return null; 76 | 77 | if (_dictionary.ContainsKey(assemblyFullName)) return _dictionary[assemblyFullName]; 78 | 79 | return null; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /MoonShell/Enums.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace MoonShell 8 | { 9 | public enum Theme 10 | { 11 | Zerg, 12 | Ocean, 13 | Caramel, 14 | Magma, 15 | Lime, 16 | Minimal 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MoonShell/MainForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MoonShell 2 | { 3 | partial class MainForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); 33 | this.topPanel = new System.Windows.Forms.Panel(); 34 | this.button8 = new System.Windows.Forms.Button(); 35 | this.placesMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 36 | this.button9 = new System.Windows.Forms.Button(); 37 | this.button7 = new System.Windows.Forms.Button(); 38 | this.button6 = new System.Windows.Forms.Button(); 39 | this.button5 = new System.Windows.Forms.Button(); 40 | this.button4 = new System.Windows.Forms.Button(); 41 | this.button3 = new System.Windows.Forms.Button(); 42 | this.button2 = new System.Windows.Forms.Button(); 43 | this.button1 = new System.Windows.Forms.Button(); 44 | this.botPanel = new System.Windows.Forms.Panel(); 45 | this.tabConsoles = new System.Windows.Forms.TabControl(); 46 | this.helperMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 47 | this.toolStripMenuItem10 = new System.Windows.Forms.ToolStripMenuItem(); 48 | this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripMenuItem(); 49 | this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripMenuItem(); 50 | this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripMenuItem(); 51 | this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripMenuItem(); 52 | this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripMenuItem(); 53 | this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripMenuItem(); 54 | this.toolStripMenuItem17 = new System.Windows.Forms.ToolStripMenuItem(); 55 | this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); 56 | this.toolStripMenuItem18 = new System.Windows.Forms.ToolStripMenuItem(); 57 | this.button10 = new System.Windows.Forms.Button(); 58 | this.topPanel.SuspendLayout(); 59 | this.botPanel.SuspendLayout(); 60 | this.helperMenu.SuspendLayout(); 61 | this.SuspendLayout(); 62 | // 63 | // topPanel 64 | // 65 | this.topPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 66 | this.topPanel.Controls.Add(this.button10); 67 | this.topPanel.Controls.Add(this.button8); 68 | this.topPanel.Controls.Add(this.button9); 69 | this.topPanel.Controls.Add(this.button7); 70 | this.topPanel.Controls.Add(this.button6); 71 | this.topPanel.Controls.Add(this.button5); 72 | this.topPanel.Controls.Add(this.button4); 73 | this.topPanel.Controls.Add(this.button3); 74 | this.topPanel.Controls.Add(this.button2); 75 | this.topPanel.Controls.Add(this.button1); 76 | this.topPanel.Dock = System.Windows.Forms.DockStyle.Top; 77 | this.topPanel.Location = new System.Drawing.Point(0, 0); 78 | this.topPanel.Margin = new System.Windows.Forms.Padding(2); 79 | this.topPanel.Name = "topPanel"; 80 | this.topPanel.Size = new System.Drawing.Size(1223, 40); 81 | this.topPanel.TabIndex = 5; 82 | // 83 | // button8 84 | // 85 | this.button8.BackColor = System.Drawing.Color.DodgerBlue; 86 | this.button8.ContextMenuStrip = this.placesMenu; 87 | this.button8.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 88 | this.button8.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 89 | this.button8.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 90 | this.button8.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 91 | this.button8.Location = new System.Drawing.Point(2, 2); 92 | this.button8.Margin = new System.Windows.Forms.Padding(2); 93 | this.button8.Name = "button8"; 94 | this.button8.Size = new System.Drawing.Size(118, 32); 95 | this.button8.TabIndex = 12; 96 | this.button8.Text = "Places"; 97 | this.button8.UseVisualStyleBackColor = false; 98 | this.button8.Click += new System.EventHandler(this.button8_Click); 99 | // 100 | // placesMenu 101 | // 102 | this.placesMenu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 103 | this.placesMenu.Font = new System.Drawing.Font("Consolas", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 104 | this.placesMenu.ImageScalingSize = new System.Drawing.Size(20, 20); 105 | this.placesMenu.Name = "InputMenu"; 106 | this.placesMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; 107 | this.placesMenu.ShowImageMargin = false; 108 | this.placesMenu.Size = new System.Drawing.Size(36, 4); 109 | // 110 | // button9 111 | // 112 | this.button9.BackColor = System.Drawing.Color.DodgerBlue; 113 | this.button9.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 114 | this.button9.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 115 | this.button9.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 116 | this.button9.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 117 | this.button9.Location = new System.Drawing.Point(856, 2); 118 | this.button9.Margin = new System.Windows.Forms.Padding(2); 119 | this.button9.Name = "button9"; 120 | this.button9.Size = new System.Drawing.Size(118, 32); 121 | this.button9.TabIndex = 11; 122 | this.button9.Text = "Themes"; 123 | this.button9.UseVisualStyleBackColor = false; 124 | this.button9.Click += new System.EventHandler(this.button9_Click); 125 | // 126 | // button7 127 | // 128 | this.button7.BackColor = System.Drawing.Color.DodgerBlue; 129 | this.button7.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 130 | this.button7.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 131 | this.button7.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 132 | this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 133 | this.button7.Location = new System.Drawing.Point(1100, 2); 134 | this.button7.Margin = new System.Windows.Forms.Padding(2); 135 | this.button7.Name = "button7"; 136 | this.button7.Size = new System.Drawing.Size(118, 32); 137 | this.button7.TabIndex = 8; 138 | this.button7.Text = "Help"; 139 | this.button7.UseVisualStyleBackColor = false; 140 | this.button7.Click += new System.EventHandler(this.button7_Click); 141 | // 142 | // button6 143 | // 144 | this.button6.BackColor = System.Drawing.Color.DodgerBlue; 145 | this.button6.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 146 | this.button6.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 147 | this.button6.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 148 | this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 149 | this.button6.Location = new System.Drawing.Point(734, 2); 150 | this.button6.Margin = new System.Windows.Forms.Padding(2); 151 | this.button6.Name = "button6"; 152 | this.button6.Size = new System.Drawing.Size(118, 32); 153 | this.button6.TabIndex = 7; 154 | this.button6.Text = "New admin"; 155 | this.button6.UseVisualStyleBackColor = false; 156 | this.button6.Click += new System.EventHandler(this.button6_Click); 157 | // 158 | // button5 159 | // 160 | this.button5.BackColor = System.Drawing.Color.DodgerBlue; 161 | this.button5.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 162 | this.button5.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 163 | this.button5.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 164 | this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 165 | this.button5.Location = new System.Drawing.Point(612, 2); 166 | this.button5.Margin = new System.Windows.Forms.Padding(2); 167 | this.button5.Name = "button5"; 168 | this.button5.Size = new System.Drawing.Size(118, 32); 169 | this.button5.TabIndex = 6; 170 | this.button5.Text = "New instance"; 171 | this.button5.UseVisualStyleBackColor = false; 172 | this.button5.Click += new System.EventHandler(this.button5_Click); 173 | // 174 | // button4 175 | // 176 | this.button4.BackColor = System.Drawing.Color.DodgerBlue; 177 | this.button4.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 178 | this.button4.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 179 | this.button4.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 180 | this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 181 | this.button4.Location = new System.Drawing.Point(490, 2); 182 | this.button4.Margin = new System.Windows.Forms.Padding(2); 183 | this.button4.Name = "button4"; 184 | this.button4.Size = new System.Drawing.Size(118, 32); 185 | this.button4.TabIndex = 5; 186 | this.button4.Text = "Options"; 187 | this.button4.UseVisualStyleBackColor = false; 188 | this.button4.Click += new System.EventHandler(this.button4_Click); 189 | // 190 | // button3 191 | // 192 | this.button3.BackColor = System.Drawing.Color.DodgerBlue; 193 | this.button3.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 194 | this.button3.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 195 | this.button3.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 196 | this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 197 | this.button3.Location = new System.Drawing.Point(368, 2); 198 | this.button3.Margin = new System.Windows.Forms.Padding(2); 199 | this.button3.Name = "button3"; 200 | this.button3.Size = new System.Drawing.Size(118, 32); 201 | this.button3.TabIndex = 4; 202 | this.button3.Text = "Clear"; 203 | this.button3.UseVisualStyleBackColor = false; 204 | this.button3.Click += new System.EventHandler(this.button3_Click); 205 | // 206 | // button2 207 | // 208 | this.button2.BackColor = System.Drawing.Color.DodgerBlue; 209 | this.button2.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 210 | this.button2.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 211 | this.button2.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 212 | this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 213 | this.button2.Location = new System.Drawing.Point(246, 2); 214 | this.button2.Margin = new System.Windows.Forms.Padding(2); 215 | this.button2.Name = "button2"; 216 | this.button2.Size = new System.Drawing.Size(118, 32); 217 | this.button2.TabIndex = 3; 218 | this.button2.Text = "Remove tab"; 219 | this.button2.UseVisualStyleBackColor = false; 220 | this.button2.Click += new System.EventHandler(this.button2_Click); 221 | // 222 | // button1 223 | // 224 | this.button1.BackColor = System.Drawing.Color.DodgerBlue; 225 | this.button1.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 226 | this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 227 | this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 228 | this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 229 | this.button1.Location = new System.Drawing.Point(124, 2); 230 | this.button1.Margin = new System.Windows.Forms.Padding(2); 231 | this.button1.Name = "button1"; 232 | this.button1.Size = new System.Drawing.Size(118, 32); 233 | this.button1.TabIndex = 2; 234 | this.button1.Text = "Add tab"; 235 | this.button1.UseVisualStyleBackColor = false; 236 | this.button1.Click += new System.EventHandler(this.button1_Click); 237 | // 238 | // botPanel 239 | // 240 | this.botPanel.AutoScroll = true; 241 | this.botPanel.AutoScrollMinSize = new System.Drawing.Size(1, 1); 242 | this.botPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 243 | this.botPanel.Controls.Add(this.tabConsoles); 244 | this.botPanel.Dock = System.Windows.Forms.DockStyle.Fill; 245 | this.botPanel.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 246 | this.botPanel.Location = new System.Drawing.Point(0, 40); 247 | this.botPanel.Margin = new System.Windows.Forms.Padding(2); 248 | this.botPanel.Name = "botPanel"; 249 | this.botPanel.Size = new System.Drawing.Size(1223, 602); 250 | this.botPanel.TabIndex = 6; 251 | // 252 | // tabConsoles 253 | // 254 | this.tabConsoles.Dock = System.Windows.Forms.DockStyle.Fill; 255 | this.tabConsoles.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 256 | this.tabConsoles.Location = new System.Drawing.Point(0, 0); 257 | this.tabConsoles.Margin = new System.Windows.Forms.Padding(2); 258 | this.tabConsoles.Name = "tabConsoles"; 259 | this.tabConsoles.SelectedIndex = 0; 260 | this.tabConsoles.Size = new System.Drawing.Size(1221, 600); 261 | this.tabConsoles.TabIndex = 0; 262 | this.tabConsoles.SelectedIndexChanged += new System.EventHandler(this.Tabs_SelectedIndexChanged); 263 | // 264 | // helperMenu 265 | // 266 | this.helperMenu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 267 | this.helperMenu.Font = new System.Drawing.Font("Consolas", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 268 | this.helperMenu.ImageScalingSize = new System.Drawing.Size(20, 20); 269 | this.helperMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 270 | this.toolStripMenuItem10, 271 | this.toolStripMenuItem11, 272 | this.toolStripMenuItem12, 273 | this.toolStripMenuItem13, 274 | this.toolStripMenuItem14, 275 | this.toolStripMenuItem15, 276 | this.toolStripMenuItem16, 277 | this.toolStripMenuItem17, 278 | this.toolStripMenuItem1, 279 | this.toolStripMenuItem18}); 280 | this.helperMenu.Name = "InputMenu"; 281 | this.helperMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; 282 | this.helperMenu.ShowImageMargin = false; 283 | this.helperMenu.Size = new System.Drawing.Size(173, 324); 284 | // 285 | // toolStripMenuItem10 286 | // 287 | this.toolStripMenuItem10.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 288 | this.toolStripMenuItem10.ForeColor = System.Drawing.Color.White; 289 | this.toolStripMenuItem10.Name = "toolStripMenuItem10"; 290 | this.toolStripMenuItem10.Size = new System.Drawing.Size(172, 32); 291 | this.toolStripMenuItem10.Text = "Copy"; 292 | this.toolStripMenuItem10.Click += new System.EventHandler(this.toolStripMenuItem10_Click); 293 | // 294 | // toolStripMenuItem11 295 | // 296 | this.toolStripMenuItem11.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 297 | this.toolStripMenuItem11.ForeColor = System.Drawing.Color.White; 298 | this.toolStripMenuItem11.Name = "toolStripMenuItem11"; 299 | this.toolStripMenuItem11.Size = new System.Drawing.Size(172, 32); 300 | this.toolStripMenuItem11.Text = "Copy all"; 301 | this.toolStripMenuItem11.Click += new System.EventHandler(this.toolStripMenuItem11_Click); 302 | // 303 | // toolStripMenuItem12 304 | // 305 | this.toolStripMenuItem12.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 306 | this.toolStripMenuItem12.ForeColor = System.Drawing.Color.White; 307 | this.toolStripMenuItem12.Name = "toolStripMenuItem12"; 308 | this.toolStripMenuItem12.Size = new System.Drawing.Size(172, 32); 309 | this.toolStripMenuItem12.Text = "Paste"; 310 | this.toolStripMenuItem12.Click += new System.EventHandler(this.toolStripMenuItem12_Click); 311 | // 312 | // toolStripMenuItem13 313 | // 314 | this.toolStripMenuItem13.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 315 | this.toolStripMenuItem13.ForeColor = System.Drawing.Color.White; 316 | this.toolStripMenuItem13.Name = "toolStripMenuItem13"; 317 | this.toolStripMenuItem13.Size = new System.Drawing.Size(172, 32); 318 | this.toolStripMenuItem13.Text = "Clear"; 319 | this.toolStripMenuItem13.Click += new System.EventHandler(this.toolStripMenuItem13_Click); 320 | // 321 | // toolStripMenuItem14 322 | // 323 | this.toolStripMenuItem14.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 324 | this.toolStripMenuItem14.ForeColor = System.Drawing.Color.White; 325 | this.toolStripMenuItem14.Name = "toolStripMenuItem14"; 326 | this.toolStripMenuItem14.Size = new System.Drawing.Size(172, 32); 327 | this.toolStripMenuItem14.Text = "Add tab"; 328 | this.toolStripMenuItem14.Click += new System.EventHandler(this.toolStripMenuItem14_Click); 329 | // 330 | // toolStripMenuItem15 331 | // 332 | this.toolStripMenuItem15.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 333 | this.toolStripMenuItem15.ForeColor = System.Drawing.Color.White; 334 | this.toolStripMenuItem15.Name = "toolStripMenuItem15"; 335 | this.toolStripMenuItem15.Size = new System.Drawing.Size(172, 32); 336 | this.toolStripMenuItem15.Text = "Remove tab"; 337 | this.toolStripMenuItem15.Click += new System.EventHandler(this.toolStripMenuItem15_Click); 338 | // 339 | // toolStripMenuItem16 340 | // 341 | this.toolStripMenuItem16.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 342 | this.toolStripMenuItem16.ForeColor = System.Drawing.Color.White; 343 | this.toolStripMenuItem16.Name = "toolStripMenuItem16"; 344 | this.toolStripMenuItem16.Size = new System.Drawing.Size(172, 32); 345 | this.toolStripMenuItem16.Text = "New instance"; 346 | this.toolStripMenuItem16.Click += new System.EventHandler(this.toolStripMenuItem16_Click); 347 | // 348 | // toolStripMenuItem17 349 | // 350 | this.toolStripMenuItem17.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 351 | this.toolStripMenuItem17.ForeColor = System.Drawing.Color.White; 352 | this.toolStripMenuItem17.Name = "toolStripMenuItem17"; 353 | this.toolStripMenuItem17.Size = new System.Drawing.Size(172, 32); 354 | this.toolStripMenuItem17.Text = "New admin"; 355 | this.toolStripMenuItem17.Click += new System.EventHandler(this.toolStripMenuItem17_Click); 356 | // 357 | // toolStripMenuItem1 358 | // 359 | this.toolStripMenuItem1.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 360 | this.toolStripMenuItem1.ForeColor = System.Drawing.Color.White; 361 | this.toolStripMenuItem1.Name = "toolStripMenuItem1"; 362 | this.toolStripMenuItem1.Size = new System.Drawing.Size(172, 32); 363 | this.toolStripMenuItem1.Text = "Export log"; 364 | this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click); 365 | // 366 | // toolStripMenuItem18 367 | // 368 | this.toolStripMenuItem18.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 369 | this.toolStripMenuItem18.ForeColor = System.Drawing.Color.White; 370 | this.toolStripMenuItem18.Name = "toolStripMenuItem18"; 371 | this.toolStripMenuItem18.Size = new System.Drawing.Size(172, 32); 372 | this.toolStripMenuItem18.Text = "Exit"; 373 | this.toolStripMenuItem18.Click += new System.EventHandler(this.toolStripMenuItem18_Click); 374 | // 375 | // button10 376 | // 377 | this.button10.BackColor = System.Drawing.Color.DodgerBlue; 378 | this.button10.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; 379 | this.button10.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; 380 | this.button10.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; 381 | this.button10.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 382 | this.button10.Location = new System.Drawing.Point(978, 2); 383 | this.button10.Margin = new System.Windows.Forms.Padding(2); 384 | this.button10.Name = "button10"; 385 | this.button10.Size = new System.Drawing.Size(118, 32); 386 | this.button10.TabIndex = 13; 387 | this.button10.Text = "Update"; 388 | this.button10.UseVisualStyleBackColor = false; 389 | this.button10.Click += new System.EventHandler(this.button10_Click); 390 | // 391 | // MainForm 392 | // 393 | this.AllowDrop = true; 394 | this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); 395 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 396 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); 397 | this.ClientSize = new System.Drawing.Size(1223, 642); 398 | this.Controls.Add(this.botPanel); 399 | this.Controls.Add(this.topPanel); 400 | this.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 401 | this.ForeColor = System.Drawing.Color.White; 402 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 403 | this.Margin = new System.Windows.Forms.Padding(2); 404 | this.Name = "MainForm"; 405 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 406 | this.Text = "MoonShell"; 407 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); 408 | this.Load += new System.EventHandler(this.MainForm_Load); 409 | this.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainForm_DragDrop); 410 | this.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainForm_DragEnter); 411 | this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyDown); 412 | this.topPanel.ResumeLayout(false); 413 | this.botPanel.ResumeLayout(false); 414 | this.helperMenu.ResumeLayout(false); 415 | this.ResumeLayout(false); 416 | 417 | } 418 | 419 | #endregion 420 | 421 | private System.Windows.Forms.Panel topPanel; 422 | private System.Windows.Forms.Button button9; 423 | private System.Windows.Forms.Button button7; 424 | private System.Windows.Forms.Button button6; 425 | private System.Windows.Forms.Button button5; 426 | private System.Windows.Forms.Button button4; 427 | private System.Windows.Forms.Button button3; 428 | private System.Windows.Forms.Button button2; 429 | private System.Windows.Forms.Button button1; 430 | private System.Windows.Forms.Panel botPanel; 431 | private System.Windows.Forms.TabControl tabConsoles; 432 | private System.Windows.Forms.ContextMenuStrip helperMenu; 433 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem10; 434 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem11; 435 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem12; 436 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem13; 437 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem14; 438 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem15; 439 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem16; 440 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem17; 441 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem18; 442 | private System.Windows.Forms.Button button8; 443 | private System.Windows.Forms.ContextMenuStrip placesMenu; 444 | private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; 445 | private System.Windows.Forms.Button button10; 446 | } 447 | } 448 | 449 | -------------------------------------------------------------------------------- /MoonShell/MainForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Security.Principal; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using System.Diagnostics; 12 | using System.IO; 13 | using System.Net; 14 | using System.Globalization; 15 | 16 | namespace MoonShell 17 | { 18 | public partial class MainForm : Form 19 | { 20 | internal static string WorkingDirectory = string.Empty; 21 | 22 | string _logsDirectory = Application.StartupPath + "\\Logs\\"; 23 | 24 | int _tabCounter = 0; 25 | 26 | ConsoleControl _currentTab; 27 | 28 | readonly string _latestVersionLink = "https://raw.githubusercontent.com/hellzerg/moonshell/master/version.txt"; 29 | readonly string _releasesLink = "https://github.com/hellzerg/moonshell/releases"; 30 | readonly string _changelogLink = "https://github.com/hellzerg/moonshell/blob/master/CHANGELOG.md"; 31 | 32 | readonly string _noNewVersionMessage = "You already have the latest version!"; 33 | readonly string _betaVersionMessage = "You are using an experimental version!"; 34 | 35 | private string NewVersionMessage(string latest) 36 | { 37 | return string.Format("There is a new version available!\n\nLatest version: {0}\nCurrent version: {1}\n\nDo you want to download it now?", latest, Program.GetCurrentVersionTostring()); 38 | } 39 | 40 | 41 | public static bool IsAdmin 42 | { 43 | get 44 | { 45 | return WindowsIdentity.GetCurrent().Owner.IsWellKnown(WellKnownSidType.BuiltinAdministratorsSid); 46 | } 47 | } 48 | 49 | private void CheckForUpdate() 50 | { 51 | WebClient client = new WebClient 52 | { 53 | Encoding = Encoding.UTF8 54 | }; 55 | 56 | string latestVersion = string.Empty; 57 | try 58 | { 59 | latestVersion = client.DownloadString(_latestVersionLink); 60 | } 61 | catch (Exception ex) 62 | { 63 | MessageBox.Show(ex.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); 64 | } 65 | 66 | if (!string.IsNullOrEmpty(latestVersion)) 67 | { 68 | if (float.Parse(latestVersion) > Program.GetCurrentVersion()) 69 | { 70 | if (MessageBox.Show(NewVersionMessage(latestVersion), "Update available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) 71 | { 72 | try 73 | { 74 | Process.Start(_releasesLink); 75 | } 76 | catch { } 77 | } 78 | } 79 | else if (float.Parse(latestVersion) == Program.GetCurrentVersion()) 80 | { 81 | MessageBox.Show(_noNewVersionMessage, "No update available", MessageBoxButtons.OK, MessageBoxIcon.Information); 82 | } 83 | else 84 | { 85 | MessageBox.Show(_betaVersionMessage, "No update available", MessageBoxButtons.OK, MessageBoxIcon.Information); 86 | } 87 | } 88 | } 89 | 90 | private void RestoreWindowState() 91 | { 92 | this.WindowState = Options.CurrentOptions.WindowState; 93 | this.Size = Options.CurrentOptions.WindowSize; 94 | 95 | if (Options.CurrentOptions.WindowLocation != null) 96 | { 97 | this.Location = (Point)Options.CurrentOptions.WindowLocation; 98 | } 99 | else 100 | { 101 | this.CenterToScreen(); 102 | } 103 | } 104 | 105 | private void SaveWindowState() 106 | { 107 | Options.CurrentOptions.WindowState = this.WindowState; 108 | 109 | if (this.WindowState == FormWindowState.Normal) 110 | { 111 | Options.CurrentOptions.WindowLocation = this.Location; 112 | Options.CurrentOptions.WindowSize = this.Size; 113 | } 114 | else 115 | { 116 | Options.CurrentOptions.WindowLocation = this.RestoreBounds.Location; 117 | Options.CurrentOptions.WindowSize = this.RestoreBounds.Size; 118 | } 119 | 120 | } 121 | 122 | internal void ExportLog() 123 | { 124 | if (_currentTab != null) 125 | { 126 | if (!Directory.Exists(_logsDirectory)) 127 | { 128 | Directory.CreateDirectory(_logsDirectory); 129 | } 130 | 131 | string fileName = string.Format("{0}-{1}-{2} - {3}.{4}.{5}.log", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); 132 | 133 | try 134 | { 135 | File.WriteAllText(_logsDirectory + fileName, _currentTab.InternalRichTextBox.Text, Encoding.UTF8); 136 | MessageBox.Show("Log file created in Logs folder!", "MoonShell", MessageBoxButtons.OK, MessageBoxIcon.Information); 137 | } 138 | catch (Exception ex) 139 | { 140 | MessageBox.Show("Log file couldn't be created:\n\n" + ex.Message, "MoonShell", MessageBoxButtons.OK, MessageBoxIcon.Information); 141 | } 142 | } 143 | } 144 | 145 | internal void AddTab(string placeDirectory = null) 146 | { 147 | _currentTab = new ConsoleControl(this); 148 | _currentTab.BackColor = Options.CurrentOptions.BackgroundColor; 149 | _currentTab.ForeColor = Options.CurrentOptions.ForegroundColor; 150 | _currentTab.ErrorColor = Options.CurrentOptions.ErrorColor; 151 | _currentTab.Font = Options.CurrentOptions.Font; 152 | 153 | _currentTab.InternalRichTextBox.ContextMenuStrip = helperMenu; 154 | _currentTab.InternalRichTextBox.DragEnter += MainForm_DragEnter; 155 | _currentTab.InternalRichTextBox.DragDrop += MainForm_DragDrop; 156 | 157 | _currentTab.InternalRichTextBox.AllowDrop = true; 158 | 159 | _tabCounter++; 160 | TabPage tab = new TabPage(); 161 | tab.Text = "Console " + _tabCounter; 162 | 163 | tab.BackColor = Options.CurrentOptions.BackgroundColor; 164 | tab.ForeColor = Options.CurrentOptions.ForegroundColor; 165 | 166 | tabConsoles.TabPages.Add(tab); 167 | _currentTab.Dock = DockStyle.Fill; 168 | tab.Controls.Add(_currentTab); 169 | _currentTab.Dock = DockStyle.Fill; 170 | 171 | if (!string.IsNullOrEmpty(placeDirectory)) 172 | { 173 | _currentTab.StartProcess(placeDirectory); 174 | } 175 | else 176 | { 177 | _currentTab.StartProcess(WorkingDirectory); 178 | } 179 | 180 | tabConsoles.SelectedTab = tab; 181 | _currentTab.Focus(); 182 | } 183 | 184 | internal void RemoveTab() 185 | { 186 | if (tabConsoles.TabPages.Count > 1) 187 | { 188 | if (_currentTab != null) 189 | { 190 | _currentTab.StopProcess(); 191 | tabConsoles.TabPages.Remove(tabConsoles.SelectedTab); 192 | } 193 | } 194 | } 195 | 196 | internal void ClearTab() 197 | { 198 | if (_currentTab != null) 199 | { 200 | _currentTab.ClearOutput(); 201 | _currentTab.Focus(); 202 | } 203 | } 204 | 205 | private void ApplyOptions() 206 | { 207 | foreach (TabPage tab in tabConsoles.TabPages) 208 | { 209 | foreach (ConsoleControl cc in tab.Controls.OfType()) 210 | { 211 | cc.Font = Options.CurrentOptions.Font; 212 | cc.ForeColor = Options.CurrentOptions.ForegroundColor; 213 | cc.BackColor = Options.CurrentOptions.BackgroundColor; 214 | } 215 | } 216 | } 217 | 218 | internal void NewWindow() 219 | { 220 | try 221 | { 222 | Process.Start(Path.Combine(Application.StartupPath + "\\" + AppDomain.CurrentDomain.FriendlyName)); 223 | } 224 | catch { } 225 | } 226 | 227 | internal void NewWindowAdmin() 228 | { 229 | try 230 | { 231 | ProcessStartInfo info = new ProcessStartInfo(Path.Combine(Application.StartupPath + "\\" + AppDomain.CurrentDomain.FriendlyName)); 232 | info.UseShellExecute = true; 233 | info.Verb = "runas"; 234 | 235 | Process.Start(info); 236 | } 237 | catch { } 238 | } 239 | 240 | private void Copy() 241 | { 242 | if (_currentTab != null) 243 | { 244 | try 245 | { 246 | Clipboard.SetText(_currentTab.InternalRichTextBox.SelectedText); 247 | } 248 | catch { } 249 | } 250 | } 251 | 252 | private void CopyAll() 253 | { 254 | if (_currentTab != null) 255 | { 256 | try 257 | { 258 | Clipboard.SetText(_currentTab.InternalRichTextBox.Text); 259 | } 260 | catch { } 261 | } 262 | } 263 | 264 | private void Paste() 265 | { 266 | if (_currentTab != null) 267 | { 268 | try 269 | { 270 | _currentTab.InternalRichTextBox.Paste(DataFormats.GetFormat("Text")); 271 | } 272 | catch { } 273 | } 274 | } 275 | 276 | internal void ShowOptions() 277 | { 278 | OptionsForm f = new OptionsForm(); 279 | f.ShowDialog(); 280 | 281 | ApplyOptions(); 282 | } 283 | 284 | internal void ShowThemes() 285 | { 286 | ThemesForm f = new ThemesForm(this); 287 | f.ShowDialog(this); 288 | } 289 | 290 | internal void ShowAboutDialog() 291 | { 292 | AboutForm f = new AboutForm(); 293 | f.ShowDialog(this); 294 | } 295 | 296 | internal void LoadPlaces() 297 | { 298 | placesMenu.Items.Clear(); 299 | 300 | foreach (string x in Options.CurrentOptions.Places) 301 | { 302 | ToolStripItem i = new ToolStripMenuItem(); 303 | 304 | if (placesMenu.Items.Count <= 0) 305 | { 306 | i.Text = "1) " + x; 307 | } 308 | else 309 | { 310 | i.Text = string.Format("{0}) {1}", placesMenu.Items.Count + 1, x); 311 | } 312 | 313 | i.ForeColor = Color.White; 314 | i.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); 315 | 316 | i.Click += Place_Click; 317 | 318 | placesMenu.Items.Add(i); 319 | } 320 | } 321 | 322 | private void Place_Click(object sender, EventArgs e) 323 | { 324 | ToolStripMenuItem item = (ToolStripMenuItem)sender; 325 | 326 | if (Directory.Exists(item.Text.Substring(3))) 327 | { 328 | AddTab(item.Text.Substring(3)); 329 | } 330 | else 331 | { 332 | MessageBox.Show("This directory no longer exists!", "MoonShell", MessageBoxButtons.OK, MessageBoxIcon.Information); 333 | } 334 | } 335 | 336 | public MainForm(string customDirectory = null) 337 | { 338 | InitializeComponent(); 339 | CheckForIllegalCrossThreadCalls = false; 340 | 341 | CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); 342 | CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US"); 343 | 344 | Options.ApplyTheme(this); 345 | 346 | helperMenu.Renderer = new ToolStripRendererMaterial(); 347 | placesMenu.Renderer = new ToolStripRendererMaterial(); 348 | 349 | this.KeyPreview = true; 350 | 351 | LoadPlaces(); 352 | 353 | if (IsAdmin) 354 | { 355 | WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System); 356 | this.Text = "Administrator: MoonShell " + Program.GetCurrentVersionTostring(); 357 | } 358 | else 359 | { 360 | WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 361 | this.Text = "MoonShell " + Program.GetCurrentVersionTostring(); 362 | } 363 | 364 | if (!string.IsNullOrEmpty(customDirectory)) 365 | { 366 | WorkingDirectory = customDirectory; 367 | } 368 | else 369 | { 370 | if (!string.IsNullOrEmpty(Options.CurrentOptions.StartingDirectory)) 371 | { 372 | if (Directory.Exists(Options.CurrentOptions.StartingDirectory)) 373 | { 374 | WorkingDirectory = Options.CurrentOptions.StartingDirectory; 375 | } 376 | else 377 | { 378 | MessageBox.Show("Custom working directory no longer exists!\nDefault directory will be set!", "MoonShell", MessageBoxButtons.OK, MessageBoxIcon.Information); 379 | Options.CurrentOptions.StartingDirectory = string.Empty; 380 | } 381 | } 382 | } 383 | 384 | 385 | 386 | } 387 | 388 | private void MainForm_Load(object sender, EventArgs e) 389 | { 390 | RestoreWindowState(); 391 | AddTab(); 392 | } 393 | 394 | private void button1_Click(object sender, EventArgs e) 395 | { 396 | AddTab(); 397 | } 398 | 399 | private void button2_Click(object sender, EventArgs e) 400 | { 401 | RemoveTab(); 402 | } 403 | 404 | private void button3_Click(object sender, EventArgs e) 405 | { 406 | ClearTab(); 407 | } 408 | 409 | private void button5_Click(object sender, EventArgs e) 410 | { 411 | NewWindow(); 412 | } 413 | 414 | private void button6_Click(object sender, EventArgs e) 415 | { 416 | NewWindowAdmin(); 417 | } 418 | 419 | private void button7_Click(object sender, EventArgs e) 420 | { 421 | ShowAboutDialog(); 422 | 423 | if (_currentTab != null) 424 | { 425 | _currentTab.Focus(); 426 | } 427 | } 428 | 429 | private void button9_Click(object sender, EventArgs e) 430 | { 431 | ShowThemes(); 432 | 433 | if (_currentTab != null) 434 | { 435 | _currentTab.Focus(); 436 | } 437 | } 438 | 439 | private void button4_Click(object sender, EventArgs e) 440 | { 441 | ShowOptions(); 442 | WorkingDirectory = Options.CurrentOptions.StartingDirectory; 443 | 444 | if (_currentTab != null) 445 | { 446 | _currentTab.Focus(); 447 | } 448 | } 449 | 450 | private void MainForm_FormClosing(object sender, FormClosingEventArgs e) 451 | { 452 | SaveWindowState(); 453 | Options.SaveSettings(); 454 | } 455 | 456 | private void toolStripMenuItem10_Click(object sender, EventArgs e) 457 | { 458 | Copy(); 459 | } 460 | 461 | private void toolStripMenuItem11_Click(object sender, EventArgs e) 462 | { 463 | CopyAll(); 464 | } 465 | 466 | private void toolStripMenuItem12_Click(object sender, EventArgs e) 467 | { 468 | Paste(); 469 | } 470 | 471 | private void toolStripMenuItem13_Click(object sender, EventArgs e) 472 | { 473 | ClearTab(); 474 | } 475 | 476 | private void toolStripMenuItem14_Click(object sender, EventArgs e) 477 | { 478 | AddTab(); 479 | } 480 | 481 | private void toolStripMenuItem15_Click(object sender, EventArgs e) 482 | { 483 | RemoveTab(); 484 | } 485 | 486 | private void toolStripMenuItem16_Click(object sender, EventArgs e) 487 | { 488 | NewWindow(); 489 | } 490 | 491 | private void toolStripMenuItem17_Click(object sender, EventArgs e) 492 | { 493 | NewWindowAdmin(); 494 | } 495 | 496 | private void toolStripMenuItem18_Click(object sender, EventArgs e) 497 | { 498 | Application.Exit(); 499 | } 500 | 501 | private void MainForm_DragDrop(object sender, DragEventArgs e) 502 | { 503 | string[] sa = (string[])e.Data.GetData(DataFormats.FileDrop, false); 504 | 505 | if (_currentTab != null) 506 | { 507 | try 508 | { 509 | if (Directory.Exists(sa[0])) 510 | { 511 | _currentTab.InternalRichTextBox.AppendText("\"" + sa[0] + "\""); 512 | } 513 | if (File.Exists(sa[0])) 514 | { 515 | _currentTab.InternalRichTextBox.AppendText(sa[0]); 516 | } 517 | } 518 | catch { } 519 | } 520 | } 521 | 522 | private void MainForm_DragEnter(object sender, DragEventArgs e) 523 | { 524 | if (e.Data.GetDataPresent(DataFormats.FileDrop)) 525 | { 526 | e.Effect = DragDropEffects.Link; 527 | } 528 | else 529 | { 530 | e.Effect = DragDropEffects.None; 531 | } 532 | } 533 | 534 | private void MainForm_KeyDown(object sender, KeyEventArgs e) 535 | { 536 | if (e.Modifiers == Keys.Control) 537 | { 538 | if (e.KeyCode == Keys.T) AddTab(); 539 | if (e.KeyCode == Keys.W) RemoveTab(); 540 | } 541 | } 542 | 543 | private void Tabs_SelectedIndexChanged(object sender, EventArgs e) 544 | { 545 | _currentTab = tabConsoles.SelectedTab.Controls.OfType().FirstOrDefault(); 546 | 547 | if (_currentTab != null) 548 | { 549 | _currentTab.Focus(); 550 | } 551 | } 552 | 553 | private void button8_Click(object sender, EventArgs e) 554 | { 555 | placesMenu.Show(button8, button8.Location); 556 | } 557 | 558 | private void toolStripMenuItem1_Click(object sender, EventArgs e) 559 | { 560 | ExportLog(); 561 | } 562 | 563 | private void button10_Click(object sender, EventArgs e) 564 | { 565 | CheckForUpdate(); 566 | } 567 | } 568 | } 569 | -------------------------------------------------------------------------------- /MoonShell/MoonShell.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1891C8ED-CADC-4DA6-A95D-1E6620CFF804} 8 | WinExe 9 | Properties 10 | MoonShell 11 | MoonShell 12 | v4.5.2 13 | 512 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | true 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | false 36 | 37 | 38 | moonshell.ico 39 | 40 | 41 | 42 | ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll 43 | True 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | Form 60 | 61 | 62 | AboutForm.cs 63 | 64 | 65 | 66 | 67 | 68 | UserControl 69 | 70 | 71 | ConsoleControl.cs 72 | 73 | 74 | 75 | 76 | 77 | 78 | Form 79 | 80 | 81 | MainForm.cs 82 | 83 | 84 | Form 85 | 86 | 87 | OptionsForm.cs 88 | 89 | 90 | 91 | Form 92 | 93 | 94 | ThemesForm.cs 95 | 96 | 97 | 98 | 99 | 100 | 101 | AboutForm.cs 102 | 103 | 104 | ConsoleControl.cs 105 | 106 | 107 | MainForm.cs 108 | 109 | 110 | OptionsForm.cs 111 | 112 | 113 | ThemesForm.cs 114 | 115 | 116 | ResXFileCodeGenerator 117 | Resources.Designer.cs 118 | Designer 119 | 120 | 121 | True 122 | Resources.resx 123 | 124 | 125 | 126 | SettingsSingleFileGenerator 127 | Settings.Designer.cs 128 | 129 | 130 | True 131 | Settings.settings 132 | True 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 152 | -------------------------------------------------------------------------------- /MoonShell/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellzerg/moonshell/c013b1c7ce0bbb1fe735867aba8aa67967a20c8b/MoonShell/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /MoonShell/Options.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Drawing; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace MoonShell 13 | { 14 | public class SettingsJson 15 | { 16 | public Theme Color { get; set; } 17 | public Color BackgroundColor { get; set; } 18 | public Color ForegroundColor { get; set; } 19 | public Color ErrorColor { get; set; } 20 | public Font Font { get; set; } 21 | public List Places { get; set; } 22 | public string StartingDirectory { get; set; } 23 | public Size WindowSize { get; set; } 24 | public Point? WindowLocation { get; set; } 25 | public FormWindowState WindowState { get; set; } 26 | 27 | //public ArrayList History { get; set; } 28 | } 29 | 30 | public static class Options 31 | { 32 | internal static Color ForegroundColor = Color.MediumOrchid; 33 | internal static Color ForegroundAccentColor = Color.DarkOrchid; 34 | 35 | readonly static string _settingsFile = Application.StartupPath + "\\MoonShell.json"; 36 | internal static SettingsJson CurrentOptions = new SettingsJson(); 37 | internal readonly static string ThemeFlag = "themeable"; 38 | 39 | internal static void ApplyTheme(Form f) 40 | { 41 | switch (CurrentOptions.Color) 42 | { 43 | case Theme.Caramel: 44 | SetTheme(f, Color.DarkOrange, Color.Chocolate); 45 | break; 46 | case Theme.Lime: 47 | SetTheme(f, Color.LimeGreen, Color.ForestGreen); 48 | break; 49 | case Theme.Magma: 50 | SetTheme(f, Color.Tomato, Color.Red); 51 | break; 52 | case Theme.Minimal: 53 | SetTheme(f, Color.Gray, Color.DimGray); 54 | break; 55 | case Theme.Ocean: 56 | SetTheme(f, Color.DodgerBlue, Color.RoyalBlue); 57 | break; 58 | case Theme.Zerg: 59 | SetTheme(f, Color.MediumOrchid, Color.DarkOrchid); 60 | break; 61 | } 62 | } 63 | 64 | private static void SetTheme(Form f, Color c1, Color c2) 65 | { 66 | ForegroundColor = c1; 67 | ForegroundAccentColor = c2; 68 | 69 | Utilities.GetSelfAndChildrenRecursive(f).OfType