Skip to content
Permalink
Browse files
Fixed API for .NET CF compatibility.
  • Loading branch information
Jim Gomes committed Aug 11, 2010
1 parent 1b0655d commit 72e029fcf659142f73de8f3355aede76989e20c3
Showing 1 changed file with 8 additions and 8 deletions.
@@ -64,7 +64,7 @@ public static StringDictionary ParseQuery(String query)
{
return EmptyMap;
}

// strip the initial "?"
if(query.StartsWith("?"))
{
@@ -139,7 +139,7 @@ public static void SetProperties(object target, StringDictionary map)
}
}
}

/// <summary>
/// Sets the public properties of a target object using a string map.
/// This method uses .Net reflection to identify public properties of
@@ -157,7 +157,7 @@ public static void SetProperties(object target, StringDictionary map, string pre

foreach(string key in map.Keys)
{
if(key.ToLower().StartsWith(prefix.ToLower()))
if(key.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase))
{
string bareKey = key.Substring(prefix.Length);
PropertyInfo prop = type.GetProperty(bareKey,
@@ -210,17 +210,17 @@ public static void SetProperties(object target, StringDictionary map, string pre

foreach(string key in props.Keys)
{
if(key.StartsWith(prefix))
if(key.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase))
{
string bareKey = key.Substring(prefix.Length);
string bareKey = key.Substring(prefix.Length);
String value = props[key];
result[bareKey] = value;
}
}

return result;
}

public static StringDictionary ExtractProperties(StringDictionary props, string prefix) {

if(props == null)
@@ -233,7 +233,7 @@ public static void SetProperties(object target, StringDictionary map, string pre

foreach(string key in props.Keys)
{
if(key.StartsWith(prefix, true, CultureInfo.InvariantCulture))
if(key.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase))
{
String value = props[key];
result[key] = value;
@@ -408,7 +408,7 @@ public Uri toUri()

public static String StripPrefix(String value, String prefix)
{
if(value.StartsWith(prefix))
if(value.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase))
{
return value.Substring(prefix.Length);
}

0 comments on commit 72e029f

Please sign in to comment.