Difference between revisions of "DOMObject"
From Virtual World Web Wiki
(Documentation for the DOMObject class) |
(Documentation for the DOMObject class) |
||
Line 1: | Line 1: | ||
+ | |||
The base class for all DOM node types | The base class for all DOM node types | ||
+ | '''See also:''' [[Server Scripting|Test]] | ||
+ | <syntaxhighlight lang="CSharp"> | ||
+ | |||
+ | var obj = new DOMObject(); | ||
+ | obj.Title = "Test"; | ||
+ | if(obj.Visible) | ||
+ | { | ||
+ | // Do Something | ||
+ | } | ||
+ | |||
+ | </syntaxhighlight> | ||
+ | |||
+ | This is some more documentation | ||
===Properties=== | ===Properties=== | ||
:{{CSharp|bool Accessable {get;} }} | :{{CSharp|bool Accessable {get;} }} | ||
Line 20: | Line 34: | ||
:{{CSharp|long ID {get; set;} }} | :{{CSharp|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 | ::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 | ||
:{{CSharp|Guid? InstanceIndex {get;} }} | :{{CSharp|Guid? InstanceIndex {get;} }} | ||
Line 44: | Line 59: | ||
:{{CSharp|string NodePath {get;} }} | :{{CSharp|string NodePath {get;} }} | ||
+ | :: | ||
::Gets a path which can be used to locate a specific node in the DOM using the FindNode method | ::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;} }} | ||
Line 54: | Line 70: | ||
:{{CSharp|Guid RecordID {get;} }} | :{{CSharp|Guid RecordID {get;} }} | ||
+ | :: | ||
::The ID used to uniquely identify an object. RecordIDs are generated when a new DOMObject is created. | ::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 112: | Line 129: | ||
:{{CSharp|DOMObject Clone()}} | :{{CSharp|DOMObject Clone()}} | ||
− | ::Gets a deep clone of the current object | + | :: |
+ | :: Gets a deep clone of the current object | ||
:{{CSharp|bool Contains<T>(T value, DOMSearchLevel applyTo)}} | :{{CSharp|bool Contains<T>(T value, DOMSearchLevel applyTo)}} | ||
Line 130: | Line 148: | ||
:{{CSharp|DOMObject Detach()}} | :{{CSharp|DOMObject Detach()}} | ||
− | ::Detaches the node from its parent and resets the childrens ID's | + | :: |
+ | :: Detaches the node from its parent and resets the childrens ID's | ||
:{{CSharp|bool DiscoverTemplate(Guid templateID)}} | :{{CSharp|bool DiscoverTemplate(Guid templateID)}} | ||
Line 144: | Line 163: | ||
:{{CSharp|DOMObject FindNode(string nodepath, Guid? templateID)}} | :{{CSharp|DOMObject FindNode(string nodepath, Guid? templateID)}} | ||
− | ::Gets the node that matches the object type node path (Example: 40/23) | + | :: |
+ | ::Gets the node that matches the object type node path (Example: 40/23) | ||
:{{CSharp|DOMObject First(DOMSearchLevel applyTo)}} | :{{CSharp|DOMObject First(DOMSearchLevel applyTo)}} | ||
Line 210: | Line 230: | ||
:{{CSharp|void SetLocalProperty(string key, Object value)}} | :{{CSharp|void SetLocalProperty(string key, Object value)}} | ||
− | |||
:{{CSharp|void ToggleClass(string className)}} | :{{CSharp|void ToggleClass(string className)}} | ||
Revision as of 15:31, 11 October 2016
The base class for all DOM node types See also: Test
var obj = new DOMObject(); obj.Title = "Test"; if(obj.Visible) { // Do Something }
This is some more documentation
Properties
- bool Accessable {get;}
- DOMAttributeCache AttributeCache {get; set;}
- DOMAttributeSet Attributes {get;}
- 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;}
- 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;}
- 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;}
- 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;}
- 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)