Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
OnNext Method
Collapse the table of content
Expand the table of content

IObserver<T>.OnNext Method

.NET Framework 4.6 and 4.5

Provides the observer with new data.

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

void OnNext(
	T value
)

Parameters

value
Type: T

The current notification information.

After an observer has called a provider's IObservable<T>.Subscribe method, the provider calls the observer's OnNext method to provide notifications.

The following example provides an implementation of the OnNext method in a latitude/longitude tracking application. See the Example section of the IObserver<T> topic for the complete example.

public virtual void OnNext(Location value)
{
   Console.WriteLine("{2}: The current location is {0}, {1}", value.Latitude, value.Longitude, this.Name);
}

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft