private void CommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (device.IsOpen)
            {
                device.Close();
            }

            Close();
        }
Exemple #2
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (device is object)
                    {
                        device.Close();
                    }
                }
                disposedValue = true;
            }
        }