public ValueConverter Build(IValueConverterRegistry registry, Type type) { return x => { if (x.Value.ToString().Contains(x.TargetName)) return true; return ValueConverterRegistry.BasicConvert(typeof(bool), x.Value); }; }
public ObjectResolver(IModelBinder[] binders, IValueConverterRegistry converters, ITypeDescriptorRegistry registry) { _binders.AddRange(binders); var defaultBinder = new StandardModelBinder(converters, registry); _binders.Add(defaultBinder); }
public void SetUp() { using (var runtime = FubuRuntime.Basic()) { registry = runtime.Get<BindingRegistry>(); } }
public void SetUp() { var container = new Container(); FubuApplication.For(new FubuRegistry()).StructureMap(container).Bootstrap(); registry = container.GetInstance <BindingRegistry>(); }
public void SetUp() { using (var runtime = FubuRuntime.Basic()) { registry = runtime.Get <BindingRegistry>(); } }
public PropertyBinderCache(IEnumerable<IPropertyBinder> binders, IValueConverterRegistry converters) { _binders.AddRange(binders); _binders.Add(new ConversionPropertyBinder(converters)); // TODO -- add the hierarchical / child binding _cache.OnMissing = prop => _binders.FirstOrDefault(x => x.Matches(prop)); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { var converter = TypeDescriptor.GetConverter(typeof(bool)); return x => x.PropertyValue.ToString().Contains(x.Property.Name) || (bool) converter.ConvertFrom(x.PropertyValue); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { var propertyType = property.PropertyType; var strategy = _library.StrategyFor(propertyType); return(new BasicValueConverter(strategy, propertyType)); }
public PropertyBinderCache(IEnumerable <IPropertyBinder> binders, IValueConverterRegistry converters, ICollectionTypeProvider collectionTypeProvider) { _binders.AddRange(binders); _binders.Add(new ConversionPropertyBinder(converters)); _binders.Add(new CollectionPropertyBinder(collectionTypeProvider)); _binders.Add(new NestedObjectPropertyBinder()); _cache.OnMissing = prop => _binders.FirstOrDefault(x => x.Matches(prop)); }
public PropertyBinderCache(IEnumerable<IPropertyBinder> binders, IValueConverterRegistry converters, ICollectionTypeProvider collectionTypeProvider) { _binders.AddRange(binders); _binders.Add(new ConversionPropertyBinder(converters)); _binders.Add(new CollectionPropertyBinder(collectionTypeProvider)); _binders.Add(new NestedObjectPropertyBinder()); _cache.OnMissing = prop => _binders.FirstOrDefault(x => x.Matches(prop)); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { var entityType = property.PropertyType; return(request => { var id = request.ValueAs <Guid?>(); return id.HasValue ? request.Service <IRepository>().Find(entityType, id.Value) : null; }); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { var entityType = property.PropertyType; return request => { var id = request.ValueAs<Guid?>(); return id.HasValue ? request.Service<IRepository>().Find(entityType, id.Value) : null; }; }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return rawValue => { var strVal = rawValue.Value as String; return strVal.IsNotEmpty() ? getConnectionString(strVal) : strVal; }; }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return(rawValue => { var strVal = rawValue.PropertyValue as String; return strVal.IsNotEmpty() ? Environment.ExpandEnvironmentVariables(strVal) : strVal; }); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return(rawValue => { var strVal = rawValue.PropertyValue as String; return strVal.IsNotEmpty() ? getConnectionString(strVal) : strVal; }); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return rawValue => { var strVal = rawValue.PropertyValue as String; return strVal.IsNotEmpty() ? Environment.ExpandEnvironmentVariables(strVal) : strVal; }; }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return(rawValue => { var strVal = rawValue.PropertyValue as String; return strVal.IsNotEmpty() ? strVal.ToPhysicalPath() : strVal; }); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return rawValue => { var strVal = rawValue.PropertyValue as String; return strVal.IsNotEmpty() ? strVal.MapPath() : strVal; }; }
public ValueConverter Build(IValueConverterRegistry registry, Type type) { Type innerType = type.GetGenericArguments()[0]; ValueConverter inner = registry[innerType]; return x => { if (x.Value == null || (x.Value is string && (string)x.Value == string.Empty)) return null; return inner(x); }; }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { var converter = TypeDescriptor.GetConverter(typeof(bool)); return x => { if (x.PropertyValue is bool) return x.PropertyValue; return x.PropertyValue.ToString().Contains(x.Property.Name) || x.PropertyValue.ToString().EqualsIgnoreCase(Checkbox_On) || (bool) converter.ConvertFrom(x.PropertyValue); }; }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { var converter = TypeDescriptor.GetConverter(typeof(bool)); return(x => { if (x.PropertyValue is bool) { return x.PropertyValue; } return x.PropertyValue.ToString().Contains(x.Property.Name) || x.PropertyValue.ToString().EqualsIgnoreCase(Checkbox_On) || (bool)converter.ConvertFrom(x.PropertyValue); }); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return(this); }
public void SetUp() { registry = StructureMapContainerFacility.GetBasicFubuContainer().GetInstance<IValueConverterRegistry>(); }
public ConversionPropertyBinder(IValueConverterRegistry converters) { _cache.OnMissing = prop => converters.FindConverter(prop); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return(context => context.PropertyValue); }
public void SetUp() { registry = StructureMapContainerFacility.GetBasicFubuContainer().GetInstance <IValueConverterRegistry>(); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return(_builder(registry, property)); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo prop) { return(null); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return(typeof(PassthroughConverter <>).CloseAndBuildAs <ValueConverter>(property.PropertyType)); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return typeof (PassthroughConverter<>).CloseAndBuildAs<ValueConverter>(property.PropertyType); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return x => x.Value.ToString().Contains(x.Property.Name) || (bool) ValueConverterRegistry.BasicConvert(typeof (bool), x.Value); }
public ValueConverter Build(IValueConverterRegistry registry, Type type) { return x => Enum.Parse(type, x.Value.ToString()); }
public ValueConverter Build(IValueConverterRegistry registry, Type type) { return x => x.Value == null ? Guid.Empty : new Guid(x.Value.ToString()); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { var propertyType = property.PropertyType; return(_converters[propertyType]); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return _builder(registry, property); }
public StandardModelBinder(IValueConverterRegistry converters, ITypeDescriptorRegistry typeRegistry) { _converters = converters; _typeRegistry = typeRegistry; NamingStrategy = DefaultNamingStrategy; }
public ConversionPropertyBinder(IValueConverterRegistry converters) { _converters = converters; }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { var propertyType = property.PropertyType; return(GetValueConverter(propertyType)); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return this; }
public void SetUp() { var container = new Container(); FubuApplication.For(new FubuRegistry()).StructureMap(container).Bootstrap(); registry = container.GetInstance<BindingRegistry>(); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo property) { return context => context.PropertyValue; }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo prop) { throw new NotImplementedException(); }
public ValueConverter Build(IValueConverterRegistry registry, PropertyInfo prop) { return null; }
protected virtual void FillValueConverters(IValueConverterRegistry registry) { registry.AddOrOverwrite("CommandParameter", new CommandParameterValueConverter()); }
public ValueConverter Build(IValueConverterRegistry registry, Type type) { return _builder(registry, type); }