Carrotware.CMS.Core.ObjectProperty.GetCustProps C# (CSharp) Метод

GetCustProps() публичный статический Метод

public static GetCustProps ( Object obj, PropertyInfo prop ) : ObjectProperty
obj Object
prop System.Reflection.PropertyInfo
Результат ObjectProperty
        public static ObjectProperty GetCustProps(Object obj, PropertyInfo prop)
        {
            ObjectProperty objprop = new ObjectProperty(obj, prop);

            try {
                foreach (Attribute attr in objprop.Props.GetCustomAttributes(true)) {
                    if (attr is WidgetAttribute) {
                        var widgetAttrib = attr as WidgetAttribute;
                        if (null != widgetAttrib) {
                            try { objprop.CompanionSourceFieldName = widgetAttrib.SelectFieldSource; } catch { objprop.CompanionSourceFieldName = ""; }
                            try { objprop.FieldMode = widgetAttrib.Mode; } catch { objprop.FieldMode = WidgetAttribute.FieldMode.Unknown; }
                        }
                    }
                }
            } catch (Exception ex) { }

            objprop.FieldDescription = ReflectionUtilities.GetDescriptionAttribute(obj.GetType(), objprop.Name);

            return objprop;
        }