Exemple #1
0
 public bool CreateImage(FullImage image)
 {
     try
     {
         using (ImageServiceClient client = new ImageServiceClient())
         {
             var item = client.PostImage(image);
             client.Close();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemple #2
0
 public void GetImage(Guid imageId, Action <FullImage, Exception> callback)
 {
     try
     {
         using (ImageServiceClient client = new ImageServiceClient())
         {
             var item = client.GetImageById(imageId);
             callback(item, null);
             client.Close();
         }
     }
     catch (Exception ex)
     {
         callback(null, ex);
     }
 }
Exemple #3
0
 public bool UpdateImage(FullImage image)
 {
     try
     {
         using (ImageServiceClient client = new ImageServiceClient())
         {
             var item = client.PutImage(image);
             client.Close();
         }
         return true;
     }
     catch (Exception ex)
     {
         return false;
     }
 }
Exemple #4
0
 public void GetImage(Guid imageId, Action<FullImage, Exception> callback)
 {
     try
     {
         using (ImageServiceClient client = new ImageServiceClient())
         {
             var item = client.GetImageById(imageId);
             callback(item, null);
             client.Close();
         }
     }
     catch (Exception ex)
     {
         callback(null, ex);
     }
 }
Exemple #5
0
        public void GetImageList(Action <ImageItem[], Exception> callback)
        {
            try
            {
                using (ImageServiceClient client = new ImageServiceClient())
                {
                    var items = client.GetImageList();
                    //var items = new ImageItem[1] { new ImageItem { _id = Guid.NewGuid(), _imageName = "test image" } };

                    callback(items, null);
                    client.Close();
                }
            }
            catch (Exception ex)
            {
                callback(null, ex);
            }
        }
Exemple #6
0
        public void GetImageList(Action<ImageItem[], Exception> callback)
        {
            try
            {
                using (ImageServiceClient client = new ImageServiceClient())
                {
                    var items = client.GetImageList();
                    //var items = new ImageItem[1] { new ImageItem { _id = Guid.NewGuid(), _imageName = "test image" } };

                    callback(items, null);
                    client.Close();
                }
            }
            catch (Exception ex)
            {
                callback(null, ex);
            }
        }