コード例 #1
0
        public SecurityAccount GetAccount(IdentityReference ident)
        {
            SecurityAccount ret = null;

            lock (_lock)
            {
                if (accountCache.TryGetValue(ident.Value, out ret))
                {
                    Utils.Free(ident);
                    return(ret);
                }
            }

            SecurityAccount created = factory(this, ident);

            lock (_lock)
            {
                if (accountCache.TryGetValue(ident.Value, out ret))
                {
                    Utils.Free(ident);
                    Utils.Free(created);
                    return(ret);
                }
                accountList = null;
                accountCache.Add(created.NTAccount.Value, created);
                accountCache.Add(created.Sid.Value, created);
            }
            return(created);
        }
コード例 #2
0
        public SecurityAccount GetAccount(String name)
        {
            SecurityAccount ret = null;

            lock (_lock)
            {
                if (accountCache.TryGetValue(name, out ret))
                {
                    return(ret);
                }
            }
            return(null);
        }