Class PropertyPath
A PropertyPath is used to store a reference to a single property within a tree.
Namespace: Unity.Properties
Syntax
public class PropertyPath : IEquatable<PropertyPath>
Remarks
The path is stored as an array of parts and can be easily queried for algorithms.
Constructors
PropertyPath()
Initializes a new instance of the PropertyPath class that is empty.
Declaration
public PropertyPath()
PropertyPath(String)
Initializes a new instance of the PropertyPath based on the given property string.
Declaration
public PropertyPath(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The string path to initialize this instance with. |
Properties
Empty
Gets if there is any part contained in the PropertyPath.
Declaration
public bool Empty { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Item[Int32]
Gets the PropertyPath.Part at the given index.
Declaration
public PropertyPath.Part this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index |
Property Value
| Type | Description |
|---|---|
| PropertyPath.Part |
PartsCount
Gets the number of parts contained in the PropertyPath.
Declaration
public int PartsCount { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
AppendPath(String)
Appends the specified path.
Declaration
public void AppendPath(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The string path to append. |
Clear()
Clears all parts from the PropertyPath.
Declaration
public void Clear()
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj |
Returns
| Type | Description |
|---|---|
| Boolean |
Overrides
Equals(PropertyPath)
Declaration
public bool Equals(PropertyPath other)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyPath | other |
Returns
| Type | Description |
|---|---|
| Boolean |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 |
Overrides
Pop()
Removes the last PropertyPath.Part from the PropertyPath.
Declaration
public void Pop()
PushIndex(Int32)
Appends the given index to the PropertyPath. This will use Index.
Declaration
public void PushIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | The index to add. |
PushKey(Object)
Appends the given key to the PropertyPath. This will use Key.
Declaration
public void PushKey(object key)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | key | The key to add. |
PushName(String)
Appends the given name to the PropertyPath. This will use Name.
Declaration
public void PushName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The part name to add. |
PushPart(PropertyPath.Part)
Appends the given PropertyPath.Part to this property path.
Declaration
public void PushPart(PropertyPath.Part part)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyPath.Part | part | The part to add. |
PushPath(PropertyPath)
Appends all parts of the given PropertyPath to the end of the this PropertyPath.
Declaration
public void PushPath(PropertyPath path)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyPath | path | The PropertyPath to append. |
PushProperty(IProperty)
Appends the given property to the PropertyPath. This will use the correct PropertyPath.PartType based on the property interfaces.
Declaration
public void PushProperty(IProperty property)
Parameters
| Type | Name | Description |
|---|---|---|
| IProperty | property | The property to add. |
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String |