Example #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();
        }
Example #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;
        }
Example #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;
             }
         }
     }
 }
Example #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();
             }
         }
     }
 }
Example #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();
        }
Example #6
0
 public LinkGraphic GetChildLink(GraphItemBase child)
 {
     return((LinkGraphic)lcmap[child]);
 }
Example #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));
 }
Example #8
0
 protected Point GetAnchorLocation(byte lca, GraphItemBase c)
 {
     return(GetAnchorLocation(lca, c, new Point(0, 0)));
 }