public bool DropConnection(IContent2 Con) { if (this.pConList.Remove(Con)) { this.OnConnectionDropped?.Invoke(this, new EventArgs()); return(true); } return(false); }
public bool AddConnection(IContent2 Con) { if (!this.IsConnected(Con)) { this.pConList.Add(Con); this.OnConnectionAdded?.Invoke(this, new EventArgs()); return(true); } return(false); }
public bool IsConnected(IContent2 Con) { if (Con == this) { return(true); } if (this.pConList.Where((el) => el == Con).Count() > 0) { return(true); } if (this.pConList.Where((el) => (el is IConnectable2 tCon) ? (tCon.IsConnected(Con)) : (false)).Count() > 0) { return(true); } return(false); }
private void _RepositionContent(IContent2 con, int index) { Vec2i tIndex = this.ContentInitialOffset.Clone() as Vec2i; int count = Math.Min(index, this.ConnectedCount); for (int i = 0; i < count; ++i) { IContent2 TC = this.GetConnectedDetails(i); switch (this.LayoutDirection) { case LayDir.TopToBottom: tIndex.Y += TC.GetSize().Y + this.SpaceBetweenContent; break; case LayDir.LeftToRight: tIndex.X += TC.GetSize().X + this.SpaceBetweenContent; break; } } con.SetPosition(tIndex); }
internal abstract void abs_HandleConnectionAppending(IContent2 Con, int Index);
internal override void abs_HandleConnectionAppending(IContent2 Con, int Index) { Con.AppendTo(this); }
internal override void abs_HandleConnectionAppending(IContent2 Con, int Index) { this._RepositionContent(Con, Index); base.abs_HandleConnectionAppending(Con, Index); }