Files
duplicati/proprietary/LoaderHelper/WebModules.cs
T
Kenneth Skovhede a4b33e5d16 Implemented Restore feature and refactored a bit.
Added a free tier for the Office 365 module.
2026-01-20 10:36:37 +01:00

45 lines
1.1 KiB
C#

// Copyright (c) 2026 Duplicati Inc. All rights reserved.
using Duplicati.Library.Interface;
using Duplicati.Library.Utility;
using Duplicati.Proprietary.LicenseChecker;
namespace Duplicati.Proprietary.LoaderHelper;
/// <summary>
/// Shared list of statically linked web modules
/// </summary>
public static class WebModules
{
/// <summary>
/// The list of all built-in web modules
/// </summary>
public static IReadOnlyList<IWebModule> LicensedWebModules
{
get
{
// Safegard against errors during loading, e.g. missing libraries
try
{
return LicensedWebModulesLazy.Value;
}
catch
{
return Array.Empty<IWebModule>();
}
}
}
/// <summary>
/// Calculate list once and cache it
/// </summary>
private static Lazy<IReadOnlyList<IWebModule>> LicensedWebModulesLazy = new(() =>
new IWebModule?[] {
LicenseHelper.AvailableOffice365FeatureSeats > 0 ? new Office365.WebModule() : null
}
.WhereNotNull()
.ToList()
);
}