Share via


Attribute Element (ProxyGen)

Represents an attribute of a type, member, or parameter.

<Attribute>
  <NullParameter>...</NullParameter>
  <Parameter>...</Parameter>
  <NamedNullParameter>...</NamedNullParameter>
  <NamedParameter>...</NamedParameter>
  <Type>...</Type>
</Attribute>

Attribute_Type

Attributes and Elements

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

Attributes

None.

Child Elements

Element

Description

NamedNullParameter

Optional element.

Represents a named parameter of the attribute's constructor that is passed the value null. This element must be located after the Parameter and NullParameter elements.

NamedParameter

Optional element.

Represents a named parameter of the attribute's constructor. This element must be located after the Parameter and NullParameter elements.

NullParameter

Optional element.

Represents a positional parameter of the attribute's constructor that is passed the value null. This element must be located before the NamedParameter and NamedNullParameter elements.

Parameter

Optional element.

Represents a positional parameter of the attribute's constructor. This element must be located before the NamedParameter and NamedNullParameter elements.

Type

Required TypeReference_Type element.

Describes the type of the attribute. This element can be only the first or last child element.

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.

Constant

Represents a constant that is defined in a proxy type for a COM or managed type.

Delegate Element

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 Element for ManagedLibrary

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

Enum

Represents a proxy enumeration for a COM or managed enumeration.

EnumerationValue

Represents a member in a proxy enumeration for a COM or managed enumeration.

Event Element for Class for COMLibrary

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

Event Element for Class for ManagedLibrary

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

Exception

Represents a proxy exception for a managed exception.

Field

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

Get

Represents the get accessor of a property that is defined in a proxy type for a COM or managed type.

Interface Element for COMLibrary

Represents a proxy interface for a COM interface.

Interface Element for ManagedLibrary

Represents a proxy interface for a managed interface.

Method Element for Class for COMLibrary

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

Method Element for Class for ManagedLibrary

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

Parameter

Represents a parameter of a method, property, or event that is defined in a proxy type for a COM or managed type.

Property Element for Class for COMLibrary

Represents a property that is defined in a proxy type for a COM type.

Property Element for Class for ManagedLibrary

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

Set

Represents the set accessor of a property that is defined in a proxy type for a COM or managed type.

Struct

Represents a proxy struct for a managed struct.

Example

The following example demonstrates an Attribute element that represents an attribute of a get accessor for a property named FileName. This example applies the MarshalAsAttribute attribute to the get accessor.

<Property originalName="FileName" isExcluded="false" dispId="1">
  <Type>
    <ExternalTypeReference isInterface="false" type="System.String" />
  </Type>
  <Get isExcluded="false">
    <Attribute>
      <Type>
        <ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.MarshalAsAttribute" />
      </Type>
      <Parameter value="BStr">
        <Type>
          <ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.UnmanagedType" />
        </Type>
      </Parameter>
    </Attribute>
  </Get>
</Property>

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