Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    DefaultValueMetadata Class

    Namespace: Stride.Core
    Assembly: Stride.Core.dll

    Abstract class that could be overloaded in order to define how to get default value of an PropertyKey.

    System.Object → PropertyKeyMetadata → DefaultValueMetadata
    Derived from DefaultValueMetadata: DefaultValueMetadata<T>

    public abstract class DefaultValueMetadata : PropertyKeyMetadata
    Name Description
    Properties
    KeepValue

    Gets a value indicating whether this value is kept.

    PropertyUpdateCallback

    Gets or sets the property update callback.

    Methods
    Delegate<T>(DelegateDefaultValueMetadata<T>.DefaultValueCallback)
    GetDefaultValue(ref PropertyContainer)

    Gets the default value of an external property, and specify if this default value should be kept. It could be usefull with properties with default values depending of its container, especially if they are long to generate. An example would be collision data, which should be generated only once.

    Static<T>(T, Boolean)
    | Improve this Doc View Source

    Properties


    KeepValue

    Gets a value indicating whether this value is kept.

    public virtual bool KeepValue { get; }
    Property Value
    Type Description
    System.Boolean

    true if this value is kept; otherwise, false.


    PropertyUpdateCallback

    Gets or sets the property update callback.

    public PropertyContainer.PropertyUpdatedDelegate PropertyUpdateCallback { get; set; }
    Property Value
    Type Description
    PropertyContainer.PropertyUpdatedDelegate

    The property update callback.

    | Improve this Doc View Source

    Methods


    Delegate<T>(DelegateDefaultValueMetadata<T>.DefaultValueCallback)

    public static DelegateDefaultValueMetadata<T> Delegate<T>(DelegateDefaultValueMetadata<T>.DefaultValueCallback callback)
    Parameters
    Type Name Description
    DelegateDefaultValueMetadata.DefaultValueCallback<> callback
    Returns
    Type Description
    DelegateDefaultValueMetadata<T>
    Type Parameters
    Name Description
    T

    GetDefaultValue(ref PropertyContainer)

    Gets the default value of an external property, and specify if this default value should be kept. It could be usefull with properties with default values depending of its container, especially if they are long to generate. An example would be collision data, which should be generated only once.

    public abstract object GetDefaultValue(ref PropertyContainer obj)
    Parameters
    Type Name Description
    PropertyContainer obj

    The property container.

    Returns
    Type Description
    System.Object

    The default value.


    Static<T>(T, Boolean)

    public static StaticDefaultValueMetadata<T> Static<T>(T defaultValue, bool keepDefaultValue = false)
    Parameters
    Type Name Description
    T defaultValue
    System.Boolean keepDefaultValue
    Returns
    Type Description
    StaticDefaultValueMetadata<T>
    Type Parameters
    Name Description
    T

    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