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

ScrollingTick() private method

private ScrollingTick ( Object timeObject, EventArgs eventArgs ) : void
timeObject Object
eventArgs System.EventArgs
return void
		void ScrollingTick(Object timeObject, EventArgs eventArgs)
		{
			// Get mouse coordinates
			Point point = Control.MousePosition;
			point = PointToClient(point);

			if ( upTimerTicking )
			{
				if ( buttonPushed )
				{
					if ( upArrowRect.Contains(point))
					{
						upArrowPressed = true;
						if ( firstItem > 0 )
						{
							firstItem--;
							Rectangle rc = GetViewPortRect();
							Invalidate(rc);
						}
						else
							doScrollingLoop = false;
					}
					else
						upArrowPressed = false;
				}
			}
			else if ( downTimerTicking )
			{
				if ( buttonPushed )
				{
					if ( downArrowRect.Contains(point))
					{
						downArrowPressed = true;
						using ( Graphics g = Graphics.FromHwnd(Handle) )
						{
							// Get the last item rectangle
							OutlookBarBand band = bands[currentBandIndex];
							Rectangle rcItem = GetItemRect(g, band, band.Items.Count - 1, Rectangle.Empty);
							Rectangle rc = GetViewPortRect();
							if ( rcItem.Bottom > rc.Bottom )
							{
								firstItem++;
								Invalidate(rc);
							}
						}
					}
					else
						doScrollingLoop = false;
				}
				else
					downArrowPressed = false;
			}

		}