IContract.AcquireLifetimeToken 方法
定义
指定客户端在撤消此协定之前一直可以访问它。Specifies that the contract is accessible to a client until the client revokes the contract.
public:
int AcquireLifetimeToken();
public int AcquireLifetimeToken ();
abstract member AcquireLifetimeToken : unit -> int
Public Function AcquireLifetimeToken () As Integer
返回
一个值(也称作生存期标记),用于标识已获取协定的客户端。A value, also known as a lifetime token, that identifies the client that has acquired the contract.
注解
实现的对象的客户端 IContract 调用 AcquireLifetimeToken 方法,以通知对象客户端需要访问协定。Clients of an object that implements IContract call the AcquireLifetimeToken method to notify the object that the client requires access to the contract. IContract只要至少有一个传递给客户端的生存期标记未被吊销,就保证可以使用。An IContract is guaranteed to be usable as long as at least one lifetime token that it passed to a client has not been revoked.
若要撤消协定,客户端将调用 RevokeLifetimeToken 方法。To revoke a contract, clients call the RevokeLifetimeToken method.