internal void OnDestroyLayout( Layout l ) { Debug.Assert( l.Keyboard == Keyboard && l != Default && _layouts != null, "It is not the default: we have more than one layout." ); // First, handle the selected layout change if needed. if( l == _currentLayout ) Current = _defaultLayout; // Then triggers the event: the layout is still functionnal. if( LayoutDestroyed != null ) LayoutDestroyed( this, new LayoutEventArgs( l ) ); _layouts.Remove( l.Name ); // Removes any configuration for this layout. l.DestroyConfig(); Context.SetKeyboardContextDirty(); }