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(); }
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; }
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; } } } }
protected void SendAllChildLinksToFront(GraphItemBase sender) { foreach (GraphItemBase lg in this.childs) { if (lg == sender) { LinkGraphic lc = (LinkGraphic)lcmap[lg]; if (lc != null) { lc.SendToFront(); } } } }
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(); }
public LinkGraphic GetChildLink(GraphItemBase child) { return((LinkGraphic)lcmap[child]); }
protected Point GetAnchorLocation(byte lca, GraphItemBase c, Point offset) { return(new Point(c.Docks[lca].X - offset.X, c.Docks[lca].Y - offset.Y)); }
protected Point GetAnchorLocation(byte lca, GraphItemBase c) { return(GetAnchorLocation(lca, c, new Point(0, 0))); }