Editare

Partajați prin


PeerObject Class

Definition

Represents 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
[<System.Serializable>]
type PeerObject = class
    interface IDisposable
    interface IEquatable<PeerObject>
    interface ISerializable
Public Class PeerObject
Implements IDisposable, IEquatable(Of PeerObject), ISerializable
Inheritance
PeerObject
Attributes
Implements

Remarks

A PeerObject is run-time data, such as a picture, certificate, or a specific description that is associated with a particular application. The data element of each PeerObject instance must be less than or equal to 16KB in size. After an instance of PeerObject is constructed it is published with the Peer Collaboration Infrastructure via SetObject.

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.

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. By default, a PeerObject is automatically unregistered if the instance goes out of scope.

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. To effectively update the registration of a specific PeerObject instance, the PeerObject must be deleted and registered again with the new information.

Constructors

PeerObject()

Initializes a new default instance of the PeerObject class.

PeerObject(Guid, Byte[], PeerScope)

Initializes a new PeerObject instance with the associated scope and data.

PeerObject(SerializationInfo, StreamingContext)

Initializes a new PeerObject instance with the associated parameters required for serialization.

Properties

Data

Gets or sets descriptive data associated with the PeerObject instance for a Peer Collaboration application.

Id

Gets or sets a Guid associated with the PeerObject instance.

PeerScope

Gets or sets the PeerScope in which the PeerObject instance is registered.

SynchronizingObject

Gets or sets the object used to marshal the event handler calls that are issued as a result of a PeerObject instance change.

Methods

Dispose()

Releases all resources utilized by the PeerObject.

Dispose(Boolean)

Releases the unmanaged resources used by the PeerObject and optionally releases the managed resources.

Equals(Object, Object)

Determines whether the specified PeerObject instances are considered equal.

Equals(Object)

Compares the PeerObject to the specified object.

Equals(PeerObject)

Compares a PeerObject to the specified PeerObject instance.

GetHashCode()

Returns the hash code for the PeerObject instance.

GetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo with the data required to serialize the specified PeerObject.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnObjectChanged(ObjectChangedEventArgs)

Signaled when a PeerObject instance with the specified ID is added, updated or removed by a remote peer.

ToString()

Returns a String that represents a PeerObject instance.

Events

ObjectChanged

Signaled when a PeerObject instance changes.

Explicit Interface Implementations

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

Populates the current PeerObject instance with the data obtained from the serialized source.

Applies to

See also