protected virtual void UpdateControlCore()
        {
            MakeControlsReadOnly(false);

            tbSubject.Text              = Controller.Subject;
            tbLocation.Text             = Controller.Location;
            tbDescription.Text          = Controller.Description;
            barEditShowTimeAs.EditValue = Controller.GetStatus();

            edtResource.ResourceId = Controller.ResourceId;

            AppointmentResourceIdCollection resourceIds = edtResources.ResourceIds;

            resourceIds.BeginUpdate();
            try
            {
                resourceIds.Clear();
                resourceIds.AddRange(Controller.ResourceIds);
            }
            finally
            {
                resourceIds.EndUpdate();
            }

            barEditLabelAs.EditValue = Controller.GetLabel();
            bool remindersEnabled = Control.RemindersEnabled;

            chkReminder.Enabled = remindersEnabled;
            chkReminder.Visible = remindersEnabled;
            chkReminder.Checked = Controller.HasReminder;
            UpdateReminderCombo();
            UpdateIntervalControlsCore();
            UpdateCustomFieldsControls();
            RaiseNotifyChangeCaption();

            bool resourceSharing = Controller.ResourceSharing;

            edtResource.Visible  = !resourceSharing;
            edtResources.Visible = resourceSharing;
            if (resourceSharing)
            {
                layoutResources.Visibility = LayoutVisibility.Always;
                layoutResource.Visibility  = LayoutVisibility.OnlyInCustomization;
            }
            else
            {
                layoutResources.Visibility = LayoutVisibility.OnlyInCustomization;
                layoutResource.Visibility  = LayoutVisibility.Always;
            }
            bool canEditResource = Controller.CanEditResource;

            edtResource.Enabled  = canEditResource;
            edtResources.Enabled = canEditResource;
            if (ReadOnly)
            {
                MakeControlsReadOnly(ReadOnly);
            }
        }
        protected internal virtual void edtResources_EditValueChanged(object sender, EventArgs e)
        {
            AppointmentResourceIdCollection resourceIds = Controller.ResourceIds;

            resourceIds.BeginUpdate();
            try
            {
                resourceIds.Clear();
                resourceIds.AddRange(edtResources.ResourceIds);
            }
            finally
            {
                resourceIds.EndUpdate();
            }
        }
コード例 #3
0
        void UpdateForm()
        {
            SuspendUpdate();
            try {
                txSubject.Text             = controller.Subject;
                edStatus.AppointmentStatus = Appointments.Statuses.GetById(controller.StatusKey);
                edLabel.AppointmentLabel   = Appointments.Labels.GetById(controller.LabelKey);

                dtStart.DateTime = controller.Start.Date;
                dtEnd.DateTime   = controller.End.Date;

                timeStart.Time      = DateTime.MinValue.AddTicks(controller.Start.TimeOfDay.Ticks);
                timeEnd.Time        = DateTime.MinValue.AddTicks(controller.End.TimeOfDay.Ticks);
                checkAllDay.Checked = controller.AllDay;

                edStatus.Storage = control.DataStorage;
                edLabel.Storage  = control.DataStorage;
                appointmentResourcesEdit1.SchedulerControl = control;

                AppointmentResourceIdCollection resourceIds = appointmentResourcesEdit1.ResourceIds;
                resourceIds.BeginUpdate();
                try {
                    resourceIds.Clear();
                    resourceIds.AddRange(controller.ResourceIds);
                }
                finally {
                    resourceIds.EndUpdate();
                }
                bool canEditResource = controller.CanEditResource;
                appointmentResourcesEdit1.Enabled = canEditResource;
                lblResource.Enabled = canEditResource;

                calcPrice.Value = controller.CustomPrice;
            }
            finally {
                ResumeUpdate();
            }
            UpdateIntervalControls();
        }