AForge.Controls.Histogram.Histogram_MouseMove C# (CSharp) Метод

Histogram_MouseMove() приватный Метод

private Histogram_MouseMove ( object sender, MouseEventArgs e ) : void
sender object
e System.Windows.Forms.MouseEventArgs
Результат void
		private void Histogram_MouseMove(object sender,System.Windows.Forms.MouseEventArgs e)
		{
			if ((allowSelection) && (values != null))
			{
				var x = 1;
				var y = 1;

				if (!tracking)
				{
					if ((e.X >= x) && (e.Y >= y) && (e.X < x + width) && (e.Y < y + height))
					{
						over = true;

						// moving over
						this.Cursor = Cursors.Cross;

						// notify parent
						if (PositionChanged != null)
						{
							PositionChanged(this,new HistogramEventArgs(
								(vertical) ? (e.Y - y) : (e.X - x)));
						}
					}
					else
					{
						this.Cursor = Cursors.Default;

						if (over)
						{
							over = false;

							// notify parent
							if (PositionChanged != null)
								PositionChanged(this,new HistogramEventArgs(-1));
						}
					}
				}
				else
				{
					// selecting region
					stop = (vertical) ? (e.Y - y) : (e.X - x);

					stop = System.Math.Min(stop,((vertical) ? height : width) - 1);
					stop = System.Math.Max(stop,0);

					Invalidate();

					// notify parent
					if (SelectionChanged != null)
						SelectionChanged(this,new HistogramEventArgs(System.Math.Min(start,stop),System.Math.Max(start,stop)));
				}
			}
		}