Peer Peer Peer Peer Class

定義

這個類別表示遠端對等電腦。This class represents a remote peer.

public ref class Peer abstract : IDisposable, IEquatable<System::Net::PeerToPeer::Collaboration::Peer ^>, System::Runtime::Serialization::ISerializable
[System.Serializable]
public abstract class Peer : IDisposable, IEquatable<System.Net.PeerToPeer.Collaboration.Peer>, System.Runtime.Serialization.ISerializable
type Peer = class
    interface IDisposable
    interface IEquatable<Peer>
    interface ISerializable
Public MustInherit Class Peer
Implements IDisposable, IEquatable(Of Peer), ISerializable
繼承
PeerPeerPeerPeer
衍生
屬性
實作

備註

目的抽象Peer類別是要提供可由共用的通用基底類別定義等衍生類別PeerNearMePeerContactThe purpose of the abstract Peer class is to provide a common base class definition that can be shared by derived classes such as PeerNearMe and PeerContact. 它無法直接建構,因為它是抽象。It cannot be directly constructed, since it is abstract. 開發人員應該改用 PeerNearMe 或 PeerContact 子類別。Developers should use the subclasses PeerNearMe or PeerContact instead.

連絡人、 對等、 遠端對等PeerNearMeLocalContact,和PeerContact同義詞彙,內容為基礎。Contact, peer, remote peer, PeerNearMe, LocalContact, and PeerContact are synonymous terms, based on context.

「 呼叫對等電腦 」 和 「 遠端對等電腦 」 的一般意義相同。"Calling peer" and "remote peer" are commonly synonymous. 呼叫的對等未參考應用程式呼叫指定的方法。Calling peer does not refer to the application calling a given method.

建構函式

Peer(SerializationInfo, StreamingContext) Peer(SerializationInfo, StreamingContext) Peer(SerializationInfo, StreamingContext) Peer(SerializationInfo, StreamingContext)

初始化 Peer 型別的新執行個體。Initializes a new instance of the Peer type.

屬性

IsOnline IsOnline IsOnline IsOnline

取得值,指定 Peer 目前是否為「線上」。Gets a value specifying if the Peer is currently 'online'.

PeerEndPoints PeerEndPoints PeerEndPoints PeerEndPoints

取得與 PeerEndPointCollection 相關聯的 PeerGets the PeerEndPointCollection associated with the Peer.

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.

方法

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

釋放由 Peer 物件使用的所有資源。Releases all resources used by the Peer object.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 Peer 物件所使用的 Unmanaged 資源,並選擇性釋放 Managed 資源。Releases the unmanaged resources used by the Peer object and optionally releases the managed resources.

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

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Equals(Peer) Equals(Peer) Equals(Peer) Equals(Peer)

在目前 Peer 和指定的對等電腦之間執行區分大小寫的比較。Performs a case-sensitive comparison of the current Peer and the specified peer.

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

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext)

將序列化目標 Peer 所需要的資料填入 SerializationInfo 物件中。Populates a SerializationInfo object with the data needed to serialize the target Peer.

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

取得本機快取中資料物件的集合。Gets the collection of data objects from a local cache.

GetObjects(Guid) GetObjects(Guid) GetObjects(Guid) GetObjects(Guid)

Peer 中,取得與提供的 Guid 相關聯的 PeerObjectCollection 物件。Gets the Peer object associated with the supplied Guid from the PeerObjectCollection.

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

取得 PeerEndPoint 的可用狀態資訊。Gets the available presence information for a PeerEndPoint.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

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

將邀請傳送給 Peer,以啟動特定 PeerApplicationSends an invitation to a Peer to start a specific PeerApplication.

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

將邀請傳送給 Peer,以啟動特定 PeerApplicationSends an invitation to a Peer to start a specific PeerApplication.

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

開始非同步邀請作業,這樣會傳送邀請給 Peer 以啟動特定的 PeerApplicationBegins an asynchronous invitation operation which sends an invitation to a Peer to start a specific PeerApplication.

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

開始非同步邀請作業,這樣會傳送邀請給 Peer 以啟動特定的 PeerApplicationBegins an asynchronous invitation operation which sends an invitation to a Peer to start a specific PeerApplication.

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.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnInviteCompleted(InviteCompletedEventArgs) OnInviteCompleted(InviteCompletedEventArgs) OnInviteCompleted(InviteCompletedEventArgs) OnInviteCompleted(InviteCompletedEventArgs)

引發 InviteCompleted 事件。Raises the InviteCompleted event.

ToString() ToString() ToString() ToString()

傳回 String,代表與 PeerName 相關聯的 PeerReturns a String representing the PeerName associated with the Peer.

事件

InviteCompleted InviteCompleted InviteCompleted InviteCompleted

當遠端對等電腦的邀請程序完成時引發。Raised when the invitation process for a remote peer has completed.

明確介面實作

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

使用序列化指定的 PeerObject 執行個體所需的資料填入 SerializationInfo 類別執行個體 。Populates a SerializationInfo class instance with the data required to serialize the specified PeerObject instance. 衍生的型別必須呼叫基底型別 GetObjectData(SerializationInfo, StreamingContext) 方法。A derived type must call the base type GetObjectData(SerializationInfo, StreamingContext) method.

適用於

另請參閱