Ejemplo n.º 1
0
        /// <summary>
        /// Updates the condensed view column list
        /// </summary>
        internal void UpdateCondensedColumnList()
        {
            if (_ModelReloaded == true && Connector != null)
            {
                _CondensedColList = new List<ColumnList>();

                List<CalendarItem> items = new List<CalendarItem>();

                // Get our appointment collection

                GetCondensedAppts(items);
                GetCondensedCustomItems(items);

                // If we have any items, sort them and
                // create a corresponding ColumnList

                if (items.Count > 0)
                {
                    items = SortCalendarItems(items);

                    if (CalendarView.HasTimeLineGetRowCollateIdCallout)
                    {
                        SortedDictionary<int, List<CalendarItem>> ditems = CollateCalendarItems(items);

                        foreach (KeyValuePair<int, List<CalendarItem>> kvp in ditems)
                        {
                            ColumnList colList = new ColumnList();

                            for (int i = 0; i < kvp.Value.Count; i++)
                                colList.AddColumnSlot(kvp.Value[i], 0);

                            colList.CountColumns();

                            _CondensedColList.Add(colList);
                        }
                    }
                    else
                    {
                        _CondensedColList.Add(new ColumnList());

                        for (int i = 0; i < items.Count; i++)
                            _CondensedColList[0].AddColumnSlot(items[i], 0);

                        _CondensedColList[0].CountColumns();
                    }
                }

                _ModelReloaded = false;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates our CalendarItems list
        /// </summary>
        private void UpdateCalendarItems()
        {
            if (NeedRecalcLayout == true)
            {
                _CollateLines.Clear();

                if (_CalendarItems.Count > 0)
                {
                    List<CalendarItem> items = SortCalendarItems(_CalendarItems);

                    if (CalendarView.HasTimeLineGetRowCollateIdCallout)
                    {
                        SortedDictionary<int, List<CalendarItem>> ditems = CollateCalendarItems(items);

                        int dy = 0;

                        foreach (KeyValuePair<int, List<CalendarItem>> kvp in ditems)
                        {
                            ColumnList colList = new ColumnList();

                            for (int i = 0; i < kvp.Value.Count; i++)
                                colList.AddColumnSlot(kvp.Value[i], 0);

                            colList.CountColumns();

                            dy = CalcAppointmentBounds(colList, dy, true);

                            _CollateLines.Add(dy);
                        }
                    }
                    else
                    {
                        ColumnList colList = new ColumnList();

                        for (int i = 0; i < items.Count; i++)
                            colList.AddColumnSlot(items[i], 0);

                        colList.CountColumns();

                        CalcAppointmentBounds(colList, 0, false);
                    }
                }

                NeedRecalcLayout = false;

                InvalidateRect();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Updates our CalendarItems list
        /// </summary>
        private void UpdateCalendarItems()
        {
            ColumnList colList = new ColumnList();

            for (int i = 0; i < _NumberOfColumns; i++)
            {
                if (IsLayoutNeeded(i) == true)
                {
                    if (_DayColumns[i].CalendarItems.Count > 0)
                    {
                        List<CalendarItem> items = SortCalendarItems(i);

                        colList.Clear();

                        for (int j = 0; j < items.Count; j++)
                            colList.AddColumnSlot(items[j], 0);

                        colList.CountColumns();

                        CalcAppointmentBounds(i, colList);
                    }

                    _DayColumns[i].NeedRecalcLayout = false;
                }
            }
        }