Ejemplo n.º 1
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    handler.Connected -= Handler_Connected;
                }

                handler             = null;
                VideoStreamReceived = null;

                disposedValue = true;
            }
        }
Ejemplo n.º 2
0
 public ConnectionController(INetworkSetting setting,
                             ITelloClient telloClient,
                             IWiFiManager wifiManager,
                             ILoggerFactory loggerFactory,
                             TelloClientHandler handler)
 {
     this.setting       = setting ?? throw new ArgumentNullException(nameof(setting));
     Client             = telloClient ?? throw new ArgumentNullException(nameof(telloClient));
     WiFi               = wifiManager ?? throw new ArgumentNullException(nameof(wifiManager));
     this.handler       = handler ?? throw new ArgumentNullException(nameof(handler));
     logger             = loggerFactory?.CreateLogger <ConnectionController>() ?? throw new ArgumentNullException(nameof(logger));
     handler.Connected += Handler_Connected;
     Connected          = false;
     tokenSource        = new CancellationTokenSource();
 }