예제 #1
0
        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();
                }
            });
        }
예제 #2
0
        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);
        }
예제 #3
0
 private static void Main(string[] args)
 {
     SystemConsole.Run(config: new Dictionary <string, Action>()
     {
         { "读取csv写入excel", () => { new ReadCsv(); } },
         { "读取excel写入json", () => { new ReadExcel(); } }
     });
 }
예제 #4
0
 public CheckScenario()
 {
     SystemConsole.Run(config: new Dictionary <string, Action>()
     {
         { "读取", Read },
         { "还原", Write }
     });
 }
예제 #5
0
 public CopyToOneFolder()
 {
     SystemConsole.Run(config: new Dictionary <string, Action>()
     {
         { "递归搜索文件重命名并复制到同一文件夹下:搜索", CopyToOne },
         { "递归搜索文件重命名并复制到同一文件夹下:还原", RevertCopyToOne },
         { "原结构复制", CopyTo },
     });
 }
예제 #6
0
        private static void Main(string[] args)
        {
            Action <object> callAction = delegate(object o)
            {
                BaseActionBy baseActionFor = (BaseActionBy)o;
                baseActionFor.Open();
            };

            SystemConsole.Run <ConvertType>(callAction);
        }
예제 #7
0
 static void Main(string[] args)
 {
     do
     {
         SystemConsole.Run(config: new Dictionary <string, Action>()
         {
             { "加密", () => { new YueGeEncrypt(); } },
             { "解密", () => { new YueGeDencrypt(); } },
             { "解密2", () => { new YueGeDencrypt2(); } }
         });
     } while (SystemConsole.ContinueY());
 }
예제 #8
0
        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);
        }
예제 #9
0
 private static void Main(string[] args) => SystemConsole.Run <CaoType>(columnsCount: 4);
예제 #10
0
 private static void Main(string[] args) => SystemConsole.Run <CaoType>();
예제 #11
0
 private static void Main(string[] args)
 {
     SystemConsole.Run <MyEnum>(group: "FileMerge");
 }
예제 #12
0
 private static void Main(string[] args)
 {
     SystemConsole.Run <MyEnum>();
 }
예제 #13
0
 private static void Main(string[] args)
 {
     SystemConsole.Run <MyEnum>(callAction: Run);
 }
예제 #14
0
 private static void Main(string[] args)
 {
     SystemConsole.Run <ConvertType>();
 }
예제 #15
0
 private static void Main(string[] args)
 {
     SystemConsole.Run <MyEnum>(group: "Check");
 }
예제 #16
0
 private static void Main(string[] args)
 {
     SystemConsole.Run <SvnList.MyEnum, Svn.MyEnum, Git.MyEnum>(columnsCount: 4, callAction: Run);
 }
예제 #17
0
 private static void Main(string[] args)
 {
     SystemConsole.Run <MyEnum, Dos2.MyEnum>(columnsCount: 4);
 }
예제 #18
0
        /// <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);
                        }
                    });
                },
            });
        }
예제 #19
0
        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);
                //	});
                //},
            });
        }