Exemple #1
0
        private void SaveGraphs()
        {
            var fd = new FolderBrowserDialog
            {
                ShowNewFolderButton = true
            };

            if (fd.ShowDialog() == DialogResult.OK)
            {
                foreach (var model in GraphModels)
                {
                    PocSerializeHelper.SaveGraph(model.Graph, Path.Combine(fd.SelectedPath, string.Format("{0}.{1}", model.Name, Settings.Default.GraphMLExtension)));
                }
            }
        }
Exemple #2
0
        private void OpenGraphs()
        {
            var ofd = new OpenFileDialog
            {
                CheckPathExists = true
            };

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                //open the file and load the graphs
                var graph = PocSerializeHelper.LoadGraph(ofd.FileName);

                GraphModels.Add(new GraphModel(Path.GetFileNameWithoutExtension(ofd.FileName), graph));
            }
        }