SidebarLibrary.Menus.MenuControl.ProcessMoveRight C# (CSharp) Method

ProcessMoveRight() protected method

protected ProcessMoveRight ( bool select ) : void
select bool
return void
		protected void ProcessMoveRight(bool select)
		{
			if (_popupMenu == null)
			{
				int newItem = _trackItem;
				//int startItem = newItem;

				for(int i=0; i<_drawCommands.Count; i++)
				{
					// Move to previous item
					newItem++;

					// Check limits
					if (newItem >= _drawCommands.Count)
						newItem = 0;

					DrawCommand dc = _drawCommands[newItem] as DrawCommand;

					// Can we select this item?
					if (!dc.Separator && (dc.Chevron || dc.MenuCommand.Enabled))
					{
						// If a change has occured
						if (newItem != _trackItem)
						{
							// Modify the display of the two items
							_trackItem = SwitchTrackingItem(_trackItem, newItem);

							if (_selected)
							{
								if (dc.Chevron || (dc.MenuCommand.MenuCommands.Count > 0))
									WindowsAPI.PostMessage(this.Handle, WM_OPERATEMENU, 0, 1);
							}

							break;
						}
					}
				}
			}
		}