public string GetSavePath(JaneCache target)
 {
     string folderName = target.SourceThread.Format(FolderFormat);
     string safeFolderName = null;
     try
     {
         safeFolderName = FileNameUtility.EscapeFileName(folderName);
         safeFolderName = target.SourceThread.FormatDirectorySeparator(safeFolderName);
     }
     catch (ArgumentException)
     {
         safeFolderName = "[不明なスレッド]";
     }
     string lastSaveFolder = Path.Combine(SaveFolder, safeFolderName);
     Directory.CreateDirectory(lastSaveFolder);
     string savePath = Path.Combine(lastSaveFolder, target.FileName);
     string lastSavePath = null;
     if (ImageSaveMode == JaneCacheConverter.ImageSaveMode.ChangeName
         && File.Exists(savePath))
     {
         lastSavePath = FileNameUtility.Rename(savePath);
     }
     else
     {
         lastSavePath = savePath;
     }
     return lastSavePath;
 }
Beispiel #2
0
 public void ForEachImageCache(Action<JaneCache, int, string> action)
 {
     string[] cachePathes = GetCachePathes();
     for (int i = 0; i < cachePathes.Length; i++)
     {
         JaneCache cache = new JaneCache(cachePathes[i], this);
         if (cache.IsImage)
         {
             int parcent = 100 * i / cachePathes.Length;
             string processText = string.Format("変換中... {0}/{1}", cache.SourceThread.Title, cache.FileName);
             action(cache, parcent, processText);
         }
     }
 }