Difference between revisions of "DOMDocument"

From Virtual World Web Wiki
Jump to: navigation, search
(Documentation for the DOMDocument class)
(Documentation for the DOMDocument class)
Line 1: Line 1:
 +
Represents a serialization and management boundary in a DOM tree. Serialization does not cross document boundaries. You can construct a document from other documents (as an server instance does for example).
 +
Generally a DOMDocument represents some server managed entity that has other meaning. Document's have a ContextType and ContextID that help you identify different kinds of documents.
 +
A Scene document is the chunk of DOM that is loaded and saved and edited when you scene edit, a Participant document represents a user's avatar, etc.
 +
DOMDocument also defines the main DOM serialization / deserialization methods
 +
 
*'''Inherits class: [[DOMObject]]'''
 
*'''Inherits class: [[DOMObject]]'''
 
===Remarks <nowiki>[</nowiki>[{{fullurl:DOMDocument Remarks|action=edit}} edit]<nowiki>]</nowiki>===
 
===Remarks <nowiki>[</nowiki>[{{fullurl:DOMDocument Remarks|action=edit}} edit]<nowiki>]</nowiki>===
Line 5: Line 10:
 
===Properties===
 
===Properties===
 
:{{CSharp|Guid ContextID {get; set;} }}
 
:{{CSharp|Guid ContextID {get; set;} }}
 +
::
 +
::The ID of the document's related server object. The meaning ContextID depends on the ContextType property.
  
 
:{{CSharp|DOMDocumentContextType ContextType {get; set;} }}
 
:{{CSharp|DOMDocumentContextType ContextType {get; set;} }}
 +
::
 +
::The type of server object represented by this DOM document.
  
 
:{{CSharp|object HostObject {get; set;} }}
 
:{{CSharp|object HostObject {get; set;} }}
 +
::
 +
::Like "Tag", but mean to be used by a DOM host to associate a document with the server object it represents
  
 
:{{CSharp|LatencyTracker LatencyTracker {get; set;} }}
 
:{{CSharp|LatencyTracker LatencyTracker {get; set;} }}
 +
::
 +
::Used by the infrastructure for latency calculations
  
 
:{{CSharp|int LightMapMode {get; set;} }}
 
:{{CSharp|int LightMapMode {get; set;} }}
 +
::
 +
::Specifies the ligh map mode to use in a scene. This probably doesn't belong on "document" but rather as a runtime-added property of scene documents
  
 
:{{CSharp|long? ViewID {get; set;} }}
 
:{{CSharp|long? ViewID {get; set;} }}
 +
::
 +
::The ID of the server [[ViewInfo]] represented by this document. This property should only be set on root documents of views
  
 
===Events===
 
===Events===
Line 23: Line 40:
 
===Constructors===
 
===Constructors===
 
:{{CSharp|DOMDocument(DOMObject[] children)}}
 
:{{CSharp|DOMDocument(DOMObject[] children)}}
 +
::
 +
::Constructs a new DOMDocument, adding children at the same time
  
 
:{{CSharp|DOMDocument(string title, DOMObject[] children)}}
 
:{{CSharp|DOMDocument(string title, DOMObject[] children)}}
 +
::
 +
::Constructs a new DOMCurveKeyframe, setting a title and adding children at the same time
  
 
===Methods===
 
===Methods===
 
:{{CSharp|DOMObject Clone()}}
 
:{{CSharp|DOMObject Clone()}}
 
::
 
::
::Gets a deep clone of the current object
+
::Creates a clone of this DOMDocument and all it's children and properties
  
 
:{{CSharp|T Deserialize<T>(Byte[] source, SerializationContext context)}}
 
:{{CSharp|T Deserialize<T>(Byte[] source, SerializationContext context)}}
 +
::
 +
::Deserializes the provided bytes into a DOM tree.
  
 
:{{CSharp|T Deserialize<T>(Byte[] source, SerializationContextType contextType)}}
 
:{{CSharp|T Deserialize<T>(Byte[] source, SerializationContextType contextType)}}
 +
::
 +
::Deserializes the provided bytes into a DOM tree.
  
 
:{{CSharp|DOMObject Deserialize(Byte[] source, SerializationContextType contextType)}}
 
:{{CSharp|DOMObject Deserialize(Byte[] source, SerializationContextType contextType)}}
 +
::
 +
::Deserializes the provided bytes into a DOM tree.
  
 
:{{CSharp|DOMObject Deserialize(Byte[] source, SerializationContext context)}}
 
:{{CSharp|DOMObject Deserialize(Byte[] source, SerializationContext context)}}
 +
::
 +
