Example #1
0
        private void SaveAsToolStripMenuItemClick(object sender, EventArgs e)
        {
            var saveFile = new SaveFileDialog
            {
                Filter = "XML files (*.xml)|*.xml", FileName = Application.StartupPath + "\\MyWebsite1.xml"
            };

            if (saveFile.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var serializer = new TreeViewSerializer();

            serializer.SerializeTreeView(this.treeView1, saveFile.FileName);
        }
Example #2
0
        private void OpenToolStripMenuItemClick(object sender, EventArgs e)
        {
            var openFile = new OpenFileDialog
            {
                Filter   = "XML files (*.xml)|*.xml",
                FileName = Application.StartupPath + "\\MyWebsite1.xml"
            };

            if (openFile.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            this.treeView1.Nodes.Clear();
            var serializer = new TreeViewSerializer();

            serializer.DeserializeTreeView(this.treeView1, openFile.FileName);
            this.treeView1.ExpandAll();
        }
Example #3
0
        private void SaveToolStripMenuItemClick(object sender, EventArgs e)
        {
            // TODO: implement save name and path
            // if the project has been openned then we save
            // otherwise we saved as

            // for now we save as
            var saveFile = new SaveFileDialog
            {
                Filter = "XML files (*.xml)|*.xml", FileName = Application.StartupPath + "\\MyWebsite1.xml"
            };

            if (saveFile.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var serializer = new TreeViewSerializer();

            serializer.SerializeTreeView(this.treeView1, saveFile.FileName);
        }