Exemplo n.º 1
0
        internal static void setAllNoClear(DiagramShape obj, bool b)
        {
            DiagramPort port1 = obj as DiagramPort;

            if (port1 != null)
            {
                port1.NoClearLinks = b;
            }
            else
            {
                LineGraph link1 = obj as LineGraph;
                if (link1 != null)
                {
                    link1.NoClearPorts = b;
                }
                else
                {
                    GroupShape group1 = obj as GroupShape;
                    if (group1 != null)
                    {
                        GroupEnumerator enumerator1 = group1.GetEnumerator();
                        while (enumerator1.MoveNext())
                        {
                            GroupShape.setAllNoClear(enumerator1.Current, b);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public virtual IDiagramShapeCollection AddCollection(IDiagramShapeCollection coll, bool reparentLinks)
        {
            foreach (DiagramShape obj1 in coll)
            {
                if (!base.IsChildOf(obj1) && (this != obj1))
                {
                    continue;
                }
                throw new ArgumentException("Cannot add a group to itself or to one of its own children.");
            }
            DiagramShapeCollection collection1 = new DiagramShapeCollection();

            foreach (DiagramShape obj2 in coll)
            {
                collection1.Add(obj2);
            }
            CollectionEnumerator enumerator2 = collection1.GetEnumerator();

            while (enumerator2.MoveNext())
            {
                DiagramShape obj3  = enumerator2.Current;
                bool         flag1 = obj3.Layer != null;
                if (flag1)
                {
                    GroupShape.setAllNoClear(obj3, true);
                    obj3.Remove();
                }
                this.Add(obj3);
                if (flag1)
                {
                    GroupShape.setAllNoClear(obj3, false);
                }
            }
            if (reparentLinks && base.IsInDocument)
            {
                SubGraphNode.ReparentAllLinksToSubGraphs(collection1, true, base.Document.LinksLayer);
            }
            return(collection1);
        }