private void resetScaleToolStripMenuItem_Click(object sender, EventArgs e) { TimeController timeController = _timeController; if (timeController == null) { return; } timeController.SetVisibleTime(timeController.BeginTime, timeController.EndTime); }
private void pictDisplay_MouseMove(object sender, MouseEventArgs e) { TimeController timeController = _timeController; if (timeController == null) { return; } decimal cursorTime = getTimeFromPosition(e.X); //cursorTime = Math.Min(timeController.VisibleEndTime, Math.Max(timeController.VisibleBeginTime, cursorTime)); timeController.CursorTime = cursorTime; RegulatedMouseInfo info = _mouse.MouseMove(e); decimal timeDelta = getTimeSpanFromDelta(_mouse.MoveDelta.X); switch (info.Button) { case RegulatedMouseButton.Left: timeController.CursorTime = cursorTime; timeController.SelectRange(Math.Min(cursorTime, _selectingTime), Math.Max(cursorTime, _selectingTime)); break; case RegulatedMouseButton.CtrlLeft: timeController.CurrentTime = cursorTime; timeController.SelectRange(Math.Min(cursorTime, _selectingTime), Math.Max(cursorTime, _selectingTime)); break; case RegulatedMouseButton.AltLeft: decimal timeOffset = timeDelta; if (!this.IsGlobalTimeLineMode) { timeOffset = -timeOffset; } timeController.SetVisibleTime(timeController.VisibleBeginTime + timeOffset, timeController.VisibleEndTime + timeOffset); break; case RegulatedMouseButton.ShiftLeft: timeController.AdjustSelectedRange(cursorTime); break; case RegulatedMouseButton.ShiftCtrlLeft: timeController.CurrentTime = cursorTime; timeController.AdjustSelectedRange(cursorTime); break; } }