Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    YamlAssetPath Class

    Namespace: Stride.Core.Assets.Yaml
    Assembly: 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.

    System.Object → YamlAssetPath
    Derived from YamlAssetPath:

    [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()
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    Properties


    Elements

    The elements constituting this path.

    public IReadOnlyList<YamlAssetPath.Element> Elements { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<YamlAssetPath.Element>
    | Improve this Doc View Source

    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

    true if the current path matches the other parameter; otherwise, false.


    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
    NonIdentifiableCollectionItemsAttribute
    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.

    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
    Overrides
    System.Object.ToString()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation