Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     InputHandler argumentHandler = new InputHandler(ProgramType.Compiler);
     argumentHandler.HandleArgs(args);
     Compiler mainC = new Compiler(new ConsoleInterface());
     mainC.SetProperties(ref argumentHandler);
 }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();
            dataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewColumn {
                Name = "0x0",
                Width = 75,
                Visible = true,
                AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells,
                SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable,
                ValueType = typeof(ushort),
                CellTemplate = new DataGridViewTextBoxCell(),
                DefaultCellStyle = new DataGridViewCellStyle { BackColor = Color.DimGray }
            });
            for (int i = 0; i < 16; i++) {
                dataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewColumn {
                    Name = i.ToString("X"),
                    Width = 75,
                    Visible = true,
                    AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells,
                    SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable,
                    ValueType = typeof(ushort),
                    CellTemplate = new DataGridViewTextBoxCell()
                });
                dataGridView1.Rows.Add(16);
                dataGridView1[0, i].Value = i.ToString("X");
            }

            buildform = new BuildForm();
            ioform = new IOForm();

            buildform.Name = "MainBuildForm";
            ioform.Name = "MainIOForm";

            buildform.Owner = this;
            ioform.Owner = this;

            compiler = new Compiler(buildform);
            vm = new VirtualMachine(ioform);
            Thread.CurrentThread.Name = "MainwindowThread";

            ioform.FormClosing += new FormClosingEventHandler(HideIOForm);
            buildform.FormClosing += new FormClosingEventHandler(HideBuildForm);
            buildform.VisibleChanged += new EventHandler(UpdateCheckedStateBuildForm);

            if (!Directory.Exists(Paths.CompiledDirectory))
                Directory.CreateDirectory(Paths.CompiledDirectory);

            EnvGrid.SelectedObject = vm;
            //dataGridView1.DataSource = vm.Memory;
            /*
            InputHandler test = new InputHandler(ProgramType.Compiler);
            test.HandleArgs(new string[] { "code.txt" });
            vm.OutputPath = "code.txt";
            compiler.SetProperties(ref test); */

            buildform.CreateControl();
            ioform.CreateControl();
            CodeHit = true;
        }