Table of Contents

Class ThisApp

Namespace
SunamoThisApp
Assembly
SunamoThisApp.dll

Central application configuration and status reporting class for Sunamo platform applications.

public class ThisApp
Inheritance
ThisApp
Inherited Members
Extension Methods

Fields

Initialized

Whether the application has been initialized.

public static readonly bool Initialized

Field Value

bool

Properties

Check

General-purpose check flag for application state.

public static bool Check { get; set; }

Property Value

bool

EventLogName

The event log name. Can be null, in which case event logging will not be used. The value is automatically truncated to 8 characters if longer.

public static string? EventLogName { get; set; }

Property Value

string

FromKey

Translation function that resolves a key to a localized string. Used by SetStatusXlf(TypeOfMessageTA, string).

public static Func<string, string> FromKey { get; set; }

Property Value

Func<string, string>

Name

The solution-level name of the application. In selling it is without spaces. Name = Solution, Project = Project.

public static string Name { get; set; }

Property Value

string

Namespace

The namespace associated with the application.

public static string Namespace { get; set; }

Property Value

string

Project

The project-level name. Falls back to Name if not set. Name = Solution, Project = Project.

public static string Project { get; set; }

Property Value

string

Resources

Dynamic reference to the application's resource helper.

public static dynamic Resources { get; set; }

Property Value

dynamic

RunInDebug

Whether the application is running in debug mode.

public static bool RunInDebug { get; set; }

Property Value

bool

UnderscoreName

Returns the application name prefixed with an underscore.

public static string UnderscoreName { get; }

Property Value

string

UseShortAsDateTime

Whether to use short format for DateTime display.

public static bool UseShortAsDateTime { get; set; }

Property Value

bool

Methods

Appeal(string, params string[])

Displays an appeal status message to draw user attention.

public static void Appeal(string text, params string[] args)

Parameters

text string

The message format string.

args string[]

Optional format arguments.

Error(string, params string[])

Displays an error status message.

public static void Error(string text, params string[] args)

Parameters

text string

The message format string.

args string[]

Optional format arguments.

Info(string, params string[])

Displays an informational status message.

public static void Info(string text, params string[] args)

Parameters

text string

The message format string.

args string[]

Optional format arguments.

Ordinal(string, params string[])

Displays an ordinal (default) status message.

public static void Ordinal(string text, params string[] args)

Parameters

text string

The message format string.

args string[]

Optional format arguments.

ResultWithException<T>(T, string, string?, bool)

Reports the result of an operation: shows info on success or error on failure.

public static void ResultWithException<T>(T data, string exceptionText, string? replacementWhenSuccess = null, bool isShowingToStringOnSuccess = false)

Parameters

data T

The result data to evaluate.

exceptionText string

The error message to display if the data is default.

replacementWhenSuccess string

Optional text to display instead of ToString on success.

isShowingToStringOnSuccess bool

Whether to display the data's ToString value on success.

Type Parameters

T

The type of the result data.

SetName(string)

Sets the application name.

public static void SetName(string name)

Parameters

name string

The name to set.

SetStatus(TypeOfMessageTA, string, params string[])

Sets and displays a formatted status message with the specified type.

public static void SetStatus(TypeOfMessageTA typeOfMessage, string text, params string[] args)

Parameters

typeOfMessage TypeOfMessageTA

The type of the status message.

text string

The status message format string.

args string[]

Optional format arguments for the status message.

SetStatusXlf(TypeOfMessageTA, string)

Sets the status using a translated key from the XLF translation function.

public static void SetStatusXlf(TypeOfMessageTA typeOfMessage, string key)

Parameters

typeOfMessage TypeOfMessageTA

The type of the status message.

key string

The translation key to resolve via FromKey.

StatusFromText(string)

Parses the text for a status message prefix and displays it with the appropriate message type.

public static void StatusFromText(string text)

Parameters

text string

The text to parse and display.

Success(string, params string[])

Displays a success status message.

public static void Success(string text, params string[] args)

Parameters

text string

The message format string.

args string[]

Optional format arguments.

Warning(string, params string[])

Displays a warning status message.

public static void Warning(string text, params string[] args)

Parameters

text string

The message format string.

args string[]

Optional format arguments.