Share via


Delegate Element (ProxyGen)

Represents a proxy delegate for a managed delegate that is defined in a parent class.

-or-

Represents a proxy delegate that handles a COM event.

<Delegate isExcluded = "true/false"
    newName = "Name of proxy delegate"
    newNamespace = "Namespace of proxy delegate"
    originalFullyQualifiedName = "Fully qualified name of original delegate">
  <Attribute>...</Attribute>
  <Parameter>...</Parameter>
  <ReturnValueAttribute>...</ReturnValueAttribute>
  <Type>...</Type>
</Delegate>

Delegate_Type

Attributes and Elements

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

Attributes

Attribute

Description

isExcluded

Optional xs:boolean attribute.

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

newName

Optional identifier_Type attribute.

The name of the proxy delegate.

newNamespace

Optional name_Type attribute.

The namespace of the proxy delegate.

originalFullyQualifiedName

Required xs:ID attribute.

The fully qualified name of the original delegate in the host application's object model.

Child Elements

Element

Description

Attribute

Optional Attribute_Type element.

Represents an attribute that is applied to the delegate.

Parameter

Optional Parameter_Type element.

Represents a parameter of the delegate.

ReturnValueAttribute

Optional Attribute_Type element.

Represents an attribute that is applied to the return value of the delegate.

Type

Required ArrayTypeReference_Type element.

Describes the type of the return value of the delegate. The type can be an array.

Parent Elements

Element

Description

Class Element for COMLibrary

Represents a proxy class for a COM class.

Class Element for ManagedLibrary

Represents a proxy class for a managed class.

COMLibrary

Represents the contents of a COM type library.

Interface Element for COMLibrary

Represents a proxy interface for a COM interface.

Interface Element for ManagedLibrary

Represents a proxy interface for a managed interface.

Struct

Represents a proxy struct for a managed struct.

Example

The following example demonstrates a Delegate element. This element represents a proxy delegate that handles a COM event.

<Delegate originalFullyQualifiedName="ShapeApp.Proxy._IDrawingEvents.Closed" 
    newName="ClosedEventHandler" isExcluded="false"
    newNamespace="ShapeApp.Proxy">
  <Parameter originalName="sender">
    <Attribute>
      <Type>
        <ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.MarshalAsAttribute" />
      </Type>
      <Parameter value="IDispatch">
        <Type>
          <ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.UnmanagedType" />
        </Type>
      </Parameter>
    </Attribute>
    <Type>
      <ExternalTypeReference isInterface="false" type="System.Object" />
    </Type>
  </Parameter>
  <Type>
    <ExternalTypeReference isInterface="false" type="System.Void" />
  </Type>
</Delegate>

Element Information

Namespace

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

Schema name

ProxyGen Descriptor

Validation file

ProxyGenDescriptorv2.xsd

Can be empty

No

See Also

Concepts

ProxyGen Descriptor Schema Reference

Creating Proxies

Defining Entry Points and Other Proxy Changes