2019-10-01 11:30:53 +02:00
|
|
|
|
/*
|
2024-03-05 18:37:42 +01:00
|
|
|
|
* Copyright (c) 2024 ETH Zürich, IT Services
|
2019-10-01 11:30:53 +02:00
|
|
|
|
*
|
|
|
|
|
* 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/.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-10-01 16:24:10 +02:00
|
|
|
|
using System;
|
2019-10-11 15:46:15 +02:00
|
|
|
|
using System.Collections.Generic;
|
2019-11-05 10:08:19 +01:00
|
|
|
|
using SafeExamBrowser.Applications.Contracts;
|
2019-10-01 16:24:10 +02:00
|
|
|
|
using SafeExamBrowser.Browser.Contracts;
|
|
|
|
|
using SafeExamBrowser.Communication.Contracts.Hosts;
|
2019-10-01 11:30:53 +02:00
|
|
|
|
using SafeExamBrowser.Configuration.Contracts;
|
2022-11-24 14:50:25 +01:00
|
|
|
|
using SafeExamBrowser.Configuration.Contracts.Integrity;
|
2024-02-29 21:05:43 +01:00
|
|
|
|
using SafeExamBrowser.Proctoring.Contracts;
|
2020-07-28 19:56:25 +02:00
|
|
|
|
using SafeExamBrowser.Server.Contracts;
|
2019-10-01 11:30:53 +02:00
|
|
|
|
using SafeExamBrowser.Settings;
|
2019-10-11 15:46:15 +02:00
|
|
|
|
using SafeExamBrowser.UserInterface.Contracts.Shell;
|
2019-10-01 11:30:53 +02:00
|
|
|
|
|
|
|
|
|
namespace SafeExamBrowser.Client
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2019-10-01 16:24:10 +02:00
|
|
|
|
/// Holds all configuration and session data for the client.
|
2019-10-01 11:30:53 +02:00
|
|
|
|
/// </summary>
|
|
|
|
|
internal class ClientContext
|
|
|
|
|
{
|
2019-10-11 15:46:15 +02:00
|
|
|
|
/// <summary>
|
2019-11-14 14:03:43 +01:00
|
|
|
|
/// All activators for shell components.
|
2019-10-11 15:46:15 +02:00
|
|
|
|
/// </summary>
|
2019-11-14 14:03:43 +01:00
|
|
|
|
internal IList<IActivator> Activators { get; }
|
2019-10-11 15:46:15 +02:00
|
|
|
|
|
2019-11-05 10:08:19 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// All applications allowed for the current session.
|
|
|
|
|
/// </summary>
|
2024-02-13 11:04:36 +01:00
|
|
|
|
internal IList<IApplication<IApplicationWindow>> Applications { get; }
|
2019-11-05 10:08:19 +01:00
|
|
|
|
|
2019-10-01 11:30:53 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The global application configuration.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal AppConfig AppConfig { get; set; }
|
|
|
|
|
|
2019-10-01 16:24:10 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The browser application.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal IBrowserApplication Browser { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The client communication host.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal IClientHost ClientHost { get; set; }
|
|
|
|
|
|
2022-11-24 14:50:25 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The integrity module.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal IIntegrityModule IntegrityModule { get; set; }
|
|
|
|
|
|
2024-02-29 21:05:43 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The proctoring controller to be used if the current session has proctoring enabled.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal IProctoringController Proctoring { get; set; }
|
|
|
|
|
|
2021-02-10 23:21:48 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The server proxy to be used if the current session mode is <see cref="SessionMode.Server"/>.
|
2020-07-28 19:56:25 +02:00
|
|
|
|
/// </summary>
|
|
|
|
|
internal IServerProxy Server { get; set; }
|
|
|
|
|
|
2019-10-01 16:24:10 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The identifier of the current session.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal Guid SessionId { get; set; }
|
|
|
|
|
|
2019-10-01 11:30:53 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The settings for the current session.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal AppSettings Settings { get; set; }
|
2019-10-11 15:46:15 +02:00
|
|
|
|
|
|
|
|
|
internal ClientContext()
|
|
|
|
|
{
|
2019-11-14 14:03:43 +01:00
|
|
|
|
Activators = new List<IActivator>();
|
2024-02-13 11:04:36 +01:00
|
|
|
|
Applications = new List<IApplication<IApplicationWindow>>();
|
2019-10-11 15:46:15 +02:00
|
|
|
|
}
|
2019-10-01 11:30:53 +02:00
|
|
|
|
}
|
|
|
|
|
}
|