main
cs 34 lines 1.65 KB
Raw
1 // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3 namespace WixToolset.Extensibility.Services
4 {
5 using System;
6 using System.Collections.Generic;
7
8 /// <summary>
9 /// The core of the service provider used to add services to the service provider.
10 /// </summary>
11 public interface IWixToolsetCoreServiceProvider : IServiceProvider
12 {
13 /// <summary>
14 /// Adds a service to the service locator.
15 /// </summary>
16 /// <param name="serviceType">Type of the service to add.</param>
17 /// <param name="creationFunction">
18 /// A function that creates the service. The create function is provided the service provider
19 /// itself to resolve additional services and a type dictionary that stores singleton services
20 /// the creation function can add its service to.
21 /// </param>
22 void AddService(Type serviceType, Func<IWixToolsetCoreServiceProvider, Dictionary<Type, object>, object> creationFunction);
23
24 /// <summary>
25 /// Adds a service to the service locator.
26 /// </summary>
27 /// <param name="creationFunction">
28 /// A function that creates the service. The create function is provided the service provider
29 /// itself to resolve additional services and a type dictionary that stores singleton services
30 /// the creation function can add its service to.
31 /// </param>
32 void AddService<T>(Func<IWixToolsetCoreServiceProvider, Dictionary<Type, object>, T> creationFunction) where T : class;
33 }
34 }