-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathScriptPack.cs
More file actions
47 lines (39 loc) · 1.29 KB
/
ScriptPack.cs
File metadata and controls
47 lines (39 loc) · 1.29 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
44
45
46
47
using System.Collections.Generic;
using ScriptCs.Contracts;
namespace ScriptCs.Wpf
{
public class ScriptPack : IScriptPack
{
public void Initialize(IScriptPackSession session)
{
var references = new List<string>
{
"WindowsBase",
"PresentationCore",
"PresentationFramework",
"System.Xaml",
"System.Xml"
};
references.ForEach(session.AddReference);
var namespaces = new List<string>
{
"System.ComponentModel",
"System.Diagnostics",
"System.Threading",
"System.Windows",
"System.Windows.Input"
};
namespaces.ForEach(session.ImportNamespace);
}
public IScriptPackContext GetContext()
{
var fileSystem = new FileSystem();
var threadManager = new ThreadManager();
var xamlLoader = new XamlLoader(fileSystem);
var viewLocator = new ViewLocator(fileSystem);
var applicationLauncher = new ApplicationLauncher();
return new Wpf(applicationLauncher, viewLocator, xamlLoader, threadManager);
}
public void Terminate() { }
}
}