Пример #1
0
        private void btnSaveCR_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            SaveFileDialog d = new SaveFileDialog();

            d.Filter = "Xml files (*.xml)|*.xml|All files (*.*)|*.*";
            if (d.ShowDialog() == DialogResult.OK)
            {
                initialXml = docCR.Serialize();
                File.WriteAllText(d.FileName, initialXml, Encoding.UTF8);
            }
        }
Пример #2
0
        private void btnOpen_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            OpenFileDialog d = new OpenFileDialog();

            if (d.ShowDialog() == DialogResult.OK)
            {
                CloseCR();
                docCR = new QDocumentCR();
                trlCRTree.DataSource = new object();

                XmlDocument doc = new XmlDocument();
                doc.Load(d.FileName);
                docCR.Deserialize(doc.DocumentElement);
                initialXml = docCR.Serialize();
                trlCRTree.ExpandAll();
            }
        }