~ubuntu-branches/ubuntu/lucid/mono/lucid

« back to all changes in this revision

Viewing changes to mcs/class/System.Web.Mvc/System.Web.Mvc/ViewMasterPage.cs

  • Committer: Bazaar Package Importer
  • Author(s): Mirco Bauer
  • Date: 2009-07-30 19:35:10 UTC
  • mto: (5.2.2 squeeze)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20090730193510-cdttfvqokq2kmdvh
Tags: upstream-2.4.2.3+dfsg
Import upstream version 2.4.2.3+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ****************************************************************************
 
2
 *
 
3
 * Copyright (c) Microsoft Corporation. All rights reserved.
 
4
 *
 
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.
 
8
 *
 
9
 * You must not remove this notice, or any other, from this software.
 
10
 *
 
11
 * ***************************************************************************/
 
12
 
 
13
namespace System.Web.Mvc {
 
14
    using System.Globalization;
 
15
    using System.Web.Mvc.Resources;
 
16
    using System.Web.UI;
 
17
 
 
18
    public class ViewMasterPage : MasterPage {
 
19
        public AjaxHelper Ajax {
 
20
            get {
 
21
                return ViewPage.Ajax;
 
22
            }
 
23
        }
 
24
 
 
25
        public HtmlHelper Html {
 
26
            get {
 
27
                return ViewPage.Html;
 
28
            }
 
29
        }
 
30
 
 
31
        public object Model {
 
32
            get {
 
33
                return ViewData.Model;
 
34
            }
 
35
        }
 
36
 
 
37
        public TempDataDictionary TempData {
 
38
            get {
 
39
                return ViewPage.TempData;
 
40
            }
 
41
        }
 
42
 
 
43
        public UrlHelper Url {
 
44
            get {
 
45
                return ViewPage.Url;
 
46
            }
 
47
        }
 
48
 
 
49
        public ViewContext ViewContext {
 
50
            get {
 
51
                return ViewPage.ViewContext;
 
52
            }
 
53
        }
 
54
 
 
55
        public ViewDataDictionary ViewData {
 
56
            get {
 
57
                return ViewPage.ViewData;
 
58
            }
 
59
        }
 
60
 
 
61
        internal ViewPage ViewPage {
 
62
            get {
 
63
                ViewPage viewPage = Page as ViewPage;
 
64
                if (viewPage == null) {
 
65
                    throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, MvcResources.ViewMasterPage_RequiresViewPage));
 
66
                }
 
67
                return viewPage;
 
68
            }
 
69
        }
 
70
 
 
71
        public HtmlTextWriter Writer {
 
72
            get {
 
73
                return ViewPage.Writer;
 
74
            }
 
75
        }
 
76
    }
 
77
}