public void Open() { var cache = AttributeHelper.GetCacheStringValue <RegexLanguaheEnum>(); SystemConsole.Run(config: new Dictionary <string, Action>() { ["匹配中文与日文"] = () => { regexStr = string.Join("|", cache.Where(p => p.Key >= RegexLanguaheEnum.日文 && p.Key <= RegexLanguaheEnum.中文).Select(p => p.Value)); GetValue(); }, ["只匹配中文"] = () => { regexStr = cache[RegexLanguaheEnum.中文]; GetValue(); }, ["只匹配日文"] = () => { regexStr = string.Join("|", cache.Where(p => p.Key < RegexLanguaheEnum.中文).Select(p => p.Value)); GetValue(); }, ["只匹配韩文"] = () => { regexStr = cache[RegexLanguaheEnum.韩文]; GetValue(); } }); }
public void ToKvExcelAll(bool isArray = true) { var cache = AttributeHelper.GetCacheStringValue <RegexLanguaheEnum>(); var regexStr = string.Empty; SystemConsole.Run(config: new Dictionary <string, Action>() { ["不过滤"] = () => { ToKvExcel(isArray, regexStr); }, ["匹配中文与日文"] = () => { regexStr = string.Join("|", cache.Where(p => p.Key >= RegexLanguaheEnum.日文 && p.Key <= RegexLanguaheEnum.中文).Select(p => p.Value)); ToKvExcel(isArray, regexStr); }, ["只匹配中文"] = () => { regexStr = cache[RegexLanguaheEnum.中文]; ToKvExcel(isArray, regexStr); }, ["只匹配日文"] = () => { regexStr = string.Join("|", cache.Where(p => p.Key < RegexLanguaheEnum.中文).Select(p => p.Value)); ToKvExcel(isArray, regexStr); }, ["只匹配韩文"] = () => { regexStr = cache[RegexLanguaheEnum.韩文]; ToKvExcel(isArray, regexStr); } }, columnsCount: 3); }
private static void Main(string[] args) { SystemConsole.Run(config: new Dictionary <string, Action>() { { "读取csv写入excel", () => { new ReadCsv(); } }, { "读取excel写入json", () => { new ReadExcel(); } } }); }
public CheckScenario() { SystemConsole.Run(config: new Dictionary <string, Action>() { { "读取", Read }, { "还原", Write } }); }
public CopyToOneFolder() { SystemConsole.Run(config: new Dictionary <string, Action>() { { "递归搜索文件重命名并复制到同一文件夹下:搜索", CopyToOne }, { "递归搜索文件重命名并复制到同一文件夹下:还原", RevertCopyToOne }, { "原结构复制", CopyTo }, }); }
private static void Main(string[] args) { Action <object> callAction = delegate(object o) { BaseActionBy baseActionFor = (BaseActionBy)o; baseActionFor.Open(); }; SystemConsole.Run <ConvertType>(callAction); }
static void Main(string[] args) { do { SystemConsole.Run(config: new Dictionary <string, Action>() { { "加密", () => { new YueGeEncrypt(); } }, { "解密", () => { new YueGeDencrypt(); } }, { "解密2", () => { new YueGeDencrypt2(); } } }); } while (SystemConsole.ContinueY()); }
private static void Main(string[] args) { Action <object> callFunc = obj => { BaseActionFor baseActionFor = (BaseActionFor)obj; SystemConsole.Run(config: new Dictionary <string, Action>() { { "搜索", () => { baseActionFor.Open(); } }, { "还原", () => { baseActionFor.Revert(); } }, }); }; SystemConsole.Run <ConvertType>(callFunc); }
private static void Main(string[] args) => SystemConsole.Run <CaoType>(columnsCount: 4);
private static void Main(string[] args) => SystemConsole.Run <CaoType>();
private static void Main(string[] args) { SystemConsole.Run <MyEnum>(group: "FileMerge"); }
private static void Main(string[] args) { SystemConsole.Run <MyEnum>(); }
private static void Main(string[] args) { SystemConsole.Run <MyEnum>(callAction: Run); }
private static void Main(string[] args) { SystemConsole.Run <ConvertType>(); }
private static void Main(string[] args) { SystemConsole.Run <MyEnum>(group: "Check"); }
private static void Main(string[] args) { SystemConsole.Run <SvnList.MyEnum, Svn.MyEnum, Git.MyEnum>(columnsCount: 4, callAction: Run); }
private static void Main(string[] args) { SystemConsole.Run <MyEnum, Dos2.MyEnum>(columnsCount: 4); }
/// <summary> /// 筛选过滤已存在图片 /// </summary> public SpliteAtlas() { SystemConsole.Run(config: new Dictionary <string, Action>() { ["图集拆解"] = () => { GetPaths("*.plist").ForEachPaths(re => { PList plist = new PList(); plist.Load(re); TextureInfo textureInfo = new TextureInfo(plist, re); if (!textureInfo.voild) { return; } var imagePath = Path.GetDirectoryName(re) + "/" + textureInfo.name; if (File.Exists(imagePath)) { HaveImageAndRead(imagePath, textureInfo); } }); }, ["图集合并"] = () => { GetPaths("*.plist").ForEachPaths(re => { PList plist = new PList(); plist.Load(re); TextureInfo textureInfo = new TextureInfo(plist, re); if (!textureInfo.voild) { return; } var imagePath = Path.GetDirectoryName(re) + "/" + textureInfo.name; if (File.Exists(imagePath)) { HaveImageAndWrite(imagePath, textureInfo); } }); }, ["文件夹删除"] = () => { GetPaths("*.plist").ForEachPaths(re => { PList plist = new PList(); plist.Load(re); TextureInfo textureInfo = new TextureInfo(plist, re); if (!textureInfo.voild) { return; } var imagePath = Path.GetDirectoryName(re) + "/" + textureInfo.name; string dir = Path.GetDirectoryName(imagePath) + "/" + Path.GetFileNameWithoutExtension(imagePath); if (Directory.Exists(dir)) { Directory.Delete(dir, true); } }); }, }); }
public SpliteAdobeAnimateAtlas() { SystemConsole.Run(config: new Dictionary <string, Action>() { ["图集拆解"] = () => { GetPaths(".bin").ForEachPaths(re => { XDocument xDoc = XDocument.Load(re); var list = xDoc.Element("TextureAtlas").Elements("SubTexture").Select(p => { return(new Sprite { name = (string)p.Attribute("name") + ".png", x = (int)p.Attribute("x"), y = (int)p.Attribute("y"), width = (int)p.Attribute("width"), height = (int)p.Attribute("height"), pivotX = p.Attribute("pivotX") != null ? (float)p.Attribute("pivotX") : 0, pivotY = p.Attribute("pivotY") != null ? (float)p.Attribute("pivotY") : 0, }); }).OrderBy(p => p.name).ToList(); var imagePath = re.Replace("Xml.bin", ".png"); if (File.Exists(imagePath)) { HaveImageAndRead(imagePath, imagePath, list); } }); }, //["图集合并"] = () => //{ // GetPaths("*.plist").ForEachPaths(re => // { // PList plist = new PList(); // plist.Load(re); // TextureInfo textureInfo = new TextureInfo(plist, re); // if (!textureInfo.voild) return; // var imagePath = Path.GetDirectoryName(re) + "/" + textureInfo.name; // if (File.Exists(imagePath)) // HaveImageAndWrite(imagePath, textureInfo); // }); //}, //["文件夹删除"] = () => //{ // GetPaths("*.plist").ForEachPaths(re => // { // PList plist = new PList(); // plist.Load(re); // TextureInfo textureInfo = new TextureInfo(plist, re); // if (!textureInfo.voild) return; // var imagePath = Path.GetDirectoryName(re) + "/" + textureInfo.name; // string dir = Path.GetDirectoryName(imagePath) + "/" + // Path.GetFileNameWithoutExtension(imagePath); // if (Directory.Exists(dir)) // Directory.Delete(dir, true); // }); //}, }); }