Difference between revisions of "DOMObject"
From Virtual World Web Wiki
(Documentation for the DOMObject class) |
(Documentation for the DOMObject class) |
||
Line 1: | Line 1: | ||
− | + | This is the base class for all [[DOM Nodes|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| | + | '''See also:''' [[Server Scripting|Server Scripting]] |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
===Remarks <nowiki>[</nowiki>[{{fullurl:DOMObject Remarks|action=edit}} edit]<nowiki>]</nowiki>=== | ===Remarks <nowiki>[</nowiki>[{{fullurl:DOMObject Remarks|action=edit}} edit]<nowiki>]</nowiki>=== | ||
Line 21: | Line 11: | ||
:{{CSharp|bool Accessable {get;} }} | :{{CSharp|bool Accessable {get;} }} | ||
:: | :: | ||
− | :: | + | ::True if the object is both Enabled and Validated and if it has a parent, that parent is accessible as well |
:{{CSharp|DOMAttributeCache AttributeCache {get; set;} }} | :{{CSharp|DOMAttributeCache AttributeCache {get; set;} }} | ||
:{{CSharp|DOMAttributeSet Attributes {get;} }} | :{{CSharp|DOMAttributeSet Attributes {get;} }} | ||
+ | :: | ||
+ | ::A collection of DOMAttributes defined on this object via the ObjectType system | ||
:{{CSharp|Guid? BaseTypeID {get; set;} }} | :{{CSharp|Guid? BaseTypeID {get; set;} }} | ||
Line 60: | Line 52: | ||
:{{CSharp|Guid MergeID {get; set;} }} | :{{CSharp|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. | ||
:{{CSharp|bool MergeLocked {get;} }} | :{{CSharp|bool MergeLocked {get;} }} | ||
Line 72: | Line 66: | ||
:{{CSharp|DOMObject Parent {get;} }} | :{{CSharp|DOMObject Parent {get;} }} | ||
+ | :: | ||
+ | ::The parent DOMObject of this node | ||
:{{CSharp|DOMPropertyCollection Properties {get;} }} | :{{CSharp|DOMPropertyCollection Properties {get;} }} | ||
Line 87: | Line 83: | ||
:{{CSharp|List<string> SystemPropertyNames {get;} }} | :{{CSharp|List<string> SystemPropertyNames {get;} }} | ||
− | :{{CSharp| | + | :{{CSharp|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) | ||
:{{CSharp|Guid TemplateID {get; set;} }} | :{{CSharp|Guid TemplateID {get; set;} }} | ||
Line 114: | Line 112: | ||
:{{CSharp|bool Viewable {get;} }} | :{{CSharp|bool Viewable {get;} }} | ||
+ | :: | ||
+ | ::True if the object is both Visible and Validated and if it has a parent, that parent is accessible as well | ||
:{{CSharp|bool Visible {get; set;} }} | :{{CSharp|bool Visible {get; set;} }} | ||
Line 168: | Line 168: | ||
:{{CSharp|void EndUpdate()}} | :{{CSharp|void EndUpdate()}} | ||
− | |||
− | |||
:{{CSharp|bool Equals(DOMObject other)}} | :{{CSharp|bool Equals(DOMObject other)}} | ||
+ | |||
+ | :{{CSharp|bool Equals(DOMObject x, DOMObject y)}} | ||
:{{CSharp|DOMObject FindNode(string nodepath, Guid? templateID)}} | :{{CSharp|DOMObject FindNode(string nodepath, Guid? templateID)}} | ||
Line 235: | Line 235: | ||
:{{CSharp|int RemoveLocalProperties(Func<string, bool> keySelector)}} | :{{CSharp|int RemoveLocalProperties(Func<string, bool> keySelector)}} | ||
− | :{{CSharp| | + | :{{CSharp|object RemoveLocalProperty(string key)}} |
:{{CSharp|void ResetTypeID(Guid typeID)}} | :{{CSharp|void ResetTypeID(Guid typeID)}} | ||
Line 241: | Line 241: | ||
:{{CSharp|void Revalidate(Func<DOMObject, bool> validationCallback)}} | :{{CSharp|void Revalidate(Func<DOMObject, bool> validationCallback)}} | ||
− | :{{CSharp|void SetLocalProperty(string key, | + | :{{CSharp|void SetLocalProperty(string key, object value)}} |
:{{CSharp|void ToggleClass(string className)}} | :{{CSharp|void ToggleClass(string className)}} | ||
Revision as of 20:40, 11 October 2016
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;}
- DOMAttributeSet Attributes {get;}
- A collection of DOMAttributes defined on this object via the ObjectType system
- Guid? BaseTypeID {get; set;}
- DOMObjectCollection Children {get;}
- string Class {get; set;}
- ReferenceContract Contract {get; set;}
- DOMDocument Document {get;}
- bool Enabled {get; set;}
- 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;}
- DOMObject InstanceRoot {get;}
- Guid? InstanceTypeID {get; set;}
- bool IsInReference {get;}
- bool IsInstanceRoot {get;}
- bool IsTemplateRoot {get;}
- bool IsTopLevelReference {get;}
- bool IsTypeRoot {get; set;}
- 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;}
- Guid NodeID {get; set;}
- string NodePath {get;}
- Gets a path which can be used to locate a specific node in the DOM using the FindNode method
- IEnumerable<DOMAttribute> ObjectAttributes {get;}
- DOMObject Parent {get;}
- The parent DOMObject of this node
- DOMPropertyCollection Properties {get;}
- DOMProtectionFlags ProtectionFlags {get; set;}
- Guid RecordID {get;}
- The ID used to uniquely identify an object. RecordIDs are generated when a new DOMObject is created.
- DOMDocument RootDocument {get;}
- DateTime ServerTime {get;}
- List<string> SystemPropertyNames {get;}
- 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;}
- DOMObject TemplateRoot {get;}
- bool Temporary {get; set;}
- string Title {get; set;}
- bool Transient {get; set;}
- Guid TypeID {get; set;}
- Guid? TypeIndex {get;}
- int TypeNodeID {get; set;}
- bool TypeReference {get; set;}
- bool[] TypeReferenceReload {get; set;}
- DOMObject TypeRoot {get;}
- bool Validated {get; set;}
- 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;}
Events
- ChildBeforeAdd(EventHandler<DOMUpdateChildAdd>)
- ChildBeforeRemove(EventHandler<DOMUpdateChildRemove>)
- Updated(EventHandler<DOMUpdateEventArgs>)
Methods
- void AddClass(string className)
- void BeginMergeUpdate()
- void BeginUpdate()
- bool CheckChild(DOMObject child)
- bool CheckParent(DOMObject parent)
- void ClearChildren()
- DOMObject Clone()
- Gets a deep clone of the current object
- bool Contains<T>(T value, DOMSearchLevel applyTo)
- bool Contains(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
- bool Contains<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)
- bool ContainsTypeReference(Guid typeID)
- int Count<T>()
- int Count<T>(DOMSearchLevel applyTo)
- int Count<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)
- int Count(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
- DOMObject Detach()
- Detaches the node from its parent and resets the childrens ID's
- bool DiscoverTemplate(Guid templateID)
- bool DiscoverType(Guid typeID)
- void EndMergeUpdate()
- void EndUpdate()
- bool Equals(DOMObject other)
- bool Equals(DOMObject x, DOMObject y)
- DOMObject FindNode(string nodepath, Guid? templateID)
- Gets the node that matches the object type node path (Example: 40/23)
- DOMObject First(DOMSearchLevel applyTo)
- T First<T>(DOMSearchLevel applyTo)
- DOMObject First(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
- T First<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)
- DOMObject FirstOrDefault(DOMSearchLevel applyTo)
- T FirstOrDefault<T>(DOMSearchLevel applyTo)
- DOMObject FirstOrDefault(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
- T FirstOrDefault<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)
- void ForEach(Func<DOMObject, bool> predicate, Action<DOMObject> action, DOMSearchLevel applyTo)
- void ForEach<T>(Func<T, bool> predicate, Action<T> action, DOMSearchLevel applyTo)
- IEnumerable<KeyValuePair<Guid, DOMObject>> GetAttributeKeys()
- TResult GetAttributeValue<TResult>(string attributeName, string propertyName)
- int GetHashCode(DOMObject obj)
- T GetLocalProperty<T>(string key, Func<T> defaultSelector)
- Guid? GetNodeIndex(DOMObject baseNode)
- Guid GetNodeIndex2(DOMObject baseNode, int depth)
- IEnumerable<string> GetPropertiesWithAttribute(string attributeName)
- bool HasAttribute(string attributeName, string propertyName)
- bool HasClass(string className)
- bool MatchesSelector(string selector)
- void MergeFrom(DOMObject source, bool restore, DOMDiffOperations type)
- void MergeFromWithTracking(DOMObject source, bool restore)
- IEnumerable<T> OfType<T>(DOMSearchLevel applyTo)
- T ParentOfType<T>()
- DOMObject QuerySelector(string selector)
- IEnumerable<DOMObject> QuerySelectorAll(string selector)
- void ReID()
- void RemoveClass(string className)
- int RemoveLocalProperties(Func<string, bool> keySelector)
- object RemoveLocalProperty(string key)
- void ResetTypeID(Guid typeID)
- void Revalidate(Func<DOMObject, bool> validationCallback)
- void SetLocalProperty(string key, object value)
- void ToggleClass(string className)
- string ToString()
- bool TryGetLocalProperty<T>(string key, out T result)
- IEnumerable<DOMObject> Where(Func<DOMObject, bool> predicate, DOMSearchLevel applyTo)
- IEnumerable<T> Where<T>(Func<T, bool> predicate, DOMSearchLevel applyTo)