forked from ServiceStack/ServiceStack.Text
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsConfigScope.cs
More file actions
85 lines (75 loc) · 3.11 KB
/
JsConfigScope.cs
File metadata and controls
85 lines (75 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System;
using System.Collections.Generic;
using ServiceStack.Text.Common;
namespace ServiceStack.Text
{
public sealed class JsConfigScope : IDisposable
{
bool disposed;
readonly JsConfigScope parent;
[ThreadStatic]
private static JsConfigScope head;
internal JsConfigScope()
{
PclExport.Instance.BeginThreadAffinity();
parent = head;
head = this;
}
internal static JsConfigScope Current => head;
public static void DisposeCurrent()
{
head?.Dispose();
}
public void Dispose()
{
if (!disposed)
{
disposed = true;
head = parent;
PclExport.Instance.EndThreadAffinity();
}
}
public bool? ConvertObjectTypesIntoStringDictionary { get; set; }
public bool? TryToParsePrimitiveTypeValues { get; set; }
public bool? TryToParseNumericType { get; set; }
public bool? TryParseIntoBestFit { get; set; }
public ParseAsType? ParsePrimitiveFloatingPointTypes { get; set; }
public ParseAsType? ParsePrimitiveIntegerTypes { get; set; }
public bool? ExcludeDefaultValues { get; set; }
public bool? IncludeNullValues { get; set; }
public bool? IncludeNullValuesInDictionaries { get; set; }
public bool? IncludeDefaultEnums { get; set; }
public bool? TreatEnumAsInteger { get; set; }
public bool? ExcludeTypeInfo { get; set; }
public bool? IncludeTypeInfo { get; set; }
public string TypeAttr { get; set; }
public string DateTimeFormat { get; set; }
internal string JsonTypeAttrInObject { get; set; }
internal string JsvTypeAttrInObject { get; set; }
public Func<Type, string> TypeWriter { get; set; }
public Func<string, Type> TypeFinder { get; set; }
public Func<string, object> ParsePrimitiveFn { get; set; }
public DateHandler? DateHandler { get; set; }
public TimeSpanHandler? TimeSpanHandler { get; set; }
public PropertyConvention? PropertyConvention { get; set; }
public bool? EmitCamelCaseNames { get; set; }
public bool? EmitLowercaseUnderscoreNames { get; set; }
public bool? ThrowOnError { get; set; }
public bool? SkipDateTimeConversion { get; set; }
public bool? AlwaysUseUtc { get; set; }
public bool? AssumeUtc { get; set; }
public bool? AppendUtcOffset { get; set; }
public bool? PreferInterfaces { get; set; }
public bool? IncludePublicFields { get; set; }
public int? MaxDepth { get; set; }
public DeserializationErrorDelegate OnDeserializationError { get; set; }
public EmptyCtorFactoryDelegate ModelFactory { get; set; }
public string[] ExcludePropertyReferences { get; set; }
public HashSet<Type> ExcludeTypes { get; set; }
[Obsolete("Renamed to ThrowOnError")] public bool? ThrowOnDeserializationError
{
get => ThrowOnError;
set => ThrowOnError = value;
}
}
}