Beispiel #1
0
        public override void Clear()
        {
            foreach (LinkGraphic lc in lcmap.Values)
            {
                lc.Parent = null;
                lc.Dispose();
            }
            lcmap.Clear();

            GraphItemBase[] gibs = new GraphItemBase[childs.Length];
            childs.CopyTo(gibs);
            foreach (GraphItemBase gib in gibs)
            {
                gib.ParentItems.Remove(this);
            }

            gibs = new GraphItemBase[parents.Length];
            parents.CopyTo(gibs);
            foreach (GraphItemBase gib in gibs)
            {
                gib.ChildItems.Remove(this);
            }

            //foreach (GraphItemBase gib in childs) gib.Dispose();
            childs.Clear();

            //foreach (GraphItemBase gib in parents) gib.Dispose();
            parents.Clear();
        }
Beispiel #2
0
        protected void AlignToControl()
        {
            if (sc == null || ec == null || (ssa == LinkControlSnapAnchor.None && this.esa == LinkControlSnapAnchor.None))
            {
                return;
            }
            Point b = GraphItemBase.FindBestDocks(sc.Docks, ssa, sa, ec.Docks, esa, ea);

            this.sa = (byte)b.X;
            ea      = (byte)b.Y;
        }
Beispiel #3
0
 protected void SetChildLinkColor(GraphItemBase sender, Color cl)
 {
     foreach (GraphItemBase lg in this.childs)
     {
         if (lg == sender)
         {
             LinkGraphic lc = (LinkGraphic)lcmap[lg];
             if (lc != null)
             {
                 lc.ForeColor = cl;
             }
         }
     }
 }
Beispiel #4
0
 protected void SendAllChildLinksToFront(GraphItemBase sender)
 {
     foreach (GraphItemBase lg in this.childs)
     {
         if (lg == sender)
         {
             LinkGraphic lc = (LinkGraphic)lcmap[lg];
             if (lc != null)
             {
                 lc.SendToFront();
             }
         }
     }
 }
Beispiel #5
0
        protected override void RemoveFromParent()
        {
            LinkGraphic[] lgs = GetChildLinks();
            foreach (LinkGraphic lg in lgs)
            {
                lg.Parent = null;
            }

            GraphItemBase[] gibs = new GraphItemBase[parents.Length];
            parents.CopyTo(gibs);
            foreach (GraphItemBase gib in gibs)
            {
                gib.ChildItems.Remove(this);
            }

            base.RemoveFromParent();
        }
Beispiel #6
0
 public LinkGraphic GetChildLink(GraphItemBase child)
 {
     return((LinkGraphic)lcmap[child]);
 }
Beispiel #7
0
 protected Point GetAnchorLocation(byte lca, GraphItemBase c, Point offset)
 {
     return(new Point(c.Docks[lca].X - offset.X, c.Docks[lca].Y - offset.Y));
 }
Beispiel #8
0
 protected Point GetAnchorLocation(byte lca, GraphItemBase c)
 {
     return(GetAnchorLocation(lca, c, new Point(0, 0)));
 }