Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
        public static void Invoke(
            Action action,
            int delay
            )
        {
            SingleDelayedInvoke d;

            d = new SingleDelayedInvoke(delay);
            d.Invoke(action);
        }
Beispiel #3
0
        public TimelineBuilder(
            TimelineBand band,
            Canvas canvas,
            DataTemplate template,
            DataTemplate textTemplate,
            int columnCount,
            TimelineCalendar timeline,
            DataTemplate eventTemplate,
            double maxEventHeight,
            bool assignRows,
            DateTime currDateTime
            )
        {
            SingleDelayedInvoke poolBuilder;

            Debug.Assert(template != null);
            Debug.Assert(canvas != null);
            Debug.Assert(eventTemplate != null);
            Debug.Assert(band != null);
            Debug.Assert(columnCount > 0);
            Debug.Assert(timeline != null);
            Debug.Assert(maxEventHeight > 0);

            m_parent         = band;
            m_eventTemplate  = eventTemplate;
            m_canvas         = canvas;
            m_template       = template;;
            m_columnCount    = columnCount;
            m_timeline       = timeline;
            m_assignRows     = assignRows;
            m_markerTemplate = textTemplate;

            m_visibleEvents  = new Dictionary <TimelineEvent, object>();
            m_dispEvents     = new Dictionary <TimelineEvent, TimelineDisplayEvent>();
            m_maxEventHeight = maxEventHeight;

            CurrentDateTime = currDateTime;

            //
            // precreate some elements, so that we can later take them from pool
            //
            poolBuilder = new SingleDelayedInvoke();

            for (int i = 0; i < INITIAL_EVENT_POOL_SIZE; ++i)
            {
                m_elementPool.Push((UIElement)CreateEventElement());
            }

            Utilities.Trace(this);
        }
Beispiel #4
0
        public static void Invoke(
            Action                                      action,
            int                                         delay
        )
        {
            SingleDelayedInvoke                         d;

            d = new SingleDelayedInvoke(delay);
            d.Invoke(action);
        }