public void Compose(IStashboxContainer container)
        {
            container.RegisterAssemblyContaining <IQuartzConfiguration>();

            // Register Quartz
            var quartz = container.Resolve <IQuartzConfiguration>();

            quartz.Scheduler.JobFactory = new QuartzJobFactory(container);
            quartz.Scheduler.ListenerManager.AddJobListener(container.Resolve <IJobListener>());
        }
        /// <summary>
        /// Adds <see cref="StashboxContainer"/> as the default dependency resolver and the default <see cref="IHubActivator"/>, also registers the available <see cref="IHub"/> and <see cref="PersistentConnection"/> implementations.
        /// </summary>
        /// <param name="container">The container.</param>
        /// <param name="types">The types.</param>
        /// <returns>The container.</returns>
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="container"/> is <c>null</c>.
        /// </exception>
        public static IStashboxContainer AddSignalRWithTypes(this IStashboxContainer container, params Type[] types)
        {
            Shield.EnsureNotNull(container, nameof(container));

            container.RegisterSingleton <Microsoft.AspNet.SignalR.IDependencyResolver, StashboxDependencyResolver>();
            container.RegisterSingleton <IHubActivator, StashboxHubActivator>();
            GlobalHost.DependencyResolver = container.Resolve <Microsoft.AspNet.SignalR.IDependencyResolver>();

            return(container.RegisterHubs(types).RegisterPersistentConnections(types));
        }
Exemple #3
0
        public override void OnFrameworkInitializationCompleted()
        {
            if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
            {
                desktop.MainWindow = new MainWindow
                {
                    DataContext = _container.Resolve <MainWindowViewModel>()
                };
            }

            base.OnFrameworkInitializationCompleted();
        }
Exemple #4
0
 public object GetService(Type serviceType, string contract = null)
 => contract == null
         ? _container.Resolve(serviceType)
         : _container.Resolve(serviceType, contract);
 public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
 {
     return(_container.Resolve <IJob>(bundle.JobDetail.JobType));
 }