Difference between revisions of "DOMDocument"

From Virtual World Web Wiki
Jump to: navigation, search
(Documentation for the DOMDocument class)
(Documentation for the DOMDocument class)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
* '''Inherits class: [[DOMObject]]'''
+
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. There are several sub-classes of DOMDocument that represent several "well known" document types that introduce relevant formal properties.
 +
DOMDocument also defines the main DOM serialization / deserialization methods
 +
 
 +
*'''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>===
{{:DOMDocument Remarks}}
+
{{#ifexist:DOMDocument Remarks|{{:DOMDocument Remarks}}|}}
  
 
===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|bool Editing {get; set;} }}
 +
::
 +
::Specifies if this document is being edited
  
 
:{{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 43:
 
===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 DOMDocument, setting a title and adding children at the same time
  
 
===Methods===
 
===Methods===
:{{CSharp|DOMObject Clone()}}
 
 
 
:{{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|DOMObject DeserializeJSON(string json)}}
 +
::
 +
::Deserializes a DOM object from a json string.
  
 
:{{CSharp|void ReID()}}
 
:{{CSharp|void ReID()}}
 +
::
 +
::Resets the ID property of this and all child objects using IDs generated by its root document
  
 
:{{CSharp|void RunCurvePlayers()}}
 
:{{CSharp|void RunCurvePlayers()}}
 
+
::
:{{CSharp|void Sanity()}}
+
::Runs the Update method on all DOMCurvePlayers in the document
  
 
:{{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|string SerializeJSON(DOMObject instance, Formatting formatting {{=}} Formatting.Indented)}}
 +
::
 +
::Serialized a DOMObject to a JSON string
  
:{{CSharp|void SetLockType<T>()}}
+
:{{CSharp|void SetLatencyTracker(LatencyTracker tracker)}}
 +
::
 +
::Sets the latency tracker for this document tree. Used by the server.
  
 
__NOTOC____NOEDITSECTION__
 
__NOTOC____NOEDITSECTION__

Latest revision as of 12:08, 30 April 2019

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. There are several sub-classes of DOMDocument that represent several "well known" document types that introduce relevant formal properties. 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.
bool Editing {get; set;}
Specifies if this document is being edited
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 DOMDocument, setting a title and adding children at the same time

Methods

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
DOMObject DeserializeJSON(string json)
Deserializes a DOM object from a json string.
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
string SerializeJSON(DOMObject instance, Formatting formatting = Formatting.Indented)
Serialized a DOMObject to a JSON string
void SetLatencyTracker(LatencyTracker tracker)
Sets the latency tracker for this document tree. Used by the server.