Esempio n. 1
0
        private void ProcessResults(WaitableTask <User> result, TaskResult <string> serverResult)
        {
            if (serverResult.IsError() || string.IsNullOrWhiteSpace(serverResult.Value))
            {
                result.SetError(serverResult.Exception);
                return;
            }

            var user = UserDeserializer.Deserialize(serverResult.Value);

            if (user == null)
            {
                result.SetError(new Exception($"Could not parse user: {serverResult.Value}"));
            }
            else
            {
                result.SetResult(user);
            }
        }
Esempio n. 2
0
 public AutoLogin(IServerReader serverReader, IUrlBuilder webAddress, UserDeserializer userDeserializer)
 {
     ServerReader     = serverReader;
     WebAddress       = webAddress;
     UserDeserializer = userDeserializer;
 }