Example #1
0
        private void test()
        {
            return;

            string strTitle = ";System.title =\"模板工程\";";
            string strW     = ";scWidth =1024;";
            string strH     = ";scHeight =768;";

            Regex regTitle = new Regex(@"\s*;\s*System.title\s*=");
            Regex regW     = new Regex(@"\s*;\s*scWidth\s*=");
            Regex regH     = new Regex(@"\s*;\s*scHeight\s*=");

            bool ret = false;

            ret = regTitle.IsMatch(strTitle);
            ret = regW.IsMatch(strW);
            ret = regH.IsMatch(strH);

            string[] layouts = Directory.GetFiles(_curConfig.ThemeDataFolder, WizardConfig.UI_LAYOUT);

            // 测试tjs值读取
            foreach (string layout in layouts)
            {
                using (StreamReader r = new StreamReader(layout))
                {
                    TjsParser parser = new TjsParser();
                    TjsValue  val    = null;
                    do
                    {
                        val = parser.Parse(r);
                    } while (val != null);
                }
            }

            // 测试tjs符号读取
            using (StreamReader r = new StreamReader(layouts[0]))
            {
                TjsParser       parser = new TjsParser();
                TjsParser.Token token  = null;
                do
                {
                    token = parser.GetNext(r);
                } while (token != null && token.t != TjsParser.TokenType.Unknow);
            }

            // 资源转换器对象的测试用例
            ResConfig config = new ResConfig();

            config.files.Add(new ResFile(@"a.png"));
            config.files.Add(new ResFile(@"b.png"));
            config.name = "TestTest";
            config.path = @"c:\";

            config.Save(@"c:\test.xml");
            ResConfig newConfig = ResConfig.Load(@"c:\test.xml");

            ResConverter cov = new ResConverter();

            cov.Start(config, @"d:\", 1024, 768, 1920, 1080);
        }
Example #2
0
 void conv_NotifyProcessEvent(ResConverter sender, ResConverter.NotifyProcessEventArgs e)
 {
     Logging(string.Format("({0}/{1}){2} 转换中……", e.index, e.count, e.file));
 }