Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EditorViewLocator"/> class.
        /// </summary>
        /// <param name="services">The service container.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="services"/> is <see langword="null"/>.
        /// </exception>
        public EditorViewLocator(IServiceLocator services)
        {
            if (services == null)
                throw new ArgumentNullException(nameof(services));

            _services = services;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes the specified service locator.
        /// </summary>
        /// <param name="serviceLocator">The service locator.</param>
        public void Initialize(IServiceLocator serviceLocator)
        {
            Argument.IsNotNull("serviceLocator", serviceLocator);

            serviceLocator.RegisterType<ILanguageService, LanguageService>();
            serviceLocator.RegisterInstance<IExceptionService>(ExceptionService.Default);
            serviceLocator.RegisterInstance<IMessageMediator>(MessageMediator.Default);

            serviceLocator.RegisterType<IValidatorProvider, AttributeValidatorProvider>();
            serviceLocator.RegisterType<IRegistrationConventionHandler, RegistrationConventionHandler>();

#if NET
            serviceLocator.RegisterType<IBinarySerializer, BinarySerializer>();
            serviceLocator.RegisterTypeWithTag<ISerializationContextInfoFactory, BinarySerializationContextInfoFactory>(typeof(BinarySerializer));
#endif
            serviceLocator.RegisterType<IDataContractSerializerFactory, DataContractSerializerFactory>();
            serviceLocator.RegisterType<IXmlSerializer, XmlSerializer>();
            serviceLocator.RegisterType<IXmlNamespaceManager, XmlNamespaceManager>();
            serviceLocator.RegisterType<ISerializationManager, SerializationManager>();
            serviceLocator.RegisterType<IObjectAdapter, ObjectAdapter>();

            serviceLocator.RegisterType<ISerializer, XmlSerializer>();
            serviceLocator.RegisterTypeWithTag<ISerializationContextInfoFactory, XmlSerializationContextInfoFactory>(typeof(XmlSerializer));

            serviceLocator.RegisterType<IModelEqualityComparer, ModelEqualityComparer>();
            serviceLocator.RegisterType<IConfigurationService, ConfigurationService>();
            serviceLocator.RegisterType<IObjectConverterService, ObjectConverterService>();
            serviceLocator.RegisterType<IRollingInMemoryLogService, RollingInMemoryLogService>();
        }
 public TransportActivator(ChannelGraph graph, IServiceLocator services, IHandlerPipeline pipeline, IEnumerable<ITransport> transports)
 {
     _graph = graph;
     _services = services;
     _pipeline = pipeline;
     _transports = transports;
 }
 /// <summary>
 /// Get IServiceLocator instace.
 /// </summary>
 /// <returns></returns>
 public static IServiceLocator GetInstance()
 {
     if (singletonServiceLocator == null) {
         singletonServiceLocator = new AbstractServiceLocator ();
     }
     return singletonServiceLocator;
 }
Esempio n. 5
0
 public AbstractTestRunner(IServiceLocator services, TestPackage package)
 {
     Services = services;
     TestPackage = package;
     TestRunnerFactory = Services.GetService<ITestRunnerFactory>();
     ProjectService = Services.GetService<IProjectService>();
 }
Esempio n. 6
0
        /// <summary>
        /// Initialises a new instance of <see cref="CSLExportProvider" />.
        /// </summary>
        /// <param name="serviceLocator"></param>
        public CSLExportProvider(IServiceLocator serviceLocator)
        {
            Throw.IfArgumentNull(serviceLocator, "serviceLocator");

            this.serviceLocator = serviceLocator;
            this.contractMapping = new Dictionary<string, Type>();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceLocatorAutoRegistrationManager" /> class.
        /// </summary>
        /// <param name="serviceLocator">The service locator.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="serviceLocator"/> is <c>null</c>.</exception>
        public ServiceLocatorAutoRegistrationManager(IServiceLocator serviceLocator)
        {
            Argument.IsNotNull("serviceLocator", serviceLocator);

            _serviceLocator = serviceLocator;

            if (EnvironmentHelper.IsProcessCurrentlyHostedByTool())
            {
                return;
            }

            TypeCache.AssemblyLoaded += (sender, args) =>
            {
                foreach (var type in args.LoadedTypes)
                {
                    _pendingTypes.Enqueue(type);
                }

                if (_autoRegisterTypesViaAttributes)
                {
                    try
                    {
                        InspectLoadedAssemblies();
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex, "Failed to handle dynamically loaded assembly '{0}'", args.Assembly.FullName);
                    }
                }
            };
        }
Esempio n. 8
0
    //--------------------------------------------------------------
    #region Creation & Cleanup
    //--------------------------------------------------------------

    public ProceduralTerrainObject(IServiceLocator services)
    {
      if (services == null)
        throw new ArgumentNullException("services");

      _services = services;
    }
Esempio n. 9
0
 public ApplicationController(IShellView shellView, IServiceLocator serviceLocator)
 {
     if (shellView == null) throw new ArgumentNullException("shellView");
     if (serviceLocator == null) throw new ArgumentNullException("serviceLocator");
     this.shellView = shellView;
     this.serviceLocator = serviceLocator;
 }
Esempio n. 10
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="DbAccessProvider" /> class.
        /// </summary>
        /// <param name="dbAccessProviders">
        ///     The db access providers.
        /// </param>
        /// <param name="serviceLocator">
        ///     The service locator.
        /// </param>
        public DbAccessProvider(IIndex<string, IDbAccess> dbAccessProviders, IServiceLocator serviceLocator)
        {
            this._dbAccessProviders = dbAccessProviders;
            this._serviceLocator = serviceLocator;
            this._providerName = Config.ConnectionProviderName;

            this._dbAccessSafe = new SafeReadWriteProvider<IDbAccess>(
                () =>
                    {
                        IDbAccess dbAccess;

                        // attempt to get the provider...
                        if (this._dbAccessProviders.TryGetValue(this.ProviderName, out dbAccess))
                        {
                            // first time...
                            this._serviceLocator.Get<IRaiseEvent>().Raise(new InitDatabaseProviderEvent(this.ProviderName, dbAccess));
                        }
                        else
                        {
                            throw new NoValidDbAccessProviderFoundException(
                                @"Unable to Locate Provider Named ""{0}"" in Data Access Providers (DLL Not Located in Bin Directory?).".FormatWith(
                                    this.ProviderName));
                        }

                        return dbAccess;
                    });
        }
 	public XmlMessageSerializer(IReflection reflection, IServiceLocator serviceLocator )
     {
         this.reflection = reflection;
         this.serviceLocator = serviceLocator;
     	customElementSerializers = this.serviceLocator.ResolveAll<ICustomElementSerializer>().ToArray();
 		elementSerializationBehaviors = this.serviceLocator.ResolveAll<IElementSerializationBehavior>().ToArray();
     }
        public ContainerSwitcher(IServiceLocator newContainer, bool shouldDisposeContainerWhenDone)
        {
            originalContainer = EnterpriseLibraryContainer.Current;
            shouldDisposeNewContainer = shouldDisposeContainerWhenDone;

            EnterpriseLibraryContainer.Current = newContainer;
        }
Esempio n. 13
0
        internal static void Setup(IServiceLocator locator, ProviderConfiguration config)
        {
            var factories = config.Datastores.Cast<Datastore>().Select(LoadFactory);
            var proxy = new UnitOfWorkFactoryProxy(factories);

            locator.Inject<IUnitOfWorkFactory>(proxy);
        }
Esempio n. 14
0
        /// <summary>
        /// Initializes the specified service locator.
        /// </summary>
        /// <param name="serviceLocator">The service locator.</param>
        public void Initialize(IServiceLocator serviceLocator)
        {
            Argument.IsNotNull(() => serviceLocator);

            serviceLocator.RegisterTypeIfNotYetRegistered<IDataContextSubscriptionService, DataContextSubscriptionService>();
            serviceLocator.RegisterTypeIfNotYetRegistered<ICommandManager, CommandManager>();
            serviceLocator.RegisterTypeIfNotYetRegistered<IViewLoadManager, ViewLoadManager>();
            serviceLocator.RegisterTypeIfNotYetRegistered<IViewModelWrapperService, ViewModelWrapperService>();
            serviceLocator.RegisterTypeIfNotYetRegistered<IViewManager, ViewManager>();
            serviceLocator.RegisterTypeIfNotYetRegistered<IViewModelManager, ViewModelManager>();
            serviceLocator.RegisterTypeIfNotYetRegistered<IAutoCompletionService, AutoCompletionService>();

#if !XAMARIN && !WIN80
            serviceLocator.RegisterTypeIfNotYetRegistered<IInteractivityManager, InteractivityManager>();
#endif

            ViewModelServiceHelper.RegisterDefaultViewModelServices(serviceLocator);

            // Don't use property, we cannot trust the cached property here yet in Visual Studio
            if (CatelEnvironment.GetIsInDesignMode())
            {
                foreach (var assembly in AssemblyHelper.GetLoadedAssemblies())
                {
                    var attributes = assembly.GetCustomAttributesEx(typeof (DesignTimeCodeAttribute));
                    foreach (var attribute in attributes)
                    {
                        // No need to do anything
                    }
                }
            }
        }
Esempio n. 15
0
 public ExampleHtmlWriter(IServiceLocator serviceLocator, IUrlRegistry urlRegistry, BehaviorGraph behaviorGraph)
 {
     _serviceLocator = serviceLocator;
     _urlRegistry = urlRegistry;
     _behaviorGraph = behaviorGraph;
     _examplePageUrl = "_fubu/html/example".ToAbsoluteUrl();
 }
Esempio n. 16
0
 public HttpServer(ILogFactory logFactory, IServiceLocator locator)
 {
     Logger = logFactory.Create("Http server");
     Listener = new HttpListener();
     Listener.IgnoreWriteExceptions = true;
     foreach (string key in ConfigurationManager.AppSettings.Keys)
     {
         if (key.StartsWith("HttpAddress", StringComparison.InvariantCultureIgnoreCase))
             Listener.Prefixes.Add(ConfigurationManager.AppSettings[key]);
     }
     if (Listener.Prefixes.Count == 0)
     {
         Listener.Prefixes.Add("http://*:80/");
         Listener.Prefixes.Add("https://*:443/");
     }
     Routes = new Routes(locator);
     var customAuth = ConfigurationManager.AppSettings["CustomAuth"];
     if (!string.IsNullOrEmpty(customAuth))
     {
         var authType = Type.GetType(customAuth);
         if (!typeof(HttpAuth).IsAssignableFrom(authType))
             throw new ConfigurationErrorsException("Custom auth does not inherit from HttpAuth. Please inherit from " + typeof(HttpAuth).FullName);
         Authentication = locator.Resolve<HttpAuth>(authType);
     }
     else Authentication = locator.Resolve<HttpAuth>();
 }
 /// <summary>
 /// Create executor 
 /// </summary>
 public void Execute(Object message, IServiceLocator serviceLocator)
 {
     if (_shortAction != null)
         _shortAction(message);
     else
         _fullAction(message, serviceLocator);
 }
Esempio n. 18
0
 public void Execute(IServiceLocator serviceLocator)
 {
     Execute(
         serviceLocator.GetInstance<IWindowManager>(),
         serviceLocator.GetInstance<IQuestionDialog>()
         );
 }
        private void RegisterRhinoQueuesTransport(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l)
        {
            var busConfig = c.ConfigurationSection.Bus;
            var fileManagerConfiguration = new QueueManagerConfiguration();

            b.RegisterSingleton<ISubscriptionStorage>(() => (ISubscriptionStorage)new FileSubscriptionStorage(
                busConfig.SubscriptionPath,
                l.Resolve<IMessageSerializer>(),
                l.Resolve<IReflection>()));

            b.RegisterSingleton<ITransport>(() => (ITransport)new RhinoFilesTransport(
                c.Endpoint,
                l.Resolve<IEndpointRouter>(),
                l.Resolve<IMessageSerializer>(),
                c.ThreadCount,
                busConfig.QueuePath,
                c.IsolationLevel,
                c.NumberOfRetries,
                busConfig.EnablePerformanceCounters,
                l.Resolve<IMessageBuilder<MessagePayload>>(),
                fileManagerConfiguration));

            b.RegisterSingleton<IMessageBuilder<MessagePayload>>(() => (IMessageBuilder<MessagePayload>)new RhinoFilesMessageBuilder(
                l.Resolve<IMessageSerializer>(),
                l.Resolve<IServiceLocator>()));

            b.RegisterSingleton<QueueManagerConfiguration>(() => fileManagerConfiguration);
        }
Esempio n. 20
0
        /// <summary>
        /// Queries the <see cref="IServiceLocator"/> instance for any instances of <see cref="IFilterRegistry"/> to process.
        /// </summary>
        /// <param name="serviceLocator">Current <see cref="IServiceLocator"/> instance for the application.</param>
        public virtual void SetupFilterRegistries(IServiceLocator serviceLocator) {
            var filterRegistries = GetFilterRegistries(serviceLocator);
            if (filterRegistries == null) return;

            var filterList = new List<Filter>();
            var typeList = new List<Type>();

            foreach (var filterRegistry in filterRegistries) {
                var registrations = filterRegistry.GetFilterRegistrations();

                using (serviceLocator.Batch()) {
                    foreach (var registration in registrations) {
                        var filterType = registration.FilterType;

                        // Prevent double registration of the same filter
                        if (typeList.Contains(filterType)) continue;

                        serviceLocator.Register(filterType, filterType);
                        typeList.Add(filterType);
                    }
                }

                filterList.AddRange(registrations);
            }

            typeList.Clear();
            FilterProviders.Providers.Add(new FilterRegistryProvider(serviceLocator, filterList));
        }
Esempio n. 21
0
 public BehaviorGraphWriter(BehaviorGraph graph, IUrlRegistry urls, IServiceLocator services)
 {
     _graph = graph;
     _urls = urls;
     _services = services;
     _diagnosticsNamespace = GetType().Namespace;
 }
        /// <summary>
        /// Initializes the specified service locator.
        /// </summary>
        /// <param name="serviceLocator">The service locator.</param>
        public void Initialize(IServiceLocator serviceLocator)
        {
            Argument.IsNotNull(() => serviceLocator);

            serviceLocator.RegisterTypeIfNotYetRegistered<IConnectionStringManager, ConnectionStringManager>();
            serviceLocator.RegisterTypeIfNotYetRegistered<IContextFactory, ContextFactory>();
        }
Esempio n. 23
0
 private static void RegisterHandlers(IServiceLocator serviceLocator)
 {
     var registrar = new BusRegistrar(serviceLocator);
     registrar.Register(typeof(CartHandlers));
     registrar.Register(typeof(CartViewProjections));
     registrar.Register(typeof(CustomerCreatedEventHandler));
 }
Esempio n. 24
0
        private static void Initialize()
        {
            var profile = new AutoMapperProfile();
            Mapper.AddProfile(profile);
            Mapper.AssertConfigurationIsValid(profile.ProfileName);

            Database.DefaultConnectionFactory = new ConnectionFactory(Database.DefaultConnectionFactory);
            Database.SetInitializer<SketchDbContext>(null);
            Database.SetInitializer<EventStoreDbContext>(null);
            using (var sketchDbContext = new SketchDbContext())
            using (var eventStoreDbContext = new EventStoreDbContext())
            {
                if (!sketchDbContext.Database.Exists())
                {
                    ((IObjectContextAdapter)sketchDbContext).ObjectContext.CreateDatabase();

                    eventStoreDbContext.Database.ExecuteSqlCommand(((IObjectContextAdapter)eventStoreDbContext).ObjectContext.CreateDatabaseScript());
                }
            }

            var container = new UnityContainer();
            var unityServiceLocator = new UnityServiceLocator(container);
            Microsoft.Practices.ServiceLocation.ServiceLocator.SetLocatorProvider(() => unityServiceLocator);
            ServiceLocator = Microsoft.Practices.ServiceLocation.ServiceLocator.Current;
            new Core.Module().Init(container);
            new Module().Init(container);
        }
Esempio n. 25
0
 /// <summary>
 /// Initializes an instance of <see cref="EventMigratorManager">EventMigratorManager</see>
 /// </summary>
 /// <param name="typeDiscoverer"></param>
 /// <param name="serviceLocator"></param>
 public EventMigratorManager(ITypeDiscoverer typeDiscoverer, IServiceLocator serviceLocator)
 {
     _typeDiscoverer = typeDiscoverer;
     _serviceLocator = serviceLocator;
     _migratorTypes = new Dictionary<Type, Type>();
     Initialize();
 }
        /// <summary>
        /// Default constructor for the type
        /// </summary>
        /// <param name="serviceLocator"></param>
        public TurbineControllerActivator(IServiceLocator serviceLocator) {
            if (serviceLocator == null) {
                throw new ArgumentNullException("serviceLocator");
            }

            ServiceLocator = serviceLocator;
        }
Esempio n. 27
0
 public override void Initialize(IServiceLocator locator)
 {
     //Initializácia kodových tabuliek modulu administrácia
     locator.GetInstance<AdministrationCodeTableService>()
         .Initialize();
     
 }
Esempio n. 28
0
			public static void SetLocator(IServiceLocator locator)
			{
				if (locator == null)
					throw new ArgumentNullException();

				instance = locator;
			}
Esempio n. 29
0
        public MailService(IServiceLocator locator)
        {
            Contract.Requires(locator != null);

            this.Serialization = locator.Resolve<ISerialization<byte[]>>();
            this.Repository = locator.Resolve<Func<string, IMailMessage>>();
        }
        public CatelWebApiDependencyResolver(IServiceLocator serviceLocator)
        {
            Argument.IsNotNull(() => serviceLocator);

            _serviceLocator = serviceLocator;
            _typeFactory = serviceLocator.ResolveType<ITypeFactory>();
        }
 public EnterpriseLibraryContainer(IServiceLocator locator)
 {
     this.locator = locator;
 }
Esempio n. 32
0
 public static void RegisterServiceLocator(IServiceLocator s)
 {
     Instance = s;
 }
Esempio n. 33
0
 public ProcessRunner(IServiceLocator services, TestPackage package) : base(services, package)
 {
     _agency = Services.GetService <TestAgency>();
 }
Esempio n. 34
0
 public UsersController(IServiceLocator serviceLocator) : base(serviceLocator)
 {
 }
Esempio n. 35
0
 public FactoryActor(IServiceLocator serviceLocator,
                     IEventQueueOperator queueOperator)
 {
     _queueOperator  = queueOperator;
     _serviceLocator = serviceLocator;
 }
Esempio n. 36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Friends"/> class.
 /// </summary>
 /// <param name="serviceLocator">
 /// The service locator.
 /// </param>
 public Friends([NotNull] IServiceLocator serviceLocator)
 {
     this.ServiceLocator = serviceLocator;
 }
Esempio n. 37
0
 protected BaseRepository(string collectionName, IServiceLocator serviceLocator)
 {
     mongoClient   = serviceLocator.Resolve <IMongoClient>();
     mongoDatabase = mongoClient.GetDatabase(AppSettings.UserCollectionName);
     collection    = mongoDatabase.GetCollection <TModel>(collectionName);
 }
Esempio n. 38
0
 public EchoServiceClient(ICredential credential, CancellationToken token, IServiceLocator serviceLocator)
 {
     this.ServiceLocator = serviceLocator;
 }
        /// <summary>
        /// The get.
        /// </summary>
        /// <param name="serviceLocator">
        /// The service locator.
        /// </param>
        /// <typeparam name="TService">
        /// </typeparam>
        /// <returns>
        /// The <see cref="TService"/>.
        /// </returns>
        public static TService Get <TService>([NotNull] this IServiceLocator serviceLocator)
        {
            CodeContracts.VerifyNotNull(serviceLocator, "serviceLocator");

            return((TService)serviceLocator.Get(typeof(TService)));
        }
Esempio n. 40
0
 public TfsExplorerBar(IServiceLocator serviceLocator)
     : base(serviceLocator)
 {
     LoadLogicalBranches();
     SubscribeToEvent <Interfaces.Events.NewRootBranchEventData>(NewRootBranchEventHandler);
 }
Esempio n. 41
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpamCheck"/> class.
 /// </summary>
 /// <param name="serviceLocator">
 /// The service locator.
 /// </param>
 public SpamCheck(IServiceLocator serviceLocator)
 {
     this.ServiceLocator = serviceLocator;
 }
Esempio n. 42
0
 public Module(IUnityContainer unityContainer, IServiceLocator serviceLocator)
 {
     this.unityContainer = unityContainer;
     this.serviceLocator = serviceLocator;
 }
Esempio n. 43
0
 public static void SetCurrent(IServiceLocator item)
 {
     Current = item;
 }
        /// <summary>
        /// The is yaf context.
        /// </summary>
        /// <param name="serviceLocator">
        /// The service locator.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public static bool IsYafContext([NotNull] this IServiceLocator serviceLocator)
        {
            CodeContracts.VerifyNotNull(serviceLocator, "serviceLocator");

            return(serviceLocator.Tag == (object)YafLifetimeScope.Context);
        }
Esempio n. 45
0
 /// <summary>
 /// Construtor padrão
 /// </summary>
 /// <param name="locator">Inteface de IoC</param>
 /// <param name="typeSchema">Classe de recuperação de metadados</param>
 /// <param name="translator">Instancia do tradutor.</param>
 public GenericPersistenceExecuter(IServiceLocator locator, ITypeSchema typeSchema, IQueryTranslator translator) : base(locator, typeSchema)
 {
     _translator = translator;
 }
Esempio n. 46
0
 /// <summary>
 /// Initializes a new instance of the <see cref="YafBBCode"/> class.
 /// </summary>
 /// <param name="serviceLocator">
 /// The service locator.
 /// </param>
 /// <param name="processReplaceRulesFactory">
 /// The process replace rules factory.
 /// </param>
 public YafBBCode(
     IServiceLocator serviceLocator, Func <IEnumerable <bool>, IProcessReplaceRules> processReplaceRulesFactory)
 {
     this.ServiceLocator             = serviceLocator;
     this.ProcessReplaceRulesFactory = processReplaceRulesFactory;
 }
 public ServiceLocatorDependencyResolver(IServiceLocator serviceLocator)
 {
     _serviceLocator = serviceLocator;
 }
Esempio n. 48
0
 public CommandBusMiddlewareFactory(IServiceLocator serviceLocator)
 {
     this.serviceLocator = serviceLocator;
 }
 public EfRepositoryBase(IServiceLocator serviceLocator) : base(serviceLocator)
 {
 }
        public AsyncEventQueueDispatcherTests()
        {
            asyncEventQueueManager = Substitute.For <IAsyncEventQueueManager>();
            serviceLocator         = Substitute.For <IServiceLocator>();

            sut = new AsyncEventQueueDispatcher(asyncEventQueueManager, serviceLocator);

            eventSequencers.Add(Substitute.For <IAsyncEventSequencer <Event1> >());
            eventSequencers.Add(Substitute.For <IAsyncEventSequencer <Event1> >());

            serviceLocator.GetAll(typeof(IAsyncEventSequencer <Event1>)).Returns(eventSequencers);

            eventMessages = new List <IEventMessage>()
            {
                new EventMessage <Event1>(new Event1(), new Dictionary <string, string>()),
                new EventMessage <Event1>(new Event1(), new Dictionary <string, string>())
            };

            eventSequencers[0].GetEventSequencing(eventMessages[0]).Returns(new List <EventSequencing>()
            {
                new EventSequencing()
                {
                    SequenceName = "queue1", EventSequenceNumber = 1
                },
                new EventSequencing()
                {
                    SequenceName = "queue2", EventSequenceNumber = 1
                },
            });

            eventSequencers[0].GetEventSequencing(eventMessages[1]).Returns(new List <EventSequencing>()
            {
                new EventSequencing()
                {
                    SequenceName = "queue1", EventSequenceNumber = 2
                },
                new EventSequencing()
                {
                    SequenceName = "queue2", EventSequenceNumber = 2
                },
            });

            eventSequencers[0].ShouldAttemptSynchronousDispatch(null).ReturnsForAnyArgs(true);

            eventSequencers[1].GetEventSequencing(eventMessages[0]).Returns(new List <EventSequencing>()
            {
                new EventSequencing()
                {
                    SequenceName = "queue1", EventSequenceNumber = 1
                }
            });

            eventSequencers[1].GetEventSequencing(eventMessages[1]).Returns(new List <EventSequencing>()
            {
                new EventSequencing()
                {
                    SequenceName = "queue3", EventSequenceNumber = 3
                }
            });

            eventSequencers[1].ShouldAttemptSynchronousDispatch(eventMessages[0]).ReturnsForAnyArgs(true);
            eventSequencers[1].ShouldAttemptSynchronousDispatch(eventMessages[1]).ReturnsForAnyArgs(false);
        }
Esempio n. 51
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AspNetRolesHelper"/> class.
 /// </summary>
 /// <param name="serviceLocator">
 /// The service locator.
 /// </param>
 public AspNetRolesHelper([NotNull] IServiceLocator serviceLocator)
 {
     this.ServiceLocator = serviceLocator;
 }
Esempio n. 52
0
 public DefaultBreadCrumbsFinder(IFubuRequest fubuRequest, IServiceLocator serviceLocator, ICmsContext cmsContext)
 {
     _fubuRequest    = fubuRequest;
     _serviceLocator = serviceLocator;
     _cmsContext     = cmsContext;
 }
Esempio n. 53
0
 public MasterTestRunner(IServiceLocator services, TestPackage package)
     : base(services, package)
 {
     _runtimeService   = Services.GetService <IRuntimeFrameworkService>();
     _extensionService = Services.GetService <ExtensionService>();
 }
Esempio n. 54
0
 public TestableVehicleController(GetUserByClaimId userServices, IServiceLocator serviceLocator)
     : base(userServices, serviceLocator)
 {
 }
Esempio n. 55
0
 /// <summary>
 /// Registers the with service locator.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="service">The service.</param>
 /// <param name="locator">The locator.</param>
 /// <returns></returns>
 public static Lazy <IServiceLocator> RegisterWithServiceLocator <T>(this Lazy <IServiceLocator> service, IServiceLocator locator)
     where T : class, IServiceLocator
 {
     ServiceLocatorManager.GetSetupDescriptor(service).RegisterWithServiceLocator <T>(service, locator, null); return(service);
 }
Esempio n. 56
0
 public KatanaHostingActivator(KatanaSettings settings, FubuRouteTable routes, IUrlRegistry urls, IServiceLocator services)
 {
     _settings = settings;
     _routes   = routes.Routes;
     _urls     = urls;
     _services = services;
 }
Esempio n. 57
0
 /// <summary>
 /// Construct a RemoteTestAgent
 /// </summary>
 public RemoteTestAgent(Guid agentId, string agencyUrl, IServiceLocator services)
     : base(agentId, services)
 {
     _agencyUrl = agencyUrl;
 }
Esempio n. 58
0
 /// <summary>
 /// Registers the with service locator.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="locator">The locator.</param>
 /// <param name="name">The name.</param>
 /// <returns></returns>
 public static Lazy <IServiceLocator> RegisterWithServiceLocator(this Lazy <IServiceLocator> service, IServiceLocator locator, string name)
 {
     ServiceLocatorManager.GetSetupDescriptor(service).RegisterWithServiceLocator(service, locator, name); return(service);
 }
Esempio n. 59
0
 public void Initialize(InitializationEngine context)
 {
     _locator = context.Locate.Advanced;
     OrderContext.Current.OrderGroupUpdated += Current_OrderGroupUpdated;
 }
Esempio n. 60
0
 public void SetTestServiceLocator(IServiceLocator theLocator)
 {
 }