예제 #1
0
        public static ViewRenderer Create(PortalView view, PortalMasterView master = null)
        {
            Argument.Assert.IsNotNull(view, nameof(view));

            portalScript = view.PortalScript;
            portalStyle  = view.PortalStyle;

            ViewRenderer renderer = new ViewRenderer();

            renderer.InitializeIndexes(renderer.RenderBaseHtml(view));

            return(renderer);
        }
예제 #2
0
        private void ApplyTemplate()
        {
            viewTemplate = PortalControlFactory.LoadTemplate("~/Views/Templates/" + ViewTemplate + ".ascx");
            if (viewTemplate == null)
            {
                return;
            }

            while (Controls.Count > 0)
            {
                MoveControlsToTemplate();
            }

            Controls.Add(viewTemplate);
        }
예제 #3
0
        private static PortalMasterView CreateMasterPrivate(string virtualPath)
        {
            Control          control = Loader.LoadControl(virtualPath);
            PortalMasterView master  = control as PortalMasterView;

            if (master == null)
            {
                PartialCachingControl pcc = control as PartialCachingControl;
                if (pcc != null)
                {
                    master = pcc.CachedControl as PortalMasterView;
                }
            }
            if (master == null)
            {
                throw new ArgumentException("The control '" + virtualPath + "' is not of type '" + typeof(PortalMasterView).Name + "'.", "path");
            }

            return(master);
        }