private object GetParameterFromMatch(ParameterInfo pi, Match match, IBlock block) { if (InlineTypes.InlineTypeExistsFor(pi.ParameterType)) { if (match.Groups[pi.Name].Success) { string value = match.Groups[pi.Name].Value; return(ValueParser.ParseValue(value, pi.ParameterType)); } } else if (block != null && BlockTypes.BlockTypeExistsFor(pi.ParameterType)) { BlockType blockType = BlockTypes.GetBlockTypeFor(pi.ParameterType); return(blockType.GetObject(pi.ParameterType, block)); } return(null); }
/// <summary> /// Sets the formatted value. /// </summary> /// <param name="value">The value.</param> public void SetFormattedValue(string value) { SetValue(ValueParser.ParseValue(value, GetValueType())); }