private void saveSessionToolStripMenuItem_Click(object sender, EventArgs e) { var sfd = new SaveFileDialog(); sfd.DefaultExt = "netcode"; sfd.Filter = "NetCode Session File (*.netcode)|*.netcode| All files (*.*)|*.*"; sfd.FilterIndex = 2; FastColoredTextBox fctb; if (tabControl1.HasChildren) { fctb = (FastColoredTextBox)tabControl1.SelectedTab.Controls[0]; } else { return; } if (sfd.ShowDialog() == DialogResult.OK) { Session s = new Session(tabControl1); ApplicationSession.Write(sfd.FileName, s); } }
private void openSessionToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = @"~"; ofd.Title = "Open File"; ofd.CheckFileExists = true; ofd.CheckPathExists = true; ofd.DefaultExt = "netcode"; ofd.Filter = "NetCode Session File (*.netcode)|*.netcode| All files (*.*)|*.*"; ofd.FilterIndex = 2; if (ofd.ShowDialog() == DialogResult.OK) { Session s = new Session(tabControl1); s = ApplicationSession.Open(ofd.FileName, s); tabControl1 = s.AddTabs(tabControl1); } }