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);
         }
     }
 }
Esempio n. 2
0
 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));
     }
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 protected virtual void InternalAggregate(TIn input)
 {
     AggregationInstance?.Aggregate(SourcePropertyInfo?.GetValue(this.GetInValue(input)));
 }