SidebarLibrary.WinControls.OutlookBar.OnMouseDown C# (CSharp) Method

OnMouseDown() protected method

protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
return void
		protected override void OnMouseDown(MouseEventArgs e)
		{
			base.OnMouseDown(e);
			// If the textbox is being displayed cancel editing
			if ( textBox.Visible )
			{
				ProcessTextBoxEditing();
				return;
			}

			int index;
			HitTestType ht = HitTest(new Point(e.X, e.Y), out index, false);
			if ( e.Button == MouseButtons.Left)
			{
				// Handle arrow button hit
				if( ht == HitTestType.UpScroll || ht == HitTestType.DownScroll)
				{
					if ( ht == HitTestType.UpScroll )
					{
						ProcessArrowScrolling(upArrowRect,
							ref upArrowVisible, ref upArrowPressed, ref upTimerTicking);
						return;
					}
					else
					{
						ProcessArrowScrolling(downArrowRect,
							ref downArrowVisible, ref downArrowPressed, ref downTimerTicking);
						return;
					}
				}

				// Handle header hit
				if ( ht == HitTestType.Header )
				{
					ProcessHeaderHit(index);
					return;
				}

				// Handle item hit
				if ( ht == HitTestType.Item )
				{
					ProcessItemHit(index, new Point(e.X, e.Y));
					return;
				}
			}
		}