Esempio n. 1
0
        public static void Types()
        {
            //bir obejct üzerinden type almak için
            Type assemblyExampleClass = new AssemblyExample().GetType();

            //Current Assembly  içindeki typeları almak için:
            Type exampleType = Assembly.GetExecutingAssembly().GetTypes().Single(type => type.Name == "AssemblyExample");

            //Typeof kullanarak bir type ornegi oluşturmak
            Type exampleClass = typeof(AssemblyExample);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine(typeof(AssemblyExample).IsAbstract);

            //   Types();

            //PropertyInfoGetMethod(new AssemblyExample());

            //PropertyInfoSetMethod(new AssemblyExample());


            #region [ Reflection Helper]

            var example = new AssemblyExample();


            // servisten gelen cevap olarak düşünebiliriz.
            //example.TestProperty = new Test() { TestNumber = 132131321 };
            //var valueTesNumber =   GetPropValue(example, "TestProperty.TestNumber");

            //Console.WriteLine(valueTesNumber);

            #endregion

            //GetConstructors(typeof(AssemblyExample));

            //GetMethods(typeof(AssemblyExample));

            //GetFieldsAndProperties(typeof(AssemblyExample));


            //InvokeMethod(typeof(AssemblyExample), "Method1");

            DynamicInvoke(typeof(AssemblyExample));


            Console.ReadLine();
        }