Exemple #1
0
        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;
        }
Exemple #2
0
        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 { }
                }
            }
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
                    }
                }
            }
        }
Exemple #6
0
 static public void Init2()
 {
     XClass.InitXClass(tl);
 }
Exemple #7
0
 public XPropVal(XClass dad, PropertyDescriptor _pd, PropertyInfo _pi)
 {
     dad.lProps.Add(this);
     pi = _pi;
 }