Artemis Artemis
Artemis Artemis

Search Results for

    Interface IBreakableModel

    Represents a model that can have a broken state

    Namespace: Artemis.Core
    Assembly: Artemis.Core.dll
    Syntax
    public interface IBreakableModel

    Properties

    BrokenDisplayName

    Gets the display name of this breakable model

    Declaration
    string BrokenDisplayName { get; }
    Property Value
    Type Description
    string

    BrokenState

    Gets or sets the broken state of this breakable model, if null this model is not broken.

    Declaration
    string? BrokenState { get; set; }
    Property Value
    Type Description
    string

    BrokenStateException

    Gets or sets the exception that caused the broken state

    Declaration
    Exception? BrokenStateException { get; set; }
    Property Value
    Type Description
    Exception

    Methods

    ClearBrokenState(string)

    Clears the broken state and exception if BrokenState equals .

    Declaration
    void ClearBrokenState(string state)
    Parameters
    Type Name Description
    string state

    GetBrokenHierarchy()

    Returns a list containing all broken models, including self and any children

    Declaration
    IEnumerable<IBreakableModel> GetBrokenHierarchy()
    Returns
    Type Description
    IEnumerable<IBreakableModel>

    SetBrokenState(string, Exception?)

    Sets the broken state to the provided state and optional exception.

    Declaration
    void SetBrokenState(string state, Exception? exception)
    Parameters
    Type Name Description
    string state

    The state to set the broken state to

    Exception exception

    The exception that caused the broken state

    TryOrBreak(Action, string)

    Try to execute the provided action. If the action succeeded the broken state is cleared if it matches , if the action throws an exception BrokenState and BrokenStateException are set accordingly.

    Declaration
    bool TryOrBreak(Action action, string breakMessage)
    Parameters
    Type Name Description
    Action action

    The action to attempt to execute

    string breakMessage

    The message to clear on succeed or set on failure (exception)

    Returns
    Type Description
    bool

    true if the action succeeded; otherwise false.

    Events

    BrokenStateChanged

    Occurs when the broken state of this model changes

    Declaration
    event EventHandler BrokenStateChanged
    Event Type
    Type Description
    EventHandler
    Content is available under the PolyForm Noncommercial License, by Artemis RGB.