Seal.Forms.MultipleSelectForm.GetPropertyValue C# (CSharp) Méthode

GetPropertyValue() public static méthode

public static GetPropertyValue ( object item, string fieldName ) : string
item object
fieldName string
Résultat string
        public static string GetPropertyValue(object item, string fieldName)
        {
            PropertyInfo classProperty = GetFieldProperty(fieldName, item.GetType());
            if (classProperty == null)
            {
                if (item is DataRowView)
                {
                    object value = ((DataRowView)item)[fieldName];
                    return (value != null ? value.ToString() : "");
                }
            }

            if (classProperty != null)
            {
                object value = classProperty.GetValue(item, null);
                if (value != null) return value.ToString();
            }

            return "";
        }