Ejemplo n.º 1
0
		private void AddNote(DateRange noteRange, ITextItem note)
		{
			if (noteRange == null) return;
			Calendar.CalendarContent.AddNote(noteRange, note);
			Calendar.SettingsNotSaved = true;

			var calendarMonth = Calendar.CalendarContent.Months.FirstOrDefault(x => x.DaysRangeBegin <= noteRange.FinishDate.Value.Date && x.DaysRangeEnd >= noteRange.FinishDate.Value.Date);
			if (calendarMonth != null)
				Months[calendarMonth.Date].AddNotes(GetNotesByWeeeks(calendarMonth));
		}
Ejemplo n.º 2
0
		private void AddNote(DateRange noteRange, string noteText = "")
		{
			if (noteRange == null) return;
			Calendar.CalendarContent.AddNote(noteRange, noteText);
			Calendar.SettingsNotSaved = true;

			var calendarMonth = Calendar.CalendarContent.Months.FirstOrDefault(x => x.DaysRangeBegin <= noteRange.FinishDate.Value.Date && x.DaysRangeEnd >= noteRange.FinishDate.Value.Date);
			if (calendarMonth != null)
			{
				var notes = GetNotesByWeeeks(calendarMonth);
				Months[calendarMonth.Date].AddNotes(notes);
				var justAddedNote = notes
					.SelectMany(array => array.Where(note => note.CalendarNote.StartDay == noteRange.StartDate &&
						note.CalendarNote.FinishDay == noteRange.FinishDate))
					.FirstOrDefault();
				if (justAddedNote != null)
					justAddedNote.Focus();
			}
		}