示例#1
0
        private void CreateBin()
        {
            string BinName = GetNewBinName();
            DvdBin dvdBin  = new DvdBin(BinName, 4692251770.88);

            Bins.Add(dvdBin);
            Log.Information("Created bin {a}", dvdBin.Name);
        }
 private DvdBin CreateDvdBin() {
     string DvdName = Path.GetDirectoryName(FolderPath);
     DvdBin dvdBin = new DvdBin(DvdName);
     foreach (FileToImport file in Files) {
         dvdBin.Files.Add(file.File);
     }
     return dvdBin;
 }
示例#3
0
        private void CreateFolder(DvdBin dvdBin)
        {
            string newFolder = Path.Combine(LocalFolder, dvdBin.Name);

            if (!Directory.Exists(newFolder))
            {
                Directory.CreateDirectory(newFolder);
            }
            else
            {
                Log.Error("Folder {a} already exists!", newFolder);
            }
        }
示例#4
0
        private void MoveFilesIntoBinFolder(DvdBin dvdBin)
        {
            string targetFolder = Path.Combine(LocalFolder, dvdBin.Name);

            if (Directory.Exists(targetFolder))
            {
                foreach (FileInfo file in dvdBin.Files)
                {
                    file.MoveTo(Path.Combine(targetFolder, file.Name));
                    Log.Information("Moved {a} to {b}", file.Name, targetFolder);
                }
            }
            else
            {
                Log.Error("Folder {a} does not exist. Skipping.", targetFolder);
            }
        }