public ModelValueProvider(string fieldOrPropertyChain, Type modelType, PropertyInfo modelProperty, Action <bool, string> addError) { if (modelType == null) { addError(false, EmailTemplateMessage.ImpossibleToAccess0BecauseTheTemplateHAsNo1.NiceToString(fieldOrPropertyChain, modelProperty.NiceName())); return; } this.Members = ParsedModel.GetMembers(modelType, fieldOrPropertyChain, addError); }
public GlobalValueProvider(string fieldOrPropertyChain, Action <bool, string> addError) { globalKey = fieldOrPropertyChain.TryBefore('.') ?? fieldOrPropertyChain; remainingFieldsOrProperties = fieldOrPropertyChain.TryAfter('.'); var gv = GlobalVariables.TryGetC(globalKey); if (gv == null) { addError(false, "The global key {0} was not found".FormatWith(globalKey)); } if (remainingFieldsOrProperties != null && gv != null) { this.Members = ParsedModel.GetMembers(gv.Type, remainingFieldsOrProperties, addError); } }
public ContinueValueProvider(string fieldOrPropertyChain, ValueProviderBase parent, Action <bool, string> addError) { this.Parent = parent; this.Members = ParsedModel.GetMembers(ParentType(), fieldOrPropertyChain, addError); }