private void TestAll(Action <TestInfo> action, TableReflectionContext context)
 {
     action(TestInfo.Create <DecoratedTypes.IBase1, UndecoratedTypes.IBase1>(context));
     action(TestInfo.Create <DecoratedTypes.IBase2, UndecoratedTypes.IBase2>(context));
     action(TestInfo.Create <DecoratedTypes.IComposite, UndecoratedTypes.IComposite>(context));
     action(TestInfo.Create <DecoratedTypes.Base, UndecoratedTypes.Base>(context));
     action(TestInfo.Create <DecoratedTypes.Derived, UndecoratedTypes.Derived>(context));
     action(TestInfo.Create <DecoratedTypes.SubDerived, UndecoratedTypes.SubDerived>(context));
     action(TestInfo.Create(typeof(DecoratedTypes.GenericDerived <>), typeof(UndecoratedTypes.GenericDerived <>), context));
     action(TestInfo.Create(typeof(DecoratedTypes.GenericDerived), typeof(UndecoratedTypes.GenericDerived), context));
 }
Ejemplo n.º 2
0
        static void InitializeComponent()
        {
            Console.Title = "中考查分";
            XmlDocument zkcf = new XmlDocument();

            zkcf.Load(".\\zkcf.xml");
            Console.WriteLine("配置文件已加载。");
            main = zkcf.FirstChild;

            CommonFolder = main.ChildNodes[0].ChildNodes[0].Attributes.GetNamedItem("value").InnerText;

            foreach (XmlNode si in main.ChildNodes[1])
            {
                StudentPool.Add(si.Attributes.GetNamedItem("Source").InnerText, StudentInfo.Create(si.Attributes.GetNamedItem("Source").InnerText, si.Attributes.GetNamedItem("Name").InnerText, Int64.Parse(si.Attributes.GetNamedItem("Id").InnerText), Int16.Parse(si.Attributes.GetNamedItem("IdLength").InnerText), Int64.Parse(si.Attributes.GetNamedItem("Zw").InnerText), Int16.Parse(si.Attributes.GetNamedItem("ZwLength").InnerText)));
            }
            Console.WriteLine("学生池已加载。");

            foreach (XmlNode ti in main.ChildNodes[2])
            {
                TestPool.Add(ti.Attributes.GetNamedItem("Source").InnerText, TestInfo.Create(ti.Attributes.GetNamedItem("Source").InnerText, ti.Attributes.GetNamedItem("Name").InnerText, ti.Attributes.GetNamedItem("Url").InnerText, ti.Attributes.GetNamedItem("Pattern").InnerText, ti.Attributes.GetNamedItem("NeedZw").InnerText == "1"));
            }
            Console.WriteLine("考试池已加载。");

            List <string> Folders = new List <string>();

            foreach (string p in TestPool.Keys)
            {
                Folders.Add(CommonFolder + "\\" + p);
            }

            foreach (string f in Folders)
            {
                if (!Directory.Exists(f))
                {
                    Directory.CreateDirectory(f);
                    Console.WriteLine("目录" + f + "已创建。");
                }
            }
            Console.WriteLine("文件夹池已加载。");

            Console.WriteLine();
            Console.Clear();
        }