forked from Azhaguthasan/TypescriptCodeDom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKnockoutTypescriptCodeProvider.cs
More file actions
31 lines (27 loc) · 1.29 KB
/
KnockoutTypescriptCodeProvider.cs
File metadata and controls
31 lines (27 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
using System;
using System.CodeDom.Compiler;
using Microsoft.Practices.Unity;
namespace TypescriptCodeDom
{
public class KnockoutTypescriptCodeProvider : CodeDomProvider
{
private readonly ICodeGenerator _codeGenerator;
public KnockoutTypescriptCodeProvider()
{
var unity = new UnityContainer();
var startup = new KnockoutStartup(unity);
startup.Initialize();
_codeGenerator = unity.Resolve<ICodeGenerator>();
}
[Obsolete("Callers should not use the ICodeGenerator interface and should instead use the methods directly on the CodeDomProvider class. Those inheriting from CodeDomProvider must still implement this interface, and should exclude this warning or also obsolete this method.")]
public override ICodeGenerator CreateGenerator()
{
return _codeGenerator;
}
[Obsolete("Callers should not use the ICodeCompiler interface and should instead use the methods directly on the CodeDomProvider class. Those inheriting from CodeDomProvider must still implement this interface, and should exclude this warning or also obsolete this method.")]
public override ICodeCompiler CreateCompiler()
{
throw new NotImplementedException();
}
}
}