Пример #1
0
 public void Multiple()
 {
     var service = new CreateTagService
                       {
                           RequestBuilder = ServerRequestBuilder.Instance
                       };
     var request = new CreateTagRequest {Tag = "tag1"};
     service.Execute(request, response => Debug.WriteLine("Success"), ExceptionHandler.Handle);
 }
Пример #2
0
 public void Execute(CreateTagRequest request, Action<CreateTagResponse> responseCallback, Action<Exception> exceptionCallback)
 {
     var webRequest = RequestBuilder.Build("https://go.urbanairship.com/api/tags/" + request.Tag);
     webRequest.Method = "PUT";
     var asyncRequest = new AsyncRequest
     {
         Request = webRequest,
         ReadFromResponse = o => responseCallback(new CreateTagResponse()),
         ExceptionCallback = exceptionCallback,
     };
     asyncRequest.Execute();
 }
        public void Tags()
        {
            var service = new CreateTagService
                              {
                                  RequestBuilder = RequestBuilderHelper.Build()
                              };

            var asyncTestHelper = new AsyncTestHelper();
            var request = new CreateTagRequest {Tag = "myTag"};
            service.Execute(request, response => asyncTestHelper.Callback(null), asyncTestHelper.HandleException);
            asyncTestHelper.Wait();
        }
Пример #4
0
        public void Execute(CreateTagRequest request, Action <CreateTagResponse> responseCallback, Action <Exception> exceptionCallback)
        {
            var webRequest = RequestBuilder.Build("https://go.urbanairship.com/api/tags/" + request.Tag);

            webRequest.Method = "PUT";
            var asyncRequest = new AsyncRequest
            {
                Request           = webRequest,
                ReadFromResponse  = o => responseCallback(new CreateTagResponse()),
                ExceptionCallback = exceptionCallback,
            };

            asyncRequest.Execute();
        }