1
/* ****************************************************************************
3 * Copyright (c) Microsoft Corporation. All rights reserved.
5 * This software is subject to the Microsoft Public License (Ms-PL).
6 * A copy of the license can be found in the license.htm file included
7 * in this distribution.
9 * You must not remove this notice, or any other, from this software.
11 * ***************************************************************************/
13 namespace System
.Web
.Mvc
{
16 using System
.Collections
;
19 internal sealed class ViewTypeControlBuilder
: ControlBuilder
{
20 private string _typeName
;
22 public override void Init(TemplateParser parser
, ControlBuilder parentBuilder
, Type type
, string tagName
, string id
, IDictionary attribs
) {
23 base.Init(parser
, parentBuilder
, type
, tagName
, id
, attribs
);
25 _typeName
= (string)attribs
["typename"];
28 public override void ProcessGeneratedCode(
29 CodeCompileUnit codeCompileUnit
,
30 CodeTypeDeclaration baseType
,
31 CodeTypeDeclaration derivedType
,
32 CodeMemberMethod buildMethod
,
33 CodeMemberMethod dataBindingMethod
) {
35 // Override the view's base type with the explicit base type
36 derivedType
.BaseTypes
[0] = new CodeTypeReference(_typeName
);