Skip to content

Commit 6ce88cb

Browse files
committed
respond to CCR
1 parent 3c06b12 commit 6ce88cb

11 files changed

Lines changed: 291 additions & 334 deletions

File tree

snippets/csharp/System.Drawing.Design/IToolboxService/Overview/itoolboxservicecontrol.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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);

snippets/csharp/System.Drawing.Design/UITypeEditorEditStyle/Overview/marqueeborder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public MarqueeBorder()
9393
// <snippet50>
9494
public virtual void StartMarquee()
9595
{
96-
// The MarqueeBorder control may contain any number of
96+
// The MarqueeBorder control cocanntain any number of
9797
// controls that implement IMarqueeWidget, so find
9898
// each IMarqueeWidget child and call its StartMarquee
9999
// method.
@@ -112,7 +112,7 @@ public virtual void StartMarquee()
112112

113113
public virtual void StopMarquee()
114114
{
115-
// The MarqueeBorder control may contain any number of
115+
// The MarqueeBorder control cocanntain any number of
116116
// controls that implement IMarqueeWidget, so find
117117
// each IMarqueeWidget child and call its StopMarquee
118118
// method.
@@ -499,7 +499,7 @@ private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWor
499499
}
500500
}
501501

502-
// The ProgressChanged event is raised by the DoWork method
502+
// The ProgressChanged event is raised by the DoWork method.
503503
// This event handler does work that is internal to the
504504
// control. In this case, the currentOffset is incremented,
505505
// and the control is told to repaint itself.

snippets/csharp/System.Drawing.Design/UITypeEditorEditStyle/Overview/marqueetext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private void backgroundWorker1_DoWork(
194194
}
195195
}
196196

197-
// The ProgressChanged event is raised by the DoWork method
197+
// The ProgressChanged event is raised by the DoWork method.
198198
// This event handler does work that is internal to the
199199
// control. In this case, the text is toggled between its
200200
// light and dark state, and the control is told to

0 commit comments

Comments
 (0)