Event Element for Class for ManagedLibrary (ProxyGen)

Represents an event that is defined in a proxy type for a managed type.

<Event isExternal = "true/false"
    isExcluded = "true/false"
    isStatic = "true/false"
    newName = "Name of event in proxy type"
    originalName = "Name of original event">
  <Attribute>...</Attribute>
  <DeclaringType>...</DeclaringType>
  <Parameter>...</Parameter>
  <ReturnValueAttribute>...</ReturnValueAttribute>
  <Type>...</Type>
</Event>

ManagedEvent_Type

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

isExternal

Optional xs:boolean attribute.

true to declare the event using the extern keyword; otherwise, false. The default is false.

isExcluded

Optional xs:boolean attribute.

true to omit the event from the proxy code; false to include the event in the proxy code. The default is false.

isStatic

Optional xs:boolean attribute.

true to declare the event using the static keyword; otherwise, false. The default is false.

newName

Optional name_Type attribute.

The new name of the event in the proxy code.

originalName

Required name_Type attribute.

The name of the original event in the host application's object model.

Child Elements

Element

Description

Attribute

Optional Attribute_Type element.

Represents an attribute that is applied to the event.

DeclaringType

Optional TypeReference_Type element.

Represents the interface or base type in which the event is declared, if the event is an explicit interface implementation or an override. The type cannot be an array.

Parameter

Optional Parameter_Type element.

Represents a parameter of the delegate that handles the event.

ReturnValueAttribute

Optional Attribute_Type element.

Describes an attribute applied to the return value of the delegate that handles the event.

Type

Optional TypeReference_Type element.

Describes the type of the delegate that handles the event. The type cannot be an array.

Parent Elements

Element

Description

Class

Represents a proxy class for a managed class.

Interface

Represents a proxy interface for a managed interface.

Struct

Represents a proxy struct for a managed struct.

Example

The following example demonstrates three Event elements that represent proxy events named ColorChanged, LocationChanged, and SizeChanged.

<Event originalName="ColorChanged" isExcluded="false">
  <Type>
    <TypeReference type="Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.ColorChangedEventHandler" />
  </Type>
</Event>
<Event originalName="LocationChanged" isExcluded="false">
  <Type>
    <TypeReference type="Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.LocationChangedEventHandler" />
  </Type>
</Event>
<Event originalName="SizeChanged" isExcluded="false">
  <Type>
    <TypeReference type="Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.SizeChangedEventHandler" />
  </Type>
</Event>

Element Information

Namespace

https://schemas.microsoft.com/vsta/2008/01/ProxyGenDescriptor

Schema name

ProxyGen Descriptor

Validation file

ProxyGenDescriptorv2.xsd

Can be empty

Yes

See Also

Concepts

ProxyGen Descriptor Schema Reference

Creating Proxies

Defining Entry Points and Other Proxy Changes