CodeDomSerializerBase::SerializeEvent Method (IDesignerSerializationManager^, CodeStatementCollection^, Object^, EventDescriptor^)

 

Serializes the given event into the given statement collection.

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

protected:
void SerializeEvent(
	IDesignerSerializationManager^ manager,
	CodeStatementCollection^ statements,
	Object^ value,
	EventDescriptor^ descriptor
)

Parameters

manager
Type: System.ComponentModel.Design.Serialization::IDesignerSerializationManager^

The IDesignerSerializationManager to use for serialization.

statements
Type: System.CodeDom::CodeStatementCollection^

The CodeStatementCollection into which the event will be serialized.

value
Type: System::Object^

The object to which descriptor is bound.

descriptor
Type: System.ComponentModel::EventDescriptor^

An EventDescriptor specifying the event to serialize.

Exception Condition
ArgumentNullException

manager, value, statements, or descriptor is null.

CodeDomSerializerException

IEventBindingService is not available.

The SerializeEvent method is a helper method that derived classes can call to serialize a single event into the given CodeStatementCollection. SerializeEvent queries the serialization manager for a MemberCodeDomSerializer for the given event, and then asks the MemberCodeDomSerializer to serialize it.

SerializeEvent places the statements and descriptor parameters on the ContextStack.

SerializeEvent requires an IEventBindingService to discover event bindings to methods that are not compiled. If this service is not present, event bindings to non-compiled methods will not be written. Event bindings to compiled methods will still be serialized if the objects to which the events are bound can be converted into expressions.

.NET Framework
Available since 2.0
Return to top
Show: