public FormDayProperties(CalendarDay day)
		{
			InitializeComponent();
			_day = day;
			Text = _day.Date.ToString("dddd, MMMM dd, yyyy");
			LoadData();
		}
Example #2
0
		public FormCloneDay(CalendarDay day, DateTime flightDateStart, DateTime flightDateEnd)
		{
			InitializeComponent();
			_day = day;
			_flightDateStart = flightDateStart;
			_flightDateEnd = flightDateEnd;
			labelControlFlightDates.Text = string.Format(labelControlFlightDates.Text, string.Format("{0} - {1}", new object[] { _flightDateStart.ToString("M/d/yy"), _flightDateEnd.ToString("M/d/yy") }));
			laOriginalDate.Text = _day.Date.ToString(@"dddd, MM/dd/yy");
			checkEditHighlightWeekdays.Text = string.Format(checkEditHighlightWeekdays.Text, _day.Date.ToString("dddd"));
			buttonXAddAllWeekdays.Text = string.Format(buttonXAddAllWeekdays.Text, _day.Date.ToString("dddd"));
			monthCalendarClone.ActiveMonth.Month = _day.Date.Month;
			monthCalendarClone.ActiveMonth.Year = _day.Date.Year;
			monthCalendarClone.Header.TextColor = Color.Black;
			if (_day.IsMondatBased)
				monthCalendarClone.FirstDayOfWeek = 2;

			UpdateTotals();

			if ((base.CreateGraphics()).DpiX > 96)
			{
				laOriginalDate.Font = new Font(laOriginalDate.Font.FontFamily, laOriginalDate.Font.Size - 4, laOriginalDate.Font.Style);
				labelControlDayTitle.Font = new Font(labelControlDayTitle.Font.FontFamily, labelControlDayTitle.Font.Size - 2, labelControlDayTitle.Font.Style);
				labelControlFlightDates.Font = new Font(labelControlFlightDates.Font.FontFamily, labelControlFlightDates.Font.Size - 2, labelControlFlightDates.Font.Style);
				labelControlClonedNumber.Font = new Font(labelControlClonedNumber.Font.FontFamily, labelControlClonedNumber.Font.Size - 2, labelControlClonedNumber.Font.Style);
				checkEditHighlightWeekdays.Font = new Font(checkEditHighlightWeekdays.Font.FontFamily, checkEditHighlightWeekdays.Font.Size - 2, checkEditHighlightWeekdays.Font.Style);
				buttonXCancel.Font = new Font(buttonXCancel.Font.FontFamily, buttonXCancel.Font.Size - 2, buttonXCancel.Font.Style);
				buttonXAddAllWeekdays.Font = new Font(buttonXAddAllWeekdays.Font.FontFamily, buttonXAddAllWeekdays.Font.Size - 2, buttonXAddAllWeekdays.Font.Style);
				buttonXClearAll.Font = new Font(buttonXClearAll.Font.FontFamily, buttonXClearAll.Font.Size - 2, buttonXClearAll.Font.Style);
				buttonXOK.Font = new Font(buttonXOK.Font.FontFamily, buttonXOK.Font.Size - 2, buttonXOK.Font.Style);
			}
		}
		public void SelectDay(CalendarDay day, Keys modifierKeys)
		{
			var ctrlSelect = (modifierKeys & Keys.Control) == Keys.Control;
			var shiftSelect = (modifierKeys & Keys.Shift) == Keys.Shift;
			if (!(ctrlSelect | shiftSelect))
				ClearSelection();
			if (shiftSelect)
			{
				var prevSelectedDay = SelectedDays.LastOrDefault();
				if (prevSelectedDay != null)
				{
					var minDate = prevSelectedDay.Date > day.Date ? day.Date : prevSelectedDay.Date;
					var maxDate = prevSelectedDay.Date < day.Date ? day.Date : prevSelectedDay.Date;
					foreach (var dayToSelect in ParentView.Calendar.CalendarContent.Days.Where(x => (x.Date >= minDate && x.Date < maxDate) && !SelectedDays.Contains(x)))
					{
						ParentView.SelectDay(dayToSelect, true);
						SelectedDays.Add(dayToSelect);
					}
				}
			}
			if (!SelectedDays.Contains(day))
			{
				ParentView.SelectDay(day, true);
				SelectedDays.Add(day);
			}
		}
Example #4
0
		public DayControl(CalendarDay day)
		{
			InitializeComponent();
			Day = day;
			laSmallDayCaption.Text = Day.Date.Day.ToString();
			RefreshData(_colorSchema);

			memoEditSimpleComment.EnableSelectAll();
			toolStripMenuItemAddNote.Visible = toolStripMenuItemPasteNote.Visible = toolStripSeparator1.Visible = Day.Parent.AllowCustomNotes;
		}
		public void PasteDay(CalendarDay[] destination)
		{
			if (SourceDay == null || destination == null) return;
			foreach (var day in destination)
			{
				day.Comment = SourceDay.Comment;
				day.Logo = SourceDay.Logo.Clone<ImageSource, ImageSource>();
			}
			DayPasted?.Invoke(null, null);
		}
		public void CloneDay(CalendarDay source, IEnumerable<CalendarDay> destination)
		{
			if (source == null || destination == null) return;
			foreach (var day in destination)
			{
				day.Comment = source.Comment;
				day.Logo = source.Logo.Clone<ImageSource, ImageSource>();
			}
			DayPasted?.Invoke(null, null);
		}
		public void PasteImage(CalendarDay[] destination, ImageSource imageSource)
		{
			if (destination == null || imageSource == null) return;
			foreach (var day in destination)
				day.Logo = imageSource.Clone<ImageSource, ImageSource>();
			DayPasted?.Invoke(null, null);
		}
		public void CopyDay(CalendarDay source)
		{
			SourceDay = source;
			if (SourceDay == null) return;
			DayCopied?.Invoke(null, null);
		}
		public void SelectDay(CalendarDay day, bool selected)
		{
			var dayControl = _days.FirstOrDefault(x => x.Day.Date.Equals(day.Date));
			if (dayControl != null)
				dayControl.ChangeSelection(selected);
		}