2018-01-17 08:26:44 +01:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018 ETH Zürich, Educational Development and Technology (LET)
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
2018-02-06 15:12:11 +01:00
|
|
|
|
namespace SafeExamBrowser.Contracts.Configuration
|
2018-01-17 08:26:44 +01:00
|
|
|
|
{
|
2018-03-06 11:38:12 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The repository which controls the loading and initializing of configuration data.
|
|
|
|
|
/// </summary>
|
2018-02-06 15:12:11 +01:00
|
|
|
|
public interface IConfigurationRepository
|
2018-01-17 08:26:44 +01:00
|
|
|
|
{
|
2018-06-29 09:50:20 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The global configuration information for the currently running application instance.
|
|
|
|
|
/// </summary>
|
|
|
|
|
AppConfig AppConfig { get; }
|
|
|
|
|
|
2018-02-08 13:32:48 +01:00
|
|
|
|
/// <summary>
|
2018-03-08 15:27:12 +01:00
|
|
|
|
/// Retrieves the current session data, i.e. the last one which was initialized. If no session has been initialized yet, this
|
2018-02-08 13:32:48 +01:00
|
|
|
|
/// property will be <c>null</c>!
|
|
|
|
|
/// </summary>
|
2018-03-08 15:27:12 +01:00
|
|
|
|
ISessionData CurrentSession { get; }
|
2018-02-08 13:32:48 +01:00
|
|
|
|
|
2018-01-23 15:33:54 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Retrieves the current settings, i.e. the last ones which were loaded. If no settings have been loaded yet, this property will
|
2018-02-06 15:12:11 +01:00
|
|
|
|
/// be <c>null</c>!
|
2018-01-23 15:33:54 +01:00
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
Settings.Settings CurrentSettings { get; }
|
2018-02-06 15:12:11 +01:00
|
|
|
|
|
2018-03-08 15:27:12 +01:00
|
|
|
|
/// <summary>
|
2018-06-21 07:56:25 +02:00
|
|
|
|
/// The path of the settings file to be used when reconfiguring the application.
|
2018-03-08 15:27:12 +01:00
|
|
|
|
/// </summary>
|
2018-06-21 07:56:25 +02:00
|
|
|
|
string ReconfigurationFilePath { get; set; }
|
2018-03-08 15:27:12 +01:00
|
|
|
|
|
2018-02-12 12:21:55 +01:00
|
|
|
|
/// <summary>
|
2018-02-14 15:26:05 +01:00
|
|
|
|
/// Builds a configuration for the client component, given the currently loaded settings, session and runtime information.
|
2018-02-12 12:21:55 +01:00
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
ClientConfiguration BuildClientConfiguration();
|
2018-02-12 12:21:55 +01:00
|
|
|
|
|
2018-02-08 13:32:48 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes all relevant data for a new session.
|
|
|
|
|
/// </summary>
|
2018-03-14 11:04:28 +01:00
|
|
|
|
void InitializeSessionConfiguration();
|
2018-02-08 13:32:48 +01:00
|
|
|
|
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// <summary>
|
2018-06-21 07:56:25 +02:00
|
|
|
|
/// Attempts to load settings from the specified resource, using the optional passwords. Returns a <see cref="LoadStatus"/>
|
|
|
|
|
/// indicating the result of the operation.
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// </summary>
|
2018-06-27 14:02:16 +02:00
|
|
|
|
LoadStatus LoadSettings(Uri resource, string adminPassword = null, string settingsPassword = null);
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Loads the default settings.
|
|
|
|
|
/// </summary>
|
2018-06-21 07:56:25 +02:00
|
|
|
|
void LoadDefaultSettings();
|
2018-01-17 08:26:44 +01:00
|
|
|
|
}
|
|
|
|
|
}
|