Inheritance: FragmentControlProvider
Example #1
0
        private void AddChildren()
        {
            MonthCalendarListItemProvider item;
            SelectionRange range = calendar.GetDisplayRange(false);

            for (DateTime d = range.Start;
                 d <= range.End; d = d.AddDays(1))
            {
                int days = (d - range.Start).Days;
                int r    = (int)System.Math.Floor((double)days
                                                  / (double)MonthCalendarProvider.DaysInWeek);
                int c = days - (r * MonthCalendarProvider.DaysInWeek);

                item = new MonthCalendarListItemProvider(
                    this, calendarProvider, Control, d, r, c);
                item.Initialize();

                AddChildProvider(item);
                gridChildren.Add(d, item);
            }

            backButton = new MonthCalendarButtonProvider(
                this, MonthCalendarButtonProvider.ButtonDirection.Back);
            backButton.Initialize();
            AddChildProvider(backButton);

            forwardButton = new MonthCalendarButtonProvider(
                this, MonthCalendarButtonProvider.ButtonDirection.Forward);
            forwardButton.Initialize();
            AddChildProvider(forwardButton);
        }
		private void AddChildren ()
		{
			MonthCalendarListItemProvider item;
			SelectionRange range = calendar.GetDisplayRange (false);

			for (DateTime d = range.Start;
			     d <= range.End; d = d.AddDays (1)) {
				int days = (d - range.Start).Days;
				int r = (int)System.Math.Floor ((double)days
					/ (double)MonthCalendarProvider.DaysInWeek);
				int c = days - (r * MonthCalendarProvider.DaysInWeek);

				item = new MonthCalendarListItemProvider (
					this, calendarProvider, Control, d, r, c);
				item.Initialize ();

				AddChildProvider (item);
				gridChildren.Add (d, item);
			}

			backButton = new MonthCalendarButtonProvider (
				this, MonthCalendarButtonProvider.ButtonDirection.Back);
			backButton.Initialize ();
			AddChildProvider (backButton);

			forwardButton = new MonthCalendarButtonProvider (
				this, MonthCalendarButtonProvider.ButtonDirection.Forward);
			forwardButton.Initialize ();
			AddChildProvider (forwardButton);
		}