Ejemplo n.º 1
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         dialer.Dispose();
         watcher.Dispose();
     }
 }
Ejemplo n.º 2
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         watcher.Connected    -= OnConnectionConnected;
         watcher.Disconnected -= OnConnectionDisconnected;
         watcher.Dispose();
     }
 }
Ejemplo n.º 3
0
        public void ThrowsAnExceptionWhenStopAfterDisposed()
        {
            var api = new Mock <IRasConnectionNotification>();

            var target = new RasConnectionWatcher(api.Object);

            target.Dispose();

            Assert.Throws <ObjectDisposedException>(() => target.Stop());
        }
Ejemplo n.º 4
0
        public void DisposeWillDisposeTheApi()
        {
            var api = new Mock <IRasConnectionNotification>();

            var target = new RasConnectionWatcher(api.Object);

            target.Dispose();

            api.Verify(o => o.Dispose(), Times.Once);
        }
Ejemplo n.º 5
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                dialer.StateChanged -= OnStateChanged;
                dialer.Dispose();

                watcher.Connected    -= OnConnected;
                watcher.Disconnected -= OnDisconnected;
                watcher.Dispose();
            }
        }
Ejemplo n.º 6
0
        public void ThrowsAnExceptionWhenConnectionChangedAfterDisposed()
        {
            var api = new Mock <IRasConnectionNotification>();

            api.Setup(o => o.IsActive).Returns(true);

            var connection = new Mock <IRasConnection>();

            var target = new RasConnectionWatcher(api.Object);

            target.Dispose();

            Assert.Throws <ObjectDisposedException>(() => target.Connection = connection.Object);
        }
Ejemplo n.º 7
0
 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     _rasConnectionWatcher.Dispose();
     Logger.Instance.Logged -= Logger_Logged;
 }