private void TestCommonBody(IServiceContainer container, IList<String> expected) { IList<String> actual = container.ResolveNameTypeServices<String>(); Assert.That(actual.Count, Is.EqualTo(expected.Count)); foreach (String actualValue in actual) Assert.True(expected.Contains(actualValue)); }
public SampleDesignerHost(IServiceProvider parentProvider) { this.serviceContainer = new ServiceContainer(parentProvider); this.designerTable = new Hashtable(); this.sites = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default); this.loadingDesigner = false; this.transactionCount = 0; this.reloading = false; this.serviceContainer.AddService(typeof(IDesignerHost), this); this.serviceContainer.AddService(typeof(IContainer), this); this.serviceContainer.AddService(typeof(IComponentChangeService), this); this.serviceContainer.AddService(typeof(IExtenderProviderService), this); this.serviceContainer.AddService(typeof(IDesignerEventService), this); CodeDomComponentSerializationService codeDomComponentSerializationService = new CodeDomComponentSerializationService(this.serviceContainer); if (codeDomComponentSerializationService != null) { this.serviceContainer.RemoveService(typeof(ComponentSerializationService), false); this.serviceContainer.AddService(typeof(ComponentSerializationService), codeDomComponentSerializationService); } ServiceCreatorCallback callback = new ServiceCreatorCallback(this.OnCreateService); this.serviceContainer.AddService(typeof(IToolboxService), callback); this.serviceContainer.AddService(typeof(ISelectionService), callback); this.serviceContainer.AddService(typeof(ITypeDescriptorFilterService), callback); this.serviceContainer.AddService(typeof(IMenuCommandService), callback); this.serviceContainer.AddService(typeof(IDesignerSerializationService), callback); ((IExtenderProviderService) this).AddExtenderProvider(new SampleNameExtenderProvider(this)); ((IExtenderProviderService) this).AddExtenderProvider(new SampleInheritedNameExtenderProvider(this)); }
public void Detach(IServiceContainer container) { container.UnregisterService(mainForm); mainForm.ServiceContainer = null; mainForm = null; }
public void Attach(IServiceContainer container) { mainForm = new MainForm(); mainForm.ServiceContainer = container; container.RegisterService(mainForm); }
/// <summary> /// This is the function that will create a new instance of the services the first time a client /// will ask for a specific service type. It is called by the base class's implementation of /// IServiceProvider. /// </summary> /// <param name="container">The IServiceContainer that needs a new instance of the service. /// This must be this package.</param> /// <param name="serviceType">The type of service to create.</param> /// <returns>The instance of the service.</returns> private object CreateService(IServiceContainer container, Type serviceType) { // Check if the IServiceContainer is this package. if (container != this) { Debug.WriteLine("ServicesPackage.CreateService called from an unexpected service container."); return null; } // Find the type of the requested service and create it. if (typeof(SMyGlobalService).IsEquivalentTo(serviceType)) { // Build the global service using this package as its service provider. return new MyGlobalService(this); } if (typeof(SMyLocalService).IsEquivalentTo(serviceType)) { // Build the local service using this package as its service provider. return new MyLocalService(this); } // If we are here the service type is unknown, so write a message on the debug output // and return null. Debug.WriteLine("ServicesPackage.CreateService called for an unknown service type."); return null; }
protected virtual void InitializeEnvironment(IServiceContainer container, ConfigurationManagerWrapper.ContentSectionTable config) { if (config.Web != null) { Url.DefaultExtension = config.Web.Web.Extension; PathData.PageQueryKey = config.Web.Web.PageQueryKey; PathData.ItemQueryKey = config.Web.Web.ItemQueryKey; PathData.PartQueryKey = config.Web.Web.PartQueryKey; PathData.PathKey = config.Web.Web.PathDataKey; if (!config.Web.Web.IsWeb) container.AddComponentInstance("n2.webContext.notWeb", typeof(IWebContext), new ThreadContext()); if (config.Web.Web.Urls.EnableCaching) container.AddComponent("n2.web.cachingUrlParser", typeof(IUrlParser), typeof(CachingUrlParserDecorator)); if (config.Web.MultipleSites) container.AddComponent("n2.multipleSitesParser", typeof(IUrlParser), typeof(MultipleSitesParser)); else container.AddComponent("n2.urlParser", typeof(IUrlParser), typeof(UrlParser)); } if (config.Management != null) { SelectionUtility.SelectedQueryKey = config.Management.Paths.SelectedQueryKey; Url.SetToken("{Selection.SelectedQueryKey}", SelectionUtility.SelectedQueryKey); } }
public void Start() { serviceContainer = new ServiceContainer(); serviceContainer.RegisterFrom<PhoneBookCompositionRoot>(); serviceContainer.RegisterFrom<ConsoleCompositionRoot>(); serviceContainer.GetInstance<IPeriodicServiceTrigger>().Start(); }
public LightInjectResolver(IServiceContainer container) { if (container == null) throw new ArgumentNullException("Container cannot be null"); this.container = container; }
public void Detach(IServiceContainer container) { container.unregisterService(MainForm); MainForm.ServiceContainer = null; MainForm = null; }
/// <summary> /// Initializes a new instance of the <see cref="PluginManager"/> class. /// </summary> /// <param name="serviceContainer">The service container.</param> public PluginManager(IServiceContainer serviceContainer) { if (serviceContainer == null) throw new ArgumentNullException("serviceContainer"); services = serviceContainer; settingsService = services.GetService<ISettingsService>(true); }
private void AddComponentUnlessConfigured(IServiceContainer container, Type serviceType, Type instanceType, IEnumerable<Type> skipList) { if (skipList.Contains(serviceType)) return; container.AddComponent(serviceType.FullName + "->" + instanceType.FullName, serviceType, instanceType); }
public DesignerHost(IServiceContainer parent) { // Keep the parent reference around for re-use this.parent = parent; // Initialise container helpers components = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default); designers = new Hashtable(); // Initialise transaction stack transactions = new Stack(); // Add our own services parent.AddService(typeof(IDesignerHost), this); parent.AddService(typeof(IContainer), this); parent.AddService(typeof(IComponentChangeService), this); parent.AddService(typeof(ITypeDescriptorFilterService), this); // Add extender services extenderProviders = new ArrayList(); parent.AddService(typeof(IExtenderListService), this); parent.AddService(typeof(IExtenderProviderService), this); AddExtenderProvider(this); // Add selection service parent.AddService(typeof(ISelectionService), new SelectionService(this)); }
protected virtual void RegisterConfiguredComponents(IServiceContainer container, EngineSection engineConfig) { foreach (ComponentElement component in engineConfig.Components) { Type implementation = Type.GetType(component.Implementation); Type service = Type.GetType(component.Service); if (implementation == null) throw new ComponentRegistrationException(component.Implementation); if (service == null && !String.IsNullOrEmpty(component.Service)) throw new ComponentRegistrationException(component.Service); if (service == null) service = implementation; string name = component.Key; if (string.IsNullOrEmpty(name)) name = implementation.FullName; if (component.Parameters.Count == 0) { container.AddComponent(name, service, implementation); } else { container.AddComponentWithParameters(name, service, implementation, component.Parameters.ToDictionary()); } } }
public override void Prepare() { this.container = new ServiceContainer(); container.Register<ISingleton>(c => new Singleton(), new PerContainerLifetime()); container.Register<ITransient>(c => new Transient(), new PerRequestLifeTime()); container.Register<ICombined>(c => new Combined(c.GetInstance<ISingleton>(), c.GetInstance<ITransient>()), new PerRequestLifeTime()); }
private object CreateService(IServiceContainer container, Type serviceType) { if (serviceType == typeof(NpgsqlProviderObjectFactory)) return new NpgsqlProviderObjectFactory(); return null; }
protected override object GetService(Type serviceType) { object service = base.GetService(serviceType); if (service != null) { return service; } if (serviceType == typeof(IServiceContainer)) { if (this._services == null) { this._services = new ServiceContainer(this._host); } return this._services; } if (this._services != null) { return this._services.GetService(serviceType); } if ((base.Owner.Site != null) && this._safeToCallOwner) { try { this._safeToCallOwner = false; return base.Owner.Site.GetService(serviceType); } finally { this._safeToCallOwner = true; } } return null; }
/// <summary> /// Initializes the class with the given <paramref name="container"/> instance. /// </summary> /// <param name="container">The target service container.</param> /// <param name="creator">The <see cref="ICreateInstance"/> instance responsible for instantiating service types.</param> /// <param name="preProcessor">The <see cref="IPreProcessor"/> that will allow users to intercept a given service request.</param> /// <param name="postProcessor">The <see cref="IPostProcessor"/> instance that will handle the results of a given service request.</param> public DefaultGetServiceBehavior(IServiceContainer container, ICreateInstance creator, IPreProcessor preProcessor, IPostProcessor postProcessor) { _container = container; _creator = creator; _preProcessor = preProcessor; _postProcessor = postProcessor; }
/// <summary> /// Initializes the class with the given <paramref name="container"/> instance. /// </summary> /// <param name="container">The target service container.</param> public DefaultGetServiceBehavior(IServiceContainer container) { _container = container; _creator = new DefaultCreator(); _preProcessor = new CompositePreProcessor(container.PreProcessors); _postProcessor = new CompositePostProcessor(container.PostProcessors); }
public UndoEngineImplication(IServiceContainer provider) : base(provider) { service = provider; editToolStripMenuItem = (ToolStripMenuItem)service.GetService(typeof(ToolStripMenuItem)); cassPropertyGrid = (FilteredPropertyGrid)service.GetService(typeof(FilteredPropertyGrid)); }
public LinFuServiceLocatorAdapter(IServiceContainer container) { if (container == null) throw new ArgumentNullException("container"); _container = container; }
public void Setup() { serviceContainer = new ServiceContainer(); serviceContainer.EnableQuartz(); serviceContainer.RegisterJobs(); serviceContainer.Register<IFoo, Foo>(); }
/// <summary> /// Parses a source code and creates a new design surface. /// </summary> /// <param name="serviceContainer"></param> /// <param name="surfaceManager"></param> /// <param name="file">The source file to deserialize.</param> /// <returns></returns> public DesignSurface Deserialize(DesignSurfaceManager surfaceManager, IServiceContainer serviceContainer, OpenedFile file) { DesignSurface surface = surfaceManager.CreateDesignSurface(serviceContainer); IDesignerHost designerHost = surface.GetService(typeof(IDesignerHost)) as IDesignerHost; Type componentType = CompileTypeFromFile(file); // load base type. surface.BeginLoad(componentType.BaseType); // get instance to copy components and properties from. Control instance = Activator.CreateInstance(componentType) as Control; // add components var components = CreateComponents(componentType, instance, designerHost); InitializeComponents(components, designerHost); Control rootControl = designerHost.RootComponent as Control; Control parent = rootControl.Parent; ISite site = rootControl.Site; // copy instance properties to root control. CopyProperties(instance, designerHost.RootComponent); rootControl.AllowDrop = true; rootControl.Parent = parent; rootControl.Visible = true; rootControl.Site = site; designerHost.RootComponent.Site.Name = instance.Name; return surface; }
/// <summary> /// HttpServiceCaller初始化 /// </summary> /// <param name="group"></param> /// <param name="config"></param> /// <param name="container"></param> public HttpServiceCaller(IWorkItemsGroup group, CastleServiceConfiguration config, IServiceContainer container) { this.config = config; this.container = container; this.smart = group; this.callers = new HttpCallerInfoCollection(); this.callTimeouts = new Dictionary<string, int>(); }
public IServiceContainer InitializeContainer() { Container = new ServiceContainer(); LoadConfigurations(Container); return Container; }
public static void AddComponentsTo(IServiceContainer container) { AddGenericRepositoriesTo(container); AddCustomRepositoriesTo(container); AddApplicationServicesTo(container); container.AddService(typeof(IValidator), typeof(Validator), LinFu.IoC.Configuration.LifecycleType.OncePerRequest); }
public MasterDataClient(string serviceName, BootstrapContext token = null) { Tracer = TracerFactory.StartTracer(this, "ctor"); var runtime = RuntimeFactory.CreateRuntime(); Container = runtime.CreateServiceProxy<IMasterDataManagementService>(serviceName); if (token.IsInstance()) Container.Initialize(token); }
public void Attach(IServiceContainer container) { MainForm = new MainForm { ServiceContainer = container }; container.registerService(MainForm); }
public override void Prepare() { this.container = new ServiceContainer(); this.RegisterDummies(); this.RegisterStandard(); this.RegisterComplex(); }
/// <summary> /// Instantiates a new process contrext for inversion. /// </summary> /// <remarks>You can think of this type here as "being Inversion". This is the thing.</remarks> /// <param name="underlyingContext">The underlying http context to wrap.</param> /// <param name="services">The service container the context will use.</param> /// <param name="resources">The resources available to the context.</param> public AspNetContext(HttpContext underlyingContext, IServiceContainer services, IResourceAdapter resources) : base(services, resources) { _underlyingContext = underlyingContext; _application = this.UnderlyingContext.ApplicationInstance as AspNetApplication; _response = new AspNetResponse(this.UnderlyingContext.Response); _request = new AspNetRequest(this.UnderlyingContext.Request); }
public MainFormInteractor(IServiceProvider services) { this.dlgFactory = services.RequireService<IDialogFactory>(); this.mru = new MruList(MaxMruItems); this.mru.Load(MruListFile); this.sc = services.RequireService<IServiceContainer>(); this.nextPage = new Dictionary<IPhasePageInteractor, IPhasePageInteractor>(); }
public DotNet2TS(IServiceContainer serviceContainer) { ServiceContainer = serviceContainer; }
/// <summary> /// Initializes services that match the given <typeparamref name="TService" /> type. /// </summary> /// <typeparam name="TService">The service type to initialize.</typeparam> /// <param name="container">The container that will create the service itself.</param> /// <returns>A <see cref="IPropertyInjectionLambda{T}" /> instance. This cannot be <c>null</c>.</returns> public static IPropertyInjectionLambda <TService> Initialize <TService>(this IServiceContainer container) { return(container.Initialize <TService>(null)); }
public abstract object Unwrap(IServiceContainer parent);
public RCompletionSourceTest(IServiceContainer services) { _shell = services.GetService <ICoreShell>(); }
protected LinterWalker(IDocumentAnalysis analysis, IServiceContainer services) { Analysis = analysis; Services = services; }
public AutomaticSyncCommand(ITextView textView, IServiceContainer services) : base(textView, new CommandId(MdPackageCommandId.MdCmdSetGuid, MdPackageCommandId.icmdAutomaticSync), false) { _settings = services.GetService <IRMarkdownEditorSettings>(); }
public SymbolsReader(IServiceContainer ctx, IModule mod, byte[] data) : base(data) { this.ctx = ctx; this.mod = mod; }
public SteppingTest(IServiceContainer services, TestMethodFixture testMethod) { _sessionProvider = new RSessionProvider(services); _session = _sessionProvider.GetOrCreate(testMethod.FileSystemSafeName); }
public void ConfigureContainer(IServiceContainer builder) { builder.BuildServiceProviderFromFactory(Services); }
public BaseAppService(IServiceContainer <TBoardService> container) { _boardContainer = container; _id = GetType().FullName; }
public void Configuration(IServiceContainer container) { container.EnableInterception(); }
public ResourceTokenFeeService(IServiceContainer <IResourceTokenFeeProvider> resourceTokenFeeProviders) { _resourceTokenFeeProviders = resourceTokenFeeProviders; }
public RInteractiveWorkflowOperationsTest(IServiceContainer services) { _workflow = services.GetService <IRInteractiveWorkflowVisualProvider>().GetOrCreate(); }
public static IAuthorizer <TService> GetAuthorizer <TService>(this IServiceContainer <TService> container) where TService : BaseDomainService { return(container.GetRequiredService <IAuthorizer <TService> >()); }
public RLanguageHandler(ITextBuffer textBuffer, IProjectionBufferManager projectionBufferManager, IServiceContainer services) : base(textBuffer) { _projectionBufferManager = projectionBufferManager; idleTime = services.GetService <IIdleTimeService>(); UpdateProjections(); }
public override void Init(IServiceContainer serviceContainer, IDictionary <string, string> jobArgsDictionary) { base.Init(serviceContainer, jobArgsDictionary); ServicePointManager.DefaultConnectionLimit = MaximumConnectionsPerServer; }
public static IServiceOperationsHelper <TService> GetServiceHelper <TService>(this IServiceContainer <TService> container) where TService : BaseDomainService { return(container.GetRequiredService <IServiceOperationsHelper <TService> >()); }
public RTextViewConnectionListener(IServiceContainer services) : base(services) { }
public static ICodeGenFactory <TService> GetCodeGenFactory <TService>(this IServiceContainer <TService> container) where TService : BaseDomainService { return(container.GetRequiredService <ICodeGenFactory <TService> >()); }
public static IDataManagerContainer <TService> GetDataManagerContainer <TService>(this IServiceContainer <TService> container) where TService : BaseDomainService { return(container.GetRequiredService <IDataManagerContainer <TService> >()); }
public S_FRAMEPROC(IServiceContainer ctx, IModule mod, SpanStream stream) : base(ctx, mod, stream) { }
public static IValidatorContainer <TService> GetValidatorContainer <TService>(this IServiceContainer <TService> container) where TService : BaseDomainService { return(container.GetRequiredService <IValidatorContainer <TService> >()); }
public override object Unwrap(IServiceContainer parent) { return(_serviceInstance); }
public static IInvokeOperationsUseCaseFactory <TService> GetInvokeOperationsUseCaseFactory <TService>(this IServiceContainer <TService> container) where TService : BaseDomainService { return(container.GetRequiredService <IInvokeOperationsUseCaseFactory <TService> >()); }
public override object Unwrap(IServiceContainer parent) { return(_lazy.Value); }
public static IUserProvider GetUserProvider(this IServiceContainer container) { return(container.GetRequiredService <IUserProvider>()); }
public static void RegisterRouter(this IServiceContainer container, string shutdownfile = "") { container.Register <IChannelShuffler, DefaultChannelShuffler>(typeof(DefaultChannelShuffler).FullName, new PerContainerLifetime()); container.Register <IChannelShuffler, FisherYatesChannelShuffler>(typeof(FisherYatesChannelShuffler).FullName, new PerContainerLifetime()); container.Register <Interface.Inbound.IPipeline, Impl.Inbound.Pipeline>(new PerContainerLifetime()); container.Register <Interface.Outbound.IPipeline, Impl.Outbound.Pipeline>(new PerContainerLifetime()); container.Register <ILogger, ConsoleLogger>(new PerContainerLifetime()); container.Register <IHost, Host>(new PerContainerLifetime()); container.Register <IRouter, Impl.Inbound.Router>(new PerContainerLifetime()); container.Register <ISagaExecutionCoordinator, SagaExecutionCoordinator>(new PerContainerLifetime()); container.Register <IMessageRouter, MessageRouter>(new PerContainerLifetime()); container.Register <IHandlerMethodSelector, HandlerMethodSelector>(new PerContainerLifetime()); container.Register <IEndPointProvider, EndPointProvider>(new PerContainerLifetime()); container.Register <IHandlerMethodExecutor, HandlerMethodExecutor>(new PerContainerLifetime()); container.Register <IComponentFactory, ComponentFactory>(new PerContainerLifetime()); container.Register <IBus, Bus>(new PerContainerLifetime()); container.Register <IConfiguration, Configuration>(new PerContainerLifetime()); container.Register <IStartup, Startup>(new PerContainerLifetime()); container.Register <IShutdown, Shutdown>(new PerContainerLifetime()); container.Register <IStartupTask, ChannelStartupTask>(typeof(ChannelStartupTask).FullName, new PerContainerLifetime()); container.Register <IStartupTask, StartupTask>(typeof(StartupTask).FullName, new PerContainerLifetime()); container.Register <IShutdownTask, ShutdownTask>(typeof(ShutdownTask).FullName, new PerContainerLifetime()); container.Register <IStartupTask, HandlerAndEndpointStartupTask>(typeof(HandlerAndEndpointStartupTask).FullName, new PerContainerLifetime()); container.Register <IStartupTask, ListenerStartupTask>(typeof(ListenerStartupTask).FullName, new PerContainerLifetime()); container.Register <IShutdownTask, ListenerShutdownTask>(typeof(ListenerShutdownTask).FullName, new PerContainerLifetime()); container.Register <IShutdownWatcher, ShutdownNullWatcher>(typeof(ShutdownNullWatcher).FullName, new PerContainerLifetime()); container.Register <IShutdownWatcher>(x => new ShutdownFileWatcher(shutdownfile), typeof(ShutdownFileWatcher).FullName, new PerContainerLifetime()); container.Register <IMonitor, Monitor>(new PerContainerLifetime()); container.Register <ISagaStorageSearcher, SagaStorageSearcher>(new PerContainerLifetime()); container.Register <IMonitoringTask, PointToPointChannelMonitor>(typeof(PointToPointChannelMonitor).FullName, new PerContainerLifetime()); container.Register <IMonitoringTask, SubscriptionToPublishSubscribeChannelMonitor>(typeof(SubscriptionToPublishSubscribeChannelMonitor).FullName, new PerContainerLifetime()); container.Register <IMonitoringTask, HeartBeatMonitor>(typeof(HeartBeatMonitor).FullName, new PerContainerLifetime()); container.Register <IMessageSerializer, NullMessageSerializer>(typeof(NullMessageSerializer).FullName, new PerContainerLifetime()); container.Register <IMessageAdapter, NullMessageAdapter>(typeof(NullMessageAdapter).FullName, new PerContainerLifetime()); container.Register <IMessageStorage, NullMessageStorage>(typeof(NullMessageStorage).FullName, new PerContainerLifetime()); container.Register <IRouterInterceptor, NullRouterInterceptor>(typeof(NullRouterInterceptor).FullName, new PerContainerLifetime()); container.Register <IPointToPointChannel, NullPointToPointChannel>(typeof(NullPointToPointChannel).FullName, new PerContainerLifetime()); container.Register <IPublishSubscribeChannel, NullPublishSubscribeChannel>(typeof(NullPublishSubscribeChannel).FullName, new PerContainerLifetime()); container.Register <IRequestReplyChannel, NullRequestReplyChannel>(typeof(NullRequestReplyChannel).FullName, new PerContainerLifetime()); container.Register <IChannelManager, NullChannelManager>(typeof(NullChannelManager).FullName, new PerContainerLifetime()); container.Register <IBusInterceptor, NullBusInterceptor>(typeof(NullBusInterceptor).FullName, new PerContainerLifetime()); container.Register <ILogger <HeartBeat>, HeartBeatLogger>(typeof(HeartBeatLogger).FullName, new PerContainerLifetime()); container.Register <ILogger <StartupBeat>, StartupBeatLogger>(typeof(StartupBeatLogger).FullName, new PerContainerLifetime()); container.Register <ILogger <ShutdownBeat>, ShutdownBeatLogger>(typeof(ShutdownBeatLogger).FullName, new PerContainerLifetime()); container.Register <ISagaStorage, NullSagaStorage>(typeof(NullSagaStorage).FullName, new PerContainerLifetime()); container.Register <IMiddleware, MessageHandler>(typeof(MessageHandler).FullName, new PerContainerLifetime()); container.Register <IMiddleware, MessageExceptionHandler>(typeof(MessageExceptionHandler).FullName, new PerContainerLifetime()); container.Register <IMiddleware, FirstMessageHandler>(typeof(FirstMessageHandler).FullName, new PerContainerLifetime()); container.Register <IMiddleware, MiddleMessageHandler>(typeof(MiddleMessageHandler).FullName, new PerContainerLifetime()); container.Register <IMiddleware, LastMessageHandler>(typeof(LastMessageHandler).FullName, new PerContainerLifetime()); container.Register <Interface.Outbound.IMiddleware, PointToPointHandler>(typeof(PointToPointHandler).FullName, new PerContainerLifetime()); container.Register <Interface.Outbound.IMiddleware, PublishSubscribeHandler>(typeof(PublishSubscribeHandler).FullName, new PerContainerLifetime()); container.Register <Interface.Outbound.IMiddleware, RequestReplyHandler>(typeof(RequestReplyHandler).FullName, new PerContainerLifetime()); container.Register <Interface.Outbound.IMiddleware, DistributionHandler>(typeof(DistributionHandler).FullName, new PerContainerLifetime()); container.Register <IValueSettingFinder, AppSettingValueSettingFinder>(typeof(AppSettingValueSettingFinder).FullName, new PerContainerLifetime()); container.Register <IValueSettingFinder, ConnectionStringValueSettingFinder>(typeof(ConnectionStringValueSettingFinder).FullName, new PerContainerLifetime()); #if NETSTANDARD2_0 container.Register <IValueSettingFinder, ConfigurationValueSettingFinder>(typeof(ConfigurationValueSettingFinder).FullName, new PerContainerLifetime()); #endif container.Register <IValueSettingFinder, NullValueSettingFinder>(typeof(NullValueSettingFinder).FullName, new PerContainerLifetime()); container.Register <IRouterConfigurationSource, EmptyRouterConfigurationSource>(typeof(EmptyRouterConfigurationSource).FullName, new PerContainerLifetime()); }
public VariableGridTest(IServiceContainer services, TestFilesFixture files) : base(services) { _files = files; _hostScript = new VariableRHostScript(Services); }
public HostBase(IServiceContainer container) { this.container = container; }
private bool updateConversionHistory(MigrationConflict conflict, ConflictResolutionRule rule, IServiceContainer serviceContainer) { if (!rule.DataFieldDictionary.ContainsKey(TfsCheckinFailureManualResolveAction.MigrationInstructionChangeId) || !rule.DataFieldDictionary.ContainsKey(TfsCheckinFailureManualResolveAction.DeltaTableChangeId)) { return(false); } ChangeGroupService changeGroupService = serviceContainer.GetService(typeof(ChangeGroupService)) as ChangeGroupService; string migrationInstructionName = rule.DataFieldDictionary[TfsCheckinFailureManualResolveAction.MigrationInstructionChangeId]; string deltaTableName = rule.DataFieldDictionary[TfsCheckinFailureManualResolveAction.DeltaTableChangeId]; string comment = rule.RuleDescription; bool result = changeGroupService.UpdateConversionHistoryAndRemovePendingChangeGroups(migrationInstructionName, deltaTableName, comment); TraceManager.TraceInformation(string.Format("Conflict of type '{0}' resolved by updating history with new change versions: Source HighWaterMark: {1}; Target HighWaterMark: {2}", conflict.ConflictType.FriendlyName, deltaTableName, migrationInstructionName)); return(result); }