private static void InitializeView(PortalView view) { IPortalContext context = PortalContext.Current; IViewResult result = context.Request.Result as IViewResult; if (result == null) { return; } view.ViewData = context.Request.Result.ViewData; view.InitializeContext(PortalContext.Current); }
private IHttpHandler GetPortalHandler(HttpContext context, string requestType, string virtualPath, string path) { IHttpHandler handler = base.GetHandler(context, requestType, virtualPath, path); PortalTrace.Write("PortalViewFactory", "GetHandler", "End base.GetHandler"); PortalView view = handler as PortalView; PortalTrace.WriteIf(view == null, "PortalViewFactory", "GetHandler", "'{0}' is not a portal view. Skipping initialization.", virtualPath); if (view != null) { PortalTrace.Write("PortalViewFactory", "GetHandler", "Initializing portal view for '{0}'", virtualPath); InitializeView(view); } return(handler); }
// Use this for initialization void Start() { cam = GetComponent <Camera>(); pv = portalEntry.GetComponent <PortalView>(); }