public PropertyValueSource GetValueSource(ITrackValueSource target) { if (target == null) { throw Logger.Fatal.ArgumentNull(nameof(target)); } return target.GetValueSource(PropertyInfo); }
public PropertyValueSource GetValueSource(ITrackValueSource target) { if (target == null) { throw Logger.Fatal.ArgumentNull(nameof(target)); } return(target.GetValueSource(PropertyInfo)); }
public void SetValue(ITrackValueSource target, Object value, PropertyValueSource source) { if (target == null) { throw Logger.Fatal.ArgumentNull(nameof(target)); } Setter(target, value); SetValueSource(target, source); }
public void Bind(ITrackValueSource target, HarshProvisionerContextBase context) { if (target == null) { throw Logger.Fatal.ArgumentNull(nameof(target)); } if (context == null) { throw Logger.Fatal.ArgumentNull(nameof(context)); } foreach (var prop in Properties) { var value = prop.Accessor.GetValue(target); if (value != null) { Logger.Debug( "Property {PropertyName} already has non-null value, skipping", prop.Name ); continue; } value = GetValueFromContext(prop, context); if (value != null) { Logger.Debug( "Setting property {PropertyName} to {$Value}", prop.Name, value ); prop.Accessor.SetValue(target, value, DefaultFromContextPropertyValueSource.Instance); } else { Logger.Debug( "Got null from context for property {PropertyName}, skipping", prop.Name ); } } }
private void SetValueSource(ITrackValueSource target, PropertyValueSource source) { target.SetValueSource(PropertyInfo, source); }
public void SetValue(ITrackValueSource target, Object value, PropertyValueSource source) => PropertyAccessor.SetValue(target, value, source);
public PropertyValueSource GetValueSource(ITrackValueSource target) => PropertyAccessor.GetValueSource(target);