@@ -44,12 +44,12 @@ public override System.ComponentModel.ISite Site
4444
4545 // If the component was sited, attempt to obtain
4646 // an IToolboxService instance.
47- if ( base . Site != null )
47+ if ( base . Site != null )
4848 {
4949 toolboxService = ( IToolboxService ) this . GetService ( typeof ( IToolboxService ) ) ;
5050 // If an IToolboxService was located, update the
5151 // category list.
52- if ( toolboxService != null )
52+ if ( toolboxService != null )
5353 UpdateLists ( ) ;
5454 }
5555 else
@@ -63,21 +63,21 @@ public override System.ComponentModel.ISite Site
6363 // selected category.
6464 private void UpdateLists ( )
6565 {
66- if ( toolboxService != null )
66+ if ( toolboxService != null )
6767 {
6868 this . listBox1 . SelectedIndexChanged -= new System . EventHandler ( this . UpdateSelectedCategory ) ;
6969 this . listBox2 . SelectedIndexChanged -= new System . EventHandler ( this . UpdateSelectedItem ) ;
7070 listBox1 . Items . Clear ( ) ;
71- for ( int i = 0 ; i < toolboxService . CategoryNames . Count ; i ++ )
71+ for ( int i = 0 ; i < toolboxService . CategoryNames . Count ; i ++ )
7272 {
73- listBox1 . Items . Add ( toolboxService . CategoryNames [ i ] ) ;
74- if ( toolboxService . CategoryNames [ i ] == toolboxService . SelectedCategory )
73+ listBox1 . Items . Add ( toolboxService . CategoryNames [ i ] ) ;
74+ if ( toolboxService . CategoryNames [ i ] == toolboxService . SelectedCategory )
7575 {
7676 listBox1 . SelectedIndex = i ;
77- tools = toolboxService . GetToolboxItems ( toolboxService . SelectedCategory ) ;
77+ tools = toolboxService . GetToolboxItems ( toolboxService . SelectedCategory ) ;
7878 listBox2 . Items . Clear ( ) ;
79- for ( int j = 0 ; j < tools . Count ; j ++ )
80- listBox2 . Items . Add ( tools [ j ] . DisplayName ) ;
79+ for ( int j = 0 ; j < tools . Count ; j ++ )
80+ listBox2 . Items . Add ( tools [ j ] . DisplayName ) ;
8181 }
8282 }
8383 this . listBox1 . SelectedIndexChanged += new System . EventHandler ( this . UpdateSelectedCategory ) ;
@@ -89,7 +89,7 @@ private void UpdateLists()
8989 // category list.
9090 private void UpdateSelectedCategory ( object sender , System . EventArgs e )
9191 {
92- if ( toolboxService != null )
92+ if ( toolboxService != null )
9393 {
9494 toolboxService . SelectedCategory = ( string ) listBox1 . SelectedItem ;
9595 UpdateLists ( ) ;
@@ -99,11 +99,11 @@ private void UpdateSelectedCategory(object sender, System.EventArgs e)
9999 // Sets the selected item when an item is clicked in the item list.
100100 private void UpdateSelectedItem ( object sender , System . EventArgs e )
101101 {
102- if ( toolboxService != null )
102+ if ( toolboxService != null )
103103 {
104- if ( listBox1 . SelectedIndex != - 1 )
104+ if ( listBox1 . SelectedIndex != - 1 )
105105 {
106- if ( ( string ) listBox1 . SelectedItem == toolboxService . SelectedCategory )
106+ if ( ( string ) listBox1 . SelectedItem == toolboxService . SelectedCategory )
107107 toolboxService . SetSelectedToolboxItem ( tools [ listBox2 . SelectedIndex ] ) ;
108108 else
109109 UpdateLists ( ) ;
@@ -132,30 +132,30 @@ private void CreateComponent(object sender, EventArgs e)
132132 IComponent [ ] comps = null ;
133133 try
134134 {
135- comps = toolboxService . GetSelectedToolboxItem ( ) . CreateComponents ( parentHost ) ;
135+ comps = toolboxService . GetSelectedToolboxItem ( ) . CreateComponents ( parentHost ) ;
136136 }
137- catch ( Exception ex )
137+ catch ( Exception ex )
138138 {
139139 // Catch and show any exceptions to prevent disabling
140140 // the control's UI.
141141 MessageBox . Show ( ex . ToString ( ) , "Exception message" ) ;
142142 }
143- if ( comps == null )
143+ if ( comps == null )
144144 return ;
145145
146- // Add any created controls to the parent form's controls.
147- // collection. Note: components are added from the
146+ // Add any created controls to the parent form's controls collection .
147+ // Components are added by the
148148 // ToolboxItem.CreateComponents(IDesignerHost) method.
149- for ( int i = 0 ; i < comps . Length ; i ++ )
149+ for ( int i = 0 ; i < comps . Length ; i ++ )
150150 {
151- if ( parentForm != null && comps [ i ] . GetType ( ) . IsSubclassOf ( typeof ( System . Windows . Forms . Control ) ) )
151+ if ( parentForm != null && comps [ i ] . GetType ( ) . IsSubclassOf ( typeof ( System . Windows . Forms . Control ) ) )
152152 {
153- ( ( System . Windows . Forms . Control ) comps [ i ] ) . Location = new Point ( 20 * controlSpacingMultiplier , 20 * controlSpacingMultiplier ) ;
154- if ( controlSpacingMultiplier > 10 )
153+ ( ( System . Windows . Forms . Control ) comps [ i ] ) . Location = new Point ( 20 * controlSpacingMultiplier , 20 * controlSpacingMultiplier ) ;
154+ if ( controlSpacingMultiplier > 10 )
155155 controlSpacingMultiplier = 0 ;
156156 else
157157 controlSpacingMultiplier ++ ;
158- parentForm . Controls . Add ( ( System . Windows . Forms . Control ) comps [ i ] ) ;
158+ parentForm . Controls . Add ( ( System . Windows . Forms . Control ) comps [ i ] ) ;
159159 }
160160 }
161161 }
@@ -209,7 +209,7 @@ public WindowMessageDesigner()
209209 // Window procedure override passes events to control.
210210 protected override void WndProc ( ref System . Windows . Forms . Message m )
211211 {
212- if ( m . HWnd == this . Control . Handle )
212+ if ( m . HWnd == this . Control . Handle )
213213 base . WndProc ( ref m ) ;
214214 else
215215 this . DefWndProc ( ref m ) ;
0 commit comments