daily pastebin goal
33%
SHARE
TWEET

C# Reflection

a guest Jul 28th, 2011 166 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication2
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Type t = typeof(X_Class);
  13.             var tt = t.GetProperties().Where(i => i.PropertyType.Equals(typeof(Zeta)));
  14.             foreach (var item in tt)
  15.             {
  16.                 Console.WriteLine(item.Name.ToString());
  17.             }
  18.  
  19.             Console.ReadLine();
  20.         }
  21.     }
  22.  
  23.     class X_Class
  24.     {
  25.         public Zeta Y_Property { get; set; }
  26.         public Zeta W_Property { get; set; }
  27.     }
  28.  
  29.     class Zeta
  30.     {
  31.     }
  32.  
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top