@@ -9,14 +9,14 @@ public class CompletionToolTip
99 private TextBox _lblDocumentation ;
1010 private CompletionToolTipWindow _dialog ;
1111 private bool _cancel = false ;
12- IEnumerable < string > _documentations ;
12+ private IEnumerable < string > _documentations ;
1313
14- private class CompletionToolTipWindow : Form
14+ private class CompletionToolTipWindow : Form
1515 {
1616 private ListBox _completions ;
1717 private TextBox _documentation ;
1818
19- public CompletionToolTipWindow ( ListBox completions , TextBox documentation )
19+ public CompletionToolTipWindow ( ListBox completions , TextBox documentation )
2020 {
2121 _completions = completions ;
2222 _documentation = documentation ;
@@ -27,16 +27,16 @@ public CompletionToolTipWindow(ListBox completions,TextBox documentation)
2727 ShowInTaskbar = false ;
2828 BackColor = Color . White ;
2929 Opacity = 0.9 ;
30-
30+
3131 Controls . Add ( completions ) ;
3232 Controls . Add ( documentation ) ;
3333
3434 Width = completions . PreferredSize . Width ;
3535 Height = completions . Height + documentation . Height ;
3636 completions . Width = Width ;
3737 documentation . Width = Width ;
38- documentation . Location = new Point ( completions . Location . X , completions . Location . Y + completions . Height ) ;
39-
38+ documentation . Location = new Point ( completions . Location . X , completions . Location . Y + completions . Height ) ;
39+
4040 completions . Show ( ) ;
4141 documentation . Show ( ) ;
4242 }
@@ -54,17 +54,16 @@ protected override void OnShown(EventArgs e)
5454 _completions . Focus ( ) ;
5555 }
5656 }
57-
5857
5958 /// <summary>
6059 /// Show a listbox with possible completions for the uncompleted string.
6160 /// When the user chooses one and presses enter (or clicks it with the mouse),
62- /// return the chosen completion. Or, when the user presses escape, then
61+ /// return the chosen completion. Or, when the user presses escape, then
6362 /// close the window and return null.
64- /// </summary>
65- public string ShowTooltip ( string uncompleted , IEnumerable < string > completions , IEnumerable < string > documentations , Point location )
63+ /// </summary>
64+ public string ShowTooltip ( string uncompleted , IEnumerable < string > completions , IEnumerable < string > documentations , Point location )
6665 {
67- _lstCompletions = new ListBox ( ) ;
66+ _lstCompletions = new ListBox ( ) ;
6867 _lstCompletions . ScrollAlwaysVisible = true ;
6968 _lstCompletions . Items . AddRange ( completions . ToArray ( ) ) ;
7069 _lstCompletions . SelectionMode = SelectionMode . One ;
@@ -87,27 +86,27 @@ public string ShowTooltip(string uncompleted, IEnumerable<string> completions, I
8786 _lblDocumentation . WordWrap = true ;
8887 _lblDocumentation . Width = _lstCompletions . Width ;
8988 _lblDocumentation . BackColor = SystemColors . ControlLight ;
90- if ( _documentations != null && _documentations . Count ( ) > 0 )
89+ if ( _documentations != null && _documentations . Count ( ) > 0 )
9190 _lblDocumentation . Text = _documentations . ElementAt ( 0 ) ;
9291 _lblDocumentation . ScrollBars = ScrollBars . Vertical ;
9392 _lblDocumentation . Multiline = true ;
9493 _lblDocumentation . AutoSize = true ;
9594 _lblDocumentation . Height = 100 ;
9695 _lblDocumentation . ReadOnly = true ;
9796
98- _dialog = new CompletionToolTipWindow ( _lstCompletions , _lblDocumentation ) ;
97+ _dialog = new CompletionToolTipWindow ( _lstCompletions , _lblDocumentation ) ;
9998 _dialog . KeyDown += new KeyEventHandler ( dialog_KeyDown ) ;
10099 _dialog . Location = location ;
101100 _dialog . KeyPreview = true ;
102101 _dialog . ShowDialog ( ) ;
103-
104102
105103 if ( _cancel || _lstCompletions . SelectedIndex < 0 )
106104 return null ;
107105
108106 return ( string ) _lstCompletions . SelectedItem ;
109107 }
110- void selectedIndexChanged ( object sender , EventArgs e )
108+
109+ private void selectedIndexChanged ( object sender , EventArgs e )
111110 {
112111 try
113112 {
@@ -120,7 +119,7 @@ void selectedIndexChanged(object sender, EventArgs e)
120119 _dialog . resize ( ) ;
121120 }
122121
123- void dialog_KeyDown ( object sender , KeyEventArgs e )
122+ private void dialog_KeyDown ( object sender , KeyEventArgs e )
124123 {
125124 if ( e . KeyCode == Keys . Enter || e . KeyCode == Keys . Tab || e . KeyCode == Keys . Return )
126125 {
@@ -132,9 +131,10 @@ void dialog_KeyDown(object sender, KeyEventArgs e)
132131 _dialog . Hide ( ) ;
133132 }
134133 }
135- void lstCompletionsClicked ( object sender , EventArgs e )
134+
135+ private void lstCompletionsClicked ( object sender , EventArgs e )
136136 {
137137 _dialog . Hide ( ) ;
138138 }
139139 }
140- }
140+ }
0 commit comments