Use CodeBuilderContext instead of CodeGeneratorContext.
This commit is contained in:
parent
be4a6c8d98
commit
24a12ba103
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
private readonly string _activateAttribute;
|
||||
|
||||
public InjectChunkVisitor([NotNull] CSharpCodeWriter writer,
|
||||
[NotNull] CodeGeneratorContext context,
|
||||
[NotNull] CodeBuilderContext context,
|
||||
[NotNull] string activateAttributeName)
|
||||
: base(writer, context)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
public class ModelChunkVisitor : MvcCSharpCodeVisitor
|
||||
{
|
||||
public ModelChunkVisitor([NotNull] CSharpCodeWriter writer,
|
||||
[NotNull] CodeGeneratorContext context)
|
||||
[NotNull] CodeBuilderContext context)
|
||||
: base(writer, context)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
public abstract class MvcCSharpChunkVisitor : CodeVisitor<CSharpCodeWriter>
|
||||
{
|
||||
public MvcCSharpChunkVisitor([NotNull] CSharpCodeWriter writer,
|
||||
[NotNull] CodeGeneratorContext context)
|
||||
[NotNull] CodeBuilderContext context)
|
||||
: base(writer, context)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
private readonly string _defaultModel;
|
||||
private readonly string _activateAttribute;
|
||||
|
||||
public MvcCSharpCodeBuilder([NotNull] CodeGeneratorContext context,
|
||||
public MvcCSharpCodeBuilder([NotNull] CodeBuilderContext context,
|
||||
[NotNull] string defaultModel,
|
||||
[NotNull] string activateAttribute)
|
||||
: base(context)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
public abstract class MvcCSharpCodeVisitor : MvcCSharpChunkVisitor
|
||||
{
|
||||
public MvcCSharpCodeVisitor([NotNull] CSharpCodeWriter writer,
|
||||
[NotNull] CodeGeneratorContext context)
|
||||
[NotNull] CodeBuilderContext context)
|
||||
: base(writer, context)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
|
||||
/// <inheritdoc />
|
||||
public override CodeBuilder DecorateCodeBuilder([NotNull] CodeBuilder incomingBuilder,
|
||||
[NotNull] CodeGeneratorContext context)
|
||||
[NotNull] CodeBuilderContext context)
|
||||
{
|
||||
UpdateCodeBuilder(context);
|
||||
return new MvcCSharpCodeBuilder(context, DefaultModel, ActivateAttribute);
|
||||
|
|
|
|||
|
|
@ -142,13 +142,14 @@ MyType1
|
|||
Assert.Equal(expected, code);
|
||||
}
|
||||
|
||||
private static CodeGeneratorContext CreateContext()
|
||||
private static CodeBuilderContext CreateContext()
|
||||
{
|
||||
return CodeGeneratorContext.Create(new MvcRazorHost(new TestFileSystem()),
|
||||
"MyClass",
|
||||
"MyNamespace",
|
||||
string.Empty,
|
||||
shouldGenerateLinePragmas: true);
|
||||
return new CodeBuilderContext(
|
||||
new CodeGeneratorContext(new MvcRazorHost(new TestFileSystem()),
|
||||
"MyClass",
|
||||
"MyNamespace",
|
||||
string.Empty,
|
||||
shouldGenerateLinePragmas: true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -98,13 +98,14 @@ Environment.NewLine +
|
|||
Assert.Equal(expected, code);
|
||||
}
|
||||
|
||||
private static CodeGeneratorContext CreateContext()
|
||||
private static CodeBuilderContext CreateContext()
|
||||
{
|
||||
return CodeGeneratorContext.Create(new MvcRazorHost(new TestFileSystem()),
|
||||
"MyClass",
|
||||
"MyNamespace",
|
||||
string.Empty,
|
||||
shouldGenerateLinePragmas: true);
|
||||
return new CodeBuilderContext(
|
||||
new CodeGeneratorContext(new MvcRazorHost(new TestFileSystem()),
|
||||
"MyClass",
|
||||
"MyNamespace",
|
||||
string.Empty,
|
||||
shouldGenerateLinePragmas: true));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue