Bewerken

Share via


PeerContact Class

Definition

Represents a peer for which a user has retrieved extended information.

public ref class PeerContact : System::Net::PeerToPeer::Collaboration::Peer, IEquatable<System::Net::PeerToPeer::Collaboration::PeerContact ^>, System::Runtime::Serialization::ISerializable
[System.Serializable]
public class PeerContact : System.Net.PeerToPeer.Collaboration.Peer, IEquatable<System.Net.PeerToPeer.Collaboration.PeerContact>, System.Runtime.Serialization.ISerializable
[<System.Serializable>]
type PeerContact = class
    inherit Peer
    interface IEquatable<PeerContact>
    interface ISerializable
Public Class PeerContact
Inherits Peer
Implements IEquatable(Of PeerContact), ISerializable
Inheritance
PeerContact
Attributes
Implements

Remarks

A contact represents a trusted peer. A PeerContact object must be created for a remote peer or PeerNearMe for a user to collaborate with the remote peer when it is outside of the "People Near Me" scope. A PeerContact object can exist as either an application running on a remote computer, or the user of a remote computer. An instance of this class can be added to the ContactManager which stores the contact information in a persistent manner.

An application invitation from a PeerContact is both authenticated and encrypted. The UI dialog to accept or reject an invitation from a peer contact also indicates that the inviter is trusted.

Subscribing to a PeerContact object means a remote peer can see its registered applications, objects and presence information. To subscribe to a PeerContact, the caller must be signed in to the peer collaboration infrastructure via SignIn or signed in via the Windows UI. All other operations do not require sign-in.

Constructors

PeerContact(SerializationInfo, StreamingContext)

No public constructor is defined for this class.

Properties

Credentials

Gets or sets the X509Certificate (public key) for the peer identified by this PeerContact instance.

DisplayName

Gets or sets a string which represents the display name of the PeerContact.

EmailAddress

Gets or sets the email address associated with the PeerContact.

IsOnline

Gets a value specifying if the Peer is currently 'online'.

(Inherited from Peer)
IsSubscribed

Gets or sets a value specifying whether the current PeerContact is subscribed or unsubscribed to an endpoint. Alternatively, this property gets or sets a value specifying whether the current peer host or hosting application has subscribed or unsubscribed to this PeerContact.

Nickname

Gets or sets a string which represents the Nickname of the PeerContact.

PeerEndPoints

Gets the PeerEndPointCollection associated with this PeerContact.

PeerName

Gets or sets the PeerName associated with the PeerContact.

SubscribeAllowed

Gets or sets a value that specifies whether the PeerContact is exposed to the collaboration events associated with the peer or application that has ownership of the ContactManager in which this PeerContact object resides.

SynchronizingObject

When this property value is set, all events not fired as the result of an asynchronous operation will have the associated event handlers called back on the thread that created the specific SynchronizingObject.

(Inherited from Peer)

Methods

Dispose()

Releases all resources used by the Peer object.

(Inherited from Peer)
Dispose(Boolean)

Releases the unmanaged resources and optionally releases the managed resources used by the PeerApplication object.

Equals(Object, Object)

Determines whether the specified PeerContact instances are considered equal.

Equals(Object)

Compares the PeerContact instance to the specified object.

Equals(Peer)

Performs a case-sensitive comparison of the current Peer and the specified peer.

(Inherited from Peer)
Equals(PeerContact)

Compares the PeerContact to the specified PeerContact instance.

FromXml(String)

Creates a PeerContact instance based on provided XML data.

GetApplications()

Retrieves the PeerApplication objects that were registered by the remote peer into the local cache.

GetApplications(Guid)

Gets the collection of PeerApplication objects with the specified Guid from the local cache.

GetApplications(PeerEndPoint, Guid)

Gets the PeerApplicationCollection associated with the specified PeerEndPoint.

GetApplications(PeerEndPoint)

Gets the PeerApplicationCollection associated with the specified PeerEndPoint.

GetHashCode()

Returns the hash code for a PeerContact instance.

GetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo object with the data needed to serialize the PeerContact.

GetObjects()

Gets the collection of data objects from a local cache.

(Inherited from Peer)
GetObjects(Guid)

Gets the Peer object associated with the supplied Guid from the PeerObjectCollection.

(Inherited from Peer)
GetObjects(PeerEndPoint, Guid)

Gets the collection of peer objects registered by the specified PeerEndPoint and registered in the PeerApplication identified by the specified Guid.

GetObjects(PeerEndPoint)

Gets the PeerObjectCollection registered by the specified PeerEndPoint and stored in the local cache.

GetPresenceInfo(PeerEndPoint)

Gets the available presence information for a PeerEndPoint.

(Inherited from Peer)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
Invite()

Sends an invitation to join into peer collaboration sponsored by the sender.

Invite(PeerApplication, String, Byte[])

Sends the specified invitation to join into the specified PeerApplication sponsored by the sender.

Invite(PeerEndPoint, PeerApplication, String, Byte[])

Sends the specified invitation to the specified PeerEndPoint to join into the specified PeerCollaboration application sponsored by the sender.

Invite(PeerEndPoint)

Sends an invitation to a specific endpoint to join into peer collaboration with the sender of the invitation.

InviteAsync(Object)

Begins an asynchronous invitation operation for an endpoint to join a PeerCollaboration application sponsored by the sender of the invitation. The invitation is identified using the specified Object.

InviteAsync(PeerApplication, String, Byte[], Object)

Begins an asynchronous invitation operation for the specified peer endpoints to join the specified collaboration PeerApplication sponsored by the sender of the invitation.

InviteAsync(PeerEndPoint, Object)

Begins an asynchronous invitation operation for the specified peer endpoint to join a PeerCollaboration application sponsored by the sender of the invitation. The invitation is identified using the specified Object.

InviteAsync(PeerEndPoint, String, Byte[], PeerApplication, Object)

Begins an asynchronous invitation operation for the specified peerEndPoint to join the specified collaboration PeerApplication sponsored by the sender of the invitation.

InviteAsyncCancel(Object)

Cancels the invitation that was sent with the InviteAsync(PeerApplication, String, Byte[], Object) method.

(Inherited from Peer)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnApplicationChanged(ApplicationChangedEventArgs)

Raises the ApplicationChanged event.

OnInviteCompleted(InviteCompletedEventArgs)

Raises the InviteCompleted event.

(Inherited from Peer)
OnObjectChanged(ObjectChangedEventArgs)

Raises the ObjectChanged event when a PeerObject is added, updated or removed by a remote peer.

OnPresenceChanged(PresenceChangedEventArgs)

Raises the PresenceChanged event when the PeerPresenceInfo of a peer has changed.

OnSubscribeCompleted(SubscribeCompletedEventArgs)

Raises the SubscribeCompleted event.

Subscribe()

Subscribes the calling peer to the PeerContact, and as a result, the peer will receive any future PeerCollaboration events associated with the PeerContact.

SubscribeAsync(Object)

Asynchronously subscribes the calling peer to the PeerContact, and as a result, the peer will receive any future PeerCollaboration events associated with the PeerContact.

ToString()

Returns a String representation of the DisplayName associated with the PeerContact.

ToXml()

Serializes the PeerContact to an XML string for persistent storage or network transfer.

Unsubscribe()

Removes a subscription to the PeerContact and as a result the calling peer no longer receives PeerCollaboration events associated with the PeerContact.

Events

ApplicationChanged

This event is raised whenever an application associated with the PeerContact has changed.

InviteCompleted

Raised when the invitation process for a remote peer has completed.

(Inherited from Peer)
ObjectChanged

This event is signaled whenever a PeerObject associated with the PeerContact has changed.

PresenceChanged

This event is raised whenever the PeerContact has changed its presence status.

SubscribeCompleted

Raised when a subscription operation has completed.

Explicit Interface Implementations

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

Implements the ISerializable interface and returns the data needed to serialize the PeerContact instance.

Applies to

See also