Source/Csla/Core/ManagedObjectBase.cs
/// <summary>
/// Loads the property vith new value and mark field dirty if value is changed.
/// </summary>
/// <param name="propertyInfo">The property info.</param>
/// <param name="newValue">The new value.</param>
/// <returns>[true] if changed, else [false] </returns>
Loads the property vith new value and mark field dirty if value is changed.
Loads the property vith new value and mark field dirty if value is changed .
protected virtual bool LoadPropertyMarkDirty(IPropertyInfo propertyInfo, object newValue)
    {
      if ((propertyInfo.RelationshipType & RelationshipTypes.PrivateField) == RelationshipTypes.PrivateField)
      {
        LoadProperty(propertyInfo, newValue);
        return false;
      }
      var t = this.GetType();
      var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
      var method = t.GetMethods(flags).FirstOrDefault(c => c.Name == "LoadPropertyMarkDirty" && c.IsGenericMethod);
      var gm = method.MakeGenericMethod(propertyInfo.Type);
      var p = new object[] { propertyInfo, newValue };
      return (bool) gm.Invoke(this, p);
    }
protected virtual bool LoadPropertyMarkDirty ( IPropertyInfo propertyInfo , object newValue ) { if ( ( propertyInfo . RelationshipType & RelationshipTypes . PrivateField ) == RelationshipTypes . PrivateField ) { LoadProperty ( propertyInfo , newValue ) ; return false ; } var t = this . GetType ( ) ; var flags = BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance ; var method = t . GetMethods ( flags ) . FirstOrDefault ( c => c . Name == " " && c . IsGenericMethod ) ; var gm = method . MakeGenericMethod ( propertyInfo . Type ) ; var p = new object [ ] { propertyInfo , newValue } ; return ( bool ) gm . Invoke ( this , p ) ; }
Loads the property vith new value and mark field dirty if value is changed.
Loads the property vith new value and mark field dirty if value is changed .
[true] if changed, else [false]
[ true ] if changed else [ false ]
propertyInfo
IPropertyInfo
The property info.
The property info .
newValue
object
The new value.
The new value .