blob: c1579330be17481f05c7656a48ee78d683a3aea7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// 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.
namespace WixToolset.Core.ExtensionCache
{
using System;
using System.Collections.Generic;
using WixToolset.Extensibility.Services;
public static class WixToolsetCoreServiceProviderExtensions
{
public static IWixToolsetCoreServiceProvider AddExtensionCacheManager(this IWixToolsetCoreServiceProvider serviceProvider)
{
var extensionManager = serviceProvider.GetService<IExtensionManager>();
extensionManager.Add(typeof(ExtensionCacheManagerExtensionFactory).Assembly);
serviceProvider.AddService(CreateExtensionCacheManager);
return serviceProvider;
}
private static ExtensionCacheManager CreateExtensionCacheManager(IWixToolsetCoreServiceProvider provider, Dictionary<Type, object> singletons)
{
var extensionCacheManager = new ExtensionCacheManager();
singletons.Add(typeof(ExtensionCacheManager), extensionCacheManager);
return extensionCacheManager;
}
}
}
|