Files
PulsarK-main/Pulsar.Common/Utilities/DeferredAssemblyCatalog.cs
T
i2p 773d05f8f1
Pulsar .NET 9.0 Windows Release / build (push) Waiting to run
Mirror to Codeberg and Gitea / mirror (push) Waiting to run
initial commit
2026-08-27 10:57:58 -06:00

57 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
namespace Pulsar.Common.Utilities
{
/// <summary>
/// Defines the set of assemblies that are considered secondary payloads and may be delivered on-demand.
/// </summary>
public static class DeferredAssemblyCatalog
{
private static readonly string[] _secondaryAssemblies = new[]
{
"AForge",
"AForge.Video",
"AForge.Video.DirectShow",
"Gma.System.MouseKeyHook",
"NAudio.Core",
"NAudio.Wasapi",
"NAudio.WinForms",
"NAudio.WinMM",
"SharpDX",
"SharpDX.Direct2D1",
"SharpDX.Direct3D11",
"SharpDX.DXGI",
"SharpDX.D3DCompiler",
"SharpDX.Mathematics"
};
private static readonly ReadOnlyCollection<string> _secondaryAssembliesReadonly =
Array.AsReadOnly(_secondaryAssemblies);
private static readonly HashSet<string> _secondaryAssembliesSet =
new HashSet<string>(_secondaryAssemblies, StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Gets the ordered list of assemblies that should be delivered after the initial connection.
/// </summary>
public static IReadOnlyList<string> SecondaryAssemblies => _secondaryAssembliesReadonly;
/// <summary>
/// Checks whether the provided assembly name is part of the deferred assembly list.
/// </summary>
/// <param name="assemblyName">The simple assembly name.</param>
public static bool IsDeferredAssembly(string assemblyName)
{
if (string.IsNullOrWhiteSpace(assemblyName))
{
return false;
}
return _secondaryAssembliesSet.Contains(assemblyName);
}
}
}