Artemis logo
Search Results for

    Show / Hide Table of Contents

    Class BreakableModel

    Provides a default implementation for models that can have a broken state

    Inheritance
    System.Object
    CorePropertyChanged
    BreakableModel
    BaseLayerBrush
    BaseLayerEffect
    ProfileElement
    Implements
    IBreakableModel
    Inherited Members
    CorePropertyChanged.PropertyChanged
    CorePropertyChanged.RequiresUpdate<T>(T, T)
    CorePropertyChanged.SetAndNotify<T>(T, T, String)
    CorePropertyChanged.OnPropertyChanged(String)
    Namespace: Artemis.Core
    Assembly: Artemis.Core.dll
    Syntax
    public abstract class BreakableModel : CorePropertyChanged, INotifyPropertyChanged, IBreakableModel

    Properties

    | Improve this Doc View Source

    BrokenDisplayName

    Gets the display name of this breakable model

    Declaration
    public abstract string BrokenDisplayName { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    BrokenState

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

    Note: If setting this manually you are also responsible for invoking BrokenStateChanged

    Declaration
    public string BrokenState { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    BrokenStateException

    Gets or sets the exception that caused the broken state

    Note: If setting this manually you are also responsible for invoking BrokenStateChanged

    Declaration
    public Exception BrokenStateException { get; set; }
    Property Value
    Type Description
    System.Exception

    Methods

    | Improve this Doc View Source

    ClearBrokenState(String)

    Clears the broken state and exception if BrokenState equals .

    Declaration
    public void ClearBrokenState(string state)
    Parameters
    Type Name Description
    System.String state
    | Improve this Doc View Source

    GetBrokenHierarchy()

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

    Declaration
    public virtual IEnumerable<IBreakableModel> GetBrokenHierarchy()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<IBreakableModel>
    | Improve this Doc View Source

    OnBrokenStateChanged()

    Invokes the BrokenStateChanged event

    Declaration
    protected virtual void OnBrokenStateChanged()
    | Improve this Doc View Source

    SetBrokenState(String, Exception)

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

    Declaration
    public void SetBrokenState(string state, Exception exception)
    Parameters
    Type Name Description
    System.String state

    The state to set the broken state to

    System.Exception exception

    The exception that caused the broken state

    | Improve this Doc View Source

    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
    public bool TryOrBreak(Action action, string breakMessage)
    Parameters
    Type Name Description
    System.Action action

    The action to attempt to execute

    System.String breakMessage

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

    Returns
    Type Description
    System.Boolean

    true if the action succeeded; otherwise false.

    Events

    | Improve this Doc View Source

    BrokenStateChanged

    Occurs when the broken state of this model changes

    Declaration
    public event EventHandler BrokenStateChanged
    Event Type
    Type Description
    System.EventHandler

    Implements

    IBreakableModel
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX