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-11-08 09:39:52 +01:00
|
|
|
|
/// Loads the default settings.
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// </summary>
|
2018-11-08 09:39:52 +01:00
|
|
|
|
Settings.Settings LoadDefaultSettings();
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-11-09 14:15:56 +01:00
|
|
|
|
/// Registers the specified <see cref="IDataFormat"/> as option to parse data from a configuration resource.
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// </summary>
|
2018-11-08 09:39:52 +01:00
|
|
|
|
void Register(IDataFormat dataFormat);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-11-09 14:15:56 +01:00
|
|
|
|
/// Registers the specified <see cref="IResourceLoader"/> as option to load data from a configuration resource.
|
2018-11-08 09:39:52 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
void Register(IResourceLoader resourceLoader);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-11-22 14:36:20 +01:00
|
|
|
|
/// Attempts to load settings from the specified resource, using the optional password. As long as the result is not
|
2018-11-08 09:39:52 +01:00
|
|
|
|
/// <see cref="LoadStatus.Success"/>, the referenced settings may be <c>null</c> or in an undefinable state!
|
|
|
|
|
/// </summary>
|
2018-11-28 15:43:30 +01:00
|
|
|
|
LoadStatus TryLoadSettings(Uri resource, out Settings.Settings settings, string password = null, bool passwordIsHash = false);
|
2018-01-17 08:26:44 +01:00
|
|
|
|
}
|
|
|
|
|
}
|