Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ((UserSession)HttpContext.Current.Session["UserSession"]).User.Info
- IHost.User.Info
- ((UserSession) DualContext.Current["UserSession"]).User.Info
- public class DualContext
- {
- private Dictionary<string, object> winFormsSession = new Dictionary<string, object>();
- private static readonly DualContext instance = new DualContext();
- public static DualContext Current
- {
- get { return instance; }
- }
- public object this[string key]
- {
- get
- {
- if (HttpContext.Current != null)
- return HttpContext.Current.Session[key];
- else
- return winFormsSession[key];
- }
- set
- {
- if (HttpContext.Current != null)
- HttpContext.Current.Session[key] = value;
- else
- winFormsSession[key] = value;
- }
- }
- }
Add Comment
Please, Sign In to add comment