示例#1
0
        public virtual IUserClient Login(string username, string password)
        {
            IUserClient user;

            if (!string.IsNullOrWhiteSpace(username))
            {
                if (accounts.TryGetValue(username.ToLowerInvariant(), out user))
                {
                    return(user);
                }

                if (AutoCreateAccounts)
                {
                    var newAccount = new FeenAccount(username.ToLowerInvariant(), textInfo.ToTitleCase(username));
                    accounts.Add(newAccount.Username, newAccount);
                    return(newAccount);
                }
            }
            return(null);
        }
示例#2
0
        public virtual IUserClient Login(string username, string password)
        {
            IUserClient user;

            if (!string.IsNullOrWhiteSpace(username))
            {
                if (accounts.TryGetValue(username.ToLowerInvariant(), out user))
                    return user;

                if (AutoCreateAccounts)
                {
                    var newAccount = new FeenAccount(username.ToLowerInvariant(), textInfo.ToTitleCase(username));
                    accounts.Add(newAccount.Username, newAccount);
                    return newAccount;
                }
            }
            return null;
        }