public IEnumerable <Localizable> Validate(IComponentContext <float> context, IValidationContext validationContext, float value) { if ((value < _min) || (value > _max)) { yield return(new Localizable( "ValueOutsideRange", Localizable.NotLocalizable(_min), Localizable.NotLocalizable(_max))); } }
private IProperty GetProperty(object @object, PropertyInfo property, AssemblingContext assemblingContext) { var name = GetAttribute <ComponentNameAttribute>(property)?.Value ?? Localizable.NotLocalizable(property.Name); var initial = (dynamic)property.GetValue(@object); var form = GetFormType(assemblingContext); if ((GetAttribute <ComplexAttribute>(property) != null) && (initial != null)) { return(CreateComponent(initial, name, Combine(GetConfiguration(property, form), GetConfiguration(property.PropertyType, form)), assemblingContext)); } if (property.PropertyType.IsEnum || _knownTypes.Contains(property.PropertyType)) { return(CreateProperty(@object, initial, property, name, form)); } if (property.PropertyType == typeof(string)) { return(CreateStringProperty(@object, initial, property, name, form, assemblingContext?.TokenReplacer)); } return(null); }
public ErrorOccuredNotification(Exception exception) { Error = Localizable.NotLocalizable(exception.Message); Type = Localizable.NotLocalizable(exception.GetType().FullName); }