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类的用途是提供可由派生类 (如和PeerContact) PeerNearMe共享的通用基类定义。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(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 对象占用的非托管资源并(可选)释放托管资源。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 时所需的数据填充 SerializationInfoPopulates 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 的浅表副本。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)

使用序列化指定 SerializationInfo 实例所需的数据填充 PeerObject 类实例。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.

适用于

另请参阅