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. APeerContact物件必須由遠端對等或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. APeerContact物件可以存在於其中一個在遠端電腦或遠端電腦的使用者上執行的應用程式。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 (公開金鑰 (Public Key))。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. 或者,這個屬性會取得或設定值,這個值會指定目前的對等主應用程式或裝載應用程式是否已訂閱或已取消訂閱這個 PeerContactAlternatively, 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

取得或設定代表 PeerContactNickname 的字串。Gets 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)

釋放 Unmanaged 資源,並選擇性釋放 PeerApplication 物件所使用的 Managed 資源。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)

以指定的 PeerApplication,取得本機快取中 Guid 物件的集合。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[])

傳送指定的邀請,以加入寄件者所贊助的特定 PeerApplicationSends 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 的淺層複本 (Shallow Copy)。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 字串,以便用於持續性儲存體 (Persistent Storage) 或網路傳輸。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.

適用於

另請參閱