This documentation is archived and is not being maintained.
ISponsor Interface
Visual Studio 2010
Indicates that the implementer wants to be a lifetime lease sponsor.
Assembly: mscorlib (in mscorlib.dll)
The ISponsor type exposes the following members.
An object must implement the ISponsor interface if it needs to request a lease renewal for a particular object. An object that implements the ISponsor interface can become a sponsor by registering itself with the lease manager. The ISponsor interface is used by the lifetime service to call back to the sponsor.
public ref class MyClientSponsor: public MarshalByRefObject, public ISponsor { private: DateTime lastRenewal; public: MyClientSponsor() { lastRenewal = DateTime::Now; } [SecurityPermissionAttribute(SecurityAction::LinkDemand,Flags=SecurityPermissionFlag::Infrastructure)] virtual TimeSpan Renewal( ILease^ /* lease */ ) { Console::WriteLine( "Request to renew the lease time." ); Console::WriteLine( "Time since last renewal: {0}", DateTime::Now - lastRenewal ); lastRenewal = DateTime::Now; return TimeSpan::FromSeconds( 20 ); } };
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show:
