예제 #1
0
        void ShowRecurrenceForm()
        {

            if (!control.SupportsRecurrence)
                return;

            // Prepare to edit the appointment's recurrence.
            DevExpress.XtraScheduler.Appointment editedAptCopy = controller.EditedAppointmentCopy;
            DevExpress.XtraScheduler.Appointment editedPattern = controller.EditedPattern;
            DevExpress.XtraScheduler.Appointment patternCopy = controller.PrepareToRecurrenceEdit();

            AppointmentRecurrenceForm dlg = new AppointmentRecurrenceForm(patternCopy,
                control.OptionsView.FirstDayOfWeek, controller);

            // Required for skin support.
            dlg.LookAndFeel.ParentLookAndFeel = this.LookAndFeel.ParentLookAndFeel;

            DialogResult result = dlg.ShowDialog(this);
            dlg.Dispose();

            if (result == DialogResult.Abort)
                controller.RemoveRecurrence();
            else
                if (result == DialogResult.OK)
                {
                    controller.ApplyRecurrence(patternCopy);
                    if (controller.EditedAppointmentCopy != editedAptCopy)
                        UpdateForm();
                }
            UpdateIntervalControls();
        }
예제 #2
0
        void ShowRecurrenceForm()
        {
            try
            {
                if (!control.SupportsRecurrence)
                {
                    return;
                }

                // Prepare to edit appointment's recurrence.
                Appointment editedAptCopy = controller.EditedAppointmentCopy;
                Appointment editedPattern = controller.EditedPattern;
                Appointment patternCopy   = controller.PrepareToRecurrenceEdit();

                AppointmentRecurrenceForm dlg = new AppointmentRecurrenceForm(patternCopy, control.OptionsView.FirstDayOfWeek, controller);

                // Required for skins support.
                dlg.LookAndFeel.ParentLookAndFeel = this.LookAndFeel.ParentLookAndFeel;

                DialogResult result = dlg.ShowDialog(this);
                dlg.Dispose();

                if (result == DialogResult.Abort)
                {
                    controller.RemoveRecurrence();
                }
                else
                if (result == DialogResult.OK)
                {
                    controller.ApplyRecurrence(patternCopy);
                    if (controller.EditedAppointmentCopy != editedAptCopy)
                    {
                        UpdateForm();
                    }
                }
                UpdateIntervalControls();
            }
            catch (Exception ex)
            {
                if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
                {
                    throw ex;
                }
            }
        }
        private void ShowRecurrenceForm()
        {
            if (!_control.SupportsRecurrence)
            {
                return;
            }

            // Prepare to edit appointment's recurrence.
            Appointment editedAptCopy = _controller.EditedAppointmentCopy;
            Appointment editedPattern = _controller.EditedPattern;
            Appointment patternCopy   = _controller.PrepareToRecurrenceEdit();

            AppointmentRecurrenceForm dlg = new AppointmentRecurrenceForm(patternCopy, _control.OptionsView.FirstDayOfWeek, _controller);

            // Required for skins support.
            dlg.LookAndFeel.ParentLookAndFeel = this.LookAndFeel.ParentLookAndFeel;
            dlg.ShowExceptionsRemoveMsgBox    = _controller.AreExceptionsPresent();

            DialogResult result = dlg.ShowDialog(this);

            dlg.Dispose();

            if (result == DialogResult.Abort)
            {
                _controller.RemoveRecurrence();
            }
            else if (result == DialogResult.OK)
            {
                _controller.ApplyRecurrence(patternCopy);
                if (_controller.EditedAppointmentCopy != editedAptCopy)
                {
                    UpdateForm();
                }
            }
            else if (_isAutoOpenRecurrenceForm && result == DialogResult.Cancel)
            {
                _controller.RemoveRecurrence();
                _isAutoOpenRecurrenceForm = false;
            }
            UpdateIntervalControls();
        }
