/// <summary> /// gets the specified session by its IP, implements a multiton design pattern for the Session class /// </summary> /// <param name="_ip">the ip address of the session</param> /// <returns>the retrieved sessions</returns> public static Session GetSessionByIP(string _ip) { if (sessions.Contains(_ip)) { return (Session)sessions[_ip]; } Session session = new Session(_ip); sessions.Add(_ip, session); Shell.AddLogEntry("New session from " + _ip, true); return session; }