// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.CodeDom;
using System.Collections.Generic;
using System.Web.Razor.Generator;
using System.Web.Razor.Parser.SyntaxTree;
namespace System.Web.Razor
{
///
/// Represents results from code generation (and parsing, since that is a pre-requisite of code generation)
///
///
/// Since this inherits from ParserResults, it has all the data from ParserResults, and simply adds code generation data
///
public class GeneratorResults : ParserResults
{
public GeneratorResults(ParserResults parserResults,
CodeCompileUnit generatedCode,
IDictionary designTimeLineMappings)
: this(parserResults.Document, parserResults.ParserErrors, generatedCode, designTimeLineMappings)
{
}
public GeneratorResults(Block document,
IList parserErrors,
CodeCompileUnit generatedCode,
IDictionary designTimeLineMappings)
: this(parserErrors.Count == 0, document, parserErrors, generatedCode, designTimeLineMappings)
{
}
protected GeneratorResults(bool success,
Block document,
IList parserErrors,
CodeCompileUnit generatedCode,
IDictionary designTimeLineMappings)
: base(success, document, parserErrors)
{
GeneratedCode = generatedCode;
DesignTimeLineMappings = designTimeLineMappings;
}
///
/// The generated code
///
public CodeCompileUnit GeneratedCode { get; private set; }
///
/// If design-time mode was used in the Code Generator, this will contain the dictionary
/// of design-time generated code mappings
///
public IDictionary DesignTimeLineMappings { get; private set; }
}
}