Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Mwzad64
- {
- class Program
- {
- static void Main(string[] args)
- {
- System.Reflection.MemberInfo info = typeof(ReflectionExample);
- // pobranie listy atrybutów
- Type type = typeof(ReflectionExample);
- var foo = Activator.CreateInstance(type);
- //MethodInfo inf = t.Get
- object[] attributes = info.GetCustomAttributes(true);
- for (int i = 0; i < attributes.Length; i++)
- {
- // Wypisujemy wszystkie atrybuty
- Console.WriteLine(attributes[i]);
- }
- Console.ReadKey();
- // Wynik działania programu
- // Refleksja.ReflectionExample
- }
- public class ReflectionExample
- {
- int wl1{ get; set; }
- string wl2 { get; set; }
- DateTime wl3 { get; set; }
- public int pl1 { private get; set; }
- public string pl2 { get; private set; }
- public static DateTime pl3 { get; set; }
- public int met1(int x)
- {
- return x;
- }
- public static string met2(string a, string b)
- {
- return a + ' ' + b;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement