Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ViewStartPage.cs « System.Web.Mvc « src - github.com/mono/aspnetwebstack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 437943c1e8aacc29235ce99671f9c46e0bdbc2e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.Web.Mvc.Properties;
using System.Web.WebPages;

namespace System.Web.Mvc
{
    public abstract class ViewStartPage : StartPage, IViewStartPageChild
    {
        private IViewStartPageChild _viewStartPageChild;

        public HtmlHelper<object> Html
        {
            get { return ViewStartPageChild.Html; }
        }

        public UrlHelper Url
        {
            get { return ViewStartPageChild.Url; }
        }

        public ViewContext ViewContext
        {
            get { return ViewStartPageChild.ViewContext; }
        }

        internal IViewStartPageChild ViewStartPageChild
        {
            get
            {
                if (_viewStartPageChild == null)
                {
                    IViewStartPageChild child = ChildPage as IViewStartPageChild;
                    if (child == null)
                    {
                        throw new InvalidOperationException(MvcResources.ViewStartPage_RequiresMvcRazorView);
                    }
                    _viewStartPageChild = child;
                }

                return _viewStartPageChild;
            }
        }
    }
}