public void SaveValueObjectOnRawData() { if (_isLocked) { return; } var currentPropertie = _getPropertyOfTheObjectFunction.Invoke(); if (currentPropertie.OwnEqual(_oldPropertie)) { return; } _isLocked = true; if (currentPropertie != null) { _propertySetter.Invoke(_owner, JsonConvert.SerializeObject(currentPropertie)); } else { _propertySetter.Invoke(_owner, null); } var currentList = currentPropertie as IList; if (currentList == null) { _oldPropertie = currentPropertie; } else { _oldPropertie = currentList.CloneO(); } _isLocked = false; }
public void SetValue(ref object p_target, object p_value) { if (_delegateForSet != null) { _delegateForSet.Invoke(ref p_target, p_value); } }
/// <summary> /// Executes the delegate on the specified target and value but only if it's not null /// </summary> public static void SafeInvoke <TTarget, TValue>(this MemberSetter <TTarget, TValue> setter, ref TTarget target, TValue value) { setter?.Invoke(ref target, value); }