示例#1
0
        private static string GetValue(IDictionary <string, PropertyMetaData> placeholders, string key)
        {
            var returnValue = GetPropertyMetaData(placeholders, key);

            return(PropertyMetaData.SanitizeProperty(returnValue) == null ?
                   string.Empty : PropertyMetaData.SanitizeProperty(returnValue).ToString());
        }
示例#2
0
        private static PropertyMetaData GetPropertyMetaData(IDictionary <string, PropertyMetaData> placeholders, string key)
        {
            PropertyMetaData returnValue;

            if (!placeholders.TryGetValue(key, out returnValue))
            {
                returnValue = new PropertyMetaData {
                    Type = typeof(string), Value = string.Empty
                };
            }
            return(returnValue);
        }
示例#3
0
 public static object SanitizeProperty(PropertyMetaData propertyMetaData)
 {
     return(SanitizeFunctions[propertyMetaData.Type](propertyMetaData));
 }
示例#4
0
 public static object Sanitize(PropertyMetaData propertyMetaData, object defaultValue)
 {
     return(propertyMetaData.Value ?? defaultValue);
 }