示例#1
0
 private bool Exists(Media m)
 {
     string path = m.LocalCopy();
     return File.Exists(path);
 }
示例#2
0
 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);
     }
 }
示例#3
0
        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);
            }
        }