Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void
コード例 #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing && _window != null)
            {
                _window.Dispose();
            }

            disposed = true;
            base.Dispose(disposing);
        }
コード例 #2
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed && !disposing)
            {
                return;
            }

            if (_window != null)
            {
                _window.Dispose();
            }

            _codeExplorerButton.Click -= OnCodeExplorerButtonClick;

            _disposed = true;
            base.Dispose(disposing);
        }