/* * Copyright (c) 2024 ETH Zürich, IT Services * * 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; namespace SafeExamBrowser.Settings.Security { /// /// Defines a restriction for the SEB version to be used. /// [Serializable] public class VersionRestriction { /// /// The major version to be used. /// public int Major { get; set; } /// /// The minor version to be used. /// public int Minor { get; set; } /// /// Optionally defines the patch version to be used. /// public int? Patch { get; set; } /// /// Optionally defines the build version to be used. /// public int? Build { get; set; } /// /// Determines whether the restriction defines the minimum version to be used. /// public bool IsMinimumRestriction { get; set; } /// /// Determines whether the restriction requires the usage of the Alliance Edition. /// public bool RequiresAllianceEdition { get; set; } public override string ToString() { return $"{Major}.{Minor}{(Patch.HasValue ? $".{Patch}" : "")}{(Build.HasValue ? $".{Build}" : "")}{(RequiresAllianceEdition ? ".AE" : "")}{(IsMinimumRestriction ? ".min" : "")}"; } } }