示例#1
0
 public static void Persist(PortletState state)
 {
     var requestNodePath = PortalContext.Current.ContextNodePath;
     if (requestNodePath == null)
     {
         var cbPortlet = state.Portlet as ContextBoundPortlet;
         if (cbPortlet != null)
         {
             var node = cbPortlet.ContextNode;
             if (node != null)
                 requestNodePath = node.Path;
         }
     }
     HttpContext.Current.Session[Math.Abs((requestNodePath + state.Portlet.ClientID).GetHashCode()).ToString()] = state;
 }
示例#2
0
 public static bool Restore(PortletBase portlet, out PortletState state)
 {
     var requestNodePath = PortalContext.Current.ContextNodePath;
     if (requestNodePath == null)
     {
         var cbPortlet = portlet as ContextBoundPortlet;
         if (cbPortlet != null)
         {
             var node = cbPortlet.ContextNode;
             if (node != null)
                 requestNodePath = node.Path;
         }
     }
     state = HttpContext.Current.Session[Math.Abs((requestNodePath + portlet.ClientID).GetHashCode()).ToString()] as PortletState;
     if (state != null)
         state.Portlet = portlet;
     return state != null;
 }
示例#3
0
        public static void Persist(PortletState state)
        {
            var requestNodePath = PortalContext.Current.ContextNodePath;

            if (requestNodePath == null)
            {
                var cbPortlet = state.Portlet as ContextBoundPortlet;
                if (cbPortlet != null)
                {
                    var node = cbPortlet.ContextNode;
                    if (node != null)
                    {
                        requestNodePath = node.Path;
                    }
                }
            }
            HttpContext.Current.Session[Math.Abs((requestNodePath + state.Portlet.ClientID).GetHashCode()).ToString()] = state;
        }
示例#4
0
        public static bool Restore(PortletBase portlet, out PortletState state)
        {
            var requestNodePath = PortalContext.Current.ContextNodePath;

            if (requestNodePath == null)
            {
                var cbPortlet = portlet as ContextBoundPortlet;
                if (cbPortlet != null)
                {
                    var node = cbPortlet.ContextNode;
                    if (node != null)
                    {
                        requestNodePath = node.Path;
                    }
                }
            }
            state = HttpContext.Current.Session[Math.Abs((requestNodePath + portlet.ClientID).GetHashCode()).ToString()] as PortletState;
            if (state != null)
            {
                state.Portlet = portlet;
            }
            return(state != null);
        }