Permalink
Browse files

changed the forcetypeinfo to includetypeinfo

  • Loading branch information...
1 parent b98062f commit 94710110ae4377b231d5976aec9d71d092639254 @allenarthurgay committed Sep 20, 2012
@@ -28,9 +28,9 @@ internal static class WriteType<T, TSerializer>
internal static TypePropertyWriter[] PropertyWriters;
private static readonly WriteObjectDelegate WriteTypeInfo;
- private static bool IsForced
+ private static bool IsIncluded
{
- get { return (JsConfig.ForceTypeInfo || JsConfig<T>.ForceTypeInfo); }
+ get { return (JsConfig.IncludeTypeInfo || JsConfig<T>.IncludeTypeInfo); }
}
private static bool IsExcluded
{
@@ -41,7 +41,7 @@ static WriteType()
{
CacheFn = Init() ? GetWriteFn() : WriteEmptyType;
- if (IsForced)
+ if (IsIncluded)
{
WriteTypeInfo = TypeInfoWriter;
}
@@ -60,7 +60,7 @@ public static void TypeInfoWriter(TextWriter writer, object obj)
TryWriteTypeInfo(writer, obj);
}
- private static bool ShouldSkipType() { return IsExcluded && !IsForced; }
+ private static bool ShouldSkipType() { return IsExcluded && !IsIncluded; }
private static bool TryWriteSelfType (TextWriter writer) {
if (ShouldSkipType()) return false;
@@ -90,7 +90,7 @@ public static bool ExcludeTypeInfo
[ThreadStatic]
private static bool? tsForceTypeInfo;
private static bool? sForceTypeInfo;
- public static bool ForceTypeInfo
+ public static bool IncludeTypeInfo
{
get
{
@@ -489,7 +489,7 @@ public class JsConfig<T>
/// <summary>
/// Always emit type info for this type. Takes precedence over ExcludeTypeInfo
/// </summary>
- public static bool ForceTypeInfo = false;
+ public static bool IncludeTypeInfo = false;
/// <summary>
/// Never emit type info for this type
@@ -356,7 +356,7 @@ public class ExplicitPets
[Test]
public void Can_force_specific_TypeInfo()
{
- JsConfig<Dog>.ForceTypeInfo = true;
+ JsConfig<Dog>.IncludeTypeInfo = true;
var pets = new ExplicitPets()
{
Cat = new Cat { Name = "Cat" },

0 comments on commit 9471011

Please sign in to comment.