public frmProjIDE(AVRProject myProject, EnviroSettings mySettings) { this.myProject = myProject; this.mySettings = mySettings; InitializeComponent(); myBuilder = new ProjectBuilder(myProject, txtOutputMsg, listErrWarn); myBuilder.DoneWork += new ProjectBuilder.EventHandler(myBuilder_DoneWork); myBurner = new ProjectBurner(myProject); serialPortControlPanel = new SerialPortPanel("com0", 9600); tabSerialPort.Controls.Add(serialPortControlPanel); serialPortControlPanel.SerialPortException += new SerialPortPanel.SerialPortErrorHandler(serialPortControlPanel_SerialPortException); myEditorTabsPanel = new EditorTabsPanel(myProject, mySettings); splitFileTreeEditorTabs.Panel2.Controls.Add(myEditorTabsPanel); try { helpToolStripMenuItem.DropDownItems.Add(MenuWebLink.GetMenuLinkRoot("Resources", "helplinks.xml")); } catch (Exception ex) { txtOutputMsg.Text += "Failed to Load Help->Resource Links\r\n" + ex.ToString(); } FillRecentProjects(); RefreshFileTree(); }
private void mbtnOpenProject_Click(object sender, EventArgs e) { if (myEditorTabsPanel.HasChanged) { DialogResult res = MessageBox.Show("You have unsaved changes. Do you want to save?", "Unsaved Project", MessageBoxButtons.YesNoCancel); if (res == DialogResult.Yes) { myEditorTabsPanel.SaveAll(); } else if (res == DialogResult.Cancel) { return; } } string originalProject = myProject.FilePath; foreach (KeyValuePair <string, FileEditorTab> i in myEditorTabsPanel.MyListOfEditors) { myEditorTabsPanel.MyTabControl.TabPages.Remove(i.Value.MyTabPage); } myEditorTabsPanel.MyListOfEditors.Clear(); treeFiles.Nodes.Clear(); splitFileTreeEditorTabs.Panel2.Controls.Clear(); myProject.Reset(); while (true) { frmWelcome newWelcome = new frmWelcome(mySettings, myProject); newWelcome.ShowDialog(); if (myProject.IsReady == false) { if (myProject.Open(originalProject) == false) { MessageBox.Show("Error Reopening Original Project"); } else { break; } } else { break; } } myEditorTabsPanel = new EditorTabsPanel(myProject, mySettings); splitFileTreeEditorTabs.Panel2.Controls.Add(myEditorTabsPanel); FillRecentProjects(); RefreshFileTree(); }
void recentMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem item = (ToolStripMenuItem)sender; string originalProject = myProject.FilePath; foreach (KeyValuePair <string, FileEditorTab> i in myEditorTabsPanel.MyListOfEditors) { myEditorTabsPanel.MyTabControl.TabPages.Remove(i.Value.MyTabPage); } myEditorTabsPanel.MyListOfEditors.Clear(); treeFiles.Nodes.Clear(); splitFileTreeEditorTabs.Panel2.Controls.Clear(); myProject.Reset(); string recentPath = ""; foreach (string i in mySettings.RecentFileList) { if (i.EndsWith(item.Text)) { recentPath = i; break; } } if (myProject.Open(recentPath) == false) { MessageBox.Show("Error Opening Recent Project"); if (myProject.Open(originalProject) == false) { MessageBox.Show("Error Reopening Original Project"); MessageBox.Show("This should never have happened, I do not know how to handle this situation, please restart the IDE"); this.Close(); return; } } myEditorTabsPanel = new EditorTabsPanel(myProject, mySettings); splitFileTreeEditorTabs.Panel2.Controls.Add(myEditorTabsPanel); FillRecentProjects(); RefreshFileTree(); }
void recentMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem item = (ToolStripMenuItem)sender; string originalProject = myProject.FilePath; foreach (KeyValuePair<string, FileEditorTab> i in myEditorTabsPanel.MyListOfEditors) { myEditorTabsPanel.MyTabControl.TabPages.Remove(i.Value.MyTabPage); } myEditorTabsPanel.MyListOfEditors.Clear(); treeFiles.Nodes.Clear(); splitFileTreeEditorTabs.Panel2.Controls.Clear(); myProject.Reset(); string recentPath = ""; foreach (string i in mySettings.RecentFileList) { if (i.EndsWith(item.Text)) { recentPath = i; break; } } if (myProject.Open(recentPath) == false) { MessageBox.Show("Error Opening Recent Project"); if (myProject.Open(originalProject) == false) { MessageBox.Show("Error Reopening Original Project"); MessageBox.Show("This should never have happened, I do not know how to handle this situation, please restart the IDE"); this.Close(); return; } } myEditorTabsPanel = new EditorTabsPanel(myProject, mySettings); splitFileTreeEditorTabs.Panel2.Controls.Add(myEditorTabsPanel); FillRecentProjects(); RefreshFileTree(); }
private void mbtnOpenProject_Click(object sender, EventArgs e) { if (myEditorTabsPanel.HasChanged) { DialogResult res = MessageBox.Show("You have unsaved changes. Do you want to save?", "Unsaved Project", MessageBoxButtons.YesNoCancel); if (res == DialogResult.Yes) { myEditorTabsPanel.SaveAll(); } else if (res == DialogResult.Cancel) { return; } } string originalProject = myProject.FilePath; foreach (KeyValuePair<string, FileEditorTab> i in myEditorTabsPanel.MyListOfEditors) { myEditorTabsPanel.MyTabControl.TabPages.Remove(i.Value.MyTabPage); } myEditorTabsPanel.MyListOfEditors.Clear(); treeFiles.Nodes.Clear(); splitFileTreeEditorTabs.Panel2.Controls.Clear(); myProject.Reset(); while (true) { frmWelcome newWelcome = new frmWelcome(mySettings, myProject); newWelcome.ShowDialog(); if (myProject.IsReady == false) { if (myProject.Open(originalProject) == false) { MessageBox.Show("Error Reopening Original Project"); } else { break; } } else { break; } } myEditorTabsPanel = new EditorTabsPanel(myProject, mySettings); splitFileTreeEditorTabs.Panel2.Controls.Add(myEditorTabsPanel); FillRecentProjects(); RefreshFileTree(); }