Use timeband arrows to jump to next/previous timeline event

May 27, 2010 at 7:10 PM

Great timeline control!

Is there a way to make the arrows on the left / right sides of the timeband cause the timeline to scroll to the previous / next timeline event?

Thanks!

Coordinator
May 28, 2010 at 11:35 PM

No, at it is implemented now, no.

 

May 20, 2013 at 9:12 AM
Hello, is it now possible ? I mean
Is there a way to make the arrows on the left / right sides of the timeband cause the timeline to scroll to the previous / next timeline event??

Thanks
Coordinator
May 31, 2013 at 2:25 PM
This is possible, but would require you to change ITimelineToolboxTarget.FindMaxDate (and other methods of ITimelineToolboxTarget interface) methods. Ideally boolean flag could be added to TimelineTray interface to switch between original and this mode. Implementation should be simple by changing CurrentDateTime property.
May 31, 2013 at 2:38 PM
I was able to implement this in TimelineTray.cs. Here is the code for moving to the next event.
    /// <summary>
    /// Moves the current time to the next event, or right one time interval.
    /// </summary>
    void ITimelineToolboxTarget.MoveRight()
    {
      try
      {
        // Move to next event right of current time
        var ct = CurrentDateTime;
        var query = _events.FirstOrDefault(e => e.StartDate > ct);
        if (query != null)
        {
          CurrentDateTime = query.StartDate;
        }
        // If there are no more events, move right one time interval up to the maximum time
        else if (CurrentDateTime + _mainBand.Calculator.ColumnTimeWidth < MaxDateTime)
        {
          CurrentDateTime += _mainBand.Calculator.ColumnTimeWidth;
        }
      }
      catch (ArgumentOutOfRangeException)
      {
        CurrentDateTime = MaxDateTime;
      }
    }
Move Left is similar.