public static void DeleteProject(ITreeItem project)
        {
            foreach (var diagram in project.GetItems().ToList())
            {
                project.Remove(diagram);
            }

            (project.GetParent() as ITreeItem).Remove(project);
        }
        public static void DeleteProject(ITreeItem solution, ITreeItem project)
        {
            foreach (var diagram in project.GetItems().ToList())
            {
                project.Remove(diagram);
            }

            solution.Remove(project);
        }
        public static void DeleteSolution(ITreeItem solution)
        {
            foreach (var project in solution.GetItems().ToList())
            {
                DeleteProject(solution, project);
            }

            (solution.GetParent() as ITree).Remove(solution as ITreeItem);
        }
Beispiel #4
0
        public static string GenerateProject(ITreeItem project,
                                             List <string> models,
                                             bool includeHistory)
        {
            var sb = new StringBuilder();

            sb.Append(Constants.PrefixRoot);
            sb.Append(Constants.ArgumentSeparator);
            sb.Append(project.GetUid());
            sb.Append(Environment.NewLine);

            foreach (var diagram in project.GetItems())
            {
                if (diagram.GetTag() != null)
                {
                    var tag     = diagram.GetTag() as Diagram;
                    var model   = tag.Model;
                    var history = tag.History;

                    if (model == null)
                    {
                        model = GenerateItemModel(null, diagram, true);
                    }

                    models.Add(model);
                    sb.Append(model);

                    if (includeHistory == true && history != null)
                    {
                        foreach (var m in history.Undo)
                        {
                            models.Add(m);
                            sb.Append(m);
                        }
                    }
                }
            }

            return(sb.ToString());
        }
        public static void DeleteSolution(ITreeItem solution)
        {
            foreach (var project in solution.GetItems().ToList())
                DeleteProject(solution, project);

            (solution.GetParent() as ITree).Remove(solution as ITreeItem);
        }
        public static void DeleteProject(ITreeItem project)
        {
            foreach (var diagram in project.GetItems().ToList())
                project.Remove(diagram);

            (project.GetParent() as ITreeItem).Remove(project);
        }
        public static void DeleteProject(ITreeItem solution, ITreeItem project)
        {
            foreach (var diagram in project.GetItems().ToList())
                project.Remove(diagram);

            solution.Remove(project);
        }