public DayViewModule(EmployeeCalendarViewModel viewModel, SchedulerDataStorage storage)
 {
     Initializer.Init();
     InitializeComponent();
     BindingContext           = viewModel;
     this.dayView.DataStorage = storage;
 }
Esempio n. 2
0
        public void UpdateNotifications(SchedulerDataStorage storage)
        {
            IList <TriggeredReminder> futureReminders =
                storage.GetNextReminders(MaxNotificationsCount);

            notificationCenter.UpdateNotifications(futureReminders, MaxNotificationsCount);
        }
Esempio n. 3
0
        void FillResources(SchedulerDataStorage storage, int count)
        {
            int cnt = Math.Min(count, Users.Length);

            for (int i = 1; i <= cnt; i++)
            {
                storage.Resources.Items.Add(storage.CreateResource(Guid.NewGuid(), Users[i - 1]));
            }
        }
Esempio n. 4
0
        // Fill the controls with appointment data.
        public void FillForm(SchedulerControl control, Appointment appointment)
        {
            this.appointment = appointment;
            SchedulerDataStorage storage = control.DataStorage as SchedulerDataStorage;

            this.appointmentLabelEdit1.Storage          = storage;
            this.appointmentLabelEdit1.AppointmentLabel = storage.Appointments.Labels.GetById(appointment.LabelKey);
            this.edtSubject.Text     = appointment.Subject;
            this.edtDescription.Text = appointment.Description;
        }
Esempio n. 5
0
        public static void FillResources(SchedulerDataStorage storage, int count)
        {
            ResourceCollection resources = storage.Resources.Items;
            int cnt = Math.Min(count, Users.Length);

            for (int i = 1; i <= cnt; i++)
            {
                resources.Add(storage.CreateResource(i, Users[i - 1]));
            }
        }
Esempio n. 6
0
        void FillResources(SchedulerDataStorage storage, int count)
        {
            int cnt = Math.Min(count, Users.Length);

            for (int i = 1; i <= cnt; i++)
            {
                var resource = storage.CreateResource(i);
                resource.Caption = Users[i - 1];
                storage.Resources.Add(resource);
            }
        }
Esempio n. 7
0
        protected override void OnShown(EventArgs e)
        {
            // Correct the text editor selection, which may result in overwriting the first typed character.
            SchedulerDataStorage storage = control.DataStorage as SchedulerDataStorage;

            if (storage.Appointments.IsNewAppointment(appointment))
            {
                edtSubject.SelectionLength = 0;
                edtSubject.SelectionStart  = edtSubject.Text.Length;
            }
            base.OnShown(e);
        }
Esempio n. 8
0
        public ResourceForm(Resource resource, SchedulerDataStorage schedulerStorage)
        {
            if (resource == null)
            {
                throw new ArgumentNullException("resource");
            }

            this.Disposed += new EventHandler(ResourceForm_Disposed);

            this.editedResourceCopy = schedulerStorage.CreateResource(null);
            this.sourceResource     = resource;
            InitializeComponent();

            UpdateEditedResourceCopy();
            UpdateForm();
        }
Esempio n. 9
0
        public static void scheduler_CustomDrawNavigationButton(object sender, DevExpress.XtraScheduler.CustomDrawObjectEventArgs e)
        {
            NavigationButtonNext navButton = e.ObjectInfo as NavigationButtonNext;
            SchedulerControl     scheduler = sender as SchedulerControl;
            SchedulerDataStorage storage   = scheduler.DataStorage as SchedulerDataStorage;

            // Do not count by resources.
            if (scheduler.GroupType != SchedulerGroupType.None)
            {
                return;
            }

            if (navButton != null && scheduler != null && storage != null)
            {
                // Count appointments within the interval used by the Next navigation button.
                AppointmentBaseCollection apts = scheduler.DataStorage.Appointments.Items;
                TimeSpan aptSearchInterval     = scheduler.OptionsView.NavigationButtons.AppointmentSearchInterval;
                DateTime lastVisibleTime       = scheduler.ActiveView.GetVisibleIntervals().Last().End;
                int      aptCount = apts.Where(a => (a.Start > lastVisibleTime) && (a.Start < lastVisibleTime.Add(aptSearchInterval))).Count();
                navButton.DisplayTextItem.Text = String.Format("Next {0} appointments", aptCount);
            }
        }
Esempio n. 10
0
 public RecurrencePatternParser(SchedulerDataStorage storage)
 {
     this.storage = storage;
     this.rule    = null;
 }