Exemplo n.º 1
0
        public void Confirm(int landId, int userId, ConfirmationSort confirmationSort, string username, string password)
        {
            client.Authenticator = new HttpBasicAuthenticator(username, password);

            var earthwatcher = new Earthwatcher { Id = userId };
            var request = new RestRequest("land/" + landId.ToString(CultureInfo.InvariantCulture) + @"/" + confirmationSort.ToString(), Method.PUT);
            request.AddBody(earthwatcher);
            request.RequestFormat = DataFormat.Json;
            client.ExecuteAsync(request, response =>
                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                    ConfirmationAdded(confirmationSort, null)
            ));
        }
Exemplo n.º 2
0
        public void Confirm(Land land, ConfirmationSort confirmationSort, string username, string password)
        {
            client.Authenticator = new HttpBasicAuthenticator(username, password);
            var landMini = new LandMini {
                LandId = land.Id, EarthwatcherId = land.EarthwatcherId.Value, Id = Current.Instance.Earthwatcher.Id, GeohexKey = land.GeohexKey
            };
            var request = new RestRequest("land/" + confirmationSort.ToString().ToLower(), Method.POST)
            {
                RequestFormat = DataFormat.Json
            };

            request.JsonSerializer = new JsonSerializer();

            request.AddBody(landMini);
            client.ExecuteAsync(request, response =>
                                Deployment.Current.Dispatcher.BeginInvoke(() =>
                                                                          ConfirmationAdded(confirmationSort, null)
                                                                          ));
        }
        public void Confirm(Land land, ConfirmationSort confirmationSort, string username, string password)
        {
            client.Authenticator = new HttpBasicAuthenticator(username, password);
            var landMini = new LandMini { LandId = land.Id, EarthwatcherId = land.EarthwatcherId.Value, Id = Current.Instance.Earthwatcher.Id, GeohexKey = land.GeohexKey };
            var request = new RestRequest("land/" + confirmationSort.ToString().ToLower(), Method.POST) { RequestFormat = DataFormat.Json };
            request.JsonSerializer = new JsonSerializer();

            request.AddBody(landMini);
            client.ExecuteAsync(request, response =>
                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                    ConfirmationAdded(confirmationSort, null)
            ));
        }
Exemplo n.º 4
0
        public void Confirm(int landId, int userId, ConfirmationSort confirmationSort, string username, string password)
        {
            client.Authenticator = new HttpBasicAuthenticator(username, password);

            var earthwatcher = new Earthwatcher {
                Id = userId
            };
            var request = new RestRequest("land/" + landId.ToString(CultureInfo.InvariantCulture) + @"/" + confirmationSort.ToString(), Method.PUT);

            request.AddBody(earthwatcher);
            request.RequestFormat = DataFormat.Json;
            client.ExecuteAsync(request, response =>
                                Deployment.Current.Dispatcher.BeginInvoke(() =>
                                                                          ConfirmationAdded(confirmationSort, null)
                                                                          ));
        }