// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Razor.Generator;
using Microsoft.AspNet.Razor.Generator.Compiler;
using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
using Microsoft.AspNet.Razor.Parser;
#if NET45
#endif
namespace Microsoft.AspNet.Razor
{
///
/// Defines the C# Code Language for Razor
///
public class CSharpRazorCodeLanguage : RazorCodeLanguage
{
private const string CSharpLanguageName = "csharp";
///
/// Returns the name of the language: "csharp"
///
public override string LanguageName
{
get { return CSharpLanguageName; }
}
///
/// Constructs a new instance of the code parser for this language
///
public override ParserBase CreateCodeParser()
{
return new CSharpCodeParser();
}
///
/// Constructs a new instance of the code generator for this language with the specified settings
///
public override RazorCodeGenerator CreateCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host)
{
return new CSharpRazorCodeGenerator(className, rootNamespaceName, sourceFileName, host);
}
public override CodeBuilder CreateCodeBuilder(CodeGeneratorContext context)
{
return new CSharpCodeBuilder(context);
}
}
}