This project has moved. For the latest updates, please go here.

COMObject ist der gemeinsame Basistyp für alle Objekte in NetOffice und representiert darüber hinaus einen COM Proxy dessen Typ zur Kompilierzeit nicht bekannt ist, jedoch handelt es sich in jedem Fall um einen COMProxy und nicht um einen scalaren Typ wie bool oder int. Betrachten Sie dazu folgendes Codebeispiel:

foreach (Office.COMAddIn item in application.COMAddIns) 
{ 
     // COMAddIn.Application is defined as COMObject 
     // The definintion in COM TypeLibrary is VT_DISPATCH. Interop Assemblies or VBA mapped this to simple object 
     Excel.Application parentApplication = (Excel.Application)item.Application; 
}

Betrachten Sie dazu: Tutorial05

Klassen Definition

/*   
class COMObject the common base type for all objects in NetOffice. */
// Constructors COMObject() COMObject(object comProxy) COMObject(COMObject replacedObject) COMObject(COMObject parentObject, object comProxy) COMObject(COMObject parentObject, object comProxy, Type comProxyType) // Properties /// <summary> /// returns the native wrapped proxy /// </summary> object UnderlyingObject{ get; } /// <summary> /// returns class name of native wrapped proxy /// </summary> string UnderlyingTypeName{ get; } /// <summary> /// returns instance is diposed means unusable /// </summary> bool IsDisposed{ get; } // Methods /// <summary> /// dispose instance and all child instances /// </summary> void Dispose(); /// <summary> /// dispose instance and all child instances /// </summary> /// <param name="disposeEventBinding">dispose event exporting instance(s) with one or more event recipients</param> void Dispose(bool disposeEventBinding); /// <summary> /// dispose all child instances /// </summary> void DisposeChildInstances(); /// <summary> /// dispose all child instances /// </summary> /// <param name="disposeEventBinding">dispose event exporting instance(s) with one or more event recipients</param> void DisposeChildInstances(bool disposeEventBinding);

Last edited May 29, 2011 at 12:57 PM by SebastianDotNet, version 6

Comments

No comments yet.