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>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
/// Initializes the global configuration information for the currently running application instance.
|
2018-06-29 09:50:20 +02:00
|
|
|
|
/// </summary>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
AppConfig InitializeAppConfig();
|
2018-06-29 09:50:20 +02:00
|
|
|
|
|
2018-02-08 13:32:48 +01:00
|
|
|
|
/// <summary>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
/// Initializes all relevant configuration data for a new session.
|
2018-02-08 13:32:48 +01:00
|
|
|
|
/// </summary>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
ISessionConfiguration 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"/>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
/// indicating the result of the operation. As long as the result is not <see cref="LoadStatus.Success"/>, the declared
|
|
|
|
|
/// <paramref name="settings"/> will be <c>null</c>!
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// </summary>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
LoadStatus TryLoadSettings(Uri resource, out Settings.Settings settings, string adminPassword = null, string settingsPassword = null);
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Loads the default settings.
|
|
|
|
|
/// </summary>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
Settings.Settings LoadDefaultSettings();
|
2018-01-17 08:26:44 +01:00
|
|
|
|
}
|
|
|
|
|
}
|