Example #1
0
        private void tsbFileNew_Click(object sender, EventArgs e)
        {
            Project g = new Project();

            g.NewProcess("main");
            g.StartUpProcess = "main";
            Process cmain = g.FindProcess("main");

            cmain.NewNode("start");
            Node nmain = cmain.FindNode("start");

            cmain.EntryNode = "start";
            cmain.ExitNode  = "start";

            GraphDoc gd = new GraphDoc();

            // ask for filename

            string prefix = "project";
            string suffix = "";
            int    i      = 1;
            //! while (m_WebService.GetProjectID(prefix + i.ToString() + suffix) > 0) i++;
            string FileName = prefix + i.ToString() + suffix;

            g.Name = prefix + i.ToString();

            GProject gproject = new GProject();

            gproject.Load(g);

            gd.FileName = FileName;
            gd.LoadProcess(gproject.GProcess("main"));
            SetProjectObject(gd.FileName, gproject);
            gd.OnDocumentModified          += new NotifyEvent(childDocumentModified);
            gd.OnDocumentStructureModified += new NotifyEvent(childDocumentStructureModified);
            gd.OnDocumentSave     += new NotifyEvent(childDocumentSave);
            gd.OnDocumentRun      += new NotifyEvent(childDocumentRun);
            gd.OnSelectionChanged += new NotifyEvent(childSelectionChanged);

            gd.DockAreas = WeifenLuo.WinFormsUI.Docking.DockAreas.Document;
            gd.Show(dockPanel);

            gd.SaveProject();
            gd.LoadProcess(GetProjectObject(gd.FileName).GProcess(gd.ProcessName));

            LoadRepository();
        }
Example #2
0
        private GraphDoc OpenDocument(string filename, string processName)
        {
            GraphDoc gd = new GraphDoc();

            gd.FileName = filename;
            gd.LoadProcess(GetProjectObject(filename).GProcess(processName));
            gd.OnDocumentModified          += new NotifyEvent(childDocumentModified);
            gd.OnDocumentStructureModified += new NotifyEvent(childDocumentStructureModified);
            gd.OnDocumentSave     += new NotifyEvent(childDocumentSave);
            gd.OnDocumentRun      += new NotifyEvent(childDocumentRun);
            gd.OnSelectionChanged += new NotifyEvent(childSelectionChanged);

            gd.DockAreas = WeifenLuo.WinFormsUI.Docking.DockAreas.Document;
            gd.Show(dockPanel);
            return(gd);
        }