Peer.GetObjects Method

Gets the collection of data objects from a local cache.

Namespace:  System.Net.PeerToPeer.Collaboration
Assembly:  System.Net (in System.Net.dll)

public PeerObjectCollection GetObjects()

Return Value

Type: System.Net.PeerToPeer.Collaboration.PeerObjectCollection
The PeerObject collection for the peer or endpoint specified by this instance.

ExceptionCondition
InvalidOperationException

The caller is not subscribed to the endpoint or has not yet called RefreshData.

PeerToPeerException

The method is unable to complete due to an error in the underlying Peer Collaboration infrastructure.

This functionality is only exposed on the PeerContact class. This functionality is not exposed on any other type of peer for security reasons.

If the peer collaboration session did not instantiate with a PermissionState of Unrestricted, this method cannot access objects on the local computer. The same is true of the applications registered into the collaboration session.

The collection of peer objects consists of application, data object, and presence information for the peer or endpoint specified by this instance. If no objects are found for the endpoint, a collection of size zero (0) is returned. If the calling peer is subscribed to this endpoint, the cache is automatically updated; otherwise RefreshData must be called prior to calling this method.

The caller is not required to be signed into the collaboration infrastructure for this method to complete successfully. A successful call to RefreshData or one of the Subscribe methods must have been completed while the caller was signed in previous to calling this method.

NOTE: Additional overloads are defined on the Peer class instead of the subclasses PeerContact and PeerNearMe.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft