CodeDomSerializerBase.SerializePropertiesToResources Method (IDesignerSerializationManager, CodeStatementCollection, Object, Attribute[])


Serializes the properties on the given object into the invariant culture’s resource bundle.

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

protected void SerializePropertiesToResources(
	IDesignerSerializationManager manager,
	CodeStatementCollection statements,
	object value,
	Attribute[] filter


Type: System.ComponentModel.Design.Serialization.IDesignerSerializationManager

The IDesignerSerializationManager to use for serialization.

Type: System.CodeDom.CodeStatementCollection

Not used.

Type: System.Object

The object whose properties will be serialized.

Type: System.Attribute[]

An Attribute array that filters which properties will be serialized.

Exception Condition

manager, value, or statements is null.

The SerializePropertiesToResources method is a helper method that derived classes can call. It looks at properties on the value parameter that match the filter parameter, and then it serializes the properties into the invariant culture resource bundle. If the resource service returns a ResXResourceWriter, the property values will be stored in the metadata section of the XML resource (.resx) file. The statements parameter is not used.

To be serialized as a resource, a property must be simple (not a content property) and its value must be serializable. Properties that do not conform to this pattern will be skipped.

SerializePropertiesToResources requires an IResourceService to obtain a ResourceWriter to write resources for the invariant culture. If this service is not available, no resources will be written.

.NET Framework
Available since 2.0
Return to top