예제 #1
0
        public void DllTypeManagerTest()
        {
            DllTypeManager dllTypeManager = new DllTypeManager();
            string         pathToTest     = Environment.CurrentDirectory;

            for (int i = 0; i < 4; i++)
            {
                pathToTest = Directory.GetParent(pathToTest).FullName;
            }
            string testPath = Path.Combine(pathToTest, "testData\\TPA.ApplicationArchitecture.dll");

            dllTypeManager.AssignPathToFile(testPath);
            dllTypeManager.InitTypeManager();
            Assert.IsTrue(dllTypeManager.LocalRememberedTypesDictionary.Count > 0);
        }
예제 #2
0
파일: Program.cs 프로젝트: jkwrobel/Project
        private static void Main(string[] args)
        {
            Console.WriteLine(Directory.GetCurrentDirectory());
            List <Type> types            = DllReader.LoadConnectionTypes(Directory.GetCurrentDirectory());
            var         constructorInfos = types[12].GetProperties(BindingFlags.Public | BindingFlags.Static |
                                                                   BindingFlags.NonPublic | BindingFlags.Instance);

            var test1 = constructorInfos[0].GetType();
            var test2 = constructorInfos[0].PropertyType;

            Console.WriteLine(constructorInfos[0].ToString());

            DllTypeManager dllTypeManager = new DllTypeManager();
            var            test           = dllTypeManager.GetRootTypes();

            DllSerializer dllSerializer = DllSerializer.SerializerInstance;

            dllSerializer.SerializeObjectToXMl(dllTypeManager, @"E:\Test.Xml");
            TypeDictionaryHolder typeDictionaryHolder = dllSerializer.DeserializeXmlToObject(@"E:\Test.Xml");

            Console.WriteLine("test");
        }