日期:2014-05-20 浏览次数:20710 次
public class Globle
{
public class Globle
{
public static Dictionary<string, AppSession> sessionDict = new Dictionary<string, AppSession>();
public static Dictionary<int, List<string>> companyDataDict = new Dictionary<int, List<string>>();
}
}
public class B
{
public void RegisterNewSession(AppSession session)
{
if (Globle.sessionDict.ContainsKey(session.user.UserID))
return;
lock (obj_1)
{
Globle.sessionDict.Add(session.user.UserID, session);
if (Globle.companyDataDict.Keys.Contains(session.user.CompanyID))
{
Globle.companyDataDict[session.user.CompanyID].Add(session.user.UserID);
}
}
}
}