PeerObject PeerObject PeerObject PeerObject Class

定義

代表 PeerObject 類別的新執行個體,該執行個體將具有自動產生的 GuidRepresents a new instance of the PeerObject class with an auto-generated Guid.

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

備註

PeerObject 是執行階段資料,例如圖片、 憑證或特定的描述與特定應用程式相關聯。A PeerObject is run-time data, such as a picture, certificate, or a specific description that is associated with a particular application. 每個 PeerObject 執行個體的資料元素必須小於或等於 16 KB 的大小。The data element of each PeerObject instance must be less than or equal to 16KB in size. 建構 PeerObject 的執行個體之後將它發行對等共同作業基礎結構,透過SetObjectAfter an instance of PeerObject is constructed it is published with the Peer Collaboration Infrastructure via SetObject.

建構此類別的執行個體,並設定適當的屬性,這個物件可傳遞至後PeerCollaborationSetObjectDeleteObject啟用/停用此物件探索及檢視其他對等發佈方法。After constructing an instance of this class and setting the appropriate properties this object may be passed to the PeerCollaborationSetObject and DeleteObject methods to enable/disable the publishing of this object for other peers to discover and view.

註冊與共同作業基礎結構的註冊資訊的物件不會保存在登錄之後,產生不同的行為,從PeerApplication執行個體。After registering an object with the collaboration infrastructure the registration information is not persisted in the registry, resulting in different behavior from PeerApplication instances. 應用程式註冊此物件的存留期期間,才有效物件註冊。The object registration is only valid for the lifetime duration of the application which registered the object. 已不再需要或在應用程式之前結束時,應用程式應該取消註冊的物件。Applications should unregister objects when they are no longer required or prior to application exit. 根據預設,PeerObject 時會自動取消的執行個體超出範圍。By default, a PeerObject is automatically unregistered if the instance goes out of scope.

變更 PeerObject 的執行個體上的屬性,其登錄之後使用PeerCollaboration註冊方法不會更新 PeerObject 執行個體的註冊。Changing the properties on a PeerObject instance after it has been registered using the PeerCollaboration registration methods will not update the registration for the PeerObject instance. 若要有效地更新特定的 PeerObject 執行個體的註冊,PeerObject 必須刪除並再次向新的資訊。To effectively update the registration of a specific PeerObject instance, the PeerObject must be deleted and registered again with the new information.

建構函式

PeerObject() PeerObject() PeerObject() PeerObject()

初始化 PeerObject 類別預設的新執行個體。Initializes a new default instance of the PeerObject class.

PeerObject(Guid, Byte[], PeerScope) PeerObject(Guid, Byte[], PeerScope) PeerObject(Guid, Byte[], PeerScope) PeerObject(Guid, Byte[], PeerScope)

使用相關聯的範圍和資料,初始化新的 PeerObject 執行個體。Initializes a new PeerObject instance with the associated scope and data.

PeerObject(SerializationInfo, StreamingContext) PeerObject(SerializationInfo, StreamingContext) PeerObject(SerializationInfo, StreamingContext) PeerObject(SerializationInfo, StreamingContext)

使用序列化 (Serialization) 所需的相關參數,初始化新的 PeerObject 執行個體。Initializes a new PeerObject instance with the associated parameters required for serialization.

屬性

Data Data Data Data

取得或設定描述性資料,此資料與對等共同作業應用程式的 PeerObject 執行個體相關聯。Gets or sets descriptive data associated with the PeerObject instance for a Peer Collaboration application.

Id Id Id Id

取得或設定與 Guid 執行個體關聯的 PeerObjectGets or sets a Guid associated with the PeerObject instance.

PeerScope PeerScope PeerScope PeerScope

取得或設定 PeerScope 執行個體要註冊的 PeerObjectGets or sets the PeerScope in which the PeerObject instance is registered.

SynchronizingObject SynchronizingObject SynchronizingObject SynchronizingObject

取得或設定物件,用於封送處理因 PeerObject 執行個體變更而發出的事件處理常式呼叫。Gets or sets the object used to marshal the event handler calls that are issued as a result of a PeerObject instance change.

方法

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

釋放 PeerObject 所使用的所有資源。Releases all resources utilized by the PeerObject.

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

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

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

PeerObject 與指定的物件相比較。Compares the PeerObject to the specified object.

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

判斷指定的 PeerObject 執行個體是否視為相等。Determines whether the specified PeerObject instances are considered equal.

Equals(PeerObject) Equals(PeerObject) Equals(PeerObject) Equals(PeerObject)

比較 PeerObject 和指定的 PeerObject 執行個體。Compares a PeerObject to the specified PeerObject instance.

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

傳回 PeerObject 執行個體的雜湊程式碼。Returns the hash code for the PeerObject instance.

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

將序列化指定之 SerializationInfo 所需的資料,填入 PeerObjectPopulates a SerializationInfo with the data required to serialize the specified PeerObject.

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

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
OnObjectChanged(ObjectChangedEventArgs) OnObjectChanged(ObjectChangedEventArgs) OnObjectChanged(ObjectChangedEventArgs) OnObjectChanged(ObjectChangedEventArgs)

當遠端對等電腦加入、更新或移除具有指定 ID 的 PeerObject 執行個體時發出信號。Signaled when a PeerObject instance with the specified ID is added, updated or removed by a remote peer.

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

傳回代表 PeerObject 執行個體的 StringReturns a String that represents a PeerObject instance.

事件

ObjectChanged ObjectChanged ObjectChanged ObjectChanged

會在 PeerObject 執行個體變更時收到信號。Signaled when a PeerObject instance changes.

明確介面實作

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

將從已序列化之資料來源取得的資料填入目前的 PeerObject 執行個體。Populates the current PeerObject instance with the data obtained from the serialized source.

適用於

另請參閱