SIL.FieldWorks.Discourse.ConstChartBody.OnMouseDown C# (CSharp) Method

OnMouseDown() protected method

protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
return void
		protected override void OnMouseDown(MouseEventArgs e)
		{
			if (System.DateTime.Now.Ticks - m_ticksWhenContextMenuClosed > 50000) // 5ms!
			{
				// Consider bringing up another menu only if we weren't already showing one.
				// The above time test seems to be the only way to find out whether this click closed the last one.
				ChartLocation cell;
				int irow;
				if (GetCellInfo(e, out cell, out irow))
				{
					m_cellContextMenu = m_logic.MakeCellContextMenu(cell);
					m_cellContextMenu.Closed += m_cellContextMenu_Closed;
					m_cellContextMenu.Show(this, e.X, e.Y);
					return; // Don't call the base method, we don't want to make a selection.
				}
				if (cell != null && cell.IsValidLocation && cell.ColIndex >= AllColumns.Length)
				{
					// Click in Notes...make sure it has one.
					if (cell.Row.Notes == null || cell.Row.Notes.Length == 0)
					{
						NonUndoableUnitOfWorkHelper.Do(Cache.ActionHandlerAccessor, () =>
							{
								cell.Row.Notes =
									Cache.TsStrFactory.EmptyString(Cache.DefaultAnalWs);
							});
					}
				}
			}
			base.OnMouseDown(e);
		}