public bool IsControlInUpNearPixel(PipeControlBase pipeControl, int nearPixel) { if (Math.Abs(this.PipeWidth - pipeControl.PipeWidth) > 1E-100) { return(false); } int yOffset = pipeControl.Location.Y + pipeControl.Height - this.Location.Y; if (Math.Abs(yOffset) > nearPixel) { return(false); } int xOffset = (int)(pipeControl.Location.X + pipeControl.UpNodePosition * pipeControl.Size.Width - (UpNodePosition * this.Size.Width + this.Location.X)); return(Math.Abs(xOffset) <= nearPixel); }
// TODO 暂时关闭自动停靠功能 private void PipeControlBase_Move(object sender, EventArgs e) { return; PipeControlBase controlBase = sender as PipeControlBase; ControlCollection controls = this.Parent.Controls; bool alreadyAttached = false; foreach (Control control in controls) { if (!(control is PipeControlBase)) { continue; } } if (!alreadyAttached) { return; } ReconnectNearPipeControl(); }
public bool AttachToNearPipeControl(PipeControlBase pipeControl) { throw new NotImplementedException(); }