public override void ModelFinalize(CopyPaste.ModelProtoElement protoElement, CopyPaste.ModelProtoGroupMerger groupMerger)
        {
            base.ModelFinalize(protoElement, groupMerger);

            RootDiagramNode node = new RootDiagramNode(this.Store);
            node.PresentationElementClass = this;

            this.DiagramClass.DiagramClassView.RootDiagramNodes.Add(node);
        }
        private static void FixUpDiagramView(LibraryModelContext model)
        {
            foreach (DiagramClass diagramClass in model.DiagramClasses)
            {
                DiagramClassView vm = new DiagramClassView(model.Store);
                vm.IsExpanded = true;
                vm.DiagramClass = diagramClass;

                // add shapes views
                foreach (PresentationElementClass p in diagramClass.PresentationElements)
                {
                    if (p is ShapeClass)
                    {
                        ShapeClass shapeClass = p as ShapeClass;
                        if (shapeClass.Parent == null)
                        {
                            RootDiagramNode node = new RootDiagramNode(p.Store);
                            node.PresentationElementClass = p;

                            vm.RootDiagramNodes.Add(node);
                        }
                        else
                        {
                            EmbeddingDiagramNode newNode = new EmbeddingDiagramNode(model.Store);
                            newNode.PresentationElementClass = p;
                        }
                    }
                    else
                    {
                        RootDiagramNode node = new RootDiagramNode(p.Store);
                        node.PresentationElementClass = p;

                        vm.RootDiagramNodes.Add(node);
                    }
                }

                foreach (PresentationElementClass p in diagramClass.PresentationElements)
                {
                    if (p is ShapeClass)
                    {
                        ShapeClass shapeClass = p as ShapeClass;
                        if (shapeClass.Parent != null)
                        {
                            EmbeddingDiagramNode source = shapeClass.Parent.DiagramTreeNode as EmbeddingDiagramNode;
                            EmbeddingDiagramNode target = p.DiagramTreeNode as EmbeddingDiagramNode;

                            if (source != null && target != null)
                                new EmbeddingDiagramNodeHasEmbeddingDiagramNodes(source, target);
                        }
                    }
                }

                model.ViewContext.DiagramView.DiagramClassViews.Add(vm);
            }
        }