private void LoadCWP3RTB() { ASMBox.Text = ""; codeDefBox.Text = "// Declarations\n"; string[] tempStr = FileIO.LoadCWP3(GlobalFileName); if (tempStr.Length >= 1) { ASMBox.LoadFile(tempStr[0]); } if (tempStr.Length >= 2) { codeDefBox.LoadFile(tempStr[1]); } foreach (string str in tempStr) { System.IO.File.Delete(str); } }
private void Main_Load(object sender, EventArgs e) { ASMDeclarations.DeclareHelpStr(); ASMDeclarations.DeclareInstructions(); string[] args = Environment.GetCommandLineArgs(); if (args.Length == 2) { GlobalFileName = args[1]; LoadCWP3RTB(); codeDefBox.SelectionStart = 0; codeDefBox.SelectionLength = codeDefBox.Text.Length; codeDefBox.SelectionFont = codeDefBox.Font; codeDefBox.SelectionLength = 0; ASMBox.SelectionStart = 0; ASMBox.SelectionLength = ASMBox.Text.Length; ASMBox.SelectionFont = ASMBox.Font; ASMBox.SelectionLength = 0; } //Set minimum size this.MinimumSize = new System.Drawing.Size(654, 564); //Set settings file int off = Application.ExecutablePath.LastIndexOf("\\"); settFile = sLeft(Application.ExecutablePath, off + 1); pathDir = settFile; settFile += "cwps3.ini"; //Load settings string a = FileIO.OpenFile(settFile); if (a != "" && a != null) { string[] b = a.Split('\n'); try { outputType = Convert.ToInt32(b[0]); bitOrder = Convert.ToInt32(b[1]); minMemRange = Convert.ToUInt32(b[2], 16); maxMemRange = Convert.ToUInt32(b[3], 16); colEnabled = Convert.ToBoolean(b[4]); colIns = Convert.ToBoolean(b[5]); colReg = Convert.ToBoolean(b[6]); colCom = Convert.ToBoolean(b[7]); colCommand = Convert.ToBoolean(b[8]); colLab = Convert.ToBoolean(b[9]); } catch { } } if (System.IO.Directory.Exists(Main.DirOf(Application.ExecutablePath) + "\\Pseudo Instructions") == false) { System.IO.Directory.CreateDirectory(Main.DirOf(Application.ExecutablePath) + "\\Pseudo Instructions"); } customPIns = CustomPIns.LoadAllPCI(Main.DirOf(Application.ExecutablePath) + "\\Pseudo Instructions"); ASMBox.Focus(); }