YamlAssetPath Class
Namespace: Stride.Core.Assets.YamlAssembly: Stride.Core.Assets.dll
A class representing the path of a member or item of an Asset as it is created/consumed by the YAML asset serializers.
[DataContract]
public sealed class YamlAssetPath
Name | Description | |
---|---|---|
Constructors | ||
YamlAssetPath() | Initializes a new instance of the YamlAssetPath class. |
|
YamlAssetPath(IEnumerable<YamlAssetPath.Element>) | Initializes a new instance of the YamlAssetPath class. |
|
Properties | ||
Elements | The elements constituting this path. |
|
Methods | ||
Append(YamlAssetPath) | Appends the given YamlAssetPath to this instance. |
|
Clone() | Creates a clone of this YamlAssetPath instance. |
|
FromMemberPath(MemberPath, Object) | Creates a YamlAssetPath out of a Stride.Core.Reflection.MemberPath instance. |
|
Match(YamlAssetPath) | Indicates whether the current path represents the same path of another object. |
|
Push(YamlAssetPath.Element) | Adds an additional element. |
|
PushIndex(Object) | Adds an additional element to the path representing an access to an item of a collection or a value of a dictionary that does not use ItemId. |
|
PushItemId(ItemId) | Adds an additional element to the path representing an access to an item of an collection or a value of a dictionary. |
|
PushMember(String) | Adds an additional element to the path representing an access to a member of an object. |
|
StartsWith(YamlAssetPath) | ||
ToMemberPath(Object) | Convert this YamlAssetPath into a Stride.Core.Reflection.MemberPath. |
|
ToString() |
Constructors
YamlAssetPath()
Initializes a new instance of the YamlAssetPath class.
public YamlAssetPath()
YamlAssetPath(IEnumerable<YamlAssetPath.Element>)
Initializes a new instance of the YamlAssetPath class.
public YamlAssetPath(IEnumerable<YamlAssetPath.Element> elements)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<YamlAssetPath.Element> | elements | The elements constituting this path, in proper order. |
Properties
Elements
The elements constituting this path.
public IReadOnlyList<YamlAssetPath.Element> Elements { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<YamlAssetPath.Element> |
Methods
Append(YamlAssetPath)
Appends the given YamlAssetPath to this instance.
[Pure]
public YamlAssetPath Append(YamlAssetPath other)
Parameters
Type | Name | Description |
---|---|---|
YamlAssetPath | other | The YamlAssetPath |
Returns
Type | Description |
---|---|
YamlAssetPath | A new instance of YamlAssetPath corresonding to the given instance appended to this instance. |
Clone()
Creates a clone of this YamlAssetPath instance.
public YamlAssetPath Clone()
Returns
Type | Description |
---|---|
YamlAssetPath | A new copy of this YamlAssetPath. |
FromMemberPath(MemberPath, Object)
Creates a YamlAssetPath out of a Stride.Core.Reflection.MemberPath instance.
public static YamlAssetPath FromMemberPath(MemberPath path, object root)
Parameters
Type | Name | Description |
---|---|---|
Stride.Core.Reflection.MemberPath | path | The Stride.Core.Reflection.MemberPath from which to create a YamlAssetPath. |
System.Object | root | The root object of the given Stride.Core.Reflection.MemberPath. |
Returns
Type | Description |
---|---|
YamlAssetPath | An instance of YamlAssetPath corresponding to the same target than the given Stride.Core.Reflection.MemberPath. |
Match(YamlAssetPath)
Indicates whether the current path represents the same path of another object.
public bool Match(YamlAssetPath other)
Parameters
Type | Name | Description |
---|---|---|
YamlAssetPath | other | An object to compare with this path. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Push(YamlAssetPath.Element)
Adds an additional element.
public void Push(YamlAssetPath.Element element)
Parameters
Type | Name | Description |
---|---|---|
YamlAssetPath.Element | element | The YamlAssetPath.Element to add. |
PushIndex(Object)
Adds an additional element to the path representing an access to an item of a collection or a value of a dictionary that does not use ItemId.
public void PushIndex(object index)
Parameters
Type | Name | Description |
---|---|---|
System.Object | index | The index of the item. |
See Also
PushItemId(ItemId)
Adds an additional element to the path representing an access to an item of an collection or a value of a dictionary.
public void PushItemId(ItemId itemId)
Parameters
Type | Name | Description |
---|---|---|
ItemId | itemId | The ItemId of the item. |
PushMember(String)
Adds an additional element to the path representing an access to a member of an object.
public void PushMember(string memberName)
Parameters
Type | Name | Description |
---|---|---|
System.String | memberName | The name of the member. |
StartsWith(YamlAssetPath)
public bool StartsWith(YamlAssetPath path)
Parameters
Type | Name | Description |
---|---|---|
YamlAssetPath | path |
Returns
Type | Description |
---|---|
System.Boolean |
ToMemberPath(Object)
Convert this YamlAssetPath into a Stride.Core.Reflection.MemberPath.
[Pure]
public MemberPath ToMemberPath(object root)
Parameters
Type | Name | Description |
---|---|---|
System.Object | root | The actual instance that is root of this path. |
Returns
Type | Description |
---|---|
Stride.Core.Reflection.MemberPath | An instance of Stride.Core.Reflection.MemberPath corresponding to the same target than this YamlAssetPath. |
ToString()
public override string ToString()
Returns
Type | Description |
---|---|
System.String |