CollectionCodeDomSerializer.Serialize Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Serializes the given collection into a CodeDOM object.
public:
override System::Object ^ Serialize(System::ComponentModel::Design::Serialization::IDesignerSerializationManager ^ manager, System::Object ^ value);
public override object Serialize (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, object value);
public override object? Serialize (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, object value);
override this.Serialize : System.ComponentModel.Design.Serialization.IDesignerSerializationManager * obj -> obj
Public Overrides Function Serialize (manager As IDesignerSerializationManager, value As Object) As Object
Parameters
- manager
- IDesignerSerializationManager
The IDesignerSerializationManager to use during serialization.
- value
- Object
The object to serialize.
Returns
A CodeDOM object representing value
.
Exceptions
manager
or value
is null
.
Remarks
Collections are serialized as follows:
If the collection is an array, the array is written.
If the collection has an AddRange method, it will be called and provided with an array.
If the collection has an Add method, it will be called repeatedly until all items in the collection are written.
If the collection is an IList, the Serialize method will cast the collection to an IList and add through that interface.
- If the collection has no Add method, but is marked with DesignerSerializationVisibility.Content, Serialize will enumerate the collection and serialize each element.