Esempio n. 1
0
        Value <bool> IVerify.Login(string id, string password)
        {
            var returnValue = new Value <bool>();
            var val         = _Storage.FindAccountByName(id);

            val.OnValue += account =>
            {
                var found = account != null;
                if (found && account.IsPassword(password))
                {
                    if (OnDoneEvent != null)
                    {
                        OnDoneEvent(account);
                    }

                    returnValue.SetValue(true);
                }
                else
                {
                    returnValue.SetValue(false);
                }
            };
            return(returnValue);
        }