예제 #1
0
        public IResponse ImageDelete(DisplayType display)
        {
            try
            {
                string result = _client.Delete(new Uri(DisplayEndpoint.Image(display), UriKind.Relative), null);
                DisplayImageResponse imageResponse = JsonConvert.DeserializeObject <DisplayImageResponse>(result);

                IResponse response = null;

                if (imageResponse.Success)
                {
                    response = new DisplayImageResponse();
                }
                else
                {
                    response = Utils.ErrorResponse(result);
                }

                return(response);
            }
            catch
            {
                throw;
            }
        }
예제 #2
0
        public IResponse ImageUpload(DisplayType display, byte[] gifImageData)
        {
            try
            {
                string result = _client.Put(new Uri(DisplayEndpoint.Image(display), UriKind.Relative), gifImageData);
                DisplayImageResponseJson imageResponse = JsonConvert.DeserializeObject <DisplayImageResponseJson>(result);

                IResponse respone = null;

                if (imageResponse.Success)
                {
                    respone = new DisplayImageResponse();
                }
                else
                {
                    respone = Utils.ErrorResponse(result);
                }

                return(respone);
            }
            catch
            {
                throw;
            }
        }