private BindingMemberInfo(string path, BindingMemberType memberType, Type type) { Should.NotBeNull(path, "path"); Should.NotBeNull(type, "type"); _type = type; _memberType = memberType; _path = path; }
private BindingMemberInfo(string path, BindingMemberType memberType, bool hasSetter = false) : this(path, memberType, typeof(object)) { if (memberType == BindingMemberType.BindingContext) { _canObserve = true; _isDataContext = true; _getValueAccessorSingle = o => { if (o == null) return null; return BindingServiceProvider.ContextManager.GetBindingContext(o).Value; }; _setValueAccessorSingle = (o, arg) => BindingServiceProvider.ContextManager.GetBindingContext(o).Value = arg; _canRead = true; _canWrite = true; _isSingleParameter = true; } else if (memberType == BindingMemberType.Empty) { if (hasSetter) { _getValueAccessor = (o, objects) => null; _setValueAccessor = (o, objects) => null; } else { _getValueAccessorSingle = o => o; _setValueAccessorSingle = NotSupportedSetter; _isSingleParameter = true; } _canRead = true; _canWrite = _setValueAccessorSingle != null; } else if (memberType == BindingMemberType.Unset) { _getValueAccessorSingle = o => BindingConstants.UnsetValue; _setValueAccessorSingle = NotSupportedSetter; _canRead = true; _canWrite = false; _isSingleParameter = true; } }
private BindingMemberInfo(string path, BindingMemberType memberType, Type type) { Should.NotBeNull(path, nameof(path)); Should.NotBeNull(type, nameof(type)); _type = type; _memberType = memberType; _path = path; }