Exemplo n.º 1
0
        //[TestMethod()]
        public void GetPropertyNamesTest()
        {
            PropertyInterrogator.GetPropertyNames(typeof(ProcEnvironInfo));

            ProcEnvironInfo env = new ProcEnvironInfo();

            string[] propertyNames = { "WorkingDir", "SysDir" };
            object   obj           = null;

            foreach (string pName in propertyNames)
            {
                obj = PropertyInterrogator.GetPropertyValue(env, pName);
            }
        }
Exemplo n.º 2
0
        private void LoadComposite(Type tp, object typeObj, string objName)
        {
            PropertyInfo[] properties = tp.GetProperties(BindingFlags.Public | BindingFlags.Instance);
            foreach (PropertyInfo pi in properties)
            {
                Type unerLyingType = TypeInterrogator.GetUnderlyingType(pi.PropertyType);
                if (IsSkipped(pi, unerLyingType))
                {
                    continue;
                }

                if (IsLeafCtrl(unerLyingType) || IsCollectionCtrl(unerLyingType))
                {
                    PropertyCtrlInfo pci = _controlMap[PropertyInterrogator.GetFullName(pi)];
                    pci.ParentObject = typeObj;
                    pci.Binder.Value = pi.GetValue(typeObj, null);
                }
                else
                {
                    LoadComposite(unerLyingType, pi.GetValue(typeObj, null), pi.Name);
                }
            }
        }