Beispiel #1
0
        protected override void Initialize()
        {
            base.Initialize();
            _jobSchedulerModule = new JobSchedulerModule();
            Isolate.Swap.AllInstances <JobSchedulerModule>().With(_jobSchedulerModule);
            var        properties = SchedulerConfig.GetProperties();
            IScheduler scheduler  = new XpandSchedulerFactory(properties, Application).GetScheduler();

            Isolate.WhenCalled(() => _jobSchedulerModule.Scheduler).WillReturn(scheduler);
            Scheduler = scheduler;
            XafTypesInfo.Instance.FindTypeInfo(typeof(DummyJobListener));
        }
Beispiel #2
0
        void ApplicationOnSetupComplete(object sender, EventArgs eventArgs)
        {
            Application.SetupComplete -= ApplicationOnSetupComplete;
            if (!Enabled())
            {
                return;
            }
            var stdSchedulerFactory = new XpandSchedulerFactory(Application);

            stdSchedulerFactory.Initialize();
            _scheduler = stdSchedulerFactory.GetScheduler();
        }
Beispiel #3
0
        void ApplicationOnSetupComplete(object sender, EventArgs eventArgs)
        {
            Application.SetupComplete -= ApplicationOnSetupComplete;
            if (!Enabled())
            {
                return;
            }
            var stdSchedulerFactory = new XpandSchedulerFactory(Application);

            stdSchedulerFactory.Initialize();
            Retry.Do(() => {
                _scheduler = stdSchedulerFactory.GetScheduler();
            }, TimeSpan.FromSeconds(10));
        }
Beispiel #4
0
        void ApplicationOnLoggedOn(object sender, LogonEventArgs logonEventArgs)
        {
            ISchedulerFactory stdSchedulerFactory = new XpandSchedulerFactory(Application);

            try {
                IScheduler scheduler = stdSchedulerFactory.AllSchedulers.SingleOrDefault();
                _scheduler = scheduler ?? stdSchedulerFactory.GetScheduler();
            } catch (Exception e) {
                if (!Debugger.IsAttached)
                {
                    Tracing.Tracer.LogError(e);
                }
            }
        }