Struct Element (ProxyGen)

Represents a proxy class for a managed struct in the host application's object model. When you use ProxyGen.exe to generate a proxy code file, it generates a class, rather than a struct, for every Struct element in the proxy descriptor file. For more information, see Proxies for Managed Assemblies.

<Class isExcluded = "true/false"
    isStatic = "true/false"
    newName = "Name of proxy class"
    newNamespace = "Namespace of proxy class"
    originalFullyQualifiedName = "Fully qualified name of original managed class">
  <Attribute>...</Attribute>
  <BaseType>...</BaseType>
  <Class>...</Class>
  <Constant>...</Constant>
  <Delegate>...</Delegate>
  <Enum>...</Enum>
  <Exception>...</Exception>
  <Event>...</Event>
  <ImplementedInterface>...</ImplementedInterface>
  <Interface>...</Interface>
  <Method>...</Method>
  <Property>...</Property>
  <Struct>...</Struct>
</Class>

ManagedType_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 class from the proxy code; false to include the class in the proxy code. The default is false.

isStatic

Optional xs:boolean attribute.

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

newName

Optional identifier_Type attribute.

The name of the proxy class.

newNamespace

Optional name_Type attribute.

The namespace of the proxy class.

originalFullyQualifiedName

Required xs:ID attribute.

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

Child Elements

Element

Description

Attribute

Optional Attribute_Type element.

Represents an attribute that is applied to the class.

BaseType

Optional TypeReference_Type element.

Describes the base type of the class.

Class

Optional ManagedEntryPoint_Type element.

Represents a nested class that is defined in the class.

Constant

Optional Constant_Type element.

Represents a constant that is defined in the class.

Delegate

Optional Delegate_Type element.

Represents a delegate that is defined in the class.

Enum

Optional Enum_Type element.

Represents an enumeration that is defined in the class.

Exception

Optional Exception_Type element.

Represents an exception that is defined in the class.

Event

Optional ManagedEvent_Type element.

Represents an event that is defined in the class.

ImplementedInterface

Optional TypeReference_Type element.

Represents an interface that the class implements.

Interface

Optional ManagedEntryPoint_Type element.

Represents a nested interface that is defined in the class.

Method

Optional ManagedMethod_Type element.

Represents a method that is defined in the class.

Property

Optional ManagedProperty_Type element.

Represents a property that is defined in the class.

Struct

Optional ManagedType_Type element.

Represents a nested struct that is defined in the class.

Parent Elements

Element

Description

ManagedLibrary

Describes the contents of the managed assembly that was passed to ProxyGen.exe.

Class

Represents the parent class in which the class is defined.

Struct

Represents the parent struct in which the class is defined.

Example

The following example demonstrates a Struct element that represents a proxy class named Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.Point.

<Struct originalFullyQualifiedName="Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.Point"
    isExcluded="false">
  <Method originalName="op_Implicit" isExcluded="false" isStatic="true">
    <Parameter originalName="point">
      <Type>
        <TypeReference type="Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.Point" />
      </Type>
    </Parameter>
    <ReturnType>
      <ExternalTypeReference isInterface="false" type="System.Drawing.Point" />
    </ReturnType>
  </Method>
  <Property originalName="X" isExcluded="false">
    <Type>
      <ExternalTypeReference isInterface="false" type="System.Int32" />
    </Type>
    <Get isExcluded="false" />
    <Set isExcluded="false" />
  </Property>
  <Property originalName="Y" isExcluded="false">
    <Type>
      <ExternalTypeReference isInterface="false" type="System.Int32" />
    </Type>
    <Get isExcluded="false" />
    <Set isExcluded="false" />
  </Property>
</Struct>

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