mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Refactoring: Extracted a method in frmOptions that sets the initially selected page
This commit is contained in:
@@ -26,6 +26,7 @@ namespace mRemoteNG.UI.Forms
|
||||
Runtime.FontOverride(this);
|
||||
SetImageListForListView();
|
||||
AddOptionsPagesToListView();
|
||||
SetInitiallyActivatedPage();
|
||||
}
|
||||
|
||||
private void AddOptionsPagesToListView()
|
||||
@@ -38,11 +39,6 @@ namespace mRemoteNG.UI.Forms
|
||||
item.Tag = page.GetType().Name;
|
||||
lstOptionPages.Items.Add(item);
|
||||
}
|
||||
|
||||
// First one to be selected
|
||||
pnlMain.Controls.Add(_pages.FirstOrDefault().Value);
|
||||
pnlMain.Focus();
|
||||
lstOptionPages.Items[0].Selected = true;
|
||||
}
|
||||
|
||||
private void SetImageListForListView()
|
||||
@@ -65,6 +61,11 @@ namespace mRemoteNG.UI.Forms
|
||||
_pages.Add(typeof(AdvancedPage).Name, new AdvancedPage());
|
||||
}
|
||||
|
||||
private void SetInitiallyActivatedPage()
|
||||
{
|
||||
lstOptionPages.Items[0].Selected = true;
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (var page in _pages.Values)
|
||||
|
||||
Reference in New Issue
Block a user