public ADFJsonBaseTask(BaseTask T, Logging logging) { this.logging = logging; foreach (PropertyInfo SourcePropertyInfo in T.GetType() .GetProperties( BindingFlags.Public | BindingFlags.Instance)) { PropertyInfo TargetPropertyInfo = this.GetType().GetProperty(SourcePropertyInfo.Name, BindingFlags.Public | BindingFlags.Instance); if (null != TargetPropertyInfo && TargetPropertyInfo.CanWrite) { TargetPropertyInfo.SetValue(this, SourcePropertyInfo.GetValue(T), null); } } }
object IBindingBridgeInternal.GetValueFromSource(object sourceObject) { if (ValueConverter != null) { return(ValueConverter.Convert( SourcePropertyInfo.GetValue(sourceObject, null), TargetPropertyChain.Last().PropertyType, ConverterParameter, ConverterCulture ?? CultureInfo.CurrentUICulture )); } else { return(SourcePropertyInfo.GetValue(sourceObject, null)); } }
bool IBindingBridgeInternal.SetValueToSource(object sourceObject, object value) { object prepared = ValueConverter == null ? value : ValueConverter.ConvertBack(value, SourcePropertyInfo.PropertyType, ConverterParameter, ConverterCulture ?? CultureInfo.CurrentUICulture ); if (SourcePropertyInfo.GetValue(sourceObject, null) != prepared) { SourcePropertyInfo.SetValue(sourceObject, prepared, null); return(true); } return(false); }
protected virtual void InternalAggregate(TIn input) { AggregationInstance?.Aggregate(SourcePropertyInfo?.GetValue(this.GetInValue(input))); }