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
|
|
|
|
using SafeExamBrowser.Contracts.Configuration.Settings;
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
2018-02-06 15:12:11 +01:00
|
|
|
|
namespace SafeExamBrowser.Contracts.Configuration
|
2018-01-17 08:26:44 +01:00
|
|
|
|
{
|
2018-02-06 15:12:11 +01:00
|
|
|
|
public interface IConfigurationRepository
|
2018-01-17 08:26:44 +01:00
|
|
|
|
{
|
2018-02-08 13:32:48 +01:00
|
|
|
|
/// <summary>
|
2018-02-14 15:26:05 +01:00
|
|
|
|
/// Retrieves the current session, 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-02-14 15:26:05 +01:00
|
|
|
|
ISession 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
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The runtime information for the currently running application instance.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
RuntimeInfo RuntimeInfo { get; }
|
2018-01-23 15:33:54 +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-02-14 15:26:05 +01:00
|
|
|
|
ISession InitializeSession();
|
2018-02-08 13:32:48 +01:00
|
|
|
|
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attempts to load settings from the specified path.
|
|
|
|
|
/// </summary>
|
2018-02-06 15:12:11 +01:00
|
|
|
|
/// <exception cref="ArgumentException">Thrown if the given path cannot be resolved to a settings file.</exception>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
Settings.Settings LoadSettings(Uri path);
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Loads the default settings.
|
|
|
|
|
/// </summary>
|
2018-02-15 15:42:54 +01:00
|
|
|
|
Settings.Settings LoadDefaultSettings();
|
2018-01-17 08:26:44 +01:00
|
|
|
|
}
|
|
|
|
|
}
|