1313
1414namespace QuickNavigate . Forms
1515{
16- public sealed partial class ClassHierarchyForm : ClassModelExplorerForm
16+ public sealed partial class ClassHierarchyForm : QuickForm
1717 {
1818 readonly ClassModel curClass ;
1919 readonly Dictionary < string , List < ClassModel > > extendsToClasses ;
@@ -62,9 +62,7 @@ static IEnumerable<ClassModel> GetExtends([NotNull] ClassModel theClass)
6262 public ClassHierarchyForm ( [ NotNull ] ClassModel model , [ NotNull ] Settings settings ) : base ( settings )
6363 {
6464 curClass = model ;
65- Font = PluginBase . Settings . DefaultFont ;
6665 InitializeComponent ( ) ;
67- if ( settings . HierarchyExplorerSize . Width > MinimumSize . Width ) Size = settings . HierarchyExplorerSize ;
6866 extendsToClasses = GetAllProjectExtendsClasses ( ) ;
6967 InitializeTree ( ) ;
7068 InitializeTheme ( ) ;
@@ -214,6 +212,18 @@ protected override void Navigate()
214212
215213 #region Event Handlers
216214
215+ protected override void OnShown ( EventArgs e )
216+ {
217+ base . OnShown ( e ) ;
218+ if ( Settings != null && Settings . HierarchyExplorerSize . Width > MinimumSize . Width ) Size = Settings . HierarchyExplorerSize ;
219+ }
220+
221+ protected override void OnFormClosing ( FormClosingEventArgs e )
222+ {
223+ if ( Settings == null ) return ;
224+ Settings . HierarchyExplorerSize = Size ;
225+ }
226+
217227 protected override void OnKeyDown ( KeyEventArgs e )
218228 {
219229 switch ( e . KeyCode )
@@ -239,8 +249,6 @@ protected override void OnKeyDown(KeyEventArgs e)
239249 }
240250 }
241251
242- protected override void OnFormClosing ( FormClosingEventArgs e ) => Settings . HierarchyExplorerSize = Size ;
243-
244252 protected override void OnTreeNodeMouseClick ( object sender , TreeNodeMouseClickEventArgs e )
245253 {
246254 var node = e . Node as TypeNode ;
@@ -290,7 +298,7 @@ void OnInputTextChanged(object sender, EventArgs e)
290298
291299 void OnInputPreviewKeyDown ( object sender , PreviewKeyDownEventArgs e )
292300 {
293- if ( e . KeyCode == Keys . Apps ) input . ContextMenu = SelectedNode != null ? InputEmptyContextMenu : null ;
301+ if ( e . KeyCode == Keys . Apps ) input . ContextMenu = SelectedNode != null ? FormHelper . EmptyContextMenu : null ;
294302 }
295303
296304 void OnInputKeyDown ( object sender , KeyEventArgs e )
0 commit comments