protected override void OnDestroy()
        {
            if (Rep.DatabaseHelper != null)
            {
                Rep.DatabaseHelper.DataBaseCreatedOrOpened -= DatabaseHelperOnDatabaseCreatedOrOpened;
            }
            if (_serviceConnection != null)
            {
                _serviceConnection.OnConnected -= _serviceConnection_OnConnected;
                _serviceConnection.UnbindErrors();

                if (_serviceConnection.Connected)
                {
                    _serviceConnection.Disconnect();
                }
                if (_serviceConnection.BillingHandler != null)
                {
                    _serviceConnection.BillingHandler.UnbindErrors();
                }
            }
            base.OnDestroy();
        }