示例#1
0
        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);
        }
示例#2
0
        // 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();
        }
示例#3
0
 public bool AttachToNearPipeControl(PipeControlBase pipeControl)
 {
     throw new NotImplementedException();
 }