Exemplo n.º 1
0
        private void InitWebpage()
        {
            if (string.IsNullOrEmpty(TemplatePath))
            {
                return;
            }

            var objectValue = RuntimeHelpers.GetObjectValue(CreateWebPageInstance());

            // ReSharper disable once JoinNullCheckWithUsage
            if (objectValue == null)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "The webpage found at '{0}' was not created.", TemplatePath));
            }

            Webpage = objectValue as SexyContentWebPage;

            if ((Webpage == null))
            {
                throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "The webpage at '{0}' must derive from SexyContentWebPage.", TemplatePath));
            }

            Webpage.Context         = HttpContext;
            Webpage.VirtualPath     = TemplatePath;
            Webpage.InstancePurpose = InstancePurposes;
            InitHelpers(Webpage);
        }
Exemplo n.º 2
0
 private void InitHelpers(SexyContentWebPage webPage)
 {
     webPage.Html = new HtmlHelper();
     webPage.Url  = new UrlHelper(InstInfo);
     webPage.Sexy = Sexy;
     webPage.DnnAppAndDataHelpers = new DnnAppAndDataHelpers(Sexy);
 }
Exemplo n.º 3
0
 private void InitHelpers(SexyContentWebPage webPage)
 {
     webPage.Html = new HtmlHelper();
     webPage.Url  = new UrlHelper(ModuleInfo);
     webPage.Sexy = Sexy;
     webPage.AppAndDataHelpers = new AppAndDataHelpers(Sexy);//, ModuleInfo, (ViewDataSource)DataSource);//, App);
 }
Exemplo n.º 4
0
        private void InitWebpage()
        {
            if (string.IsNullOrEmpty(TemplatePath)) return;

            var objectValue = RuntimeHelpers.GetObjectValue(CreateWebPageInstance());
            if ((objectValue == null))
                throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "The webpage found at '{0}' was not created.", new object[] { TemplatePath }));

            Webpage = objectValue as SexyContentWebPage;

            if ((Webpage == null))
                throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "The webpage at '{0}' must derive from SexyContentWebPage.", new object[] { TemplatePath }));

            Webpage.Context = HttpContext;
            Webpage.VirtualPath = TemplatePath;
            Webpage.InstancePurpose = InstancePurposes;
            InitHelpers(Webpage);
        }
Exemplo n.º 5
0
 private void InitHelpers(SexyContentWebPage webPage)
 {
     webPage.Html = new HtmlHelper();
     webPage.Url = new UrlHelper(ModuleInfo);
     webPage.Sexy = Sexy;
     webPage.AppAndDataHelpers = new AppAndDataHelpers(Sexy);//, ModuleInfo, (ViewDataSource)DataSource);//, App);
 }