예제 #1
0
 public void SaveToPhotosAlbum(Action <NSError> callback = null)
 {
     if (callback == null)
     {
         UIImageWriteToSavedPhotosAlbum(Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
     }
     else
     {
         UIImageDispatcher dispatcher = new UIImageDispatcher(callback);
         Callbacks.Subscribe(dispatcher, "__onSaveToPhotoAlbum:", delegate(IntPtr obj, IntPtr e, IntPtr ctx)
         {
             callback((e == IntPtr.Zero) ? null : Runtime.GetNSObject <NSError>(e));
             dispatcher.Dispose();
         });
         UIImageWriteToSavedPhotosAlbum(Handle, dispatcher.Handle, ObjC.GetSelector("__onSaveToPhotoAlbum:"), IntPtr.Zero);
     }
 }
예제 #2
0
파일: UIImage.cs 프로젝트: aws/aws-sdk-net
 public void SaveToPhotosAlbum(Action<NSError> callback = null)
 {
     if (callback == null)
     {
         UIImageWriteToSavedPhotosAlbum(Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
     }
     else
     {
         var dispatcher = new UIImageDispatcher(callback);
         Callbacks.Subscribe(dispatcher, SelectorName, (IntPtr obj, IntPtr e, IntPtr ctx) =>
         {
             callback(e == IntPtr.Zero ? null : Runtime.GetNSObject<NSError>(e));
             dispatcher.Dispose();
         });
         UIImageWriteToSavedPhotosAlbum(Handle, dispatcher.Handle, ObjC.GetSelector(SelectorName), IntPtr.Zero);
     }
 }