Esempio n. 1
0
        /// <summary>
        /// Insert new events and Bolded Dates into queues.
        /// </summary>
        /// <param name="events">Source of events, that should be inserted.</param>
        /// <param name="from">Local paramater from with which this was started.</param>
        /// <param name="to">Local paramater to with which this was started.</param>
        private void insertEventsAndBoldedDates(IEnumerable <TimeEvent> events, DateTime from, DateTime to)
        {
            foreach (var item in events)
            {
                if (invokeStopPreviewQueing(from, to))
                {
                    return;
                }
                lock (listboxPreviewData)
                {
                    while (listboxPreviewData.Count > 500)
                    {
                        Monitor.Wait(listboxPreviewData, 250);
                        if (invokeStopPreviewQueing(from, to))
                        {
                            return;
                        }
                    }

                    listboxPreviewData.Enqueue(item);
                }

                lock (previewBoldedDates)
                {
                    if (invokeStopPreviewQueing(from, to))
                    {
                        return;
                    }
                    SupportMethods.EnqueInterval(previewBoldedDates, item.StartDate, item.EndDate);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Insert new Events and Bolded Dates into queues.
        /// </summary>
        /// <param name="events">Source of events, that should be inserted.</param>
        /// <param name="sParams">Local paramater with which this was started.</param>
        private void insertEventsAndBoldedDates(IEnumerable <TimeEvent> events, SearchParams sParams)
        {
            foreach (var item in events)
            {
                if (invokeStopSearchQueing(sParams))
                {
                    return;
                }
                lock (listboxSearchData)
                {
                    while (listboxSearchData.Count > 500)
                    {
                        Monitor.Wait(listboxSearchData, 250);
                        if (invokeStopSearchQueing(sParams))
                        {
                            return;
                        }
                    }
                    listboxSearchData.Enqueue(item);
                }

                lock (searchBoldedDates)
                {
                    if (invokeStopSearchQueing(sParams))
                    {
                        return;
                    }
                    SupportMethods.EnqueInterval(searchBoldedDates, item.StartDate, item.EndDate);
                }
            }
        }