PeerContact PeerContact PeerContact PeerContact Class

定义

表示用户已检索其扩展信息的对等方。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
type PeerContact = class
    inherit Peer
    interface IEquatable<PeerContact>
    interface ISerializable
Public Class PeerContact
Inherits Peer
Implements IEquatable(Of PeerContact), ISerializable
继承
PeerContactPeerContactPeerContactPeerContact
属性
实现

注解

联系人表示受信任的对等方。A contact represents a trusted peer. 必须PeerContact为远程对等方创建一个对象, PeerNearMe或者, 如果该对象不在 "网络邻居" 范围内, 则为该用户与远程对等方协作。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. PeerContact对象可以作为远程计算机上运行的应用程序或远程计算机的用户存在。A PeerContact object can exist as either an application running on a remote computer, or the user of a remote computer. 此类的实例可以添加到, ContactManager后者以持久方式存储联系人信息。An instance of this class can be added to the ContactManager which stores the contact information in a persistent manner.

PeerContact应用程序邀请已进行身份验证和加密。An application invitation from a PeerContact is both authenticated and encrypted. 用于接受或拒绝对等联系人邀请的 UI 对话框也指示邀请者是受信任的。The UI dialog to accept or reject an invitation from a peer contact also indicates that the inviter is trusted.

PeerContact订阅对象意味着远程对等机可以查看其已注册的应用程序、对象和状态信息。Subscribing to a PeerContact object means a remote peer can see its registered applications, objects and presence information. 若要订阅PeerContact, 调用方必须通过SignIn Windows UI 登录到对等方协作基础结构或登录。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.

构造函数

PeerContact(SerializationInfo, StreamingContext) PeerContact(SerializationInfo, StreamingContext) PeerContact(SerializationInfo, StreamingContext) PeerContact(SerializationInfo, StreamingContext)

不为此类定义公共构造函数。No public constructor is defined for this class.

属性

Credentials Credentials Credentials Credentials

获取或设置由此 PeerContact 实例标识的对等方的 X509Certificate(公钥)。Gets or sets the X509Certificate (public key) for the peer identified by this PeerContact instance.

DisplayName DisplayName DisplayName DisplayName

获取或设置一个字符串,该字符串表示 PeerContact 的显示名称。Gets or sets a string which represents the display name of the PeerContact.

EmailAddress EmailAddress EmailAddress EmailAddress

获取或设置与 PeerContact 关联的电子邮件地址。Gets or sets the email address associated with the PeerContact.

IsOnline IsOnline IsOnline IsOnline

获取一个值,该值指定 Peer 当前是否处于“联机状态”。Gets a value specifying if the Peer is currently 'online'.

(Inherited from Peer)
IsSubscribed IsSubscribed IsSubscribed IsSubscribed

获取或设置一个值,该值指定当前 PeerContact 是已订阅终结点,还是已取消对终结点的订阅。Gets or sets a value specifying whether the current PeerContact is subscribed or unsubscribed to an endpoint. 此属性还会获取或设置另一个值,该值指定当前对等主机或宿主应用程序是已订阅此 PeerContact,还是已取消对它的订阅。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 Nickname Nickname Nickname

获取或设置一个字符串,该字符串表示 PeerContactNicknameGets or sets a string which represents the Nickname of the PeerContact.

PeerEndPoints PeerEndPoints PeerEndPoints PeerEndPoints

获取与此 PeerEndPointCollection 关联的 PeerContactGets the PeerEndPointCollection associated with this PeerContact.

PeerName PeerName PeerName PeerName

获取或设置与 PeerName 关联的 PeerContactGets or sets the PeerName associated with the PeerContact.

SubscribeAllowed SubscribeAllowed SubscribeAllowed SubscribeAllowed

获取或设置一个值,该值指定是否将 PeerContact 公开给特定的协作事件,这些事件与拥有此 ContactManager 对象所驻留的 PeerContact 的对等方或应用程序关联。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 SynchronizingObject SynchronizingObject SynchronizingObject

设置此属性值后,将在创建特定 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)

方法

Dispose() Dispose() Dispose() Dispose()

释放由 Peer 对象使用的所有资源。Releases all resources used by the Peer object.

(Inherited from Peer)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

释放非托管资源,并(可选)释放由 PeerApplication 对象占用的托管资源。Releases the unmanaged resources and optionally releases the managed resources used by the PeerApplication object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

PeerContact 实例与指定对象进行比较。Compares the PeerContact instance to the specified object.

Equals(Object, Object) Equals(Object, Object) Equals(Object, Object) Equals(Object, Object)

确定指定的 PeerContact 实例是否可视为相等的实例。Determines whether the specified PeerContact instances are considered equal.

Equals(Peer) Equals(Peer) Equals(Peer) Equals(Peer)

对当前的 Peer 和指定对等方执行区分大小写的比较。Performs a case-sensitive comparison of the current Peer and the specified peer.

(Inherited from Peer)
Equals(PeerContact) Equals(PeerContact) Equals(PeerContact) Equals(PeerContact)

PeerContact 与指定的 PeerContact 实例进行比较。Compares the PeerContact to the specified PeerContact instance.

FromXml(String) FromXml(String) FromXml(String) FromXml(String)

基于提供的 XML 数据创建一个 PeerContact 实例。Creates a PeerContact instance based on provided XML data.

GetApplications() GetApplications() GetApplications() GetApplications()

检索远程对等方在本地缓存中注册的 PeerApplication 对象。Retrieves the PeerApplication objects that were registered by the remote peer into the local cache.

GetApplications(Guid) GetApplications(Guid) GetApplications(Guid) GetApplications(Guid)

从本地缓存中获取具有指定 PeerApplicationGuid 对象的集合。Gets the collection of PeerApplication objects with the specified Guid from the local cache.

GetApplications(PeerEndPoint) GetApplications(PeerEndPoint) GetApplications(PeerEndPoint) GetApplications(PeerEndPoint)

获取与指定 PeerApplicationCollection 关联的 PeerEndPointGets the PeerApplicationCollection associated with the specified PeerEndPoint.

GetApplications(PeerEndPoint, Guid) GetApplications(PeerEndPoint, Guid) GetApplications(PeerEndPoint, Guid) GetApplications(PeerEndPoint, Guid)

获取与指定 PeerApplicationCollection 关联的 PeerEndPointGets the PeerApplicationCollection associated with the specified PeerEndPoint.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

返回 PeerContact 实例的哈希代码。Returns the hash code for a PeerContact instance.

GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext)

使用序列化 PeerContact 时所需的数据填充 SerializationInfo 对象。Populates a SerializationInfo object with the data needed to serialize the PeerContact.

GetObjects() GetObjects() GetObjects() GetObjects()

从本地缓存中获取数据对象的集合。Gets the collection of data objects from a local cache.

(Inherited from Peer)
GetObjects(Guid) GetObjects(Guid) GetObjects(Guid) GetObjects(Guid)

Peer 中获取与提供的 Guid 关联的 PeerObjectCollection 对象。Gets the Peer object associated with the supplied Guid from the PeerObjectCollection.

(Inherited from Peer)
GetObjects(PeerEndPoint) GetObjects(PeerEndPoint) GetObjects(PeerEndPoint) GetObjects(PeerEndPoint)

获取由指定 PeerObjectCollection 注册并存储在本地缓存中的 PeerEndPointGets the PeerObjectCollection registered by the specified PeerEndPoint and stored in the local cache.

GetObjects(PeerEndPoint, Guid) GetObjects(PeerEndPoint, Guid) GetObjects(PeerEndPoint, Guid) GetObjects(PeerEndPoint, Guid)

获取指定的 PeerEndPoint 在由指定 PeerApplication 标识的 Guid 中注册的对等对象的集合。Gets the collection of peer objects registered by the specified PeerEndPoint and registered in the PeerApplication identified by the specified Guid.

GetPresenceInfo(PeerEndPoint) GetPresenceInfo(PeerEndPoint) GetPresenceInfo(PeerEndPoint) GetPresenceInfo(PeerEndPoint)

获取 PeerEndPoint 的可用状态信息。Gets the available presence information for a PeerEndPoint.

(Inherited from Peer)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
Invite() Invite() Invite() Invite()

发送加入由发送方发起的对等方协作的邀请。Sends an invitation to join into peer collaboration sponsored by the sender.

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

发送加入由发送方发起的指定 PeerApplication 的指定邀请。Sends the specified invitation to join into the specified PeerApplication sponsored by the sender.

Invite(PeerEndPoint) Invite(PeerEndPoint) Invite(PeerEndPoint) Invite(PeerEndPoint)

向特定终结点发送邀请,以使之加入与邀请发送方之间的对等方协作。Sends an invitation to a specific endpoint to join into peer collaboration with the sender of the invitation.

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

向指定 PeerEndPoint 发送指定的邀请,以使之加入由发送方发起的指定 PeerCollaboration 应用程序。Sends the specified invitation to the specified PeerEndPoint to join into the specified PeerCollaboration application sponsored by the sender.

InviteAsync(Object) InviteAsync(Object) InviteAsync(Object) InviteAsync(Object)

为一个终结点开始一个异步邀请操作,以加入由邀请的发件人赞助的 PeerCollaboration 应用程序。Begins an asynchronous invitation operation for an endpoint to join a PeerCollaboration application sponsored by the sender of the invitation. 使用指定的 Object 标识邀请。The invitation is identified using the specified Object.

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

为指定的对等终结点开始异步邀请操作,以加入由邀请的发件人赞助的指定协作 PeerApplicationBegins 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) InviteAsync(PeerEndPoint, Object) InviteAsync(PeerEndPoint, Object) InviteAsync(PeerEndPoint, Object)

为指定的对等终结点开始异步邀请操作,以加入由邀请的发件人赞助的 PeerCollaboration 应用程序。Begins an asynchronous invitation operation for the specified peer endpoint to join a PeerCollaboration application sponsored by the sender of the invitation. 使用指定的 Object 标识邀请。The invitation is identified using the specified Object.

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

为指定的 peerEndPoint 开始一个异步邀请操作,以加入由邀请的发件人赞助的指定协作 PeerApplicationBegins an asynchronous invitation operation for the specified peerEndPoint to join the specified collaboration PeerApplication sponsored by the sender of the invitation.

InviteAsyncCancel(Object) InviteAsyncCancel(Object) InviteAsyncCancel(Object) InviteAsyncCancel(Object)

取消使用 InviteAsync(PeerApplication, String, Byte[], Object) 方法发送的邀请。Cancels the invitation that was sent with the InviteAsync(PeerApplication, String, Byte[], Object) method.

(Inherited from Peer)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
OnApplicationChanged(ApplicationChangedEventArgs) OnApplicationChanged(ApplicationChangedEventArgs) OnApplicationChanged(ApplicationChangedEventArgs) OnApplicationChanged(ApplicationChangedEventArgs)

引发 ApplicationChanged 事件。Raises the ApplicationChanged event.

OnInviteCompleted(InviteCompletedEventArgs) OnInviteCompleted(InviteCompletedEventArgs) OnInviteCompleted(InviteCompletedEventArgs) OnInviteCompleted(InviteCompletedEventArgs)

引发 InviteCompleted 事件。Raises the InviteCompleted event.

(Inherited from Peer)
OnObjectChanged(ObjectChangedEventArgs) OnObjectChanged(ObjectChangedEventArgs) OnObjectChanged(ObjectChangedEventArgs) OnObjectChanged(ObjectChangedEventArgs)

当远程对等添加、更新或删除 PeerObject 时将引发 ObjectChanged 事件。Raises the ObjectChanged event when a PeerObject is added, updated or removed by a remote peer.

OnPresenceChanged(PresenceChangedEventArgs) OnPresenceChanged(PresenceChangedEventArgs) OnPresenceChanged(PresenceChangedEventArgs) OnPresenceChanged(PresenceChangedEventArgs)

当对等的 PeerPresenceInfo 发生更改时,引发 PresenceChanged 事件。Raises the PresenceChanged event when the PeerPresenceInfo of a peer has changed.

OnSubscribeCompleted(SubscribeCompletedEventArgs) OnSubscribeCompleted(SubscribeCompletedEventArgs) OnSubscribeCompleted(SubscribeCompletedEventArgs) OnSubscribeCompleted(SubscribeCompletedEventArgs)

引发 SubscribeCompleted 事件。Raises the SubscribeCompleted event.

Subscribe() Subscribe() Subscribe() Subscribe()

订阅 PeerContact 的调用对等方,这样对等方就可接收此后所有与 PeerContact 相关联的 PeerCollaboration 事件。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) SubscribeAsync(Object) SubscribeAsync(Object) SubscribeAsync(Object)

异步订阅调用对等方到 PeerContact,这样对等方就可接收此后与 PeerContact 相关联的 PeerCollaboration 事件。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() ToString() ToString() ToString()

返回与 String 关联的 DisplayNamePeerContact 表示形式。Returns a String representation of the DisplayName associated with the PeerContact.

ToXml() ToXml() ToXml() ToXml()

PeerContact 序列化为一个 XML 字符串,以供持久存储或网络传输时使用。Serializes the PeerContact to an XML string for persistent storage or network transfer.

Unsubscribe() Unsubscribe() Unsubscribe() Unsubscribe()

删除对 PeerContact 的订阅,其结果为调用对等方不再接收与 PeerContact 关联的 PeerCollaboration 事件。Removes a subscription to the PeerContact and as a result the calling peer no longer receives PeerCollaboration events associated with the PeerContact.

事件

ApplicationChanged ApplicationChanged ApplicationChanged ApplicationChanged

只要与 PeerContact 关联的应用程序发生更改,就会引发此事件。This event is raised whenever an application associated with the PeerContact has changed.

InviteCompleted InviteCompleted InviteCompleted InviteCompleted

在完成对远程对等方的邀请过程时引发。Raised when the invitation process for a remote peer has completed.

(Inherited from Peer)
ObjectChanged ObjectChanged ObjectChanged ObjectChanged

只要与 PeerObject 关联的 PeerContact 发生更改,就会发出此事件信号。This event is signaled whenever a PeerObject associated with the PeerContact has changed.

PresenceChanged PresenceChanged PresenceChanged PresenceChanged

只要 PeerContact 的状态发生更改,就会引发此事件。This event is raised whenever the PeerContact has changed its presence status.

SubscribeCompleted SubscribeCompleted SubscribeCompleted SubscribeCompleted

在完成订阅操作时引发。Raised when a subscription operation has completed.

显式界面实现

ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext)

实现 ISerializable 接口,并返回序列化 PeerContact 实例所需的数据。Implements the ISerializable interface and returns the data needed to serialize the PeerContact instance.

适用于

另请参阅