Пример #1
0
        void InitializeAppointments()
        {
            SchedulerBindingList <CustomEvent> eventList = new SchedulerBindingList <CustomEvent>();

            GenerateEvents(eventList);
            this.scheduler.Storage.AppointmentStorage.DataSource = eventList;
        }
        void InitAppointments()
        {
            SchedulerStorage storage = scheduler.Storage;
            SchedulerBindingList <CustomEvent> eventList = new SchedulerBindingList <CustomEvent>();

            GenerateEvents(storage, eventList);
            storage.AppointmentStorage.DataSource = eventList;
        }
        void GenerateEvents(SchedulerStorage storage, SchedulerBindingList <CustomEvent> eventList)
        {
            int count = storage.ResourceStorage.Count;

            for (int i = 0; i < count; i++)
            {
                Resource resource   = (Resource)storage.ResourceStorage[i];
                string   subjPrefix = resource.Caption + "'s ";
                eventList.Add(CreateEvent(eventList, subjPrefix + "meeting", resource.Id, 2, 5));
                eventList.Add(CreateEvent(eventList, subjPrefix + "travel", resource.Id, 3, 6));
                eventList.Add(CreateEvent(eventList, subjPrefix + "phone call", resource.Id, 0, 10));
            }
        }
        CustomEvent CreateEvent(SchedulerBindingList <CustomEvent> eventList, string subject, object resourceId, int status, int label)
        {
            CustomEvent apt = new CustomEvent();

            apt.Subject = subject;
            apt.OwnerId = resourceId;
            Random rnd            = DemoUtils.RandomInstance;
            int    rangeInMinutes = 60 * 24;

            apt.StartTime = DateTime.Today + TimeSpan.FromMinutes(rnd.Next(0, rangeInMinutes));
            apt.EndTime   = apt.StartTime + TimeSpan.FromMinutes(rnd.Next(0, rangeInMinutes / 4));
            apt.Status    = status;
            apt.Label     = label;
            return(apt);
        }
Пример #5
0
        public SynchronizeWithOutlook()
        {
            InitializeComponent();
            FillCalendarNamesCombo();
            SchedulerBindingList <CustomEvent> eventList = new SchedulerBindingList <CustomEvent>();

            scheduler.Storage.AppointmentStorage.DataSource = eventList;

            scheduler.Storage.AppointmentStorage.Mappings.Start          = "StartTime";
            scheduler.Storage.AppointmentStorage.Mappings.End            = "EndTime";
            scheduler.Storage.AppointmentStorage.Mappings.Subject        = "Subject";
            scheduler.Storage.AppointmentStorage.Mappings.AllDay         = "AllDay";
            scheduler.Storage.AppointmentStorage.Mappings.Description    = "Description";
            scheduler.Storage.AppointmentStorage.Mappings.Label          = "Label";
            scheduler.Storage.AppointmentStorage.Mappings.Location       = "Location";
            scheduler.Storage.AppointmentStorage.Mappings.RecurrenceInfo = "RecurrenceInfo";
            scheduler.Storage.AppointmentStorage.Mappings.ReminderInfo   = "ReminderInfo";
            scheduler.Storage.AppointmentStorage.Mappings.ResourceId     = "OwnerId";
            scheduler.Storage.AppointmentStorage.Mappings.Status         = "Status";
            scheduler.Storage.AppointmentStorage.Mappings.Type           = "EventType";
        }