示例#1
0
		private void calendar1_LoadItems_1(object sender, CalendarLoadEventArgs e)
		{
			if (_data.ScheduledItems.Count > 0) {
				PlaceItems();
			}

			SetScrollValues();
		}
示例#2
0
        // loads events to calendar-view.
        private void Calendar_LoadItems(object sender, CalendarLoadEventArgs e)
        {
            foreach (Event @event in this._events) // loop through events.
            {
                CalendarItem c = new CalendarItem(this.Calendar, @event.Time.LocalTime, @event.Time.LocalTime.AddHours(1), @event.FullTitle); // create a calendar item.

                if (Calendar.ViewIntersects(c)) // if the event intersects view calendars current view range (start day-end day).
                {
                    c.Tag = @event; // store event on the tag.
                    c.ToolTipText = @event.FullTitle; // item tooltip.
                    Calendar.Items.Add(c); // add it to calendar.
                }

                // we don't need to add this event to calendar as the calendar view does not interesect event date & time.
                // (The calendar will explicitly re-ask us the events list when it's view range changes).
                else c = null;
            }
        }
示例#3
0
 protected virtual void OnLoadItems(CalendarLoadEventArgs e)
 {
     if (LoadItems != null)
     {
         LoadItems(this, e);
     }
 }
示例#4
0
 private void calendar1_LoadItems(object sender, System.Windows.Forms.Calendar.CalendarLoadEventArgs e)
 {
     PlaceItems();
 }
示例#5
0
 private void calendar1_LoadItems(object sender, CalendarLoadEventArgs e)
 {
     PlaceItems();
 }
示例#6
0
        private void calendar1_LoadItems(object sender, CalendarLoadEventArgs e)
        {
            var bk = vc.BookingsToCalendar();

            List<ItemInfo> lst = new List<ItemInfo>();

            foreach (Booking item in bk)
            {

                lst.Add(new ItemInfo(item.StartTime, item.EndTime, item.Firstname, item.Surname, item.Types));

            }

            foreach (ItemInfo item in lst)
            {

                CalendarItem cal = new CalendarItem(calendar1, item.StartTime, item.EndTime, item.FirstName);

                _items.Add(cal);

            }

            PlaceItems();
        }