surveillance-client/SurveillanceClient/src/SurveillanceClient.Core/ServiceCollectionExtensions.cs
MaddoScientisto de077ca5d5 Add detailed analysis and documentation for RSNet.dll download functionality
- Introduced a comprehensive markdown document outlining the API surface of RSNet.dll related to downloading video files.
- Documented initialization, connection, record querying, and download processes.
- Provided insights into the exported functions, their parameters, and expected behaviors.
- Included practical implications and recommendations for implementing a downloader script using C# interop.
- Highlighted the necessary struct layouts and callback mechanisms for effective integration with the DLL.
2026-04-17 21:19:46 +02:00

27 lines
983 B
C#

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using SurveillanceClient.Core.Configuration;
using SurveillanceClient.Core.Services;
namespace SurveillanceClient.Core;
/// <summary>
/// DI registration helpers for the SurveillanceClient Core services.
/// </summary>
public static class ServiceCollectionExtensions
{
/// <summary>
/// Registers <see cref="IRsNetClient"/> and binds its options from
/// configuration. The client is a singleton because <c>RSNet.dll</c>
/// holds process-wide global state.
/// </summary>
public static IServiceCollection AddSurveillanceClientCore(this IServiceCollection services)
{
services.AddOptions<RsNetOptions>().BindConfiguration(RsNetOptions.SectionName);
services.AddOptions<DeviceOptions>().BindConfiguration(DeviceOptions.SectionName);
services.TryAddSingleton<IRsNetClient, RsNetClient>();
return services;
}
}