private static void uploadDatabase(SyncServiceClient serviceClient) { string dbPath = Path.Combine(Constants.GetCurrentDirectoryPath, Constants.DOWNLOAD_FOLDER, Constants.REMOTE_DB_NAME); // get some info about the input file var fileInfo = new FileInfo(dbPath); FileStream stream = null; try { // open input stream stream = new FileStream(dbPath, FileMode.Open, FileAccess.Read); using (var uploadStreamWithProgress = new StreamWithProgress(stream)) { stream = null; uploadStreamWithProgress.ProgressChanged += onUploadStreamWithProgressProgressChanged; // upload file serviceClient.UploadFile(fileInfo.Name, fileInfo.Length, uploadStreamWithProgress); } } catch (Exception e) { MessageBox.Show(e.Message); } finally { if (stream != null) stream.Dispose(); } }
private static void onUploadStreamWithProgressProgressChanged(object sender, StreamWithProgress.ProgressChangedEventArgs e) { //throw new NotImplementedException(); }