public void Initialize( List <TimelineEvent> events, bool sorted = false ) { Debug.Assert(events != null); if (!sorted) { events.Sort(new Comparison <TimelineEvent>((l, r) => DateTime.Compare(l.StartDate, r.StartDate))); } m_list = events; m_hasDuration = false; m_initialized = false; if (m_list.Count > 0) { SingleDelayedInvoke.Invoke(new Action(() => { InitSearch(); m_initialized = true; }), INDEX_CREATION_DELAY); } else { m_byStart = null; m_initialized = false; } }
public static void Invoke( Action action, int delay ) { SingleDelayedInvoke d; d = new SingleDelayedInvoke(delay); d.Invoke(action); }
public void DisplayEvents( bool animate = false ) { if (m_parent.TimelineTray.ImmediateDisplay || m_displayExecTime <= SingleDelayedInvoke.MINIMAL_UI_DELAY) { m_displayExecTime = DisplayEventsImpl(false, false); //m_displayExecTime = DisplayEventsImpl(false, animate); //m_displayExecTime = DisplayEventsImpl(true, animate); } else { m_delayInvoke.Invoke(() => { //DisplayEventsImpl(true, false); //m_delayComplete.Invoke(() => //{ // m_displayExecTime = DisplayEventsImpl(false, false); //}); }); } }