IObserver(Of T).OnCompleted Method ()

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Notifies the observer that the provider has finished sending push-based notifications.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

Sub OnCompleted

When the observer's OnCompleted implementation is called, the OnCompleted method can optionally call the Dispose method of the IDisposable object that was returned to the observer when it called the IObservable(Of T).Subscribe method.

The following example provides an implementation of the OnCompleted method in a latitude/longitude tracking application. The method simply reports that no further data is available and calls the provider's IDisposable.Dispose implementation. See the Example section of the IObserver(Of T) topic for the complete example.

Public Overridable Sub OnCompleted() Implements System.IObserver(Of Location).OnCompleted
   Console.WriteLine("The Location Tracker has completed transmitting data to {0}.", Me.Name)
End Sub

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top