Ejemplo n.º 1
0
        public void LoadFromXml(IXPathNavigable doc, IProjectContent pc)
        {
            if (pc == null)
            {
                return;
            }
            if (doc == null)
            {
                return;
            }
            ClearCanvas();

            XPathNavigator    nav = doc.CreateNavigator();
            XPathNodeIterator ni  = nav.Select(@"/ClassDiagram/Class | /ClassDiagram/Struct | /ClassDiagram/Enum | /ClassDiagram/Interface | /ClassDiagram/Delegate");

            while (ni.MoveNext())
            {
                string          typeName   = ni.Current.GetAttribute("Name", "");
                IClass          ct         = pc.GetClass(typeName, 0);
                ClassCanvasItem canvasitem = ClassCanvas.CreateItemFromType(ct);
                if (canvasitem != null)
                {
                    canvasitem.LoadFromXml(ni.Current);
                    AddCanvasItem(canvasitem);
                }
            }
            ni = nav.Select(@"/ClassDiagram/Comment");
            while (ni.MoveNext())
            {
                NoteCanvasItem note = new NoteCanvasItem();
                note.LoadFromXml(ni.Current);
                AddCanvasItem(note);
            }
        }
Ejemplo n.º 2
0
        private InteractiveItemsStack PrepareNestedTypesContent()
        {
            InteractiveItemsStack innerItems = new InteractiveItemsStack();

            innerItems.OrientationAxis = Axis.Y;
            innerItems.Spacing         = 10;
            innerItems.Padding         = 10;
            foreach (IClass ct in classtype.InnerClasses)
            {
                ClassCanvasItem innerItem = ClassCanvas.CreateItemFromType(ct);
                innerItems.Add(innerItem);
                innerItem.LayoutChanged += HandleRedraw;
            }
            return(innerItems);
        }