Udostępnij za pośrednictwem


Class Element for COMLibrary (ProxyGen)

Represents a proxy class for a COM class in the host application's object model.

<Class GUID = "GUID of COM class"
    isAddInEntryPoint = "true/false">
    isExcluded = "true/false
    newName = "Name of proxy class"
    newNamespace = "Namespace of proxy class"
    originalFullyQualifiedName = "Fully qualified name of the COM class"
    SourceInterfaceGUID = "GUID of the source interface of the COM class"
  <Attribute>...</Attribute>
  <BaseType>...</BaseType>
  <Delegate>...</Delegate>
  <Enum>...</Enum>
  <Event>...</Event>
  <ImplementedInterface>...</ImplementedInterface>
  <Method>...</Method>
  <Property>...</Property>
</Class>

COMClass_Type

Attributes and Elements

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

Attributes

Attribute

Description

GUID

Required guid_Type attribute.

The GUID of the COM class. The value must be a valid GUID without enclosing braces ({}).

isAddInEntryPoint

Optional xs:boolean attribute.

true if the class is an entry point in the proxy assembly; otherwise, false. The default is false.

For more information about entry points, see Defining Entry Points and Other Proxy Changes.

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.

newName

Optional identifier_Type attribute.

The name of the new proxy class.

newNamespace

Optional name_Type attribute.

The namespace of the new proxy class.

originalFullyQualifiedName

Required xs:ID attribute.

The fully qualified name of the COM class in the host application's object model.

SourceInterfaceGUID

Optional guid_Type attribute.

The GUID of the source interface for the class. The value must be a valid GUID without enclosing braces ({}).

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.

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.

Event

Optional COMEvent_Type element.

Represents an event that is defined in the class.

ImplementedInterface

Optional TypeReference_Type element.

Represents an interface that the class implements.

Method

Optional COMMethod_Type element.

Represents a method that is defined in the class.

Property

Optional COMProperty_Type element.

Represents a property that is defined in the class.

Parent Elements

Element

Description

COMLibrary

Describes the contents of the COM type library that was passed to ProxyGen.exe.

Example

The following example demonstrates a Class element that represents a class named ShapeApp.Proxy.Application. This class includes a method named CreateColor, a property named ActiveDrawing, and an event named CreatedDrawing.

<Class originalFullyQualifiedName="ShapeApp.Proxy.Application"
    GUID="87184553-2394-4622-B983-D1B01DCF7706"
    SourceInterfaceGUID="2A67FE39-9B48-4DDB-9A24-AA3637C0B772"
    isExcluded="false"
    isAddInEntryPoint="true">
  <BaseType>
    <ExternalTypeReference isInterface="false" isMarshalByRefObject="true" type="System.MarshalByRefObject" />
  </BaseType>
  <ImplementedInterface>
    <TypeReference type="ShapeApp.Proxy.IApplication" />
  </ImplementedInterface>
  <ImplementedInterface>
    <TypeReference type="ShapeApp.Proxy._IApplicationEvents" />
  </ImplementedInterface>
  <Method originalName="CreateColor" isExcluded="false" dispId="5" invokeType="InvokeMethod">
    <ReturnValueAttribute>
      <Type>
        <ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.MarshalAsAttribute" />
      </Type>
      <Parameter value="Interface">
        <Type>
          <ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.UnmanagedType" />
        </Type>
      </Parameter>
    </ReturnValueAttribute>
    <Parameter originalName="argb">
      <Type>
        <ExternalTypeReference isInterface="false" type="System.Int32" />
      </Type>
    </Parameter>
    <ReturnType>
      <TypeReference type="ShapeApp.Proxy.Color" />
    </ReturnType>
  </Method>
  <Property originalName="ActiveDrawing" isExcluded="false" dispId="3">
    <Type>
      <TypeReference type="ShapeApp.Proxy.IDrawing" />
    </Type>
    <Get isExcluded="false">
      <Attribute>
        <Type>
          <ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.MarshalAsAttribute" />
        </Type>
        <Parameter value="Interface">
          <Type>
            <ExternalTypeReference isInterface="false" type="System.Runtime.InteropServices.UnmanagedType" />
          </Type>
        </Parameter>
      </Attribute>
    </Get>
  </Property>
  <Event originalName="CreatedDrawing" isExcluded="false" dispId="1">
    <Type>
      <TypeReference type="ShapeApp.Proxy._IApplicationEvents.CreatedDrawing" />
    </Type>
  </Event>
</Class>

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