DOMDocument
From Virtual World Web Wiki
Revision as of 12:38, 6 September 2017 by Spark5 (Talk | contribs) (Documentation for the DOMDocument class)
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
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 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)