コード例 #1
0
        private void Scheduler_DataBound(object sender, EventArgs e)
        {
            ASPxSchedulerListEditor listEditor = (ASPxSchedulerListEditor)this.View.Editor;
            ASPxScheduler           scheduler  = listEditor.SchedulerControl;

            if (this._schedulerViewType != SchedulerViewType.Agenda)
            {
                List <object> value = IEventControllerResourceManager.Resources.Value;

                if (value.Count == 0 && scheduler.Storage.Resources.Items.Count >= 1)
                {
                    WorkflowResource workflowResource = this.CurrentObjectSpace.GetObjects <WorkflowResource>(CriteriaOperator.Parse("ObjectOid == ?", SecuritySystem.CurrentUserId.ToString())).FirstOrDefault();

                    for (int i = 0; i < scheduler.Storage.Resources.Items.Count; i++)
                    {
                        DevExpress.XtraScheduler.Resource res = scheduler.Storage.Resources.Items[i];

                        if (res.Caption.Contains(workflowResource.Description))
                        {
                            value.Add(res.Id);
                            break;
                        }
                    }
                }

                scheduler.SetVisibleResources(value);
            }
        }
コード例 #2
0
        private void Scheduler_ActiveViewChanging(object sender, ActiveViewChangingEventArgs e)
        {
            ASPxSchedulerListEditor listEditor = (ASPxSchedulerListEditor)this.View.Editor;
            ASPxScheduler           scheduler  = listEditor.SchedulerControl;

            this._schedulerViewType = e.NewView.Type;
            scheduler.DataBind();
        }
コード例 #3
0
 protected override void OnDeactivated()
 {
     base.OnDeactivated();
     if (_listEditor?.SchedulerControl != null)
     {
         _listEditor.SchedulerControl.InitNewAppointment -= SchedulerControlOnInitNewAppointment;
         _listEditor = null;
     }
 }
コード例 #4
0
 protected override void OnViewControlsCreated()
 {
     base.OnViewControlsCreated();
     _listEditor = View.Editor as ASPxSchedulerListEditor;
     if (_listEditor != null)
     {
         _listEditor.SchedulerControl.InitNewAppointment += SchedulerControlOnInitNewAppointment;
     }
 }
コード例 #5
0
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            ASPxSchedulerListEditor listEditor = View.Editor as ASPxSchedulerListEditor;

            if (listEditor != null)
            {
                ASPxScheduler scheduler = listEditor.SchedulerControl;
                scheduler.Views.DayView.VisibleTime =
                    new TimeOfDayInterval(new TimeSpan(6, 0, 0), new TimeSpan(11, 0, 0));
            }
        }
コード例 #6
0
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            // Access and customize the target View control.
            ASPxSchedulerListEditor listEditor = View.Editor as ASPxSchedulerListEditor;

            if (listEditor != null)
            {
                ASPxScheduler scheduler = listEditor.SchedulerControl;
                scheduler.Views.DayView.VisibleTime =
                    new TimeOfDayInterval(new TimeSpan(8, 0, 0), new TimeSpan(17, 0, 0));
            }
        }
コード例 #7
0
        protected override void OnDeactivated()
        {
            ASPxSchedulerListEditor editor = View.Editor as ASPxSchedulerListEditor;

            if (editor != null)
            {
                ASPxScheduler scheduler = ((ASPxSchedulerListEditor)editor).SchedulerControl;
                if (scheduler != null)
                {
                    scheduler.Load -= scheduler_Load;
                }
                base.OnDeactivated();
            }
        }
コード例 #8
0
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            ASPxSchedulerListEditor editor = View.Editor as ASPxSchedulerListEditor;

            if (editor != null)
            {
                ASPxScheduler scheduler = ((ASPxSchedulerListEditor)editor).SchedulerControl;
                if (scheduler != null)
                {
                    scheduler.Load += scheduler_Load;
                }
            }
        }
コード例 #9
0
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            if (((IModelListViewEventCreation)View.Model).CreateEventOnDoubleClick)
            {
                ASPxSchedulerListEditor editor = View.Editor as ASPxSchedulerListEditor;
                if (editor != null)
                {
                    XafCallbackManager.RegisterHandler("ASPxSchedulerEventCreationController", this);
                    editor.SchedulerControl.ClientSideEvents.Init = @"function(s,e) {
s.GetMainElement().ondblclick = function() { " + XafCallbackManager.GetScript("ASPxSchedulerEventCreationController", "") +
                                                                    @" }
}";
                }
            }
        }
コード例 #10
0
 protected override void OnViewControlsCreated()
 {
     base.OnViewControlsCreated();
     listEditor = View.Editor as ASPxSchedulerListEditor;
     if (listEditor != null)
     {
         ASPxScheduler scheduler = (ASPxScheduler)listEditor.SchedulerControl;
         scheduler.InitAppointmentDisplayText -= scheduler_InitAppointmentDisplayText;
         scheduler.InitAppointmentDisplayText += scheduler_InitAppointmentDisplayText;
         scheduler.OptionsCustomization.AllowAppointmentDrag   = UsedAppointmentType.None;
         scheduler.OptionsCustomization.AllowAppointmentResize = UsedAppointmentType.None;
     }
     // Access and customize the target View control.
     //editor = ((ListView)View).Editor as ASPxSchedulerListEditor;
     //if (editor != null)
     //{
     //    editor.SchedulerControl.AppointmentViewInfoCustomizing += new DevExpress.Web.ASPxScheduler.AppointmentViewInfoCustomizingEventHandler(SchedulerControl_AppointmentViewInfoCustomizing);
     //}
 }
