Exemplo n.º 1
0
        internal void UpdatePictureInternal(PicturePublic picture, string newComment, string newAppTag, Action <BuddyCallResult <bool> > callback)
        {
            if (picture == null)
            {
                throw new ArgumentNullException("picture");
            }

            this.Client.Service.Pictures_VirtualAlbum_UpdatePhoto(this.Client.AppName, this.Client.AppPassword, this.AuthUser.Token, picture.PhotoID.ToString(),
                                                                  newComment == null ? "" : newComment, newAppTag == null ? "" : newAppTag, (bcr) =>
            {
                var result = bcr.Result;
                if (bcr.Error != BuddyError.None && bcr.Error != BuddyError.ServiceErrorNegativeOne)
                {
                    callback(BuddyResultCreator.Create(default(bool), bcr.Error));
                    return;
                }
                callback(BuddyResultCreator.Create(result == "1", BuddyError.None));
            });
            return;
        }
Exemplo n.º 2
0
        internal void AddPictureInternal(PicturePublic picture, Action <BuddyCallResult <long> > callback)
        {
            if (picture == null)
            {
                throw new ArgumentNullException("picture");
            }

            this.Client.Service.Pictures_VirtualAlbum_AddPhoto(this.Client.AppName, this.Client.AppPassword, this.AuthUser.Token, this.ID.ToString(),
                                                               picture.PhotoID.ToString(), (bcr) =>
            {
                if (bcr.Error != BuddyError.None)
                {
                    callback(BuddyResultCreator.Create((long)-1, bcr.Error));
                    return;
                }
                {
                    callback(BuddyResultCreator.Create(long.Parse(bcr.Result), bcr.Error));
                    return;
                }
                ;
            });
            return;
        }
Exemplo n.º 3
0
        internal void UpdatePictureInternal (PicturePublic picture, string newComment, string newAppTag, Action<BuddyCallResult<bool>> callback)
        {
            if (picture == null)
                throw new ArgumentNullException ("picture");

            this.Client.Service.Pictures_VirtualAlbum_UpdatePhoto (this.Client.AppName, this.Client.AppPassword, this.AuthUser.Token, picture.PhotoID.ToString (),
                        newComment == null ? "" : newComment, newAppTag == null ? "" : newAppTag, (bcr) =>
            {
                var result = bcr.Result;
                if (bcr.Error != BuddyError.None && bcr.Error != BuddyError.ServiceErrorNegativeOne) {
                    callback (BuddyResultCreator.Create (default(bool), bcr.Error));
                    return;
                }
                callback (BuddyResultCreator.Create (result == "1", BuddyError.None));
            });
            return;
        }
Exemplo n.º 4
0
 public IAsyncResult UpdatePictureAsync (Action<bool, BuddyCallbackParams> callback, PicturePublic picture, string newComment, string newAppTag = "", object state = null)
 {
     UpdatePictureInternal (picture, newComment, newAppTag, (bcr) => {
         if (callback == null)
             return;
         callback (bcr.Result, new BuddyCallbackParams (bcr.Error)); });
     return null;
 }
Exemplo n.º 5
0
 public IAsyncResult RemovePictureAsync (Action<bool, BuddyCallbackParams> callback, PicturePublic picture, object state = null)
 {
     RemovePictureInternal (picture, (bcr) => {
         if (callback == null)
             return;
         callback (bcr.Result, new BuddyCallbackParams (bcr.Error)); });
     return null;
 }
Exemplo n.º 6
0
        internal void AddPictureInternal (PicturePublic picture, Action<BuddyCallResult<bool>> callback)
        {
            if (picture == null)
                throw new ArgumentNullException ("picture");

            this.Client.Service.Pictures_VirtualAlbum_AddPhoto (this.Client.AppName, this.Client.AppPassword, this.AuthUser.Token, this.ID.ToString (),
                        picture.PhotoID.ToString (), (bcr) =>
            {
                if (bcr.Error != BuddyError.None) {
                    callback (BuddyResultCreator.Create (default(bool), bcr.Error));
                    return;
                }
                {
                    callback (BuddyResultCreator.Create (true, bcr.Error));
                    return; }
                ;
            });
            return;
        }
Exemplo n.º 7
0
 public IAsyncResult UpdatePictureAsync(Action <bool, BuddyCallbackParams> callback, PicturePublic picture, string newComment, string newAppTag = "", object state = null)
 {
     UpdatePictureInternal(picture, newComment, newAppTag, (bcr) => {
         if (callback == null)
         {
             return;
         }
         callback(bcr.Result, new BuddyCallbackParams(bcr.Error));
     });
     return(null);
 }
Exemplo n.º 8
0
 public IAsyncResult RemovePictureAsync(Action <bool, BuddyCallbackParams> callback, PicturePublic picture, object state = null)
 {
     RemovePictureInternal(picture, (bcr) => {
         if (callback == null)
         {
             return;
         }
         callback(bcr.Result, new BuddyCallbackParams(bcr.Error));
     });
     return(null);
 }
        internal void SetProfilePhotoInternal (PicturePublic picture, Action<BuddyCallResult<bool>> callback)
        {
            if (picture == null)
                throw new ArgumentNullException ("picture");

            this.Client.Service.Pictures_ProfilePhoto_Set (this.Client.AppName, this.Client.AppPassword, this.Token, picture.PhotoID.ToString (), (bcr) =>
            {
                var result = bcr.Result;
                if (bcr.Error != BuddyError.None && bcr.Error != BuddyError.ServiceErrorNegativeOne) {
                    callback (BuddyResultCreator.Create (default(bool), bcr.Error));
                    return;
                }
                callback (BuddyResultCreator.Create (result == "1", BuddyError.None));
            });
            return;

        }
 public IAsyncResult DeleteProfilePhotoAsync (Action<bool, BuddyCallbackParams> callback, PicturePublic picture, object state = null)
 {
     DeleteProfilePhotoInternal (picture, (bcr) => {
         if (callback == null)
             return;
         callback (bcr.Result, new BuddyCallbackParams (bcr.Error)); });
     return null;
 }