Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

CodeDomSerializerBase.SerializeResource Method

Serializes the given object into a resource bundle using the given resource name.

Namespace:  System.ComponentModel.Design.Serialization
Assembly:  System.Design (in System.Design.dll)

protected void SerializeResource(
	IDesignerSerializationManager manager,
	string resourceName,
	Object value


Type: System.ComponentModel.Design.Serialization.IDesignerSerializationManager

The IDesignerSerializationManager to use for serialization.

Type: System.String

The name of the resource bundle into which value will be serialized.

Type: System.Object

The object to serialize.

The SerializeResource method is a helper method that serializes a value to a resource bundle under the given name. The culture that the resource is written to is determined by searching the serialization manager’s Properties collection for a property called ResourceCulture. If this property exists, resources will be written to that culture. Otherwise, resources will be written to the invariant culture. The value parameter must be serializable.

SerializeResource requires an IResourceService to obtain a ResourceWriter to write resources for the correct culture. If this service is not available, SerializeResource will instead build a binary object in code that represents the resource.

Notes to Callers

ResourceCulture is a read-write property that is accessed through the serialization manager’s Properties collection. The SerializeResource method never changes the value of this property; it merely reads it to identify the culture to which it will write. The property is set during deserialization as resources are parsed and loaded.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
© 2015 Microsoft