Example #1
0
            protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
            {
                // Look for the CLR property with this name first.
                PropertyInfo propertyInfo = (from prop in GetProperties(bindingAttr) where prop.Name == name select prop).FirstOrDefault();

                if (propertyInfo == null)
                {
                    // If the CLR property was not found, return a custom property
                    if (_infra.HasProperty(name))
                    {
                        return(new CustomPropertyInfoHelper(name, _infra.GetPropertyType(name)));
                    }
                }

                return(propertyInfo);
            }
Example #2
0
            public override object GetValue(object component)
            {
                using (CEF.UseServiceScope(_ss))
                {
                    DynamicWithBag iw = null;

                    if (component is DynamicBindable db)
                    {
                        iw = db.Wrapped;
                    }

                    if (iw == null)
                    {
                        iw = _iw;
                    }

                    if (iw.HasProperty(_name))
                    {
                        return(iw.GetValue(_name));
                    }
                    return(null);
                }
            }