Difference between revisions of "DOMObject"

From Virtual World Web Wiki
Jump to: navigation, search
(Documentation for the DOMObject class)
(Documentation for the DOMObject class)
 
(22 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
===Remarks <nowiki>[</nowiki>[{{fullurl:DOMObject Remarks|action=edit}} edit]<nowiki>]</nowiki>===
 
===Remarks <nowiki>[</nowiki>[{{fullurl:DOMObject Remarks|action=edit}} edit]<nowiki>]</nowiki>===
{{:DOMObject Remarks}}
+
{{#ifexist:DOMObject Remarks|{{:DOMObject Remarks}}|}}
  
 
===Properties===
 
===Properties===
Line 15: Line 15:
 
:{{CSharp|DOMAttributeCache AttributeCache {get; set;} }}
 
:{{CSharp|DOMAttributeCache AttributeCache {get; set;} }}
 
::
 
::
::Used by the server to optimize [[Object Type]] attribute requests
+
::Used by the infrastructure to optimize [[Object Type]] [[DOM Attribution]]
  
 
:{{CSharp|DOMAttributeSet Attributes {get;} }}
 
:{{CSharp|DOMAttributeSet Attributes {get;} }}
 
::
 
::
 
::A collection of DOMAttributes defined on this object via the [[Object Type]] system
 
::A collection of DOMAttributes defined on this object via the [[Object Type]] system
 
:{{CSharp|Guid? BaseTypeID {get; set;} }}
 
::
 
::The type ID of the root [[Object Type]] in a derived [[Object Type Reference]] chain
 
  
 
:{{CSharp|DOMObjectCollection Children {get;} }}
 
:{{CSharp|DOMObjectCollection Children {get;} }}
Line 33: Line 29:
 
::Much like the HTML concept of class, a space-separated list of class names which can be used by [[CSS Selectors]] to select this node
 
::Much like the HTML concept of class, a space-separated list of class names which can be used by [[CSS Selectors]] to select this node
  
:{{CSharp|ReferenceContract Contract {get; set;} }}
+
:{{CSharp|bool DebuggingEnabled {get; set;} }}
 
::
 
::
::Provides access to the ReferenceContract (which keeps track of runtime changes to an [[Object Type Reference]])
+
::When True, the DOM will output much more debugging noise
  
 
:{{CSharp|DOMDocument Document {get;} }}
 
:{{CSharp|DOMDocument Document {get;} }}
Line 44: Line 40:
 
::
 
::
 
::When True the effects of this object and its children should be honored in a client, for example a DOMLight should shine, a DOMRenderable should display, etc. Conversely when False, this object should be treated as though it were hidden and it's effects ignored.
 
::When True the effects of this object and its children should be honored in a client, for example a DOMLight should shine, a DOMRenderable should display, etc. Conversely when False, this object should be treated as though it were hidden and it's effects ignored.
 +
 +
:{{CSharp|HierarchyResolverDelegate HierarchyResolver {get; set;} }}
 +
 +
:{{CSharp|bool HighLoadPriority {get; set;} }}
 +
::
 +
::High Load Priority nodes will be included in the list of things that need to be loaded before the scene will be ready to display.
  
 
:{{CSharp|long ID {get; set;} }}
 
:{{CSharp|long ID {get; set;} }}
Line 60: Line 62:
 
::
 
::
 
::The type ID of the next [[Object Type]] up the hierarchy in a derived [[Object Type Reference]] chain
 
::The type ID of the next [[Object Type]] up the hierarchy in a derived [[Object Type Reference]] chain
 
:{{CSharp|bool IsInReference {get;} }}
 
::
 
::True if this node is part of a [[Object Type Reference]]
 
  
 
:{{CSharp|bool IsInstanceRoot {get;} }}
 
:{{CSharp|bool IsInstanceRoot {get;} }}
Line 72: Line 70:
 
::
 
::
 
::True if this node represents the root node of an instance of an [[Object Template]]
 
::True if this node represents the root node of an instance of an [[Object Template]]
 
:{{CSharp|bool IsTopLevelReference {get;} }}
 
::
 
::True if this node is the top-most reference root
 
  
 
:{{CSharp|bool IsTypeRoot {get; set;} }}
 
:{{CSharp|bool IsTypeRoot {get; set;} }}
Line 92: Line 86:
 
::
 
::
 
::Unique ID set on first creation (not sure how this is different than RecordID)
 
::Unique ID set on first creation (not sure how this is different than RecordID)
 
:{{CSharp|string NodePath {get;} }}
 
::
 
::Gets a path which can be used to locate a specific node in the DOM using the FindNode method
 
  
 
:{{CSharp|IEnumerable<DOMAttribute> ObjectAttributes {get;} }}
 
:{{CSharp|IEnumerable<DOMAttribute> ObjectAttributes {get;} }}
 
::
 
::
 
::Gets a list of DOMAttributes on this node
 
::Gets a list of DOMAttributes on this node
 +
 +
:{{CSharp|Guid? ObjectTypeID {get;} }}
 +
::
 +
::The authoritive "Real" object type ID that this node is a part of
 +
 +
:{{CSharp|Guid? OriginalInstanceID {get; set;} }}
 +
::
 +
::When this node is an embedded reference, this is a recording of our original instance ID, and will be restored if we are removed (un-embedded) from our parent referebce.
  
 
:{{CSharp|DOMObject Parent {get;} }}
 
:{{CSharp|DOMObject Parent {get;} }}
 
::
 
::
 
::The parent DOMObject of this node
 
::The parent DOMObject of this node
 +
 +
:{{CSharp|Guid? ParentInstanceID {get; set;} }}
 +
::
 +
::When this node is an embedded reference, this is the instance ID of the next parent reference up the chain
  
 
:{{CSharp|DOMPropertyCollection Properties {get;} }}
 
:{{CSharp|DOMPropertyCollection Properties {get;} }}
Line 112: Line 114:
 
::
 
::
 
::A set of flags representing protections enforced by the server. '''Delete''' object (1), '''Move''' object (2), '''Add''' child (4), '''Remove''' child (8), '''Change''' object (16) are some of the possible flags. This property can only be set on the server and is used to protect certain objects from accidental operations that could be harmful to the basic DOM structure, like deleting the root instance document for example.
 
::A set of flags representing protections enforced by the server. '''Delete''' object (1), '''Move''' object (2), '''Add''' child (4), '''Remove''' child (8), '''Change''' object (16) are some of the possible flags. This property can only be set on the server and is used to protect certain objects from accidental operations that could be harmful to the basic DOM structure, like deleting the root instance document for example.
 
:{{CSharp|Guid RecordID {get;} }}
 
::
 
::The ID used to uniquely identify an object. RecordIDs are generated when a new DOMObject is created.
 
  
 
:{{CSharp|DOMDocument RootDocument {get;} }}
 
:{{CSharp|DOMDocument RootDocument {get;} }}
Line 147: Line 145:
 
:{{CSharp|string Title {get; set;} }}
 
:{{CSharp|string Title {get; set;} }}
 
::
 
::
::The title of the object, usually used only for display in a server inspector, but sometimes has special meaning (eg. in [[DOMTitle]], [[DOMHookpoint]], and [[DOMCurveValue]] nodes
+
::The title of the object, usually used only for display in a server inspector, but sometimes has special meaning (eg. in [[DOMTitle]], [[DOMHookPoint]], and [[DOMCurveValue]] nodes
 +
 
 +
:{{CSharp|DOMObject Top {get;} }}
 +
::
 +
::Returns the topmost DOM node in this hierarchy
  
 
:{{CSharp|bool Transient {get; set;} }}
 
:{{CSharp|bool Transient {get; set;} }}
Line 168: Line 170:
 
::
 
::
 
::True if this node is the root of a type reference (as in, not locally defined, but here as the result of a [[DOMReference]] expansion, and will be serialized as a DOMReference)
 
::True if this node is the root of a type reference (as in, not locally defined, but here as the result of a [[DOMReference]] expansion, and will be serialized as a DOMReference)
 
:{{CSharp|bool[] TypeReferenceReload {get; set;} }}
 
::
 
::A Dirkasaurus-Rex Boolean Factory
 
  
 
:{{CSharp|DOMObject TypeRoot {get;} }}
 
:{{CSharp|DOMObject TypeRoot {get;} }}
 
::
 
::
 
::Finds the node up the hierarchy that represents the root of this object type (assuming this node is part of one, otherwise null)
 
::Finds the node up the hierarchy that represents the root of this object type (assuming this node is part of one, otherwise null)
 +
 +
:{{CSharp|Guid? UnboundReferenceID {get; set;} }}
 +
::
 +
::When this node was a reference and was UnBound, or if it was instantiated directly from a type (rather than as a reference to a type), this value will be set with the ID of the original Object Type
  
 
:{{CSharp|bool Validated {get; set;} }}
 
:{{CSharp|bool Validated {get; set;} }}
Line 190: Line 192:
  
 
===Events===
 
===Events===
 +
:{{CSharp|ChildAfterAdd(EventHandler<DOMUpdateChildAdd>)}}
 +
::
 +
::Fires just after a child was added to this node or one of its children. You can use this event to cleanup
 +
 
:{{CSharp|ChildBeforeAdd(EventHandler<DOMUpdateChildAdd>)}}
 
:{{CSharp|ChildBeforeAdd(EventHandler<DOMUpdateChildAdd>)}}
 
::
 
::
Line 197: Line 203:
 
::
 
::
 
::Fires just before a child is removed from this node or one of its children. You can use this event to prevent a node from being removed from the DOM or examine it while it's parentage is still intact
 
::Fires just before a child is removed from this node or one of its children. You can use this event to prevent a node from being removed from the DOM or examine it while it's parentage is still intact
 +
 +
:{{CSharp|NodeEvent(EventHandler<DOMUpdateNodeEvent>)}}
 +
::
 +
::Fires when a node event is received
  
 
:{{CSharp|Updated(EventHandler<DOMUpdateEventArgs>)}}
 
:{{CSharp|Updated(EventHandler<DOMUpdateEventArgs>)}}
Line 220: Line 230:
 
::Similar to JQuery's AddClass method, this adds one space separated item to the Class property without disturbing the others
 
::Similar to JQuery's AddClass method, this adds one space separated item to the Class property without disturbing the others
  
:{{CSharp|void BeginUpdate()}}
+
:{{CSharp|void AddListenerAllow(DOMListener listener)}}
 
::
 
::
::Begins an update, which coalesces many changes to the DOM into a single update. You can add and remove nodes and change properties. WHen you're done, call EndUpdate.
+
::Adds a listener to the allow list. If there is no allow list, one will be created, causing all other listeners to see the node dissapear
 +
 
 +
:{{CSharp|void AddListenerDeny(DOMListener listener)}}
 +
::
 +
::Adds a listener to the deny list. This user will see the node dissapear
 +
 
 +
:{{CSharp|void AddListenerWritable(DOMListener listener)}}
 +
::
 +
::Adds a listener to this node's writable list. Calls to IsListenerWritable at this node or its children will return true for this listener
 +
 
 +
:{{CSharp|DOMObject ChangeType(DOMObject node, Type type, bool swapInPlace {{=}} true)}}
 +
::
 +
::Changes the type of this node to another node type (in place or by clone) if possible
  
 
:{{CSharp|bool CheckChild(DOMObject child)}}
 
:{{CSharp|bool CheckChild(DOMObject child)}}
Line 235: Line 257:
 
::
 
::
 
:: Removes all children from this DOM node
 
:: Removes all children from this DOM node
 +
 +
:{{CSharp|void ClearReferenceTracker()}}
 +
::
 +
::If this object is a reference, reset its change tracker.
  
 
:{{CSharp|DOMObject Clone()}}
 
:{{CSharp|DOMObject Clone()}}
Line 268: Line 294:
 
::Returns a count of all nodes within the specified scope and matching the supplied predicate
 
::Returns a count of all nodes within the specified scope and matching the supplied predicate
  
:{{CSharp|DOMObject Detach()}}
+
:{{CSharp|DOMObject CreateInstance(Type type)}}
 
::
 
::
::Detaches the node from its parent and resets the childrens ID's
+
::Creates an instance of the specified DOMObject type
  
:{{CSharp|void EndUpdate()}}
+
:{{CSharp|bool DiscoverTemplate(Guid templateID)}}
 
::
 
::
::Ends an update, sending all accumulated changes to connected clients.
+
::Used by Curiosity. This is sillyish
 +
 
 +
:{{CSharp|bool DiscoverType(Guid typeID)}}
 +
::
 +
::Used by Curiosity. This is sillyish
 +
 
 +
:{{CSharp|void EmptyListenerAllowList()}}
 +
::
 +
::Initializes an empty allow list, or clears an existing one. No listener will be able to see this node after this call (similar to Visible=false)
  
 
:{{CSharp|bool Equals(DOMObject first, DOMObject second)}}
 
:{{CSharp|bool Equals(DOMObject first, DOMObject second)}}
Line 284: Line 318:
 
::Tests if this DOMObject is the same object as another (compares reference hashcodes)
 
::Tests if this DOMObject is the same object as another (compares reference hashcodes)
  
:{{CSharp|DOMObject FindNode(string nodepath, Guid? templateID)}}
+
:{{CSharp|void FireEvent(string name, string payload, DOMListener[] allowed {{=}} NULL, DOMListener[] denied {{=}} NULL, Guid? sender {{=}} NULL, bool track {{=}} true)}}
 +
::
 +
::Fires a [[DOM Event]] which is a message, with a name and payload, that can be processed by connected clients
 +
 
 +
:{{CSharp|void FireEvent<T>(T instance, DOMListener[] allowed {{=}} NULL, DOMListener[] denied {{=}} NULL, Guid? sender {{=}} NULL, bool track {{=}} true)}}
 
::
 
::
::Gets the node that matches the object type node path (Example: 40/23)
+
::Fires a [[DOM Event]] which is a message, with a name and payload, that can be processed by connected clients. This version takes an attributed type-safe payload object
  
 
:{{CSharp|DOMObject First(DOMSearchLevel applyTo)}}
 
:{{CSharp|DOMObject First(DOMSearchLevel applyTo)}}
Line 326: Line 364:
 
:{{CSharp|void ForEach<T>(Func<T, bool> predicate, Action<T> action, DOMSearchLevel applyTo)}}
 
:{{CSharp|void ForEach<T>(Func<T, bool> predicate, Action<T> action, DOMSearchLevel applyTo)}}
 
::
 
::
::Executes the specified action on all nodes withing the specified scope and matching the supplied predicate and type
+
::Executes the specified action on all nodes within the specified scope and matching the supplied predicate and type
  
:{{CSharp|TResult GetAttributeValue<TResult>(string attributeName, string propertyName)}}
+
:{{CSharp|DOMObject FromStorage(object nodeStorage)}}
 +
 
 +
:{{CSharp|Guid GenerateNodeID()}}
 +
::
 +
::Generates a node ID for this node. Used by the infrastructure.
 +
 
 +
:{{CSharp|TResult GetAttributeValue<TResult>(string attributeName, string propertyName {{=}} NULL)}}
 
::
 
::
 
::Gets the value of the specified attribute if it is defined on this node or the specified property
 
::Gets the value of the specified attribute if it is defined on this node or the specified property
Line 336: Line 380:
 
::Calls DOMObject.GetHashCode on the specified object
 
::Calls DOMObject.GetHashCode on the specified object
  
:{{CSharp|T GetLocalProperty<T>(string key, Func<T> defaultSelector)}}
+
:{{CSharp|T GetLocalProperty<T>(string key, Func<T> defaultSelector {{=}} NULL)}}
 
::
 
::
 
::Gets the value of a local property of this DOM node
 
::Gets the value of a local property of this DOM node
Line 344: Line 388:
 
::Gets a list of the names of all the properties that have the specified attribute defined on them
 
::Gets a list of the names of all the properties that have the specified attribute defined on them
  
:{{CSharp|bool HasAttribute(string attributeName, string propertyName)}}
+
:{{CSharp|bool HasAttribute(string attributeName, string propertyName {{=}} NULL)}}
 
::
 
::
 
::Tests if this node or a specific property has the specified attribute defined on it
 
::Tests if this node or a specific property has the specified attribute defined on it
Line 351: Line 395:
 
::
 
::
 
::Similar to JQuery's HasClass method, this checks for the existance of one space separated item on the Class property
 
::Similar to JQuery's HasClass method, this checks for the existance of one space separated item on the Class property
 +
 +
:{{CSharp|bool HasLocalProperty(string key)}}
 +
::
 +
::Tests if this DOMObject has a local property with the specified key
 +
 +
:{{CSharp|bool IsListenerAllowed(DOMListener listener)}}
 +
::
 +
::Determines if a given DOMListener is allowed to see updates from this node and its children
 +
 +
:{{CSharp|bool IsListenerWritable(DOMListener listener)}}
 +
::
 +
::Tests if a given listener has been granted write privilages at this node or one of its parents
  
 
:{{CSharp|bool MatchesSelector(string selector)}}
 
:{{CSharp|bool MatchesSelector(string selector)}}
Line 356: Line 412:
 
::Tests if this node matches the specified [[CSS Selectors|CSS Selector]]
 
::Tests if this node matches the specified [[CSS Selectors|CSS Selector]]
  
:{{CSharp|void MergeFrom(DOMObject source, bool restore, DOMDiffOperations type)}}
+
:{{CSharp|void MergeFrom(DOMObject source, bool restore {{=}} false, bool applyTo {{=}} true, DOMDiffOperation type {{=}} DOMDiffOperation.Merge)}}
 
::
 
::
 
::Preforms a merge form the specified source to this object
 
::Preforms a merge form the specified source to this object
Line 363: Line 419:
 
::
 
::
 
::Returns all nodes withing the specified scope and matching the specified type
 
::Returns all nodes withing the specified scope and matching the specified type
 +
 +
:{{CSharp|ProtoValue op_Explicit(DOMObject obj)}}
  
 
:{{CSharp|T ParentOfType<T>()}}
 
:{{CSharp|T ParentOfType<T>()}}
 
::
 
::
 
::Searches up the DOM hierarchy looking for a parent of the specified type
 
::Searches up the DOM hierarchy looking for a parent of the specified type
 +
 +
:{{CSharp|DOMObject Parse(object value)}}
 +
::
 +
::Parse anonymous object to DOMObject
  
 
:{{CSharp|DOMObject QuerySelector(string selector)}}
 
:{{CSharp|DOMObject QuerySelector(string selector)}}
Line 375: Line 437:
 
::
 
::
 
::Returns all the nodes that match the specified [[CSS Selectors|CSS Selector]]. This could include this node, and anty of its children.
 
::Returns all the nodes that match the specified [[CSS Selectors|CSS Selector]]. This could include this node, and anty of its children.
 +
 +
:{{CSharp|bool ReferenceContains(Guid typeID)}}
 +
::
 +
::Checks if this object is part of a reference that contains the specified type. Used by the infrastructure.
 +
 +
:{{CSharp|void ReferenceReset(bool props, bool children)}}
 +
::
 +
::Resets aspects of reference. Used by the infrastructure.
 +
 +
:{{CSharp|void ReferenceResetProperty(DOMObject sourceNode, string propertyName)}}
 +
::
 +
::Resets aspects of reference. Used by the infrastructure.
 +
 +
:{{CSharp|void RefreshResource(Guid resourceItemID)}}
  
 
:{{CSharp|void ReID()}}
 
:{{CSharp|void ReID()}}
Line 383: Line 459:
 
::
 
::
 
::Similar to JQuery's RemoveClass method, this removes one space separated item to the Class property without disturbing the others
 
::Similar to JQuery's RemoveClass method, this removes one space separated item to the Class property without disturbing the others
 +
 +
:{{CSharp|void RemoveListenerAllow(DOMListener listener)}}
 +
::
 +
::Removes a listener from the allow list. That listener will see this node disappear. If you want everyone to be able to see the node again, use RemoveListenerAllowList.
 +
 +
:{{CSharp|void RemoveListenerAllowList()}}
 +
::
 +
::Removes the entire allow list. Doing this makes this node visible to everyone again. If you wish to have an allow list, but an empty one, call EmptyListenerAllowList
 +
 +
:{{CSharp|void RemoveListenerDeny(DOMListener listener)}}
 +
::
 +
::Removes a listener from the deny list. That listener will see this node reappear.
 +
 +
:{{CSharp|void RemoveListenerDenyList()}}
 +
::
 +
::Removes the entire deny list. All listeners on this list will see this node reappear.
 +
 +
:{{CSharp|void RemoveListenerWritable(DOMListener listener)}}
 +
::
 +
::Removes a listener from this node's writable list. Calls to IsListenerWritable at this node or its children will return false for this listener
  
 
:{{CSharp|int RemoveLocalProperties(Func<string, bool> predicate)}}
 
:{{CSharp|int RemoveLocalProperties(Func<string, bool> predicate)}}
Line 392: Line 488:
 
::Removes a single local property by its key
 
::Removes a single local property by its key
  
:{{CSharp|void ResetTypeID(Guid typeID)}}
+
:{{CSharp|void ResetTypeID(Guid typeID, bool? resetTemplateID {{=}} NULL)}}
 
::
 
::
 
::Changes the TypeID on this node and all sub-nodes that share the current TypeID. The Template ID of this node is also cleared
 
::Changes the TypeID on this node and all sub-nodes that share the current TypeID. The Template ID of this node is also cleared
Line 403: Line 499:
 
::
 
::
 
::Sets the value of a local property
 
::Sets the value of a local property
 +
 +
:{{CSharp|int SortCompare(DOMObject other)}}
 +
::
 +
::Compares this node with another node of the same type for display sorting purposes
  
 
:{{CSharp|void ToggleClass(string className)}}
 
:{{CSharp|void ToggleClass(string className)}}

Latest revision as of 17:14, 11 September 2019

This is the base class for all DOM node types. A DOM Object is essentially a collection of properties (name value pairs) and a collection of child DOM Objects forming a hierarchy. Changes to properties and changes to the hierarchy cause Update events to bubble up firing at each node until the the topmost node is reached.

See also: Server Scripting

Remarks [edit]

Properties

bool Accessable {get;}
True if the object is both Enabled and Validated and if it has a parent, that parent is accessible as well
DOMAttributeCache AttributeCache {get; set;}
Used by the infrastructure to optimize Object Type DOM Attribution
DOMAttributeSet Attributes {get;}
A collection of DOMAttributes defined on this object via the Object Type system
DOMObjectCollection Children {get;}
Provides access to the children collection for this object
string Class {get; set;}
Much like the HTML concept of class, a space-separated list of class names which can be used by CSS Selectors to select this node
bool DebuggingEnabled {get; set;}
When True, the DOM will output much more debugging noise
DOMDocument Document {get;}
Provides access to the DOMDocument of which this node is a part.
bool Enabled {get; set;}
When True the effects of this object and its children should be honored in a client, for example a DOMLight should shine, a DOMRenderable should display, etc. Conversely when False, this object should be treated as though it were hidden and it's effects ignored.
HierarchyResolverDelegate HierarchyResolver {get; set;}
bool HighLoadPriority {get; set;}
High Load Priority nodes will be included in the list of things that need to be loaded before the scene will be ready to display.
long ID {get; set;}
The unique ID of this object in the view. DOM node IDs can change if a node is moved between view documents or removed from a document in which case this property will return zero. DOM node IDs are allocated by the RootDocument in a view
Guid? InstanceIndex {get;}
Used internally by the referencing system
DOMObject InstanceRoot {get;}
Finds the node up the hierarchy that represents the root of this Object Type Reference (assuming this node is part of one, otherwise null)
Guid? InstanceTypeID {get; set;}
The type ID of the next Object Type up the hierarchy in a derived Object Type Reference chain
bool IsInstanceRoot {get;}
True if this node is the root node in an Object Type Reference
bool IsTemplateRoot {get;}
True if this node represents the root node of an instance of an Object Template
bool IsTypeRoot {get; set;}
True if this node represents the root node of an Object Type
Guid MergeID {get; set;}
An ID that makes this object unique within it's container (parent). The MergeID changes whenever the object is re-parented.
bool MergeLocked {get;}
Used by the merge system to prevent change tracking in certain cases
Guid NodeID {get; set;}
Unique ID set on first creation (not sure how this is different than RecordID)
IEnumerable<DOMAttribute> ObjectAttributes {get;}
Gets a list of DOMAttributes on this node
Guid? ObjectTypeID {get;}
The authoritive "Real" object type ID that this node is a part of
Guid? OriginalInstanceID {get; set;}
When this node is an embedded reference, this is a recording of our original instance ID, and will be restored if we are removed (un-embedded) from our parent referebce.
DOMObject Parent {get;}
The parent DOMObject of this node
Guid? ParentInstanceID {get; set;}
When this node is an embedded reference, this is the instance ID of the next parent reference up the chain
DOMPropertyCollection Properties {get;}
Provides access to the property collection for this object
DOMProtectionFlags ProtectionFlags {get; set;}
A set of flags representing protections enforced by the server. Delete object (1), Move object (2), Add child (4), Remove child (8), Change object (16) are some of the possible flags. This property can only be set on the server and is used to protect certain objects from accidental operations that could be harmful to the basic DOM structure, like deleting the root instance document for example.
DOMDocument RootDocument {get;}
Provides access to the top-most DOMDocument of which this node is a part.
DateTime ServerTime {get;}
Gets the current server time
List<string> SystemPropertyNames {get;}
Returns a list of system property names for this node type
object Tag {get; set;}
A property you can use to associate this object with something in your DOM host (a TreeNode or GameObject for example)
Guid TemplateID {get; set;}
If this node is part of an instaniated Object Template this property will contain the ID of the template
DOMObject TemplateRoot {get;}
Finds the node up the hierarchy that represents the root of this Object Template instantiation (assuming this node is part of one, otherwise null)
bool Temporary {get; set;}
A node marked as Temporary will not be serialized for storage and will not be disturbed during a publish merge. They are considered "runtime nodes" not part of the saved layout or type.
string Title {get; set;}
The title of the object, usually used only for display in a server inspector, but sometimes has special meaning (eg. in DOMTitle, DOMHookPoint, and DOMCurveValue nodes
DOMObject Top {get;}
Returns the topmost DOM node in this hierarchy
bool Transient {get; set;}
A transient node is meant to be removed from the DOM immediately after it is received. On the server side, when a node marked Transient is added to the DOM a ChildAdd packet is sent to the client, but the node is never added to the Children collection of the target parent.
Guid TypeID {get; set;}
The ID of the Object Type (stored DOM snippet) that this node is a part of. If the Object Type is a derived reference or this node is part of a reference inside an Object Type this will indicate the first type in which this node was introduced
Guid? TypeIndex {get;}
Used internally by the referencing system
int TypeNodeID {get; set;}
When part of an Object Type this integer ID uniquely identifies the node within the type. Note that if an Object Type contains references those nodes could have conflicting TypeNodeIDs but their TypeID would appear different.
bool TypeReference {get; set;}
True if this node is the root of a type reference (as in, not locally defined, but here as the result of a DOMReference expansion, and will be serialized as a DOMReference)
DOMObject TypeRoot {get;}
Finds the node up the hierarchy that represents the root of this object type (assuming this node is part of one, otherwise null)
Guid? UnboundReferenceID {get; set;}
When this node was a reference and was UnBound, or if it was instantiated directly from a type (rather than as a reference to a type), this value will be set with the ID of the original Object Type
bool Validated {get; set;}
True if this object has a template ID and that Object Template was found in a container attached to the worldspace in which this view is running.
bool Viewable {get;}
True if the object is both Visible and Validated and if it has a parent, that parent is accessible as well
bool Visible {get; set;}
Marks a node as visible or not visible to connected clients. When toggled, the server sends RemoveNode / AddNode packets, so from a client perspective it's as though the node is added or removed from the DOM. It can be useful to hide nodes that will be used or cloned by scripts. It can be useful to mark a node as not visible before making many changes to it's subtree to reduce network traffic, although BeginUpdate and EndUpdate are better suited for this.

Events

ChildAfterAdd(EventHandler<DOMUpdateChildAdd>)
Fires just after a child was added to this node or one of its children. You can use this event to cleanup
ChildBeforeAdd(EventHandler<DOMUpdateChildAdd>)
Fires just before a child is added to this node or one of its children. You can use this event to prevent a node from being added to the DOM or examine it while it is still an orphaned node
ChildBeforeRemove(EventHandler<DOMUpdateChildRemove>)
Fires just before a child is removed from this node or one of its children. You can use this event to prevent a node from being removed from the DOM or examine it while it's parentage is still intact
NodeEvent(EventHandler<DOMUpdateNodeEvent>)
Fires when a node event is received
Updated(EventHandler<DOMUpdateEventArgs>)
Fires when properties or the hierarchy changes on this node or any of its children

Constructors

DOMObject()
Constructs a new DOMObject with default settings
DOMObject(DOMObject[] children)
Constructs a new DOMObject, adding children at the same time
DOMObject(string title, DOMObject[] children)
Constructs a new DOMObject, setting a title and adding children at the same time

Methods

void AddClass(string className)
Similar to JQuery's AddClass method, this adds one space separated item to the Class property without disturbing the others
void AddListenerAllow(DOMListener listener)
Adds a listener to the allow list. If there is no allow list, one will be created, causing all other listeners to see the node dissapear
void AddListenerDeny(DOMListener listener)
Adds a listener to the deny list. This user will see the node dissapear
void AddListenerWritable(DOMListener listener)
Adds a listener to this node's writable list. Calls to IsListenerWritable at this node or its children will return true for this listener
DOMObject ChangeType(DOMObject node, Type type, bool swapInPlace = true)
Changes the type of this node to another node type (in place or by clone) if possible
bool CheckChild(DOMObject child)
Called on DOMObject derived types just before a child is added to their Children collection to ensure they are acceptable
bool CheckParent(DOMObject parent)
Called on DOMObject derived types just before they are added to the DOM to ensure their parent is appropriate.
void ClearChildren()
Removes all children from this DOM node
void ClearReferenceTracker()
If this object is a reference, reset its change tracker.
DOMObject Clone()
Gets a deep clone of the current object
bool Contains<T>(T value, DOMSearchLevel applyTo)
Searches the specified object within the specified scope
bool Contains(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
Searches the specified object within the specified scope and matching the specified predicate
bool Contains<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)
Searches the specified object within the specified scope and matching the specified predicate and type
int Count<T>()
Returns a count of all child nodes that match the specified type
int Count<T>(DOMSearchLevel applyTo)
Returns a count of all nodes within the specified scope that match the specified type
int Count<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)
Returns a count of all nodes within the specified scope and matching the supplied predicate and type
int Count(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
Returns a count of all nodes within the specified scope and matching the supplied predicate
DOMObject CreateInstance(Type type)
Creates an instance of the specified DOMObject type
bool DiscoverTemplate(Guid templateID)
Used by Curiosity. This is sillyish
bool DiscoverType(Guid typeID)
Used by Curiosity. This is sillyish
void EmptyListenerAllowList()
Initializes an empty allow list, or clears an existing one. No listener will be able to see this node after this call (similar to Visible=false)
bool Equals(DOMObject first, DOMObject second)
Tests if two DOMObjects are the same object
bool Equals(DOMObject other)
Tests if this DOMObject is the same object as another (compares reference hashcodes)
void FireEvent(string name, string payload, DOMListener[] allowed = NULL, DOMListener[] denied = NULL, Guid? sender = NULL, bool track = true)
Fires a DOM Event which is a message, with a name and payload, that can be processed by connected clients
void FireEvent<T>(T instance, DOMListener[] allowed = NULL, DOMListener[] denied = NULL, Guid? sender = NULL, bool track = true)
Fires a DOM Event which is a message, with a name and payload, that can be processed by connected clients. This version takes an attributed type-safe payload object
DOMObject First(DOMSearchLevel applyTo)
Finds the first DOMObject in the specified scope
T First<T>(DOMSearchLevel applyTo)
Finds the first DOMObject in the specified scope and matching the supplied type
DOMObject First(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
Finds the first DOMObject in the specified scope and matching the supplied predicate
T First<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)
Finds the first DOMObject in the specified scope and matching the supplied predicate and type
DOMObject FirstOrDefault(DOMSearchLevel applyTo)
Finds the first DOMObject in the specified scope
T FirstOrDefault<T>(DOMSearchLevel applyTo)
Finds the first DOMObject in the specified scope and matching the supplied type
DOMObject FirstOrDefault(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
Finds the first DOMObject in the specified scope and matching the supplied predicate
T FirstOrDefault<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)
Finds the first DOMObject in the specified scope and matching the supplied predicate and type
void ForEach(Func<DOMObject, bool> predicate, Action<DOMObject> action, DOMSearchLevel applyTo)
Executes the specified action on all nodes withing the specified scope and matching the supplied predicate
void ForEach<T>(Func<T, bool> predicate, Action<T> action, DOMSearchLevel applyTo)
Executes the specified action on all nodes within the specified scope and matching the supplied predicate and type
DOMObject FromStorage(object nodeStorage)
Guid GenerateNodeID()
Generates a node ID for this node. Used by the infrastructure.
TResult GetAttributeValue<TResult>(string attributeName, string propertyName = NULL)
Gets the value of the specified attribute if it is defined on this node or the specified property
int GetHashCode(DOMObject obj)
Calls DOMObject.GetHashCode on the specified object
T GetLocalProperty<T>(string key, Func<T> defaultSelector = NULL)
Gets the value of a local property of this DOM node
IEnumerable<string> GetPropertiesWithAttribute(string attributeName)
Gets a list of the names of all the properties that have the specified attribute defined on them
bool HasAttribute(string attributeName, string propertyName = NULL)
Tests if this node or a specific property has the specified attribute defined on it
bool HasClass(string className)
Similar to JQuery's HasClass method, this checks for the existance of one space separated item on the Class property
bool HasLocalProperty(string key)
Tests if this DOMObject has a local property with the specified key
bool IsListenerAllowed(DOMListener listener)
Determines if a given DOMListener is allowed to see updates from this node and its children
bool IsListenerWritable(DOMListener listener)
Tests if a given listener has been granted write privilages at this node or one of its parents
bool MatchesSelector(string selector)
Tests if this node matches the specified CSS Selector
void MergeFrom(DOMObject source, bool restore = false, bool applyTo = true, DOMDiffOperation type = DOMDiffOperation.Merge)
Preforms a merge form the specified source to this object
IEnumerable<T> OfType<T>(DOMSearchLevel applyTo)
Returns all nodes withing the specified scope and matching the specified type
ProtoValue op_Explicit(DOMObject obj)
T ParentOfType<T>()
Searches up the DOM hierarchy looking for a parent of the specified type
DOMObject Parse(object value)
Parse anonymous object to DOMObject
DOMObject QuerySelector(string selector)
Returns the first object that matchs the specified CSS Selector. This could be this node, or one of its children.
IEnumerable<DOMObject> QuerySelectorAll(string selector)
Returns all the nodes that match the specified CSS Selector. This could include this node, and anty of its children.
bool ReferenceContains(Guid typeID)
Checks if this object is part of a reference that contains the specified type. Used by the infrastructure.
void ReferenceReset(bool props, bool children)
Resets aspects of reference. Used by the infrastructure.
void ReferenceResetProperty(DOMObject sourceNode, string propertyName)
Resets aspects of reference. Used by the infrastructure.
void RefreshResource(Guid resourceItemID)
void ReID()
Resets the ID property of this and all child objects using IDs generated by its root document
void RemoveClass(string className)
Similar to JQuery's RemoveClass method, this removes one space separated item to the Class property without disturbing the others
void RemoveListenerAllow(DOMListener listener)
Removes a listener from the allow list. That listener will see this node disappear. If you want everyone to be able to see the node again, use RemoveListenerAllowList.
void RemoveListenerAllowList()
Removes the entire allow list. Doing this makes this node visible to everyone again. If you wish to have an allow list, but an empty one, call EmptyListenerAllowList
void RemoveListenerDeny(DOMListener listener)
Removes a listener from the deny list. That listener will see this node reappear.
void RemoveListenerDenyList()
Removes the entire deny list. All listeners on this list will see this node reappear.
void RemoveListenerWritable(DOMListener listener)
Removes a listener from this node's writable list. Calls to IsListenerWritable at this node or its children will return false for this listener
int RemoveLocalProperties(Func<string, bool> predicate)
Removes any local properties, using a predicate function to test the keys
object RemoveLocalProperty(string key)
Removes a single local property by its key
void ResetTypeID(Guid typeID, bool? resetTemplateID = NULL)
Changes the TypeID on this node and all sub-nodes that share the current TypeID. The Template ID of this node is also cleared
void Revalidate(Func<DOMObject, bool> validationCallback)
Used internally by the instance host to validate DOM nodes
void SetLocalProperty(string key, object value)
Sets the value of a local property
int SortCompare(DOMObject other)
Compares this node with another node of the same type for display sorting purposes
void ToggleClass(string className)
Similar to JQuery's ToggleClass method, this toggles (adds or removes) one space separated item on the Class property without disturbing the others
string ToString()
Gets a string represnetation of this DOM Node
bool TryGetLocalProperty<T>(string key, out T result)
IEnumerable<DOMObject> Where(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
Returns all nodes withing the specified scope and matching the specified predicate
IEnumerable<T> Where<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)
Returns all nodes withing the specified scope and matching the specified predicate and type