30 references to SerializerKind
illink (30)
Linker.Steps\DiscoverSerializationHandler.cs (16)
35
if (!Context.SerializationMarker.IsActive (
SerializerKind
.DataContractSerializer) &&
40
Context.SerializationMarker.Activate (
SerializerKind
.DataContractSerializer);
43
if (!Context.SerializationMarker.IsActive (
SerializerKind
.XmlSerializer) &&
48
Context.SerializationMarker.Activate (
SerializerKind
.XmlSerializer);
83
var
serializedFor =
SerializerKind
.None;
86
if (IsPreservedSerializationAttribute (provider, attribute, out
SerializerKind
serializerKind))
90
if (serializedFor ==
SerializerKind
.None)
93
if (serializedFor.HasFlag (
SerializerKind
.DataContractSerializer))
94
Context.SerializationMarker.TrackForSerialization (provider,
SerializerKind
.DataContractSerializer);
95
if (serializedFor.HasFlag (
SerializerKind
.XmlSerializer))
96
Context.SerializationMarker.TrackForSerialization (provider,
SerializerKind
.XmlSerializer);
99
static bool IsPreservedSerializationAttribute (ICustomAttributeProvider provider, CustomAttribute attribute, out
SerializerKind
serializerKind)
102
serializerKind =
SerializerKind
.None;
116
serializerKind =
SerializerKind
.DataContractSerializer;
127
serializerKind =
SerializerKind
.XmlSerializer;
Linker\SerializationMarker.cs (14)
56
SerializerKind
ActiveSerializers { get; set; }
58
Dictionary<
SerializerKind
, HashSet<ICustomAttributeProvider>>? _trackedRoots;
59
Dictionary<
SerializerKind
, HashSet<ICustomAttributeProvider>> TrackedRoots {
61
_trackedRoots ??= new Dictionary<
SerializerKind
, HashSet<ICustomAttributeProvider>> ();
81
public bool IsActive (
SerializerKind
serializerKind) => ActiveSerializers.HasFlag (serializerKind);
83
static DependencyKind ToDependencyKind (
SerializerKind
serializerKind) => serializerKind switch {
84
SerializerKind
.DataContractSerializer => DependencyKind.DataContractSerialized,
85
SerializerKind
.XmlSerializer => DependencyKind.XmlSerialized,
86
_ => throw new ArgumentException (nameof (
SerializerKind
))
89
public void TrackForSerialization (ICustomAttributeProvider provider,
SerializerKind
serializerKind)
104
public void Activate (
SerializerKind
serializerKind)
106
if (!Enum.IsDefined<
SerializerKind
> (serializerKind) || serializerKind ==
SerializerKind
.None)
123
public void MarkRecursiveMembers (ICustomAttributeProvider provider,
SerializerKind
serializerKind)