Click or drag to resize

Deferred Class

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
An object to wait for the status of a one time operation. See remarks.
Inheritance Hierarchy
SystemObject
  Telogis.GeoBase.ConcurrencyDeferred

Namespace:  Telogis.GeoBase.Concurrency
Assembly:  geobase.net (in geobase.net.dll) Version: 4.86.0.0
Syntax
public class Deferred

The Deferred type exposes the following members.

Constructors
  NameDescription
Public methodDeferred
Creates an AsyncEvent.
Top
Methods
  NameDescription
Public methodBeginWait
Waits asynchronously for the event to complete.
Public methodDefer(DeferredDeferredAction)
Invokes an action when the event occurs. If the event has already occurred action is invoked synchronously.
Public methodDefer(DeferredExceptionHandler, DeferredDeferredAction)
Invokes an action when the event occurs. If the event has already occurred action is invoked synchronously.
Public methodDeferAlways(DeferredDeferredAction)
Invokes an action once when the event reoccurs.
Public methodDeferAlways(DeferredExceptionHandler, DeferredDeferredAction)
Invokes an action once when the event reoccurs.
Public methodEndWait
Blocks until the event occurs. Returns immediately if the event has already occurred.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodSet
Raises the event and synchronously invokes all waiting callbacks.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWait
Blocks until the event occurs. Returns immediately if the event has already occurred.
Top
Examples
The typical usage pattern is:
C#
class DirectionsCalculator {
    private Directions directions;
    private AsyncEvent readyEvent = new AsyncEvent();

    public DirectionsCalculator(Route route) {
        Thread thread = new Thread(() => {
            directions = route.GetDirections();
            readyEvent.Set();
        });
        thread.Start();
    }

    public IAsyncResult GetDirections(AsyncCallback callback, object state) {
        return readyEvent.BeginWait(callback, state);
    }

    public Directions EndGetDirections(IAsyncResult result) {
        readyEvent.EndWait(result);
        return directions;
    }
}
See Also