public override void OnEvent(FileObserverEvents ev, string path)
 {
     Log.Debug(Tag, "UploadFileObserver: OnEvent " + ev + " " + path);
     if ((ev & FileObserverEvents.CloseWrite) != 0)
     {
         string screenshotFile = this.ssFolder + sep + path;
         Log.Debug(Tag, "UploadFileObserver: OnEvent " + ev + " at " + screenshotFile);
         if (!(new Java.IO.File(screenshotFile)).Exists())
         {
             return;
         }
         Log.Debug(Tag, "UploadFileObserver: OnEvent " + ev + " " + path + " started bitmapping");
         SmartPrintScreen.Upload(this.service, screenshotFile);
     }
 }
 public override void OnChange(bool selfChange, Android.Net.Uri uri)
 {
     lock (locker) {
         base.OnChange(selfChange, uri);
         if (uri.ToString().Contains(MediaStore.Images.Media.ExternalContentUri.ToString()))
         {
             ICursor cursor = null;
             try {
                 cursor = contentResolver.Query(uri, new string[] {
                     MediaStore.Images.Media.InterfaceConsts.DisplayName,
                     MediaStore.Images.Media.InterfaceConsts.Data,
                     MediaStore.Images.Media.InterfaceConsts.DateAdded,
                 }, null, null, null);
                 if (cursor != null && cursor.MoveToFirst())
                 {
                     long now = Java.Lang.JavaSystem.CurrentTimeMillis() / 1000;
                     do
                     {
                         string fileName  = cursor.GetString(cursor.GetColumnIndex(MediaStore.Images.Media.InterfaceConsts.DisplayName));
                         string path      = cursor.GetString(cursor.GetColumnIndex(MediaStore.Images.Media.InterfaceConsts.Data));
                         long   dateAdded = cursor.GetLong(cursor.GetColumnIndex(MediaStore.Images.Media.InterfaceConsts.DateAdded));
                         if ((now - dateAdded) < 3 &&
                             this.lastUploadingFileName != fileName &&
                             fileName.ToLowerInvariant().Contains("screenshot"))
                         {
                             this.lastUploadingFileName = fileName;
                             SmartPrintScreen.Upload(this.service, path);
                             break;
                         }
                     } while (cursor.MoveToNext());
                 }
             } finally {
                 if (cursor != null)
                 {
                     cursor.Close();
                     cursor.Dispose();
                 }
             }
         }
     }
 }