public void Save(Stream fileStream) { XmlDocument xmlDocument = new XmlDocument(); XmlElement docElement = xmlDocument.CreateElement("DocumentElement"); xmlDocument.AppendChild(docElement); foreach (IDriver drv in DriverManager.Instance.Drivers) { IDriverControl drvControl = drv.Control as IDriverControl; drvControl.Save(xmlDocument); } // xmlDocument.Save(fileStream); }
public void Load(Stream fileStream) { XmlDocument xmlDocument = null; StreamReader fileStreamReader = null; // xmlDocument = new XmlDocument(); fileStreamReader = new StreamReader(fileStream); xmlDocument.Load(fileStreamReader); foreach (IDriver drv in DriverManager.Instance.Drivers) { IDriverControl drvControl = drv.Control as IDriverControl; drvControl.Load(xmlDocument); } }
private void CreateDriverTab() { foreach (IDriver drv in DriverManager.Instance.Drivers) { TabPage tab = new TabPage(drv.Name); IDriverControl drvControl = drv.Control as IDriverControl; drvControl.DataChanged += delegate { if (_viewContent.PrimaryFile != null) { _viewContent.PrimaryFile.MakeDirty(); } }; tab.Controls.Add(drv.Control); drv.Control.Dock = DockStyle.Fill; tabControl.TabPages.Add(tab); } }