Beispiel #1
0
        public ChangeDetector(IOptions <ExternalIpDetection> options, IProbeFactory probeFactory, IDnsProviderFactory providerFactory)
        {
            if (probeFactory == null)
            {
                throw new ArgumentNullException(nameof(probeFactory));
            }

            if (providerFactory == null)
            {
                throw new ArgumentNullException(nameof(providerFactory));
            }

            _probe    = new Lazy <IProbe>(() => probeFactory.Create(options.Value.Mode));
            _provider = new Lazy <IDnsProvider>(providerFactory.Create);
        }
Beispiel #2
0
 public RealTimeProbe([NotNull] IDisposer disposer,
                      [NotNull] IAgenda agenda,
                      [NotNull] IWire wire,
                      [NotNull] IProbeFactory factory)
     : base(disposer,
            agenda,
            new[]
 {
     wire
 },
            new[]
 {
     wire
 })
 {
     m_Probe = factory.Create(wire);
 }