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
Properties
Check
General-purpose check flag for application state.
public static bool Check { get; set; }
Property Value
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
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
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
Namespace
The namespace associated with the application.
public static string Namespace { get; set; }
Property Value
Project
The project-level name. Falls back to Name if not set. Name = Solution, Project = Project.
public static string Project { get; set; }
Property Value
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
UnderscoreName
Returns the application name prefixed with an underscore.
public static string UnderscoreName { get; }
Property Value
UseShortAsDateTime
Whether to use short format for DateTime display.
public static bool UseShortAsDateTime { get; set; }
Property Value
Methods
Appeal(string, params string[])
Displays an appeal status message to draw user attention.
public static void Appeal(string text, params string[] args)
Parameters
Error(string, params string[])
Displays an error status message.
public static void Error(string text, params string[] args)
Parameters
Info(string, params string[])
Displays an informational status message.
public static void Info(string text, params string[] args)
Parameters
Ordinal(string, params string[])
Displays an ordinal (default) status message.
public static void Ordinal(string text, params string[] args)
Parameters
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
dataTThe result data to evaluate.
exceptionTextstringThe error message to display if the data is default.
replacementWhenSuccessstringOptional text to display instead of ToString on success.
isShowingToStringOnSuccessboolWhether to display the data's ToString value on success.
Type Parameters
TThe type of the result data.
SetName(string)
Sets the application name.
public static void SetName(string name)
Parameters
namestringThe 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
typeOfMessageTypeOfMessageTAThe type of the status message.
textstringThe status message format string.
argsstring[]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
typeOfMessageTypeOfMessageTAThe type of the status message.
keystringThe 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
textstringThe text to parse and display.
Success(string, params string[])
Displays a success status message.
public static void Success(string text, params string[] args)
Parameters
Warning(string, params string[])
Displays a warning status message.
public static void Warning(string text, params string[] args)