internal FuncBindingBridge(IBindingSourceInternal source, Expression <Func <TSource, object> > sourceGetter, PropertyInfo[] targetProperyChain) { MyBindingSource = source; getter = sourceGetter.Compile(); readExpression(sourceGetter); TargetPropertyChain = targetProperyChain; bool fromSource = true && TargetPropertyChain.Last().CanWrite; bool fromTarget = false && TargetPropertyChain.Last().CanRead && MyBindingSource.Controler.BackwardProperties.Contains(TargetPropertyName); if (fromSource && fromTarget) { Mode = BridgeMode.TwoWay; } else if (fromSource) { Mode = BridgeMode.OnlyFromSource; } else if (fromTarget) { Mode = BridgeMode.BackwardFromTarget; } else { throw new ArgumentException("Невозможно вычислить направление биндинга, необходимо что бы хотябы одно свойство имело возможность записи, а другое чтение."); } }
internal BindingBridge(IBindingSourceInternal source, PropertyInfo sourcePropery, PropertyInfo[] targetProperyChain) { MyBindingSource = source; SourcePropertyInfo = sourcePropery; TargetPropertyChain = targetProperyChain; bool fromSource = SourcePropertyInfo.CanRead && TargetPropertyChain.Last().CanWrite; bool fromTarget = SourcePropertyInfo.CanWrite && TargetPropertyChain.Last().CanRead && MyBindingSource.Controler.BackwardProperties.Contains(TargetPropertyName); if (fromSource && fromTarget) { Mode = BridgeMode.TwoWay; } else if (fromSource) { Mode = BridgeMode.OnlyFromSource; } else if (fromTarget) { Mode = BridgeMode.BackwardFromTarget; } else { throw new ArgumentException("Невозможно вычислить направление биндинга, необходимо что бы хотябы одно свойство имело возможность записи, а другое чтение."); } }
internal BindingBridge(IBindingSourceInternal source, PropertyInfo sourcePropery, PropertyInfo[] targetProperyChain) { MyBindingSource = source; SourcePropertyInfo = sourcePropery; TargetPropertyChain = targetProperyChain; bool fromSource = SourcePropertyInfo.CanRead && TargetPropertyChain.Last ().CanWrite; bool fromTarget = SourcePropertyInfo.CanWrite && TargetPropertyChain.Last ().CanRead && MyBindingSource.Controler.BackwardProperties.Contains (TargetPropertyName); if (fromSource && fromTarget) Mode = BridgeMode.TwoWay; else if (fromSource) Mode = BridgeMode.OnlyFromSource; else if (fromTarget) Mode = BridgeMode.BackwardFromTarget; else throw new ArgumentException ("Невозможно вычислить направление биндинга, необходимо что бы хотябы одно свойство имело возможность записи, а другое чтение."); }
internal BindingBridge(IBindingSourceInternal source, PropertyInfo sourcePropery, PropertyInfo[] targetProperyChain, IValueConverter converter, object converterParameter, CultureInfo converterCulture) : this(source, sourcePropery, targetProperyChain, converter) { ConverterParameter = converterParameter; ConverterCulture = converterCulture; }
internal BindingBridge(IBindingSourceInternal source, PropertyInfo sourcePropery, PropertyInfo[] targetProperyChain, IValueConverter converter) : this(source, sourcePropery, targetProperyChain) { ValueConverter = converter; }