Search Results for

    Show / Hide Table of Contents
    View Source

    Class Settable<T>

    Represents a value that can be assigned a value.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core
    Assembly: Umbraco.Core.dll
    Syntax
    public class Settable<T>
    Type Parameters
    Name Description
    T

    The type of the value

    Properties

    View Source

    HasValue

    Gets a value indicating whether a value has been assigned to this Settable<T> instance.

    Declaration
    public bool HasValue { get; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Value

    Gets the value assigned to this Settable<T> instance.

    Declaration
    public T Value { get; }
    Property Value
    Type Description
    T
    Remarks

    An exception is thrown if the HasValue property is false.

    Methods

    View Source

    Clear()

    Clears the value.

    Declaration
    public void Clear()
    View Source

    Set(T)

    Assigns a value to this Settable<T> instance.

    Declaration
    public void Set(T value)
    Parameters
    Type Name Description
    T value

    The value.

    View Source

    Set(Settable<T>)

    Assigns a value to this Settable<T> instance by copying the value of another instance, if the other instance has a value.

    Declaration
    public void Set(Settable<T> other)
    Parameters
    Type Name Description
    Settable<T> other

    The other instance.

    View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    View Source

    ValueOrDefault()

    Gets the value assigned to this Settable<T> instance, if a value has been assigned, otherwise the default value of T.

    Declaration
    public T ValueOrDefault()
    Returns
    Type Description
    T

    The value assigned to this Settable<T> instance, if a value has been assigned, else the default value of T.

    View Source

    ValueOrDefault(T)

    Gets the value assigned to this Settable<T> instance, if a value has been assigned, otherwise a specified default value.

    Declaration
    public T ValueOrDefault(T defaultValue)
    Parameters
    Type Name Description
    T defaultValue

    The default value.

    Returns
    Type Description
    T

    The value assigned to this Settable<T> instance, if a value has been assigned, else defaultValue.

    • Improve this Doc
    • View Source
    In This Article
    • Properties
      • HasValue
      • Value
    • Methods
      • Clear()
      • Set(T)
      • Set(Settable<T>)
      • ToString()
      • ValueOrDefault()
      • ValueOrDefault(T)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX