private void OnDayViewResolveAppointments(object sender, Calendar.ResolveAppointmentsEventArgs args) { System.Collections.Generic.List <Calendar.Appointment> appts = new System.Collections.Generic.List <Calendar.Appointment>(); foreach (System.Collections.Generic.KeyValuePair <UInt32, CalendarItem> item in m_Items) { if (IsItemWithinRange(item.Value, args.StartDate, args.EndDate)) { // Recalculate colours if (m_taskColorIsBkgnd) { item.Value.TextColor = ((item.Value.TaskTextColor.GetBrightness() > 0.5) ? System.Drawing.Color.Black : System.Drawing.Color.White); item.Value.BorderColor = ColorUtil.DarkerDrawing(item.Value.TaskTextColor, 0.5f); item.Value.BarColor = item.Value.TaskTextColor; item.Value.FillColor = item.Value.TaskTextColor; } else { item.Value.TextColor = item.Value.TaskTextColor; item.Value.BorderColor = item.Value.TaskTextColor; item.Value.FillColor = ColorUtil.LighterDrawing(item.Value.TaskTextColor, 0.9f); item.Value.BarColor = item.Value.TaskTextColor; } appts.Add(item.Value); } } args.Appointments = appts; }
void DayViewMain_ResolveAppointments(object sender, Calendar.ResolveAppointmentsEventArgs args) { var list = new List <Calendar.Appointment>(); foreach (var user in this.myController.ActiveUsersList) { foreach (var item in user.Terminliste.Where(a => a.StartDate >= this.myController.CalendarStartDay && a.EndDate <= this.myController.CalendarStartDay.AddDays(7))) { list.Add(item); } } args.Appointments = list; }
private void OnResolveAppointments(object sender, Calendar.ResolveAppointmentsEventArgs args) { var appts = new System.Collections.Generic.List <Calendar.Appointment>(); foreach (System.Collections.Generic.KeyValuePair <UInt32, CalendarItem> item in m_Items) { if (IsItemWithinRange(item.Value, args.StartDate, args.EndDate)) { appts.Add(item.Value); } } args.Appointments = appts; }
/******************************************************************************************/ /************************Calendar-Related**************************************************/ #region // needed for adding courses to the calendar private void dayView1_ResolveAppointments(object sender, Calendar.ResolveAppointmentsEventArgs args) { List <Calendar.Appointment> m_Apps = new List <Calendar.Appointment>(); foreach (Calendar.Appointment m_App in CandidateSchedule.Create().getCalendarItems()) { if ((m_App.StartDate >= args.StartDate) && (m_App.StartDate <= args.EndDate)) { m_Apps.Add(m_App); } } args.Appointments = m_Apps; }
void dayView_ResolveAppointments(object sender, Calendar.ResolveAppointmentsEventArgs args) { if (this.myTerminliste != null) { List <Calendar.Appointment> list = new List <Calendar.Appointment>(); foreach (var termin in myTerminliste) { foreach (var user in myUsersToShow) { // if (termin.Owner.Equals(user) && termin.StartDate >= args.StartDate && termin.EndDate <= args.EndDate) { list.Add(termin); } } } args.Appointments = (List <Calendar.Appointment>)list; } }
private void dayView1_ResolveAppointments(object sender, Calendar.ResolveAppointmentsEventArgs e) { List <Calendar.Appointment> resolvedAppointments = new List <Calendar.Appointment>(); foreach (Calendar.Appointment appt in _appointments) { if ((!appt.AllDayEvent && (appt.StartDate.Date >= e.StartDate.Date && appt.EndDate.Date <= e.EndDate) || (appt.AllDayEvent && dayView1.DateWithin(e.StartDate, e.EndDate, appt.StartDate, appt.EndDate)))) { if (dayView1.SelectedAppointment != appt) { if (dayView1.ViewType == Calendar.DayView.DayViewType.TeamView) { //if its team view get the column for the person appt.Column = GetPeopleColumn((string)appt.Object); //if person not found, continue... if (!appt.AllDayEvent && appt.Column == -1) { continue; } } else { //if dayview only show appointments for selected person if (!appt.AllDayEvent && (string)appt.Object != (string)lstPeople.CheckedItems[0]) { continue; } } } resolvedAppointments.Add(appt); } } e.Appointments = resolvedAppointments; }
private void OnResolveAppointments(object sender, Calendar.ResolveAppointmentsEventArgs args) { args.Appointments = GetMatchingAppointments(args.StartDate, args.EndDate); }