PeerNearMe PeerNearMe PeerNearMe PeerNearMe Class

定义

表示通过“网络邻居”基础结构找到的对等方。Represents a peer located by the "People Near Me" infrastructure.

public ref class PeerNearMe : System::Net::PeerToPeer::Collaboration::Peer, IEquatable<System::Net::PeerToPeer::Collaboration::PeerNearMe ^>, System::Runtime::Serialization::ISerializable
[System.Serializable]
public class PeerNearMe : System.Net.PeerToPeer.Collaboration.Peer, IEquatable<System.Net.PeerToPeer.Collaboration.PeerNearMe>, System.Runtime.Serialization.ISerializable
type PeerNearMe = class
    inherit Peer
    interface IEquatable<PeerNearMe>
    interface ISerializable
Public Class PeerNearMe
Inherits Peer
Implements IEquatable(Of PeerNearMe), ISerializable
继承
PeerNearMePeerNearMePeerNearMePeerNearMe
属性
实现

注解

不能直接创建此类的实例。An instance of this class cannot be created directly. 相反, 通过使用静态GetPeersNearMe方法返回附近对等方的集合, 来获取调用对等节点的对等方的引用。Instead, a reference to the peers "near" the calling peer is obtained by using the static GetPeersNearMe method to return a collection of nearby peers.

PeerNearMe对象表示的对等方不一定在调用对等方的通讯簿中。A peer represented by a PeerNearMe object is not necessarily in the calling peer's address book.

构造函数

PeerNearMe() PeerNearMe() PeerNearMe() PeerNearMe()

初始化 PeerNearMe 类的新默认实例。Initializes a new default instance of the PeerNearMe class.

PeerNearMe(SerializationInfo, StreamingContext) PeerNearMe(SerializationInfo, StreamingContext) PeerNearMe(SerializationInfo, StreamingContext) PeerNearMe(SerializationInfo, StreamingContext)

使用序列化所需的关联参数初始化一个新的 PeerNearMe 实例。Initializes a new PeerNearMe instance with the associated parameters required for serialization.

属性

IsOnline IsOnline IsOnline IsOnline

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

(Inherited from Peer)
Nickname Nickname Nickname Nickname

获取或设置一个表示 String 对象的昵称的 PeerNearMeGets or sets a String representing the Nickname of the PeerNearMe object.

PeerEndPoints PeerEndPoints PeerEndPoints PeerEndPoints

获取与 PeerEndPointCollection 关联的 PeerGets the PeerEndPointCollection associated with the Peer.

(Inherited from 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.

(Inherited from Peer)

方法

AddToContactManager() AddToContactManager() AddToContactManager() AddToContactManager()

PeerContact 对象生成 PeerNearMe,并将其与 ContactManager 关联。Generates a PeerContact from the PeerNearMe object and associates it with the ContactManager.

AddToContactManager(String, String, MailAddress) AddToContactManager(String, String, MailAddress) AddToContactManager(String, String, MailAddress) AddToContactManager(String, String, MailAddress)

使用关联的描述性参数从 PeerContact 对象生成 PeerNearMe,并将其与 ContactManager 关联。Generates a PeerContact with the associated descriptive parameters from the PeerNearMe object and associates it with the ContactManager.

CreateFromPeerEndPoint(PeerEndPoint) CreateFromPeerEndPoint(PeerEndPoint) CreateFromPeerEndPoint(PeerEndPoint) CreateFromPeerEndPoint(PeerEndPoint)

从提供的 PeerNearMe 生成 PeerEndPoint 对象。Generates a PeerNearMe object from the provided PeerEndPoint.

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

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

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

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

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

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

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

确定指定的 PeerNearMe 实例是否可视为相等的实例。Determines whether the specified PeerNearMe 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(PeerNearMe) Equals(PeerNearMe) Equals(PeerNearMe) Equals(PeerNearMe)

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

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

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

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

使用序列化指定的 SerializationInfo 所需的数据填充 PeerNearMePopulates a SerializationInfo with the data required to serialize the specified PeerNearMe. 派生的类型必须调用基类型 GetObjectData(SerializationInfo, StreamingContext) 方法。A derived type must call the base type GetObjectData(SerializationInfo, StreamingContext) method.

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

启动网络操作,以检索特定于 PeerNearMe 实例的应用程序、对象和显示状态数据。Initiates a network operation to retrieve the application, object and presence data specific to a PeerNearMe instance.

Invite() Invite() Invite() Invite()

向远程对等方发送加入对等协作应用程序的邀请。Sends an invitation to join a peer collaboration application to a remote peer.

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

向远程对等方发送加入对等协作应用程序的邀请,其中包含描述或指定应用程序邀请的数据。Sends an invitation to join a peer collaboration application to a remote peer that includes data that describes or specifies the application invite.

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

接收来自对等方的有关加入对等协作应用程序的邀请响应。Receives an invitation response from a peer regarding joining a peer collaboration application.

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

接收来自对等方有关加入对等协作应用程序的邀请的邀请响应。Receives an invitation response from a peer regarding an invitation to a peer collaboration application.

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

引发 InviteCompleted 事件。Raises the InviteCompleted event.

(Inherited from Peer)
OnRefreshDataCompleted(RefreshDataCompletedEventArgs) OnRefreshDataCompleted(RefreshDataCompletedEventArgs) OnRefreshDataCompleted(RefreshDataCompletedEventArgs) OnRefreshDataCompleted(RefreshDataCompletedEventArgs)

发出 RefreshDataCompleted 事件信号。Signals the RefreshDataCompleted event.

RefreshData() RefreshData() RefreshData() RefreshData()

启动网络操作,以检索特定于 PeerNearMe 实例的应用程序、对象和显示状态数据。Initiates a network operation to retrieve the application, object and presence data specific to a PeerNearMe instance.

RefreshDataAsync(Object) RefreshDataAsync(Object) RefreshDataAsync(Object) RefreshDataAsync(Object)

启动网络操作,以检索特定于 PeerNearMe 实例的应用程序、对象和显示状态数据。Initiates a network operation to retrieve the application, object and presence data specific to a PeerNearMe instance.

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

返回一个表示 String 实例的 PeerNearMeReturns String that represents a PeerNearMe instance.

事件

InviteCompleted InviteCompleted InviteCompleted InviteCompleted

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

(Inherited from Peer)
PeerNearMeChanged PeerNearMeChanged PeerNearMeChanged PeerNearMeChanged

在下列情况下发出此信号:找到新的 PeerNearMe 实例,该实例不再可用或关联的 PeerEndPoint 对象信息发生更改。Signaled when a new PeerNearMe instance is found, no longer available, or the associated PeerEndPoint object information has changed.

RefreshDataCompleted RefreshDataCompleted RefreshDataCompleted RefreshDataCompleted

RefreshData() 实例的 RefreshDataAsync(Object)PeerNearMe 操作完成时发出此信号。Signaled when the RefreshData() or RefreshDataAsync(Object) operation for the PeerNearMe instance is completed.

显式界面实现

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

使用从已序列化的源中获取的数据填充当前的 PeerNearMe 实例。Populates the current PeerNearMe instance with the data obtained from the serialized source.

适用于

另请参阅