Export (0) Print
Expand All

PeerObject Class

Represents a new instance of the PeerObject class with an auto-generated Guid.

System.Object
  System.Net.PeerToPeer.Collaboration.PeerObject

Namespace:  System.Net.PeerToPeer.Collaboration
Assembly:  System.Net (in System.Net.dll)

[SerializableAttribute]
public class PeerObject : IDisposable, IEquatable<PeerObject>, 
	ISerializable

The PeerObject type exposes the following members.

  NameDescription
Public methodPeerObject()Initializes a new default instance of the PeerObject class.
Protected methodPeerObject(SerializationInfo, StreamingContext)Initializes a new PeerObject instance with the associated parameters required for serialization.
Public methodPeerObject(Guid, Byte[], PeerScope)Initializes a new PeerObject instance with the associated scope and data.
Top

  NameDescription
Public propertyDataGets or sets descriptive data associated with the PeerObject instance for a Peer Collaboration application.
Public propertyIdGets or sets a Guid associated with the PeerObject instance.
Public propertyPeerScopeGets or sets the PeerScope in which the PeerObject instance is registered.
Public propertySynchronizingObjectGets or sets the object used to marshal the event handler calls that are issued as a result of a PeerObject instance change.
Top

  NameDescription
Public methodDispose()Releases all resources utilized by the PeerObject.
Protected methodDispose(Boolean)Releases the unmanaged resources used by the PeerObject and optionally releases the managed resources.
Public methodEquals(Object)Compares the PeerObject to the specified object. (Overrides Object.Equals(Object).)
Public methodEquals(PeerObject)Compares a PeerObject to the specified PeerObject instance.
Public methodStatic memberEquals(Object, Object)Determines whether the specified PeerObject instances are considered equal.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns the hash code for the PeerObject instance. (Overrides Object.GetHashCode().)
Protected methodGetObjectDataPopulates a SerializationInfo with the data required to serialize the specified PeerObject.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnObjectChangedSignaled when a PeerObject instance with the specified ID is added, updated or removed by a remote peer.
Public methodToStringReturns a String that represents a PeerObject instance. (Overrides Object.ToString().)
Top

  NameDescription
Public eventObjectChangedSignaled when a PeerObject instance changes.
Top

  NameDescription
Explicit interface implemetationPrivate methodISerializable.GetObjectDataPopulates the current PeerObject instance with the data obtained from the serialized source.
Top

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 PeerCollaboration SetObject 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 deregister objects when they are no longer required or prior to application exit. By default, a PeerObject is automatically deregistered 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.

.NET Framework

Supported in: 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft