/// <summary> /// Updates all data stored in HTTPContext.Session /// </summary> private void UpdateSessionAll() { var sessionContents = new SessionContents(HttpContext.Session); sessionContents.UpdateSessionContents(SessionConstants.MODULE_INFOS_SESSION_KEY, ModuleInfos); sessionContents.UpdateSessionContents(SessionConstants.AXIOM_INFOS_SESSION_KEY, AxiomInfos); sessionContents.UpdateSessionContents(SessionConstants.RULE_INFOS_SESSION_KEY, RuleInfos); }
/// <summary> /// Loads information from session and sets them. If session doesn't contain required information, sets default /// values instead. /// </summary> private void GetInfoFromSession() { var sessionContents = new SessionContents(HttpContext.Session); ModuleInfos = sessionContents.GetSessionContents <ModuleInfo>(SessionConstants.MODULE_INFOS_SESSION_KEY); AxiomInfos = sessionContents.GetSessionContents <AxiomInfo>(SessionConstants.AXIOM_INFOS_SESSION_KEY); RuleInfos = sessionContents.GetSessionContents <RuleInfo>(SessionConstants.RULE_INFOS_SESSION_KEY); }
private void GetSessionInfo() { var sessionContents = new SessionContents(HttpContext.Session); var modules = sessionContents.GetSessionContents <ModuleInfo>(SessionConstants.MODULE_INFOS_SESSION_KEY); _modules = new Dictionary <string, ModuleInfo>(); foreach (var module in modules) { _modules.Add(module.ModuleName, module); } _axiom = sessionContents.GetSessionContents <AxiomInfo>(SessionConstants.AXIOM_INFOS_SESSION_KEY); _rules = sessionContents.GetSessionContents <RuleInfo>(SessionConstants.RULE_INFOS_SESSION_KEY); }
/// <summary> /// Updates data which relates to ModuleInfos stored in HTTPContext.Session /// </summary> private void UpdateSessionModules() { var sessionContents = new SessionContents(HttpContext.Session); sessionContents.UpdateSessionContents(SessionConstants.MODULE_INFOS_SESSION_KEY, ModuleInfos); }