public VersionNameExists ( string version_name ) : bool | ||
version_name | string | |
return | bool |
private static string GetVersionName(Photo p, int i) { string name = Catalog.GetPluralString ("PhotoMosaic", "PhotoMosaic ({0})", i); name = String.Format (name, i); if (p.VersionNameExists (name)) return GetVersionName (p, i + 1); return name; }
private static string GetNextVersionFileName(Photo p, int i) { Regex exiflowpat = new Regex(@"^(\d{8}(-\d{6})?-.{3}\d{4}-.{2})(\d)(.{2})\.([^.]*$)"); Match exiflowpatmatch = exiflowpat.Match(p.Name); string filename = String.Format("{0}{1}00.jpg", exiflowpatmatch.Groups[1], i, exiflowpatmatch.Groups[5]); System.Uri developed = GetUriForVersionFileName (p, filename); if (p.VersionNameExists (GetVersionName(filename)) || System.IO.File.Exists(GLib.Shell.Quote(developed.LocalPath))) return GetNextVersionFileName (p, i + 1); return filename; }
private static string GetNextVersionFileName(Photo p, int i) { Console.WriteLine ("New New "+ GetNextIntelligentVersionFileNames(p)[0].ToString()); Regex exiflowpat = new Regex(@"^(\d{8}(-\d{6})?-.{3}\d{4}-.{2})(\d)(.{2})\.([^.]*)$"); Match exiflowpatmatch = exiflowpat.Match(System.IO.Path.GetFileName(p.VersionUri(p.DefaultVersionId).LocalPath)); // besser mit UnixPath.GetFileName() string filename = String.Format("{0}{1}00.{2}", exiflowpatmatch.Groups[1], i, exiflowpatmatch.Groups[5]); System.Uri developed = GetUriForVersionFileName (p, filename); if (p.VersionNameExists (GetVersionName(filename)) || System.IO.File.Exists(CheapEscape(developed.LocalPath))) return GetNextVersionFileName (p, i + 1); return filename; }
private static string GetVersionName(Photo p, int i) { string name = Catalog.GetPluralString ("Developed in UFRaw", "Developed in UFRaw ({0})", i); name = String.Format (name, i); if (p.VersionNameExists (name)) return GetVersionName (p, i + 1); return name; }
private static string GetNextIntelligentVersionFileNames(Photo p, int x, int y, int z) { Regex exiflowpat = new Regex(@"^(\d{8}(-\d{6})?-.{3}\d{4}-.{2})(.)(.)(.)(.*)\.([^.]*)$"); Match exiflowpatmatch = exiflowpat.Match(System.IO.Path.GetFileName(p.VersionUri(p.DefaultVersionId).LocalPath)); string filename = null; if (x > 0) filename = String.Format("{0}{1}{2}{3}.{4}", exiflowpatmatch.Groups[1], GetNextValidChar(exiflowpatmatch.Groups[3].ToString(),x), 0, 0, exiflowpatmatch.Groups[7]); if (y > 0) filename = String.Format("{0}{1}{2}{3}.{4}", exiflowpatmatch.Groups[1], exiflowpatmatch.Groups[3], GetNextValidChar(exiflowpatmatch.Groups[4].ToString(),y), 0, exiflowpatmatch.Groups[7]); if (z > 0) filename = String.Format("{0}{1}{2}{3}.{4}", exiflowpatmatch.Groups[1], exiflowpatmatch.Groups[3], exiflowpatmatch.Groups[4], GetNextValidChar(exiflowpatmatch.Groups[5].ToString(),z), exiflowpatmatch.Groups[7]); System.Uri developed = GetUriForVersionFileName (p, filename); Console.WriteLine (developed); if (p.VersionNameExists (GetVersionName(filename)) || System.IO.File.Exists(CheapEscape(developed.LocalPath))){ if (x > 0) return GetNextIntelligentVersionFileNames (p, x+1, y, z); if (y > 0) return GetNextIntelligentVersionFileNames (p, x, y+1, z); if (z > 0) return GetNextIntelligentVersionFileNames (p, x, y, z+1); } return filename; }