2010-06-21 Marek Habersack <mhabersack@novell.com>
[mcs.git] / class / System.Web.Mvc / System.Web.Mvc / ViewTypeControlBuilder.cs
blob0a306530ff33972cde0f3d656684426e1f8b895b
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 {
14 using System;
15 using System.CodeDom;
16 using System.Collections;
17 using System.Web.UI;
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);