Пример #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);
        }
Пример #2
0
 private void InitHelpers(SexyContentWebPage webPage)
 {
     webPage.Html = new HtmlHelper();
     webPage.Url  = new UrlHelper(InstInfo);
     webPage.Sexy = Sexy;
     webPage.DnnAppAndDataHelpers = new DnnAppAndDataHelpers(Sexy);
 }
Пример #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);
 }
Пример #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);
        }
Пример #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);
 }