System.Reflection.PropertyInfo.GetValue C# (CSharp) Method

GetValue() private method

private GetValue ( object obj ) : object
obj object
return object
        public extern object GetValue(object obj);

Same methods

PropertyInfo::GetValue ( object obj, Array index ) : object

Usage Example

Esempio n. 1
0
        public static bool ArePropertiesEqual(PropertyInfo property, object object1, object object2)
        {
            bool result = true;

            object object1Value = null;
            object object2Value = null;

            if (object1 != null)
            {
                object1Value = property.GetValue(object1, null);
            }
            if (object2 != null)
            {
                object2Value = property.GetValue(object2, null);
            }

            if (object1Value != null)
            {
                if (object1Value.Equals(object2Value) == false)
                {
                    result = false;
                }
            }
            else
            {
                if (object2Value != null)
                {
                    result = false;
                }
            }

            return result;
        }
All Usage Examples Of System.Reflection.PropertyInfo::GetValue