AnimatGuiCtrls.Controls.TimeRuler.RemoveKeyFrame C# (CSharp) Method

RemoveKeyFrame() private method

private RemoveKeyFrame ( Point pMousePos ) : void
pMousePos Point
return void
		private void RemoveKeyFrame(Point pMousePos)
		{
			try
			{
				int iMousePosition = ((this.Orientation == enumOrientation.orHorizontal) ? pMousePos.X : pMousePos.Y);
				long lMillisecond = CalculateMillisecondValue(iMousePosition);
				
				if(lMillisecond <= _lCurrentMillisecond)
					throw new System.Exception("You can not remove keyframes that occur before the current simulation time.");

				KeyFrame keyFrame = _aryKeyFrames.RemoveClosest(KeyFrame.enumKeyFrameType.Snapshot, lMillisecond);

				if(keyFrame != null)
					OnKeyFrameRemoved(keyFrame);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}