::Deserializes the provided bytes into a DOM tree.
  
 
:{{CSharp|T Deserialize<T>(Stream stream, SerializationContextType contextType)}}
 
:{{CSharp|T Deserialize<T>(Stream stream, SerializationContextType contextType)}}
 +
::
 +
::Deserializes the a DOM tree from a stream
  
 
:{{CSharp|void ReID()}}
 
:{{CSharp|void ReID()}}
Line 48: Line 79:
 
::
 
::
 
::Runs the Update method on all DOMCurvePlayers in the document
 
::Runs the Update method on all DOMCurvePlayers in the document
 
:{{CSharp|void Sanity()}}
 
  
 
:{{CSharp|Byte[] Serialize<T>(T instance, SerializationContextType contextType)}}
 
:{{CSharp|Byte[] Serialize<T>(T instance, SerializationContextType contextType)}}
 +
::
 +
::Serializes the provided DOM tree
  
 
:{{CSharp|void Serialize<T>(Stream stream, T instance, SerializationContextType contextType)}}
 
:{{CSharp|void Serialize<T>(Stream stream, T instance, SerializationContextType contextType)}}
 +
::
 +
::Serializes the provided DOM tree into the provided stream
  
 
:{{CSharp|void SetLatencyTracker(LatencyTracker tracker)}}
 
:{{CSharp|void SetLatencyTracker(LatencyTracker tracker)}}
 +
::
 +
::Sets the latency tracker for this document tree. Used by the server.
  
 
:{{CSharp|void SetLockType<T>()}}
 
:{{CSharp|void SetLockType<T>()}}
 +
::
 +
::Used to set a type to use for DOM synchronization (this is here because ReaderWriterLockSlim is not available in Unity, but is more efficient and used on the server)
  
 
__NOTOC____NOEDITSECTION__
 
__NOTOC____NOEDITSECTION__

Revision as of 19:40, 4 April 2017

Represents a serialization and management boundary in a DOM tree. Serialization does not cross document boundaries. You can construct a document from other documents (as an server instance does for example). Generally a DOMDocument represents some server managed entity that has other meaning. Document's have a ContextType and ContextID that help you identify different kinds of documents. A Scene document is the chunk of DOM that is loaded and saved and edited when you scene edit, a Participant document represents a user's avatar, etc. DOMDocument also defines the main DOM serialization / deserialization methods

Remarks [edit]

Properties

Guid ContextID {get; set;}
The ID of the document's related server object. The meaning ContextID depends on the ContextType property.
DOMDocumentContextType ContextType {get; set;}
The type of server object represented by this DOM document.
object HostObject {get; set;}
Like "Tag", but mean to be used by a DOM host to associate a document with the server object it represents
LatencyTracker LatencyTracker {get; set;}
Used by the infrastructure for latency calculations
int LightMapMode {get; set;}
Specifies the ligh map mode to use in a scene. This probably doesn't belong on "document" but rather as a runtime-added property of scene documents
long? ViewID {get; set;}
The ID of the server ViewInfo represented by this document. This property should only be set on root documents of views

Events

IdentifierChanged(EventHandler)
Event is raised, when the document and its children identifiers have changed

Constructors

DOMDocument(DOMObject[] children)
Constructs a new DOMDocument, adding children at the same time
DOMDocument(string title, DOMObject[] children)
Constructs a new DOMCurveKeyframe, setting a title and adding children at the same time

Methods

DOMObject Clone()
Creates a clone of this DOMDocument and all it's children and properties
T Deserialize<T>(Byte[] source, SerializationContext context)
Deserializes the provided bytes into a DOM tree.
T Deserialize<T>(Byte[] source, SerializationContextType contextType)
Deserializes the provided bytes into a DOM tree.
DOMObject Deserialize(Byte[] source, SerializationContextType contextType)
Deserializes the provided bytes into a DOM tree.
DOMObject Deserialize(Byte[] source, SerializationContext context)
Deserializes the provided bytes into a DOM tree.
T Deserialize<T>(Stream stream, SerializationContextType contextType)
Deserializes the a DOM tree from a stream
void ReID()
Resets the ID property of this and all child objects using IDs generated by its root document
void RunCurvePlayers()
Runs the Update method on all DOMCurvePlayers in the document
Byte[] Serialize<T>(T instance, SerializationContextType contextType)
Serializes the provided DOM tree
void Serialize<T>(Stream stream, T instance, SerializationContextType contextType)
Serializes the provided DOM tree into the provided stream
void SetLatencyTracker(LatencyTracker tracker)
Sets the latency tracker for this document tree. Used by the server.
void SetLockType<T>()
Used to set a type to use for DOM synchronization (this is here because ReaderWriterLockSlim is not available in Unity, but is more efficient and used on the server)