Ejemplo 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);
            }
        }
Ejemplo n.º 2
0
 public AutoLogin(IServerReader serverReader, IUrlBuilder webAddress, UserDeserializer userDeserializer)
 {
     ServerReader     = serverReader;
     WebAddress       = webAddress;
     UserDeserializer = userDeserializer;
 }