-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathScriptPack.cs
More file actions
43 lines (37 loc) · 1.21 KB
/
ScriptPack.cs
File metadata and controls
43 lines (37 loc) · 1.21 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.ComponentModel.Composition;
using System.Linq;
using ScriptCs.Contracts;
namespace ScriptCs.WebApi
{
public class ScriptPack : IScriptPack
{
private readonly ILog _logger;
private readonly IControllerTypeManager _typeManager;
[ImportingConstructor]
public ScriptPack(ScriptCs.Contracts.ILogProvider loggerProvider, IControllerTypeManager typeManager)
{
_logger = loggerProvider.ForCurrentType();
_typeManager = typeManager;
}
IScriptPackContext IScriptPack.GetContext()
{
return new WebApi(_logger, _typeManager);
}
void IScriptPack.Initialize(IScriptPackSession session)
{
session.AddReference("System.Net.Http");
var namespaces = new[]
{
"System.Web.Http",
"System.Web.Http.Routing",
"System.Net.Http",
"System.Net.Http.Headers",
"Owin"
}.ToList();
namespaces.ForEach(session.ImportNamespace);
}
void IScriptPack.Terminate()
{
}
}
}