Skip to main content

XPMemberInfo.GetModified(Object) Method

Checks whether or not the member is modified.

Namespace: DevExpress.Xpo.Metadata

Assembly: DevExpress.Xpo.v23.2.dll

NuGet Package: DevExpress.Xpo

Declaration

public abstract bool GetModified(
    object theObject
)

Parameters

Name Type Description
theObject Object

A persistent object that will be checked.

Returns

Type Description
Boolean

true, if the member is modified; otherwise, false.

Remarks

Set the Session.TrackpropertiesModifications or XpoDefault.TrackPropertiesModifications property to true to track changes. The GetModified method always returns false if a Session does not track changes made to properties.

XPMemberInfo member = customer.ClassInfo.GetMember(propertyName);
string memberValue;
if(member.GetModified(customer)) {
  memberValue = string.Format("{0} (old value: {1})", member.GetValue(customer), member.GetOldValue(customer));
} 
else {
  memberValue = (string)member.GetValue(customer);
}

For more information, refer to the %PUBLIC%\Documents\DevExpress Demos 23.2\Components\WinForms\CS\XpoTutorials\ModifiedProperties\ModifiedProperties.cs file.

See Also