Exemple #1
0
        private void InitializeChildren()
        {
            this.dockLayout = new DockLayoutPanel();
            if (this.Calendar.MultiViewRows == 1 && this.Calendar.MultiViewColumns == 1)
            {
                this.calendarVisualElement = new MonthViewElement(this.calendar, this.calendar.DefaultView);
            }
            else
            {
                this.calendarVisualElement = new MultiMonthViewElement(this.calendar, this.calendar.DefaultView);
            }

            this.calendarStatusElement = new CalendarStatusElement(this);
            this.calendarStatusElement.SetValue(DockLayoutPanel.DockProperty, Dock.Bottom);
            this.calendarStatusElement.SetValue(BoxLayout.StripPositionProperty, BoxLayout.StripPosition.Last);
            if (true == this.Calendar.ShowFooter)
            {
                this.calendarStatusElement.Visibility = ElementVisibility.Visible;
            }

            this.dockLayout.Children.Add(this.calendarStatusElement);
            this.calendarNavigationElement = new CalendarNavigationElement(this);
            this.CalendarNavigationElement.SetValue(DockLayoutPanel.DockProperty, Dock.Top);
            this.calendarNavigationElement.SetValue(BoxLayout.StripPositionProperty, BoxLayout.StripPosition.First);
            this.calendarNavigationElement.Visibility = (this.Calendar.ShowHeader) ? ElementVisibility.Visible : ElementVisibility.Collapsed;
            this.dockLayout.Children.Add(this.calendarNavigationElement);
            this.dockLayout.Children.Add(this.calendarVisualElement);
            this.Children.Add(this.dockLayout);
        }
Exemple #2
0
        public override void Initialize(int rows, int columns)
        {
            this.visualElements = new List <LightVisualElement>(this.view.Children.Count);
            this.visualElements.Clear();

            int currentRow    = 0;
            int currentColumn = 0;

            for (int i = 0; i < this.view.Children.Count; i++)
            {
                CalendarView     monthView        = this.view.Children[i];
                MonthViewElement monthViewElement = new MonthViewElement(this.Calendar, monthView);

                monthView.ShowHeader = true;
                monthViewElement.TitleElement.Visibility = ElementVisibility.Visible;

                monthViewElement.Row    = currentRow;
                monthViewElement.Column = currentColumn;


                currentColumn++;
                if (currentColumn == columns)
                {
                    currentColumn = 0;
                    currentRow++;
                }

                this.visualElements.Add(monthViewElement);
            }
        }
Exemple #3
0
        protected override void DisposeManagedResources()
        {
            this.calendar = null;
            this.view     = null;

            if (this.calendarVisualElement != null)
            {
                this.calendarVisualElement.Dispose();
                this.calendarVisualElement = null;
            }

            if (this.calendarStatusElement != null)
            {
                this.calendarStatusElement.Dispose();
                this.calendarStatusElement = null;
            }

            if (this.calendarNavigationElement != null)
            {
                this.calendarNavigationElement.Dispose();
                this.calendarNavigationElement = null;
            }

            base.DisposeManagedResources();
        }
 protected internal override LightVisualElement GetElement(int row, int column)
 {
     for (int index = 0; index < this.visualElements.Count; ++index)
     {
         MonthViewElement visualElement = this.visualElements[index] as MonthViewElement;
         if (visualElement.Column == column && visualElement.Row == row)
         {
             return((LightVisualElement)visualElement);
         }
     }
     return((LightVisualElement)null);
 }
