示例#1
0
 private static string GetStringValue(ParameterAttribute attribute, object value)
 {
     if (value is DateTime)
     {
         value = ((DateTime)value).ToUniversalTime();
     }
     else if (value is Boolean)
     {
         value = ((Boolean)value).GetHashCode();
     }
     return(string.Format(CultureInfo.InvariantCulture, attribute.FormatString ?? "{0}", value));
 }
示例#2
0
 private static string GetStringValue(ParameterAttribute attribute, object value)
 {
     if (value is DateTime)
     {
         value = ((DateTime)value).ToUniversalTime();
     } else if (value is Boolean) {
         value = ((Boolean)value).GetHashCode();
     }
     return string.Format (CultureInfo.InvariantCulture, attribute.FormatString ?? "{0}", value);
 }
示例#3
0
 private static KeyValuePair <string, ValueHolder> ParameterFromValue(string suffix, ParameterAttribute attribute, object value, bool excludeFromHash)
 {
     return(new KeyValuePair <string, ValueHolder>(
                attribute.Name + suffix,
                new ValueHolder
     {
         Value = GetStringValue(attribute, value),
         ExcludeFromHash = excludeFromHash || attribute.ExcludeFromHash,
         SortIndex = attribute.SortIndex
     }
                ));
 }
示例#4
0
 private static KeyValuePair<string, ValueHolder> ParameterFromValue(string suffix, ParameterAttribute attribute, object value, bool excludeFromHash)
 {
     return new KeyValuePair<string, ValueHolder>(
         attribute.Name + suffix,
         new ValueHolder
             {
                 Value = GetStringValue(attribute, value),
                 ExcludeFromHash = excludeFromHash || attribute.ExcludeFromHash,
                 SortIndex = attribute.SortIndex
             }
         );
 }