Method Element for Class for ManagedLibrary (ProxyGen)

Represents a method that is defined in a proxy type for a managed type.

<Method isExternal = "true/false"
    isExcluded = "true/false"
    isStatic = "true/false"
    newName = "Name of method in proxy type"
    originalName = "Name of original method">
  <Attribute>...</Attribute>
  <DeclaringType>...</DeclaringType>
  <Parameter>...</Parameter>
  <ReturnType>...</ReturnType>
  <ReturnValueAttribute>...</ReturnValueAttribute>
</Method>

ManagedMethod_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 method using the extern keyword; otherwise, false. The default is false.

isExcluded

Optional xs:boolean attribute.

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

isStatic

Optional xs:boolean attribute.

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

newName

Optional name_Type attribute.

The new name of the method in the proxy code.

originalName

Required name_Type attribute.

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

Child Elements

Element

Description

Attribute

Optional Attribute_Type element.

Represents an attribute that is applied to the method.

DeclaringType

Optional TypeReference_Type element.

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

Parameter

Optional Parameter_Type element.

Represents a parameter of the method.

ReturnType

Optional ArrayTypeReference_Type element.

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

ReturnValueAttribute

Optional Attribute_Type element.

Describes an attribute applied to the return value of the method.

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 a Method element that represents a proxy method named Load.

<Method originalName="Load" isExcluded="false">
  <Parameter originalName="savedState">
    <Type>
      <ExternalTypeReference isInterface="false" type="System.Byte" arrayInfo="[]" />
    </Type>
  </Parameter>
  <ReturnType>
    <TypeReference type="Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.IShape" />
  </ReturnType>
</Method>

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