public static string[] MapFilesToTagDir(string[] srcs, GUTag currentTag) { string[] dsts = new string[srcs.Length]; for (int i = 0; i < srcs.Length; i++) { string s = srcs[i]; if (PathHelper.IsValidWebLink(s)) { dsts[i] = s; } else { System.Diagnostics.Debug.Assert(PathHelper.IsValidFS(s)); string n = Path.GetFileName(s); string d = Path.Combine(currentTag.GetDir(true), n);//如果目录不存在,现在创建 dsts[i] = d; } } return(dsts); }
public static string GetFileByTagFileName(GUTag tag, string fileName, bool createDir = false) { string dir = tag.GetDir(createDir); //不要再这儿创建目录 return(System.IO.Path.Combine(dir, fileName)); //TODO 待定 }
public static string GetFileByTag(GUTag tag, string postfix, bool createDir = false) /// 根据tag和后缀名获得文件路径 { string dir = tag.GetDir(createDir); //不要再这儿创建目录 return(System.IO.Path.Combine(dir, tag + "." + postfix)); //TODO 待定 }