Table of Contents

Class ApplicationContext

Namespace
GroupeIsa.Neos.Designer.UIAbstractions
Assembly
GroupeIsa.Neos.Designer.UIAbstractions.dll

Represents a context containing application-wide settings.

Its scope is the application, meaning that there is only one instance accessible by all UI views.

[ExcludeFromCodeCoverage]
public static class ApplicationContext
Inheritance
ApplicationContext
Inherited Members

Properties

ClusterCompany

Gets the cluster company.

public static string ClusterCompany { get; }

Property Value

string

ClusterInProduction

Gets a value indicating whether the cluster is in production.

public static bool ClusterInProduction { get; }

Property Value

bool

ClusterName

Gets the cluster name.

public static string ClusterName { get; }

Property Value

string

ClusterTitle

Gets the cluster title.

public static string ClusterTitle { get; }

Property Value

string

ClusterVersion

Gets the cluster version.

public static string ClusterVersion { get; }

Property Value

string

MenuItems

Gets the application menu items.

public static MenuItem[] MenuItems { get; }

Property Value

MenuItem[]

UIDefaultBehavior

Gets the UI default behavior.

public static IUIViewBehavior UIDefaultBehavior { get; }

Property Value

IUIViewBehavior

UserCustomViewMode

Gets the UI default behavior.

[Obsolete("Specific property of the UICustomization module. This property will be removed in future versions.")]
public static UserCustomViewMode UserCustomViewMode { get; }

Property Value

UserCustomViewMode

UserEmail

Gets the user email.

public static string UserEmail { get; }

Property Value

string

UserFirstName

Gets the user first name.

public static string UserFirstName { get; }

Property Value

string

UserIdentifier

Gets the user identifier.

public static string UserIdentifier { get; }

Property Value

string

UserLastName

Gets the user last name.

public static string UserLastName { get; }

Property Value

string

Methods

Add(string, object)

Adds the specified key and value to the application context. If the key is already present, an exception is thrown.

public static void Add(string key, object value)

Parameters

key string

The key of the element to add.

value object

The value of the element to add.

AddApiContextValue(string, bool)

Adds a boolean value to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValueAsync instead.")]
public static Task AddApiContextValue(string key, bool value)

Parameters

key string

The key of the element to add.

value bool

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValue(string, decimal)

Adds a decimal value to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValueAsync instead.")]
public static Task AddApiContextValue(string key, decimal value)

Parameters

key string

The key of the element to add.

value decimal

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValue(string, Guid)

Adds a GUID value to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValueAsync instead.")]
public static Task AddApiContextValue(string key, Guid value)

Parameters

key string

The key of the element to add.

value Guid

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValue(string, int)

Adds an integer value to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValueAsync instead.")]
public static Task AddApiContextValue(string key, int value)

Parameters

key string

The key of the element to add.

value int

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValue(string, string)

Adds a string value to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValueAsync instead.")]
public static Task AddApiContextValue(string key, string value)

Parameters

key string

The key of the element to add.

value string

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValueAsync(string, bool)

Adds a boolean value to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValueAsync(string key, bool value)

Parameters

key string

The key of the element to add.

value bool

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValueAsync(string, decimal)

Adds a decimal value to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValueAsync(string key, decimal value)

Parameters

key string

The key of the element to add.

value decimal

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValueAsync(string, Guid)

Adds a GUID value to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValueAsync(string key, Guid value)

Parameters

key string

The key of the element to add.

value Guid

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValueAsync(string, int)

Adds an integer value to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValueAsync(string key, int value)

Parameters

key string

The key of the element to add.

value int

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValueAsync(string, string)

Adds a string value to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValueAsync(string key, string value)

Parameters

key string

The key of the element to add.

value string

The value of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValues(string, bool[])

Adds boolean values to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValuesAsync instead.")]
public static Task AddApiContextValues(string key, bool[] values)

Parameters

key string

The key of the element to add.

