don't break apart when using empty IReadOnlyDictionary

This commit is contained in:
Matthias Mailänder
2014-07-20 14:17:33 +02:00
parent 1071a94d1d
commit 7d0f4a261f
2 changed files with 6 additions and 0 deletions

View File

@@ -82,6 +82,9 @@ namespace OpenRA
return elems.JoinWith(", "); return elems.JoinWith(", ");
} }
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(OpenRA.Primitives.Cache<,>))
return ""; // TODO
if (t == typeof(DateTime)) if (t == typeof(DateTime))
return ((DateTime)v).ToString("yyyy-MM-dd HH-mm-ss", CultureInfo.InvariantCulture); return ((DateTime)v).ToString("yyyy-MM-dd HH-mm-ss", CultureInfo.InvariantCulture);

View File

@@ -257,6 +257,9 @@ namespace OpenRA.Utility
if (t.IsSubclassOf(typeof(Array))) if (t.IsSubclassOf(typeof(Array)))
return "Multiple {0}".F(FriendlyTypeName(t.GetElementType())); return "Multiple {0}".F(FriendlyTypeName(t.GetElementType()));
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(OpenRA.Primitives.Cache<,>))
return "Cached<{0},{1}>".F(t.GetGenericArguments().Select(FriendlyTypeName).ToArray());
if (t == typeof(int) || t == typeof(uint)) if (t == typeof(int) || t == typeof(uint))
return "Integer"; return "Integer";