11using System ;
22using System . Collections . Generic ;
3- using System . ComponentModel ;
4- using System . Data ;
5- using System . Drawing ;
6- using System . Text ;
73using System . Windows . Forms ;
8- using System . Reflection ;
94using PluginCore ;
105using PluginCore . Localization ;
116using ASCompletion . Model ;
12- using ASClassWizard . Wizards ;
13- using ASClassWizard . Resources ;
147using PluginCore . Controls ;
158
169namespace ASClassWizard . Wizards
1710{
1811 public partial class ClassBrowser : SmartForm
1912 {
20-
2113 private MemberList all ;
2214 private List < GListBox . GListBoxItem > dataProvider ;
2315 private FlagType invalidFlag ;
@@ -78,20 +70,22 @@ private void InitializeLocalization()
7870
7971 private void ClassBrowser_Load ( object sender , EventArgs e )
8072 {
81- ASClassWizard . Wizards . GListBox . GListBoxItem node ;
73+ GListBox . GListBoxItem node ;
8274 this . itemList . BeginUpdate ( ) ;
8375 this . itemList . Items . Clear ( ) ;
8476 if ( this . ClassList != null )
8577 {
8678 foreach ( MemberModel item in this . ClassList )
8779 {
80+ // exclude types imported in the current file
81+ if ( item . Name != item . Type ) continue ;
8882 if ( ExcludeFlag > 0 ) if ( ( item . Flags & ExcludeFlag ) > 0 ) continue ;
8983 if ( IncludeFlag > 0 )
9084 {
9185 if ( ! ( ( item . Flags & IncludeFlag ) > 0 ) ) continue ;
9286 }
9387 if ( this . itemList . Items . Count > 0 && item . Name == this . itemList . Items [ this . itemList . Items . Count - 1 ] . ToString ( ) ) continue ;
94- node = new ASClassWizard . Wizards . GListBox . GListBoxItem ( item . Name , ( item . Flags & FlagType . Interface ) > 0 ? 6 : 8 ) ;
88+ node = new GListBox . GListBoxItem ( item . Name , ( item . Flags & FlagType . Interface ) > 0 ? 6 : 8 ) ;
9589 this . itemList . Items . Add ( node ) ;
9690 this . DataProvider . Add ( node ) ;
9791 }
@@ -106,9 +100,9 @@ private void ClassBrowser_Load(object sender, EventArgs e)
106100 }
107101
108102 /// <summary>
109- /// Filder the list
103+ /// Filter the list
110104 /// </summary>
111- private void filterBox_TextChanged ( Object sender , EventArgs e )
105+ private void filterBox_TextChanged ( Object sender , EventArgs e )
112106 {
113107 string text = this . filterBox . Text ;
114108 this . itemList . BeginUpdate ( ) ;
@@ -138,11 +132,9 @@ private void filterBox_TextChanged( Object sender, EventArgs e)
138132 }
139133
140134 /// <summary>
141- /// Filder the results
135+ /// Filter the results
142136 /// </summary>
143- /// <param name="item"></param>
144- /// <returns></returns>
145- private bool FindAllItems ( GListBox . GListBoxItem item )
137+ private bool FindAllItems ( GListBox . GListBoxItem item )
146138 {
147139 if ( matchLen == 0 ) return true ;
148140 int score = PluginCore . Controls . CompletionList . SmartMatch ( item . Text , matchToken , matchLen ) ;
@@ -162,15 +154,12 @@ private bool FindAllItems( GListBox.GListBoxItem item )
162154 /// <summary>
163155 /// Select None button click
164156 /// </summary>
165- /// <param name="sender"></param>
166- /// <param name="e"></param>
167157 private void cancelButton_Click ( object sender , EventArgs e )
168158 {
169159 this . itemList . SelectedItem = null ;
170160 }
171161
172-
173- private void itemList_DoubleClick ( object sender , EventArgs e )
162+ private void itemList_DoubleClick ( object sender , EventArgs e )
174163 {
175164 this . DialogResult = DialogResult . OK ;
176165 this . Close ( ) ;
0 commit comments