Defines the context of a serialization operation.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.11.0 (in Microsoft.VisualStudio.Modeling.Sdk.11.0.dll)
'Declaration Public NotInheritable Class SerializationContext
public sealed class SerializationContext
public ref class SerializationContext sealed
[<Sealed>] type SerializationContext = class end
public final class SerializationContext
The SerializationContext type exposes the following members.
|SerializationContext(DomainXmlSerializerDirectory)||Create a serialization context with no source/destination location information.|
|SerializationContext(DomainXmlSerializerDirectory, String)||Create a serialization context with given source/destination location.|
|SerializationContext(DomainXmlSerializerDirectory, String, SerializationResult)||Create a serialization context with given source/destination location and SeralizationResult.|
|Directory||A serializer instance needs to look up for other serializer instances during serialization/deserialization, so this directory provides the lookup service.|
|Item||Indexer to access properties stored in this context. The property name is compared by case-sensitive ordinal string comparison. If a property already exists in the context, setting it will override the old value with the new value. If a property doesn't exist in the context, getting it will return null, therefore setting a property to null will remove it from the context (i.e. null and non-existing values are not distinguishable).|
|Location||In read operation, this is the source's location; in write operation, this is the destination location. Usually this is a file path, but it can be other format as well, depending on the underlying source/destination. It can be null as well if the location is not available, e.g. serializing to a string buffer.|
|Result||This is the SerializationResult collected from all serializers participating in the current serialization operation.|
|WriteOptionalPropertiesWithDefaultValue||Whether optional properties with default value should be written out during serialization.|
|Equals||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
|TransactionContextKey||Unique key used to identify SerializationContext instances in the TransactionContext property bag|
The context is passed to each participating serializer and provides information that can be used during serialization. The context also stores the results that are collected after serialization.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.