values bool[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValues(string, decimal[])

Adds decimal values to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValuesAsync instead.")]
public static Task AddApiContextValues(string key, decimal[] values)

Parameters

key string

The key of the element to add.

values decimal[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValues(string, Guid[])

Adds GUID values to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValuesAsync instead.")]
public static Task AddApiContextValues(string key, Guid[] values)

Parameters

key string

The key of the element to add.

values Guid[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValues(string, int[])

Adds integer values to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValuesAsync instead.")]
public static Task AddApiContextValues(string key, int[] values)

Parameters

key string

The key of the element to add.

values int[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValues(string, string[])

Adds string values to the API context. If the key is already present, an exception is thrown.

[Obsolete("Use AddApiContextValuesAsync instead.")]
public static Task AddApiContextValues(string key, string[] values)

Parameters

key string

The key of the element to add.

values string[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValuesAsync(string, bool[])

Adds boolean values to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValuesAsync(string key, bool[] values)

Parameters

key string

The key of the element to add.

values bool[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValuesAsync(string, decimal[])

Adds decimal values to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValuesAsync(string key, decimal[] values)

Parameters

key string

The key of the element to add.

values decimal[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValuesAsync(string, Guid[])

Adds GUID values to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValuesAsync(string key, Guid[] values)

Parameters

key string

The key of the element to add.

values Guid[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValuesAsync(string, int[])

Adds integer values to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValuesAsync(string key, int[] values)

Parameters

key string

The key of the element to add.

values int[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddApiContextValuesAsync(string, string[])

Adds string values to the API context. If the key is already present, an exception is thrown.

public static Task AddApiContextValuesAsync(string key, string[] values)

Parameters

key string

The key of the element to add.

values string[]

The values of the element to add.

Returns

Task

A task that represents the asynchronous operation.

AddListenerOnValueChanged<T>(string, Action<T>)

Adds a listener on the value changed event of the specified key.

public static void AddListenerOnValueChanged<T>(string key, Action<T> callback)

Parameters

key string

The key to listen to.

callback Action<T>

The callback to be called when the value changes.

Type Parameters

T

The type of value.

ContainsKey(string)

Determines whether the application context contains the specified key.

public static bool ContainsKey(string key)

Parameters

key string

The key to locate in the application context.

Returns

bool

true if the application context contains an element with the specified key; otherwise, false.

GetApiContextValue<T>(string)

Gets the value associated with the specified key in the API context.

public static T GetApiContextValue<T>(string key)

Parameters

key string

The key of the value to get.

Returns

T

The value associated with the specified key if it exists; otherwise the default value.

Type Parameters

T

The type of the value.

GetApiContextValue<T>(string, T)

Gets the value associated with the specified key in the API context.

public static T GetApiContextValue<T>(string key, T defaultValue)

Parameters

key string

The key of the value to get.

defaultValue T

The default value.

Returns

T

The value associated with the specified key if it exists; otherwise the specified default value.

Type Parameters

T

The type of the value.

GetMenuItems(string)

Returns the menu items of the specified menu.

public static MenuItem[] GetMenuItems(string menuName)

Parameters

menuName string

The name of the menu to get menu items from.

Returns

MenuItem[]

The table of menu items.

GetValue<T>(string)

Gets the value associated with the specified key.

public static T GetValue<T>(string key)

Parameters

key string

The key of the value to get.

Returns

T

The value associated with the specified key if it exists; otherwise the default value.

Type Parameters

T

The type of the value.

GetValue<T>(string, T)

Gets the value associated with the specified key.

public static T GetValue<T>(string key, T defaultValue)

Parameters

key string

The key of the value to get.

defaultValue T

The default value.

Returns

T

The value associated with the specified key if it exists; otherwise the specified default value.

Type Parameters

T

The type of the value.

Remove(string)

Removes the value with the specified key from the application context.

public static void Remove(string key)

Parameters

key string

The key of the element to remove.

RemoveApiContextValue(string)

Removes the value with the specified key from the API context.

[Obsolete("Use RemoveApiContextValueAsync instead.")]
public static Task RemoveApiContextValue(string key)

Parameters

key string

The key of the element to add.

Returns

Task

A task that represents the asynchronous operation.

RemoveApiContextValueAsync(string)

Removes the value with the specified key from the API context.

public static Task RemoveApiContextValueAsync(string key)

Parameters

key string

The key of the element to add.

Returns

Task

A task that represents the asynchronous operation.

RemoveListenerOnValueChanged<T>(string, Action<T>)

Removes a listener on the value changed event of the specified key.

public static void RemoveListenerOnValueChanged<T>(string key, Action<T> callback)

Parameters

key string

The key to listen to.

callback Action<T>

The callback to be called when the value changes.

Type Parameters

T

The type of value.

Set(string, object)

Sets the specified key and value to the application context.

public static void Set(string key, object value)

Parameters

key string

The key of the element to set.

value object

The value of the element to set.

SetApiContextValue(string, bool)

Sets a boolean value to the API context.

[Obsolete("Use SetApiContextValueAsync instead.")]
public static Task SetApiContextValue(string key, bool value)

Parameters

key string

The key of the element to set.

value bool

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValue(string, decimal)

Sets a decimal value to the API context.

[Obsolete("Use SetApiContextValueAsync instead.")]
public static Task SetApiContextValue(string key, decimal value)

Parameters

key string

The key of the element to set.

value decimal

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValue(string, Guid)

Sets a GUID value to the API context.

[Obsolete("Use SetApiContextValueAsync instead.")]
public static Task SetApiContextValue(string key, Guid value)

Parameters

key string

The key of the element to set.

value Guid

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValue(string, int)

Sets an integer value to the API context.

[Obsolete("Use SetApiContextValueAsync instead.")]
public static Task SetApiContextValue(string key, int value)

Parameters

key string

The key of the element to set.

value int

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValue(string, string)

Sets a string value to the API context.

[Obsolete("Use SetApiContextValueAsync instead.")]
public static Task SetApiContextValue(string key, string value)

Parameters

key string

The key of the element to set.

value string

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValueAsync(string, bool)

Sets a boolean value to the API context.

public static Task SetApiContextValueAsync(string key, bool value)

Parameters

key string

The key of the element to set.

value bool

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValueAsync(string, decimal)

Sets a decimal value to the API context.

public static Task SetApiContextValueAsync(string key, decimal value)

Parameters

key string

The key of the element to set.

value decimal

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValueAsync(string, Guid)

Sets a GUID value to the API context.

public static Task SetApiContextValueAsync(string key, Guid value)

Parameters

key string

The key of the element to set.

value Guid

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValueAsync(string, int)

Sets an integer value to the API context.

public static Task SetApiContextValueAsync(string key, int value)

Parameters

key string

The key of the element to set.

value int

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValueAsync(string, string)

Sets a string value to the API context.

public static Task SetApiContextValueAsync(string key, string value)

Parameters

key string

The key of the element to set.

value string

The value of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValues(string, bool[])

Sets boolean values to the API context.

[Obsolete("Use SetApiContextValuesAsync instead.")]
public static Task SetApiContextValues(string key, bool[] values)

Parameters

key string

The key of the element to set.

values bool[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValues(string, decimal[])

Sets decimal values to the API context.

[Obsolete("Use SetApiContextValuesAsync instead.")]
public static Task SetApiContextValues(string key, decimal[] values)

Parameters

key string

The key of the element to set.

values decimal[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValues(string, Guid[])

Sets GUID values to the API context.

[Obsolete("Use SetApiContextValuesAsync instead.")]
public static Task SetApiContextValues(string key, Guid[] values)

Parameters

key string

The key of the element to set.

values Guid[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValues(string, int[])

Sets integer values to the API context.

[Obsolete("Use SetApiContextValuesAsync instead.")]
public static Task SetApiContextValues(string key, int[] values)

Parameters

key string

The key of the element to set.

values int[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValues(string, string[])

Sets string values to the API context.

[Obsolete("Use SetApiContextValuesAsync instead.")]
public static Task SetApiContextValues(string key, string[] values)

Parameters

key string

The key of the element to set.

values string[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValuesAsync(string, bool[])

Sets boolean values to the API context.

public static Task SetApiContextValuesAsync(string key, bool[] values)

Parameters

key string

The key of the element to set.

values bool[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValuesAsync(string, decimal[])

Sets decimal values to the API context.

public static Task SetApiContextValuesAsync(string key, decimal[] values)

Parameters

key string

The key of the element to set.

values decimal[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValuesAsync(string, Guid[])

Sets GUID values to the API context.

public static Task SetApiContextValuesAsync(string key, Guid[] values)

Parameters

key string

The key of the element to set.

values Guid[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValuesAsync(string, int[])

Sets integer values to the API context.

public static Task SetApiContextValuesAsync(string key, int[] values)

Parameters

key string

The key of the element to set.

values int[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

SetApiContextValuesAsync(string, string[])

Sets string values to the API context.

public static Task SetApiContextValuesAsync(string key, string[] values)

Parameters

key string

The key of the element to set.

values string[]

The values of the element to set.

Returns

Task

A task that represents the asynchronous operation.

TryGetValue(string, out object)

Tries to get the value associated with the specified key.

public static bool TryGetValue(string key, out object value)

Parameters

key string

The key of the value to get.

value object

When this method returns, contains the value associated with the specified key, if the key is found; otherwise, null.

Returns

bool

true if the application context contains an element with the specified key; otherwise, false.