ISponsor Interface
.NET Framework 3.0
Indicates that the implementer wants to be a lifetime lease sponsor.
Namespace: System.Runtime.Remoting.Lifetime
Assembly: mscorlib (in mscorlib.dll)
Assembly: mscorlib (in mscorlib.dll)
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 Class MyClientSponsor Inherits MarshalByRefObject Implements ISponsor Private lastRenewal As DateTime Public Sub New() lastRenewal = DateTime.Now End Sub 'New <SecurityPermission(SecurityAction.LinkDemand, Flags := SecurityPermissionFlag.Infrastructure)> _ Public Function Renewal(lease As ILease) As TimeSpan Implements ISponsor.Renewal Console.WriteLine("Request to renew the lease time.") Console.WriteLine("Time since last renewal: " + _ DateTime.op_Subtraction(DateTime.Now, lastRenewal).ToString()) lastRenewal = DateTime.Now Return TimeSpan.FromSeconds(20) End Function 'Renewal End Class 'MyClientSponsor
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: