public WeekControl(DayControl[] days)
        {
            InitializeComponent();
            Dock    = DockStyle.Top;
            Resize += OnResize;

            if (days.Length > 0)
            {
                _dayControls.AddRange(days);
                Controls.AddRange(days);
                _maxWeekDayIndex = _dayControls.Max(x => x.Day.WeekDayIndex);
                if (_maxWeekDayIndex < 7)
                {
                    _footer = new WeekEmptySpaceControl();
                    Controls.Add(_footer);
                }

                _minWeekDayIndex = _dayControls.Min(x => x.Day.WeekDayIndex);
                if (_maxWeekDayIndex > 1)
                {
                    _header = new WeekEmptySpaceControl();
                    Controls.Add(_header);
                }
                FitControls();
            }
        }
Example #2
0
		public WeekControl(DayControl[] days)
		{
			InitializeComponent();
			Dock = DockStyle.Top;
			Resize += OnResize;

			if (days.Length > 0)
			{
				_dayControls.AddRange(days);
				Controls.AddRange(days);
				_maxWeekDayIndex = _dayControls.Max(x => x.Day.WeekDayIndex);
				if (_maxWeekDayIndex < 7)
				{
					_footer = new WeekEmptySpaceControl();
					Controls.Add(_footer);
				}

				_minWeekDayIndex = _dayControls.Min(x => x.Day.WeekDayIndex);
				if (_maxWeekDayIndex > 1)
				{
					_header = new WeekEmptySpaceControl();
					Controls.Add(_header);
				}
				FitControls();
			}
		}
        public void Release()
        {
            Controls.Clear();

            _notes.ForEach(control => control.Release());
            _notes.Clear();

            _dayControls.ForEach(control => control.Release());
            _dayControls.Clear();

            _footer = null;
            _header = null;
        }
Example #4
0
		public void Release()
		{
			Controls.Clear();

			_notes.ForEach(control => control.Release());
			_notes.Clear();

			_dayControls.ForEach(control => control.Release());
			_dayControls.Clear();

			_footer = null;
			_header = null;
		}