static public void Init1() { XClass.TClasses = new List <XClass> (); tl = new List <Type> (); string myAssembly = Assembly.GetExecutingAssembly().GetName().Name; foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) { if ( a.FullName.Contains(myAssembly) || a.FullName.Contains("Presentation") || a.FullName.StartsWith("WindowsBase") ) { foreach (Module m in a.GetModules()) { foreach (Type t in m.GetTypes()) { tl.Add(t); } } } } XClass.BuildXClass("DependencyObject", tl); return; }
public XClass(XClass dad, Type _t, List <Type> tl) { TClasses.Add(this); //_t); type = _t; PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(type, PropertyFilter); foreach (PropertyInfo pi in type.GetProperties()) { if (pi.DeclaringType != type) { continue; } new XPropVal(this, pdc.Find(pi.Name, true), pi); } if (tl != null) { List <Type> l = new List <Type> (); foreach (Type t in tl) { if (t.IsClass && t.BaseType != null) { try { string n = t.BaseType.FullName; if (n != null) { if (type.FullName == n) { l.Add(t); } } } catch { } } } foreach (Type t in l) { tl.Remove(t); } foreach (Type t in l) { try { XClass xc = new XClass(this, t, tl); } catch { } } } }
public static XClass BuildXClass(string name, List <Type> tl) { XClass x; foreach (Type t in tl) { if (t.Name == name) { tl.Remove(t); x = new XClass(null, t, tl); return(x); } } return(null); }
XClass InitXClass(List <Type> tl, Type t) { XClass x; if (t.BaseType != null) { x = InitXClass(tl, t.BaseType); if (x != null) { return(x); } } x = XClass.BuildXClass(t.Name, tl); return(x); }
internal void InitXClass(List <Type> tl) { Type t = null; t = pi.PropertyType; if (t != null) { XClass x = XClass.FindFullName(t.FullName); if (x == null) { InitXClass(tl, t); x = XClass.FindFullName(t.FullName); if (x == null) { x = XClass.BuildXClass(t.Name, tl); } } } }
static public void Init2() { XClass.InitXClass(tl); }
public XPropVal(XClass dad, PropertyDescriptor _pd, PropertyInfo _pi) { dad.lProps.Add(this); pi = _pi; }