Редагувати

Поділитися через


CodeDomSerializerBase.SerializeEvent Method

Definition

Serializes the given event into the given statement collection.

protected:
 void SerializeEvent(System::ComponentModel::Design::Serialization::IDesignerSerializationManager ^ manager, System::CodeDom::CodeStatementCollection ^ statements, System::Object ^ value, System::ComponentModel::EventDescriptor ^ descriptor);
protected void SerializeEvent (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, System.CodeDom.CodeStatementCollection statements, object value, System.ComponentModel.EventDescriptor descriptor);
member this.SerializeEvent : System.ComponentModel.Design.Serialization.IDesignerSerializationManager * System.CodeDom.CodeStatementCollection * obj * System.ComponentModel.EventDescriptor -> unit
Protected Sub SerializeEvent (manager As IDesignerSerializationManager, statements As CodeStatementCollection, value As Object, descriptor As EventDescriptor)

Parameters

manager
IDesignerSerializationManager

The IDesignerSerializationManager to use for serialization.

statements
CodeStatementCollection

The CodeStatementCollection into which the event will be serialized.

value
Object

The object to which descriptor is bound.

descriptor
EventDescriptor

An EventDescriptor specifying the event to serialize.

Exceptions

manager, value, statements, or descriptor is null.

Remarks

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.

Applies to

See also