Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        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);
            }
        }