Edit

Share via


CodeDomSerializerBase.SerializePropertiesToResources Method

Definition

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

protected:
 void SerializePropertiesToResources(System::ComponentModel::Design::Serialization::IDesignerSerializationManager ^ manager, System::CodeDom::CodeStatementCollection ^ statements, System::Object ^ value, cli::array <Attribute ^> ^ filter);
protected void SerializePropertiesToResources (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, System.CodeDom.CodeStatementCollection statements, object value, Attribute[] filter);
protected void SerializePropertiesToResources (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, System.CodeDom.CodeStatementCollection statements, object value, Attribute[]? filter);
member this.SerializePropertiesToResources : System.ComponentModel.Design.Serialization.IDesignerSerializationManager * System.CodeDom.CodeStatementCollection * obj * Attribute[] -> unit
Protected Sub SerializePropertiesToResources (manager As IDesignerSerializationManager, statements As CodeStatementCollection, value As Object, filter As Attribute())

Parameters

manager
IDesignerSerializationManager

The IDesignerSerializationManager to use for serialization.

statements
CodeStatementCollection

Not used.

value
Object

The object whose properties will be serialized.

filter
Attribute[]

An Attribute array that filters which properties will be serialized.

Exceptions

manager, value, or statements is null.

Remarks

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.

Applies to

See also