Exemplo n.º 1
0
 public async Task<string> GetUrl(ImageRequest request, SystemSession session)
 {
     var serviceRequest = new Elif { FileId = request.FileId, AskWebp = request.AskWebp, IsProfilePic = request.IsProfilePicture, SizeCodes = (SizedCodes)request.SizeCode, Username = request.UserName };
     var response = await Task.Factory.StartNew(() => Client.ElifService.getUrl(serviceRequest, session.GetSession())).ConfigureAwait(false);
     //  return string.IsNullOrWhiteSpace(response) ? null : response;
     return response;
 }
Exemplo n.º 2
0
        ////public async Task<StatusData<bool>> Crop(ImageCropRequest cropRequest, SystemSession session)
        ////{
        ////    var serviceRequest = new Elif { FileId = cropRequest.FileId, AskWebp = cropRequest.AskWebp, Username = cropRequest.UserName };
        ////    var serviceCropRequest = new ElifImageCrop { Width = cropRequest.CropDetail.Width, Height = cropRequest.CropDetail.Height, Top = cropRequest.CropDetail.Top, Bottom = cropRequest.CropDetail.Bottom, Left = cropRequest.CropDetail.Left, Right = cropRequest.CropDetail.Right, SizeCodes = (SizedCodes)cropRequest.CropDetail.SizeCode };
        ////    var response = await Task.Factory.StartNew(() => Client.ElifService.doCrop(serviceRequest, serviceCropRequest, session.GetSession())).ConfigureAwait(false);
        ////    var result = new StatusData<bool> { Status = response ? SystemDbStatus.Updated : SystemDbStatus.NotModified, Data = response };
        ////    return result;
        ////}

        public async Task<StatusData<bool>> Crop(ImageCropRequest cropRequest, SystemSession session)
        {
            var result = new StatusData<bool> { Status = SystemDbStatus.Updated };
            var serviceRequest = new Elif { FileId = cropRequest.FileId, AskWebp = cropRequest.AskWebp, Username = cropRequest.UserName };
            var serviceCropRequest = new ElifImageCrop { Width = cropRequest.CropDetail.Width, Height = cropRequest.CropDetail.Height, Top = cropRequest.CropDetail.Top, Bottom = cropRequest.CropDetail.Bottom, Left = cropRequest.CropDetail.Left, Right = cropRequest.CropDetail.Right, SizeCodes = (SizedCodes)cropRequest.CropDetail.SizeCode };
            result.Data = await Task.Factory.StartNew(() => Client.ElifService.doCrop(serviceRequest, serviceCropRequest, session.GetSession())).ConfigureAwait(false);
            return result;
        }
Exemplo n.º 3
0
 public async Task<IEnumerable<ImageDetectionResponse>> GetDetection(ImageRequest request, SystemSession session)
 {
     var serviceRequest = new Elif { FileId = request.FileId, Username = request.UserName };
     var response = await Task.Factory.StartNew(() => Client.ElifService.getDetection(serviceRequest, session.GetSession())).ConfigureAwait(false);
     var result = response.Select(x => new ImageDetectionResponse
     {
         X = x.X,
         Y = x.Y,
         Height = x.Height,
         Width = x.Width
     });
     return result;
 }
Exemplo n.º 4
0
      public ElifMeta getMeta(Elif el, Session session)
      {
        #if !SILVERLIGHT
        send_getMeta(el, session);
        return recv_getMeta();

        #else
        var asyncResult = Begin_getMeta(null, null, el, session);
        return End_getMeta(asyncResult);

        #endif
      }
Exemplo n.º 5
0
 public IAsyncResult Begin_getMeta(AsyncCallback callback, object state, Elif el, Session session)
 {
   return send_getMeta(callback, state, el, session);
 }
Exemplo n.º 6
0
 public void send_doCrop(Elif el, ElifImageCrop crop, Session session)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("doCrop", TMessageType.Call, seqid_));
   doCrop_args args = new doCrop_args();
   args.El = el;
   args.Crop = crop;
   args.Session = session;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
Exemplo n.º 7
0
 public IAsyncResult send_doCrop(AsyncCallback callback, object state, Elif el, ElifImageCrop crop, Session session)
Exemplo n.º 8
0
      public bool doCrop(Elif el, ElifImageCrop crop, Session session)
      {
        #if !SILVERLIGHT
        send_doCrop(el, crop, session);
        return recv_doCrop();

        #else
        var asyncResult = Begin_doCrop(null, null, el, crop, session);
        return End_doCrop(asyncResult);

        #endif
      }
Exemplo n.º 9
0
 public IAsyncResult Begin_doCrop(AsyncCallback callback, object state, Elif el, ElifImageCrop crop, Session session)
 {
   return send_doCrop(callback, state, el, crop, session);
 }
Exemplo n.º 10
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Struct) {
           El = new Elif();
           El.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Session = new Session();
           Session.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Exemplo n.º 11
0
 public IAsyncResult send_deleteFile(AsyncCallback callback, object state, Elif el, Session session)
Exemplo n.º 12
0
      public bool deleteFile(Elif el, Session session)
      {
        #if !SILVERLIGHT
        send_deleteFile(el, session);
        return recv_deleteFile();

        #else
        var asyncResult = Begin_deleteFile(null, null, el, session);
        return End_deleteFile(asyncResult);

        #endif
      }
Exemplo n.º 13
0
 public IAsyncResult Begin_deleteFile(AsyncCallback callback, object state, Elif el, Session session)
 {
   return send_deleteFile(callback, state, el, session);
 }
Exemplo n.º 14
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.List) {
           {
             El = new List<Elif>();
             TList _list384 = iprot.ReadListBegin();
             for( int _i385 = 0; _i385 < _list384.Count; ++_i385)
             {
               Elif _elem386;
               _elem386 = new Elif();
               _elem386.Read(iprot);
               El.Add(_elem386);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Session = new Session();
           Session.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Exemplo n.º 15
0
      public string getUrl(Elif el, Session session)
      {
        #if !SILVERLIGHT
        send_getUrl(el, session);
        return recv_getUrl();

        #else
        var asyncResult = Begin_getUrl(null, null, el, session);
        return End_getUrl(asyncResult);

        #endif
      }
Exemplo n.º 16
0
 public IAsyncResult send_getMeta(AsyncCallback callback, object state, Elif el, Session session)
Exemplo n.º 17
0
 public void send_getMeta(Elif el, Session session)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("getMeta", TMessageType.Call, seqid_));
   getMeta_args args = new getMeta_args();
   args.El = el;
   args.Session = session;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
Exemplo n.º 18
0
      public List<ElifImageDetection> getDetection(Elif el, Session session)
      {
        #if !SILVERLIGHT
        send_getDetection(el, session);
        return recv_getDetection();

        #else
        var asyncResult = Begin_getDetection(null, null, el, session);
        return End_getDetection(asyncResult);

        #endif
      }