Пример #1
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EditorPage page = dockPanel1.ActiveDocument as EditorPage;

            if (page != null)
            {
                page.save();
                mruManager.Add(page.fileName);
            }
        }
Пример #2
0
        private void buildToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (bwCompiler.IsBusy)
            {
                return;
            }

            if (cobBoard.SelectedIndex < 0 || (cobCPU.Items.Count > 0 && cobCPU.SelectedIndex < 0))
            {
                MessageBox.Show("Please select platform / processor", "Build Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            EditorPage page = dockPanel1.ActiveDocument as EditorPage;

            if (page != null)
            {
                if (!page.save())
                {
                    setListBox1("Could not save " + page.fileName, Color.Red);
                }

                outputListBox.Items.Clear();

                string filename = Path.GetFileNameWithoutExtension(page.fileName);

                if (!new DirectoryInfo(cfg.buildPath).Name.Equals(filename))
                {
                    cfg.buildPath += filename + "/";
                }

                _text = page.Editor.Text;

                ArduinoBoard board = cfg.arduinoBoards.First(b => b.name.Equals(cobBoard.SelectedItem.ToString()));


                bwCompiler.RunWorkerAsync(board);
            }
        }