private Sid GetSidFromCache(string role) { Sid sid = null; if (s_sidCache != null) { lock (s_cacheLock) { Sid cachedsid = (Sid)s_sidCache[role.ToUpper()]; if (cachedsid != null) { sid = cachedsid.Copy(); } } } return(sid); }
private void AddSidToCache(string role, Sid sid) { if (s_sidCache == null) { lock (s_cacheLock) { if (s_sidCache == null) { s_sidCache = new SidCache(); } } } lock (s_cacheLock) { if (!s_sidCache.Contains(role)) { s_sidCache.Add(role.ToUpper(), sid.Copy()); } } }