This topic has not yet been rated - Rate this topic

ComponentSerializationService.SerializeAbsolute Method

Serializes the given object, accounting for default property values.

Namespace:  System.ComponentModel.Design.Serialization
Assembly:  System (in System.dll)
public abstract void SerializeAbsolute(
	SerializationStore store,
	Object value
)

Parameters

store
Type: System.ComponentModel.Design.Serialization.SerializationStore

The SerializationStore to which the state of value will be serialized.

value
Type: System.Object

The object to serialize.

ExceptionCondition
ArgumentNullException

store or value is null.

InvalidOperationException

store is closed, or store is not a supported type of serialization store. Use a store returned by CreateStore.

Standard serialization, as implemented through the Serialize method, only serializes values that differ from the component's default state. This provides the most compact serialization mechanism but assumes that a newly created object will be used during deserialization. If an existing object is used, the resulting deserialized object is not guaranteed to duplicate the original state of the serialized object; the properties that contained default values during serialization will not be reset back to their defaults during deserialization.

The SerializeAbsolute method does not use this shortcut. It serializes all properties of the source object so that deserialization can restore all the object's properties, regardless of default state.

This method is particularly useful for serializing collections, because the order of the constituent items within the collection can change. In this circumstance, the safest process to restore the original state of the entire collection is to overwrite all the items with all their original property values.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.