gov.va.medora.mdws.MdwsSvc.getMdwsSessionsInMemory C# (CSharp) Method

getMdwsSessionsInMemory() private method

private getMdwsSessionsInMemory ( ) : gov.va.medora.mdws.ApplicationSessionsTO
return gov.va.medora.mdws.ApplicationSessionsTO
        public ApplicationSessionsTO getMdwsSessionsInMemory()
        {
            ApplicationSessionsTO result = new ApplicationSessionsTO();
            if (Application == null || Application.AllKeys == null || !Application.AllKeys.Contains("APPLICATION_SESSIONS"))
            {
                return result;
            }
            ApplicationSessions sessions = (ApplicationSessions)Application["APPLICATION_SESSIONS"];
            if (sessions.Sessions == null || sessions.Sessions.Count == 0)
            {
                return result;
            }

            result.sessions = new ApplicationSessionTO[sessions.Sessions.Count];
            int currentIndex = 0;
            foreach (string sessionId in sessions.Sessions.Keys)
            {
                result.sessions[currentIndex] = new ApplicationSessionTO(sessions.Sessions[sessionId]);
                currentIndex++;
            }
            return result;
        }