Share via


Property Element for Class for COMLibrary (ProxyGen)

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

<Property dispID = "Dispatch ID of property "
    isExternal = "true/false"
    isExcluded = "true/false"
    newName = "New name of property in proxy type"
    originalName = "Name of original property ">
  <Attribute>...</Attribute>
  <DeclaringType>...</DeclaringType>
  <Get>...</Get>
  <Parameter>...</Parameter>
  <ReturnValueAttribute>...</ReturnValueAttribute>
  <Set>...</Set>
  <Type>...</Type>
</Property>

COMProperty_Type

Attributes and Elements

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

Attributes

Attribute

Description

dispId

Required xs:long attribute.

The dispatch ID of the property.

isExternal

Optional xs:boolean attribute.

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

isExcluded

Optional xs:boolean attribute.

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

newName

Optional name_Type attribute.

The new name of the property in the proxy code.

originalName

Required name_Type attribute.

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

Child Elements

Element

Description

Attribute

Optional Attribute_Type element.

Represents an attribute that is applied to the property.

DeclaringType

Optional TypeReference_Type element.

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

Get

Optional element.

Represents the get accessor of the property.

Parameter

Optional Parameter_Type element.

Represents a parameter of the property.

ReturnValueAttribute

Optional Attribute_Type element.

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

Set

Optional element.

Represents the set accessor of the property.

Type

Optional TypeReference_Type element.

Describes the type of the property. The type cannot be an array.

Parent Elements

Element

Description

Class

Represents a proxy class for a COM class.

Interface

Represents a proxy interface for a COM interface.

Example

The following example demonstrates a Property element that represents a property named FileName.

<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

Yes

See Also

Concepts

ProxyGen Descriptor Schema Reference

Creating Proxies

Defining Entry Points and Other Proxy Changes