Peer 類別

定義

這個類別表示遠端對等電腦。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
繼承
Peer
衍生
屬性
實作

備註

抽象Peer類的目的是要提供可由衍生類別PeerNearMe (例如和PeerContact) 共用的通用基類定義。The 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 型別的新執行個體。Initializes a new instance of the Peer type.

屬性

IsOnline

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

PeerEndPoints

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

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()

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

Dispose(Boolean)

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

Equals(Object)

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

(繼承來源 Object)
Equals(Peer)

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

GetHashCode()

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

(繼承來源 Object)
GetObjectData(SerializationInfo, StreamingContext)

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

GetObjects()

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

GetObjects(Guid)

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

GetPresenceInfo(PeerEndPoint)

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

GetType()

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

(繼承來源 Object)
Invite()

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

Invite(PeerApplication, String, Byte[])

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

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)

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

InviteAsyncCancel(Object)

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

MemberwiseClone()

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

(繼承來源 Object)
OnInviteCompleted(InviteCompletedEventArgs)

引發 InviteCompleted 事件。Raises the InviteCompleted event.

ToString()

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

事件

InviteCompleted

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

明確介面實作

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.

適用於

另請參閱