コード例 #11
0
        private void View_ControlsCreated(object sender, EventArgs e)
        {
            if (this.View != null)
            {
                ASPxSchedulerListEditor listEditor = (ASPxSchedulerListEditor)this.View.Editor;
                ASPxScheduler           scheduler  = listEditor.SchedulerControl;

                #region Default Scheduler options
                ((ASPxDateNavigator)listEditor.DateNavigator).Visible = false;
                scheduler.ActiveViewType = SchedulerControllerResourceManager.ActiveViewType.Value;

                scheduler.EnableCallbackAnimation = true;
                scheduler.OptionsBehavior.ShowDetailedErrorInfo      = true;
                scheduler.OptionsBehavior.ShowFloatingActionButton   = true;
                scheduler.OptionsBehavior.ShowViewNavigator          = true;
                scheduler.OptionsBehavior.ShowViewVisibleInterval    = true;
                scheduler.OptionsToolTips.ShowAppointmentDragToolTip = true;
                scheduler.OptionsToolTips.ShowSelectionToolTip       = true;
                scheduler.OptionsAdaptivity.Enabled = true;
                scheduler.OptionsForms.AppointmentFormVisibility             = SchedulerFormVisibility.PopupWindow;
                scheduler.OptionsCustomization.AllowDisplayAppointmentFlyout = true;
                scheduler.OptionsCustomization.AllowAppointmentEdit          = UsedAppointmentType.All;
                scheduler.OptionsCustomization.AllowAppointmentDrag          = UsedAppointmentType.All;
                scheduler.OptionsCustomization.AllowAppointmentResize        = UsedAppointmentType.All;
                scheduler.OptionsBehavior.ShowRemindersForm          = true;
                scheduler.OptionsToolTips.AppointmentToolTipMode     = AppointmentToolTipMode.Auto;
                scheduler.OptionsBehavior.RemindersFormDefaultAction = DevExpress.XtraScheduler.RemindersFormDefaultAction.SnoozeAll;
                scheduler.InitAppointmentDisplayText          += Scheduler_InitAppointmentDisplayText;
                scheduler.OptionsCookies.Enabled               = true;
                scheduler.Storage.Appointments.ResourceSharing = true;
                scheduler.ResourceNavigator.Mode               = ResourceNavigatorMode.Tokens;
                scheduler.ResourceNavigator.SettingsTokens.ShowResourceColor = true;
                scheduler.ResourceNavigator.SettingsTokens.ShowExpandButton  = true;
                scheduler.GroupType = DevExpress.XtraScheduler.SchedulerGroupType.Resource;
                scheduler.ResourceNavigator.Visibility = ResourceNavigatorVisibility.Always;
                scheduler.Start                = MyWorkbench.BaseObjects.Constants.Constants.DateTimeTimeZone(this.Session).AddDays(-7);
                scheduler.Unload              += Scheduler_Unload;
                scheduler.DataBound           += Scheduler_DataBound;
                scheduler.PopupMenuShowing    += Scheduler_PopupMenuShowing;
                scheduler.AppointmentsChanged += Scheduler_AppointmentsChanged;
                scheduler.ActiveViewChanging  += Scheduler_ActiveViewChanging;

                if (scheduler != null)
                {
                    scheduler.Storage.Appointments.Statuses.Clear();
                    foreach (Priority priority in Enum.GetValues(typeof(Priority)))
                    {
                        scheduler.Storage.Appointments.Statuses.Add(System.Drawing.ColorTranslator.FromHtml(Attributes.GetAttribute <Color>(priority).ToString()), priority.ToString());
                    }

                    scheduler.Storage.Appointments.Labels.Clear();
                    foreach (Status status in this.View.ObjectSpace.GetObjects <Status>(null))
                    {
                        scheduler.Storage.Appointments.Labels.Add(status.UniqueID, status.Description, status.Description, status.Color);
                    }
                }
                #endregion

                #region Agenda View Options
                scheduler.AgendaView.AllowFixedDayHeaders = true;
                scheduler.AgendaView.DayCount             = 70;
                scheduler.AgendaView.DayHeaderOrientation = AgendaDayHeaderOrientation.Vertical;
                scheduler.AgendaView.AppointmentDisplayOptions.ShowLabel         = true;
                scheduler.AgendaView.AppointmentDisplayOptions.ShowResource      = true;
                scheduler.AgendaView.AppointmentDisplayOptions.ShowTime          = true;
                scheduler.AgendaView.AppointmentDisplayOptions.StatusDisplayType = AppointmentStatusDisplayType.Bounds;
                scheduler.AgendaView.Styles.ScrollAreaHeight = 600;
                scheduler.AgendaView.GroupType = SchedulerGroupType.Resource;
                #endregion

                #region Agenda View Options
                scheduler.TimelineView.IntervalCount           = 70;
                scheduler.TimelineView.DisplayedIntervalCount  = 5;
                scheduler.TimelineView.Styles.ScrollAreaHeight = 600;
                scheduler.TimelineView.GroupType = SchedulerGroupType.Resource;
                #endregion
            }
        }