示例#1
0
        public void DllReaderTest()
        {
            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");
            List <Type> types    = DllReader.LoadConnectionTypes(testPath);

            Assert.IsNotNull(types);
            Assert.IsTrue(types.Count > 0);
        }
示例#2
0
        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");
        }
示例#3
0
        public void InitTypeManager()
        {
            DllReader.LoadConnectionTypes(_pathToFile);
            foreach (Type connectionType in DllReader.ConnectionTypes)
            {
                if (RememberedTypesDictionary.ContainsKey(connectionType.GUID))
                {
                    continue;
                }
                RememberedTypesDictionary.Add(connectionType.GUID, new DllTypeClass(connectionType));
            }

            dictionarySnapshot = new Dictionary <Guid, ATypeRepresentation>(DllTypeManager.RememberedTypesDictionary);

            int levelCounter = 0;

            while (RunGenerationForGivenLevel(levelCounter))
            {
                levelCounter++;
            }
            LocalRememberedTypesDictionary = RememberedTypesDictionary;
        }