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); } }