예제 #4
0
        void ShowRecurrenceForm()
        {
            if (!control.SupportsRecurrence)
            {
                return;
            }

            // Prepare to edit the appointment's recurrence.
            DevExpress.XtraScheduler.Appointment editedAptCopy = controller.EditedAppointmentCopy;
            DevExpress.XtraScheduler.Appointment editedPattern = controller.EditedPattern;
            DevExpress.XtraScheduler.Appointment patternCopy   = controller.PrepareToRecurrenceEdit();

            AppointmentRecurrenceForm dlg = new AppointmentRecurrenceForm(patternCopy,
                                                                          control.OptionsView.FirstDayOfWeek, controller);

            // Required for skin support.
            dlg.LookAndFeel.ParentLookAndFeel = this.LookAndFeel.ParentLookAndFeel;

            DialogResult result = dlg.ShowDialog(this);

            dlg.Dispose();

            if (result == DialogResult.Abort)
            {
                controller.RemoveRecurrence();
            }
            else
            if (result == DialogResult.OK)
            {
                controller.ApplyRecurrence(patternCopy);
                if (controller.EditedAppointmentCopy != editedAptCopy)
                {
                    UpdateForm();
                }
            }
            UpdateIntervalControls();
        }
예제 #5
0
        void ShowRecurrenceForm()
        {
            if (!control.SupportsRecurrence)
            {
                return;
            }

            // Prepare to edit appointment's recurrence.
            Appointment editedAptCopy = controller.EditedAppointmentCopy;
            Appointment editedPattern = controller.EditedPattern;
            Appointment patternCopy   = controller.PrepareToRecurrenceEdit();

            AppointmentRecurrenceForm dlg = new AppointmentRecurrenceForm(patternCopy, control.OptionsView.FirstDayOfWeek, controller);

            dlg.Text     = "Schedule Recurrence";
            dlg.ShowIcon = false;
            // Required for skins support.
            dlg.LookAndFeel.ParentLookAndFeel = this.LookAndFeel.ParentLookAndFeel;
            dlg.Controls[5].Text = "Play Time";
            dlg.Controls[4].Controls[5].Visible             = false;
            dlg.Controls[4].Controls[7].Visible             = false;
            dlg.Controls[4].Controls[3].Controls[1].Visible = false;
            //dlg.Controls[4].Height = 120;
            dlg.Controls[4].Controls[6].Location = new Point(16, 40);
            dlg.Controls[4].Controls[4].Location = new Point(16, 78);
            if (editedAptCopy.Description == "Message")
            {
                dlg.Controls[5].Controls[1].Enabled = false;
                //dlg.Controls[5].Controls[3].Enabled = false;
                dlg.Controls[5].Controls[0].Enabled = false;
            }
            DialogResult result = dlg.ShowModalDialog();

            dlg.Dispose();

            if (result == DialogResult.Abort)
            {
                controller.RemoveRecurrence();
                isRecurrence        = false;
                dtStart.Enabled     = true;
                dtEnd.Enabled       = !chkPlayOnce.Checked;
                chkPlayOnce.Enabled = !checkAllDay.Checked;
                timeStart.Enabled   = true;
                timeEnd.Enabled     = !chkPlayOnce.Checked; //apt.Description != LibraryType.Message.ToString();
            }
            else
            if (result == DialogResult.OK)
            {
                controller.ApplyRecurrence(patternCopy);
                isRecurrence        = true;
                chkPlayOnce.Checked = false;
                chkPlayOnce.Enabled = false;
                chkPlayOnce.Enabled = false;
                checkAllDay.Enabled = true;
                if (controller.EditedAppointmentCopy != editedAptCopy)
                {
                    UpdateForm();
                }
            }
            UpdateIntervalControls();
            if (isRecurrence)
            {
                dtStart.Enabled   = false;
                dtEnd.Enabled     = false;
                timeStart.Enabled = false;
                timeEnd.Enabled   = false;
            }
        }