예제 #1
0
        private void OpenFileViewer(FileEntry entry)
        {
            var tempDir = TempDir();

            var pathName = System.IO.Path.Combine(tempDir, Guid.NewGuid().ToString() + entry.Title);
            _storage.Download(entry.IdString,
                              pathName,
                              Dispatcher,
                              () =>
                                  {
                                      if (File.Exists(pathName)) //some files are empty
                                          fileViewCallback(pathName);
                                      else if (entry.IsGDrive && !string.IsNullOrEmpty(entry.GdocWebUrl))
                                      {
                                          webViewCallback(entry.GdocWebUrl);
                                      }
                                  });
        }
예제 #2
0
 private bool AddEntry(int expected, FileEntry entry, int folderRequestId)
 {
     if (entry != null)
     {
         _entries.Add(entry);
         numFetched.Text = _entries.Count + " of " + expected + " (" + ((int) (100*_entries.Count/expected)) +
                           "%)";
     }
     var doContinue = _entries.Count < expected && !_cancelled && folderRequestId == _folderRequestId;
     if (!doContinue)
     {
         _isBusy = false;
         fetchProgress.Visibility = Visibility.Collapsed;
     }
     return doContinue;
 }