Exemple #5
0
        protected internal override LightVisualElement GetElement(int row, int column)
        {
            for (int i = 0; i < this.visualElements.Count; i++)
            {
                MonthViewElement element = this.visualElements[i] as MonthViewElement;

                if (element.Column == column &&
                    element.Row == row)
                {
                    return(element);
                }
            }

            return(null);
        }
 private static void ClearMonthSelection(MonthViewElement currentMonth)
 {
     if (currentMonth.Calendar != null)
     {
         currentMonth.Calendar.SelectedDates.Clear();
     }
     for (int index = 0; index < currentMonth.TableElement.Children.Count; ++index)
     {
         CalendarCellElement child = currentMonth.TableElement.Children[index] as CalendarCellElement;
         if (child != null)
         {
             child.isChecked = false;
             child.Selected  = false;
         }
     }
 }
        private static void ClearMonthSelection(MonthViewElement currentMonth)
        {
            if (currentMonth.Calendar != null)
            {
                currentMonth.Calendar.SelectedDates.Clear();
            }

            for (int i = 0; i < currentMonth.TableElement.Children.Count; i++)
            {
                CalendarCellElement cell = currentMonth.TableElement.Children[i] as CalendarCellElement;
                if (cell != null)
                {
                    cell.isChecked = false;
                    cell.Selected  = false;
                }
            }
        }
Exemple #8
0
 protected override void DisposeManagedResources()
 {
     this.calendar = (RadCalendar)null;
     this.view     = (CalendarView)null;
     if (this.calendarVisualElement != null)
     {
         this.calendarVisualElement.Dispose();
         this.calendarVisualElement = (MonthViewElement)null;
     }
     if (this.calendarStatusElement != null)
     {
         this.calendarStatusElement.Dispose();
         this.calendarStatusElement = (CalendarStatusElement)null;
     }
     if (this.calendarNavigationElement != null)
     {
         this.calendarNavigationElement.Dispose();
         this.calendarNavigationElement = (CalendarNavigationElement)null;
     }
     LocalizationProvider <CalendarLocalizationProvider> .CurrentProviderChanged -= new EventHandler(this.CalendarLocalizationProvider_CurrentProviderChanged);
     base.DisposeManagedResources();
 }
Exemple #9
0
        private void InitializeChildren()
        {
            this.dockLayout            = new DockLayoutPanel();
            this.calendarVisualElement = this.Calendar.MultiViewRows != 1 || this.Calendar.MultiViewColumns != 1 ? (MonthViewElement) new MultiMonthViewElement(this.calendar, this.calendar.DefaultView) : new MonthViewElement(this.calendar, this.calendar.DefaultView);
            this.calendarStatusElement = new CalendarStatusElement(this);
            int num1 = (int)this.calendarStatusElement.SetValue(DockLayoutPanel.DockProperty, (object)Dock.Bottom);
            int num2 = (int)this.calendarStatusElement.SetValue(BoxLayout.StripPositionProperty, (object)BoxLayout.StripPosition.Last);

            if (this.Calendar.ShowFooter)
            {
                this.calendarStatusElement.Visibility = ElementVisibility.Visible;
            }
            this.dockLayout.Children.Add((RadElement)this.calendarStatusElement);
            this.calendarNavigationElement = new CalendarNavigationElement(this);
            int num3 = (int)this.CalendarNavigationElement.SetValue(DockLayoutPanel.DockProperty, (object)Dock.Top);
            int num4 = (int)this.calendarNavigationElement.SetValue(BoxLayout.StripPositionProperty, (object)BoxLayout.StripPosition.First);

            this.calendarNavigationElement.Visibility = this.Calendar.ShowHeader ? ElementVisibility.Visible : ElementVisibility.Collapsed;
            this.dockLayout.Children.Add((RadElement)this.calendarNavigationElement);
            this.dockLayout.Children.Add((RadElement)this.calendarVisualElement);
            this.Children.Add((RadElement)this.dockLayout);
            this.LocalizeStrings();
        }
        public override void Initialize(int rows, int columns)
        {
            this.visualElements = new List <LightVisualElement>(this.View.Children.Count);
            this.visualElements.Clear();
            int num1 = 0;
            int num2 = 0;

            for (int index = 0; index < this.View.Children.Count; ++index)
            {
                CalendarView     child            = this.View.Children[index];
                MonthViewElement monthViewElement = new MonthViewElement(this.Calendar, child);
                child.ShowHeader = true;
                monthViewElement.TitleElement.Visibility = ElementVisibility.Visible;
                monthViewElement.Row    = num1;
                monthViewElement.Column = num2;
                ++num2;
                if (num2 == columns)
                {
                    num2 = 0;
                    ++num1;
                }
                this.visualElements.Add((LightVisualElement)monthViewElement);
            }
        }