private bool Exists(Media m) { string path = m.LocalCopy(); return File.Exists(path); }
private void Remove(Media m) { string path = m.LocalCopy(); if( File.Exists(path) ==true) { File.Delete(path); } medias.Remove(m); if (MediaRemoved != null) { MediaRemoved(m, EventArgs.Empty); } }
private void DownloadMedia(Media m) { FileFetcher ff = new FileFetcher(); fileFetchers[Thread.CurrentThread] = ff; string tempFile = ff.Fetch(m); // replace the old backup // with the new one string newFile = m.LocalCopy(); if (File.Exists(newFile)) { File.Replace(tempFile, newFile, null); } else { File.Move(tempFile, newFile); } }