Esempio n. 1
0
        public Shapes.IDiagramShapeCollection AddCollection(Shapes.IDiagramShapeCollection coll, bool reparentLinks)
        {
            Shapes.DiagramShapeCollection collection1 = new Shapes.DiagramShapeCollection();
            foreach (Shapes.DiagramShape obj1 in coll)
            {
                collection1.Add(obj1);
            }
            CollectionEnumerator enumerator2 = collection1.GetEnumerator();

            while (enumerator2.MoveNext())
            {
                Shapes.DiagramShape obj2 = enumerator2.Current;
                bool flag1 = obj2.Layer != null;
                if (flag1)
                {
                    Shapes.GroupShape.setAllNoClear(obj2, true);
                    obj2.Remove();
                }
                this.Add(obj2);
                if (flag1)
                {
                    Shapes.GroupShape.setAllNoClear(obj2, false);
                }
            }
            if (reparentLinks && this.IsInDocument)
            {
                Shapes.SubGraphNode.ReparentAllLinksToSubGraphs(collection1, true, this.Document.LinksLayer);
            }
            return(collection1);
        }
Esempio n. 2
0
 public virtual void DoNoRelink(Shapes.IDiagramLine oldlink, Shapes.IDiagramPort fromPort, Shapes.IDiagramPort toPort)
 {
     Shapes.DiagramShape obj1 = oldlink.DiagramShape;
     if ((obj1 != null) && (obj1.Layer != null))
     {
         if (obj1.Movable)
         {
             oldlink.FromPort       = fromPort;
             oldlink.ToPort         = toPort;
             base.TransactionResult = "Relink";
             base.View.RaiseLinkRelinked(oldlink.DiagramShape);
             return;
         }
         if (obj1.CanDelete())
         {
             CancelEventArgs args1 = new CancelEventArgs();
             base.View.RaiseSelectionDeleting(args1);
             if (!args1.Cancel)
             {
                 obj1.Remove();
                 base.View.RaiseSelectionDeleted();
                 base.TransactionResult = "Relink";
                 return;
             }
             this.DoCancelMouse();
         }
         else
         {
             this.DoCancelMouse();
         }
     }
     base.TransactionResult = null;
 }
Esempio n. 3
0
 public override void Stop()
 {
     base.View.StopAutoScroll();
     this.Forwards          = true;
     this.OriginalStartPort = null;
     this.OriginalEndPort   = null;
     if (this.Link != null)
     {
         Shapes.DiagramShape obj1 = this.Link.DiagramShape;
         if ((obj1 != null) && obj1.IsInView)
         {
             obj1.Remove();
         }
     }
     this.Link = null;
     if (this.StartPort != null)
     {
         Shapes.DiagramShape obj2 = this.StartPort.DiagramShape;
         if ((obj2 != null) && obj2.IsInView)
         {
             obj2.Remove();
         }
     }
     this.StartPort = null;
     if (this.EndPort != null)
     {
         Shapes.DiagramShape obj3 = this.EndPort.DiagramShape;
         if ((obj3 != null) && obj3.IsInView)
         {
             obj3.Remove();
         }
     }
     this.EndPort = null;
     if (this.ValidPortsCache != null)
     {
         this.ValidPortsCache.Clear();
     }
     base.StopTransaction();
 }