ContractBase 类

定义

提供 IContract 成员的默认实现。Provides a default implementation of IContract members.

public ref class ContractBase : MarshalByRefObject, System::AddIn::Contract::IContract, System::Runtime::Remoting::Lifetime::ISponsor
public class ContractBase : MarshalByRefObject, System.AddIn.Contract.IContract, System.Runtime.Remoting.Lifetime.ISponsor
type ContractBase = class
    inherit MarshalByRefObject
    interface IContract
    interface ISponsor
Public Class ContractBase
Inherits MarshalByRefObject
Implements IContract, ISponsor
继承
ContractBase
实现

注解

协定定义宿主和外接程序使用的类型和方法。Contracts define the types and methods used by the host and the add-in. 所有协定必须派生自IContractAll contracts must derive from IContract. 此类提供IContract成员的默认实现。This class provides the default implementation of IContract members.

构造函数

ContractBase()

初始化 ContractBase 类的新实例。Initializes a new instance of the ContractBase class.

方法

AcquireLifetimeToken()

获取一个生存期标记。Obtains a lifetime token.

CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(继承自 MarshalByRefObject)
Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(继承自 MarshalByRefObject)
GetRemoteHashCode()

获取当前 ContractBase 对象的哈希代码。Gets the hash code for the current ContractBase object.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(继承自 MarshalByRefObject)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(继承自 MarshalByRefObject)
OnFinalRevoke()

当在外接程序端适配器中被重写时,释放该适配器占用的本机资源。When overridden in an add-in-side adapter, releases native resources held by the adapter.

QueryContract(String)

如果当前对象实现协定,则反射该协定的实例并返回 this 指针。Reflects over the instance of a contract and returns the this pointer if the current object implements that contract.

RemoteEquals(IContract)

比较一个对象是否与远程对象相等。Compares an object with a remote object for equality.

RemoteToString()

获取一个标识远程对象的字符串。Gets a string that identifies a remote object.

Renewal(ILease)

请求发起客户端续订指定对象的租约。Requests a sponsoring client to renew the lease for the specified object.

RevokeLifetimeToken(Int32)

从未处理的生存期标记列表中移除指定的标记。Removes the specified token from the list of outstanding lifetime tokens.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