@@ -48,21 +48,12 @@ private sealed class ViewConnector
48
48
private int SavedSelectionLength ;
49
49
private bool ViewNotebookFirstTime = true ;
50
50
51
- /// <summary>
52
- /// Sets the view panel.
53
- /// </summary>
54
- /// <param name="view">The view mode.</param>
55
- public void SetView ( ViewMode view )
56
- {
57
- SetView ( view , false ) ;
58
- }
59
-
60
51
/// <summary>
61
52
/// Sets the view panel.
62
53
/// </summary>
63
54
/// <param name="view">The view mode.</param>
64
55
/// <param name="first">true to first.</param>
65
- public void SetView ( ViewMode view , bool first )
56
+ public void SetView ( ViewMode view , bool first = false )
66
57
{
67
58
var ViewPanels = new Dictionary < ViewMode , ViewConnector > ( )
68
59
{
@@ -94,17 +85,16 @@ public void SetView(ViewMode view, bool first)
94
85
}
95
86
}
96
87
} ;
97
- if ( Program . Settings . CurrentView == view && ! first ) return ;
98
- if ( Program . Settings . CurrentView == ViewMode . Letters )
99
- {
100
- ViewPanels [ Program . Settings . CurrentView ] . Focused . Focus ( ) ;
101
- }
102
- ViewPanels [ Program . Settings . CurrentView ] . MenuItem . Checked = false ;
103
- ViewPanels [ Program . Settings . CurrentView ] . Panel . Parent = null ;
88
+ if ( Settings . CurrentView == view && ! first ) return ;
89
+ if ( Settings . CurrentView == ViewMode . Letters )
90
+ ViewPanels [ Settings . CurrentView ] . Focused . Focus ( ) ;
91
+ ViewPanels [ Settings . CurrentView ] . MenuItem . Checked = false ;
92
+ ViewPanels [ Settings . CurrentView ] . Panel . Parent = null ;
104
93
ViewPanels [ view ] . MenuItem . Checked = true ;
105
94
ViewPanels [ view ] . Panel . Parent = PanelMainCenter ;
106
95
ViewPanels [ view ] . Focused . Focus ( ) ;
107
- Program . Settings . CurrentView = view ;
96
+ Settings . CurrentView = view ;
97
+ LabelCurrentView . Text = AppTranslations . CurrentViewText [ view ] . GetLang ( ) ;
108
98
if ( view == ViewMode . Analysis )
109
99
{
110
100
EditWord . TextBox . SelectionStart = SavedSelectionStart ;
@@ -122,7 +112,6 @@ public void SetView(ViewMode view, bool first)
122
112
SavedSelectionStart = EditWord . TextBox . SelectionStart ;
123
113
SavedSelectionLength = EditWord . TextBox . SelectionLength ;
124
114
}
125
- LabelCurrentView . Text = AppTranslations . CurrentViewText [ view ] . GetLang ( ) ;
126
115
if ( view == ViewMode . Notebook && ViewNotebookFirstTime )
127
116
{
128
117
ViewNotebookFirstTime = false ;
0 commit comments