Skip to main content
Version: 4.1

Configuration

Namespace: Wisej.Core

Assembly: Wisej.Framework (4.1.0.0)

Configuration settings.

public class Configuration

Constructors​

Instance member Configuration(json)​

Creates a new instance from the specified

json string.

NameTypeDescription
jsonStringThe json string that defines the configuration values.

Properties​

Instance member AllowedResourceTypes​

String[]: The list of additional allowed embedded resource types as a comma-separated string. i.e.: "pdf,xls,doc" Since 4.0.8

Instance member AllowedRoutes​

String[]: List of allowed Url routes separated by a semicolon. i.e.: "api;product;log/performance".

Instance member AutoReload​

Boolean: When true, the application is automatically reloaded when the session expires or Exit is called.

The application can always override this feature by changing the Wisej.onExit method using a script.


<script>
Wisej.onExit = function() {
// this is the default implementation
// when AutoReload is set to true.
location.reload();
}
</script>

Instance member BrowserCheck​

String: The custom function used to validate the browser. If it returns false the browser is not supported and Wisej redirects to NotSupportedUrl.

Instance member Culture​

String: Returns the culture set at the application's level. It can be any of the supported cultures or the keyword "auto", in which case we will detect the culture from the browser.

Instance member Debug​

Boolean: Enables/disables debug mode.

Instance member DisableClientObjectModel​

Boolean: When true, the client will not be able to access the application's controls using the object model registered with javascript under the "App" namespace.

Instance member DisableMinification​

Boolean: When true, dynamic minification is turned off also in release mode. Since 3.5.7

Instance member DropDuplicateClicks​

Boolean: When true, the client drops all "execute" events triggered while there is a pending request.

Instance member EmbeddedResourcesCacheControl​

String: Cache-Control for embedded resources. The default is "browser" to cache the embedded resources on the browser for 1 month. Other allowed values are: - "server" to cache the resources on the server using the ETag header - "private, max-age=..." to use set the standard Cache-Control header - any value Cache-Control string value.

Instance member EnablePWA​

Boolean: Enables the PWA installation of the application.

Instance member EnableWebSocket​

Boolean: Enables/disables the WebSocket protocol.

Instance member EnableWebSocketCompression​

Boolean: Enables/disables gzip compression when using the WebSocket protocol.

Instance member FilePath​

String: The full path of the configuration file.

Instance member Impersonate​

Boolean: Enables impersonation mode.

When set to true and windows authentication is configured in web.config, every request thread and application tasks started using Application.StartTask will impersonate the current user.

Instance member InvalidSessionHttpCode​

Int32: Determines the HTTP code that Wisej.NET returns to the browser when a request cannot be authenticated with a valid session. The default is 200 (OK). Set it to 401 (Not Authorized) in case a deployment requires it.

Instance member KeepAliveInterval​

Int32: The keep-alive interval in seconds.

Instance member Loader​

String: Name of the loader resource (i.e. gif, svg, png) to show at startup to replace the built-in loader.

Instance member LoaderTimeout​

Int32: The ajax loader timeout in milliseconds.

Instance member MainWindow​

String: Full name of the first window created automatically at startup.

Instance member MaxModalStack​

Int32: Returns the maximum number of nested modal loops.

Instance member MaxSessions​

Int32: Returns the maximum number of active sessions before redirecting to NotAvailableUrl.

Instance member MaxSessionsPerClient​

Int32: Limits the number of sessions that can be associated with a client. The default is 50. Set it to 0 for unlimited. Use this configuration option to protect again potential DoS attacks. Since 3.5.23

Instance member NetworkCheckInterval​

Int32: Network check interval in milliseconds. The default is 1000 (1 second). Wisej.NET will send a /healthcheck.wx request at the specified interval when the application goes offline.

Instance member NotAvailableUrl​

String: The URL of the page to load when the server cannot respond to the request.

Instance member NotSupportedUrl​

String: The URL of the page to load when the client browser is not supported.

Instance member OfflineUrl​

String: The URL of the page to load when the connection is lost.

Instance member Options​

Object: Native client-side platform options.

Instance member PollingInterval​

Int32: Polling interval in milliseconds. The default is zero (disabled). If this value is set, the polling starts when the application is loaded.

The polling interval determines the frequency of the automatic poll requests coming from the client when a WebSocket connection is not available. When the client is connected using a WebSocket channel, this value is ignored.

An application that wants to enable automatic client updates in absence of a WebSocket connection can set this value, or it can call StartPolling and EndPolling to start and terminate the automatic polling from the client. Both methods are ignored when the client is using a WebSocket connection.

Instance member ResponseTimeout​

Int32: The timeout for the server to respond to a Wisej request in seconds.

Instance member RightToLeft​

String: Returns the rightToLeft mode. It can be "true", "false", or "auto". When set to "auto" the RightToLeft layout is enabled automatically using the current language. The default is "auto".

Instance member Secure​

Boolean: Forces the client to switch to a secure connection (HTTPS and WSS).

Instance member SessionStorage​

String: Where to save the session id on the client. The default is "session" to indicate the browser's sessionStorage. It can be changed to "local" to indicate the browser's localStorage.

Instance member SessionTimeout​

Int32: The session timeout in seconds. The timeout is enforced on the client side.

Instance member Settings​

Object: Application settings.

Instance member ShowLoader​

Boolean: Shows the loader animated gif while initializing the application.

Instance member StartUp​

String: The startup Main method.

Instance member ThemeName​

String: Theme name.

Instance member ThreadPool​

Object: ThreadPool min/max configuration, null by default.

Instance member Url​

String: Url redirection.

Instance member ValidateClient​

Boolean: Verifies the client's unique id when retrieving a session. It prevents session hijacking over unsecured connections.

Instance member ValidateResources​

Boolean: Verifies that resource requests are received from the user's authorized browser. Prevents reusing a resource URL from an unauthorized request. Since 3.5.5

Instance member WebSocketCompressionThreshold​

Int32: Sets the response size that triggers the compression of the response over the WebSocket channel.

Methods​

Static member GetInstance(filePath, uri)​

Loads or retrieves the configuration file.

ParameterTypeDescription
filePathStringThe full path to the .json file to load.
uriUriThe current Uri representing the site being loaded.

Returns: Configuration.

Events​

Static member LoadConfiguration​

LoadConfigurationEventHandler Fired when the system needs to load a Wisej configuration file.

An application can install a custom configuration handler and return a custom Configuration object. In alternative, the handler can change the value of FilePath and let Wisej.NET load the alternative json file.

This is a static event and should be attached to before the application starts. One way to do that is to register an HttpModuleStartup method with IIS when using .NET 4.8. When running on .NET Core, attach to the event in the Startup method.


[assembly: PreApplicationStartMethod(typeof(ApplicationNameSpace.HttpModuleStartup), "Start")]

namespace ApplicationNameSpace
{
public static class HttpModuleStartup
{
public static void Start()
{
Wisej.Core.Configuration.LoadConfiguration += (s, e) =>
{
// load json from a file, or build a json object.
// you can also implement your own caching mechanism here.

e.SuppressCache = true;

return new Wisej.Core.Configuration(new
{
url = "Default.html",
theme = "bootstrap-4",
startup = "ApplicationNameSpace.Program.Main, Application"

}.ToJSON());
}
}
}
}