Class EmitBehaviors
A set of built-in, identified behaviors that configure how a serializer emits content when it serializes an object.
Inheritance
Inherited Members
Namespace: ExtendedXmlSerializer.Configuration
Assembly: ExtendedXmlSerializer.dll
Syntax
public static class EmitBehaviors
Properties
Always
Ensures that content is always emitted, regardless of its value.
Declaration
public static IEmitBehavior Always { get; }
Property Value
IEmitBehavior
|
Assigned
Declaration
[Obsolete("This is considered deprecated and will be removed in a future release. Use EmitBehaviors.WhenModified instead.")]
public static IEmitBehavior Assigned { get; }
Property Value
IEmitBehavior
|
Classic
Follows the classic serializer behavior for emitting content. For classic serialization, the serializer always emits the value when it is a System.Enum and empty lists. Otherwise, it emits if the value is assigned (non-null).
Declaration
public static IEmitBehavior Classic { get; }
Property Value
IEmitBehavior
|
NotDefault
Declaration
[Obsolete("This is considered deprecated and will be removed in a future release. Use EmitBehaviors.WhenAssigned instead.")]
public static IEmitBehavior NotDefault { get; }
Property Value
IEmitBehavior
|
WhenAssigned
This configures the container to emit when the value is assigned. That is, not null.
Declaration
public static IEmitBehavior WhenAssigned { get; }
Property Value
IEmitBehavior
|
WhenModified
This is a variant of the WhenAssigned behavior. With this behavior, the serializer emits when the
value is different from the defined value in the class. For instance, if you have a property public bool MyProperty {get; set} = true
and MyProperty
is false
upon serialization, then the content is emitted.
Declaration
public static IEmitBehavior WhenModified { get; }
Property Value
IEmitBehavior
|