Class TrackerFactorySerializer
- Namespace
- VpnHood.Core.Client.VpnServices.Abstractions.Tracking
- Assembly
- VpnHood.Core.Client.VpnServices.Abstractions.dll
Provides the passage of a tracker factory to the VPN engine, by its kind (TrackerKinds): GA4's as its measurement ID, any other as the .NET type the engine makes again in its own process.
public static class TrackerFactorySerializer
- Inheritance
-
TrackerFactorySerializer
- Inherited Members
Methods
Serialize(ITrackerFactory)
Writes a factory as its kind and settings.
public static TrackerFactoryInfo Serialize(ITrackerFactory trackerFactory)
Parameters
trackerFactoryITrackerFactoryThe factory.
Returns
- TrackerFactoryInfo
Ga4 with the measurement ID for a Ga4TrackerFactory; otherwise, DotNet with the factory's assembly-qualified type name and its public properties.
Exceptions
- InvalidOperationException
The factory's type has no assembly-qualified name.
TryDeserialize(TrackerFactoryInfo)
Makes a factory again from its kind and settings.
public static ITrackerFactory? TryDeserialize(TrackerFactoryInfo trackerFactoryInfo)
Parameters
trackerFactoryInfoTrackerFactoryInfoThe factory's kind and settings.
Returns
- ITrackerFactory
The factory, or null where this engine cannot make it, which it logs: a kind it does not have, a type this process lacks, or settings that do not fit.