private void MdiParentForm_Load(object sender, EventArgs e) { WindowState = FormWindowState.Maximized; var projectMruPlaceholder = new MruPlaceholderToolStripMenuItem() { Text = "<mru>" }; fileToolStripMenuItem.DropDownItems.Insert(10, projectMruPlaceholder); var sessionMruPlaceholder = new MruPlaceholderToolStripMenuItem() { Text = "<mru>" }; sessionToolStripMenuItem.DropDownItems.Insert(7, sessionMruPlaceholder); var projectMruFile = Path.Combine(Options.AppDirectory, "projectsMru.json"); _projectMru = MruMenu.Load(projectMruFile); _projectMru.MruItemSelected += _projectMru_MruItemSelected; fileToolStripMenuItem.DropDownOpening += FileToolStripMenuItem_DropDownOpening; var sessionMruFile = Path.Combine(Options.AppDirectory, "sessionsMru.json"); _sessionMru = MruMenu.Load(sessionMruFile); _sessionMru.MruItemSelected += _sessionMru_MruItemSelected; sessionToolStripMenuItem.DropDownOpening += SessionToolStripMenuItem_DropDownOpening; _sessionMru.SetMenuItemState(false); }
protected void SaveSymbols() { XmlSerializer xs = new XmlSerializer(typeof(Schema)); TextWriter tw = new StreamWriter(SchemaFilename); xs.Serialize(tw, Schema); tw.Close(); MruMenu.AddFile(SchemaFilename); }
protected void LoadSymbols() { XmlSerializer xs = new XmlSerializer(typeof(Schema)); StreamReader sr = new StreamReader(SchemaFilename); Schema = (Schema)xs.Deserialize(sr); sr.Close(); SymbolEditorController.IfNotNull(ctrl => ctrl.PopulateTree()); PropertyGridController.IfNotNull(pgrid => pgrid.View.ShowObject(Schema)); MruMenu.AddFile(SchemaFilename); }
public void LoadReceptors(object sender, EventArgs args) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"; DialogResult ret = ofd.ShowDialog(); if (ret == DialogResult.OK) { LoadApplet(ofd.FileName); MruMenu.AddFile(ofd.FileName); } }
public void SaveReceptorsAs(object sender, EventArgs args) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"; sfd.OverwritePrompt = true; DialogResult ret = sfd.ShowDialog(); if (ret == DialogResult.OK) { SaveReceptorsInternal(sfd.FileName); MruMenu.AddFile(sfd.FileName); } }