Skip to content

Commit b579245

Browse files
authored
Normalize trailing spaces, Part 3 (#4162)
1 parent 7583241 commit b579245

File tree

1,305 files changed

+10000
-10000
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,305 files changed

+10000
-10000
lines changed

samples/snippets/csharp/VS_Snippets_CLR/ServiceInstallConfig/CS/source.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -334,27 +334,27 @@ public ServiceSampleForm()
334334
this.query_button.Name = "query_button";
335335
this.query_button.Size = new System.Drawing.Size(124, 30);
336336
this.query_button.Text = "Query Service";
337-
this.query_button.Click += new System.EventHandler(this.query_button_Click);
338-
337+
this.query_button.Click += new System.EventHandler(this.query_button_Click);
338+
339339
// Set properties for startMode_button.
340340
this.startMode_button.Enabled = false;
341341
this.startMode_button.Location = new System.Drawing.Point(264, 16);
342342
this.startMode_button.Name = "startMode_button";
343-
this.startMode_button.Size = new System.Drawing.Size(124, 30);
343+
this.startMode_button.Size = new System.Drawing.Size(124, 30);
344344
this.startMode_button.Text = "Change Service Start Mode";
345-
this.startMode_button.Click += new System.EventHandler(this.startMode_button_Click);
345+
this.startMode_button.Click += new System.EventHandler(this.startMode_button_Click);
346346
// Set properties for modeLabel
347347
this.modeLabel.Location = new System.Drawing.Point(395, 20);
348348
this.modeLabel.Size = new Size(180, 22);
349-
this.modeLabel.Text = "Select a service mode:";
349+
this.modeLabel.Text = "Select a service mode:";
350350
this.modeLabel.Visible = false;
351351
// Set properties for modeComboBox
352352
this.modeComboBox.Location = new System.Drawing.Point(560, 16);
353353
this.modeComboBox.Size = new Size(190, 23);
354354
this.modeComboBox.Name = "modeComboBox";
355355
this.modeComboBox.Items.AddRange( new string[] { "Automatic", "Manual", "Disabled" } );
356356
this.modeComboBox.Anchor = System.Windows.Forms.AnchorStyles.Left
357-
| System.Windows.Forms.AnchorStyles.Right
357+
| System.Windows.Forms.AnchorStyles.Right
358358
| System.Windows.Forms.AnchorStyles.Top;
359359
this.modeComboBox.SelectedIndex = 0;
360360
this.modeComboBox.Visible = false;
@@ -363,27 +363,27 @@ public ServiceSampleForm()
363363
this.startName_button.Enabled = false;
364364
this.startName_button.Location = new System.Drawing.Point(136, 16);
365365
this.startName_button.Name = "startName_button";
366-
this.startName_button.Size = new System.Drawing.Size(124, 30);
366+
this.startName_button.Size = new System.Drawing.Size(124, 30);
367367
this.startName_button.Text = "Change Service Account";
368-
this.startName_button.Click += new System.EventHandler(this.startName_button_Click);
368+
this.startName_button.Click += new System.EventHandler(this.startName_button_Click);
369369

370-
// Set properties for textBox.
370+
// Set properties for textBox.
371371
this.textBox.Anchor = (System.Windows.Forms.AnchorStyles.Top
372372
| System.Windows.Forms.AnchorStyles.Bottom
373-
| System.Windows.Forms.AnchorStyles.Left
373+
| System.Windows.Forms.AnchorStyles.Left
374374
| System.Windows.Forms.AnchorStyles.Right);
375375
this.textBox.Location = new System.Drawing.Point(8, 48);
376376
this.textBox.Multiline = true;
377377
this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
378378
this.textBox.Name = "textBox";
379-
this.textBox.Size = new System.Drawing.Size(744, 280);
380-
this.textBox.Text = "";
381-
379+
this.textBox.Size = new System.Drawing.Size(744, 280);
380+
this.textBox.Text = "";
381+
382382
// Set properties for the ServiceSampleForm.
383383
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
384384
this.ClientSize = new System.Drawing.Size(768, 340);
385385
this.MinimumSize = new System.Drawing.Size(750, 340);
386-
this.Controls.AddRange(new System.Windows.Forms.Control[] {this.textBox,
386+
this.Controls.AddRange(new System.Windows.Forms.Control[] {this.textBox,
387387
this.query_button, this.startMode_button, this.startName_button,
388388
this.modeComboBox, this.modeLabel });
389389
this.Name = "ServiceSampleForm";
@@ -398,7 +398,7 @@ protected override void Dispose( bool disposing )
398398

399399
// Define the windows application entry point.
400400
[STAThread]
401-
static void Main()
401+
static void Main()
402402
{
403403
Application.Run(new ServiceSampleForm());
404404
}

samples/snippets/csharp/VS_Snippets_CLR/ServiceProcess_serviceinstaller/CS/simpleservice.cs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ static void Main()
4343
// A new file is created each time. If a
4444
// previous log file exists, it is overwritten.
4545
StreamWriter myFile = File.CreateText(logFile);
46-
46+
4747
// Create a new trace listener writing to the text file,
4848
// and add it to the trace listeners.
4949
serviceTraceListener = new TextWriterTraceListener(myFile);
5050
Trace.Listeners.Add(serviceTraceListener);
5151

5252
Trace.AutoFlush = true;
53-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
53+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
5454
" - Service main method starting...",
5555
"Main");
5656

5757
// Load the service into memory.
5858
System.ServiceProcess.ServiceBase.Run(new SimpleService());
5959

60-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
60+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
6161
" - Service main method exiting...",
6262
"Main");
6363

@@ -82,7 +82,7 @@ protected override void OnStart(string[] args)
8282
{
8383
// Start a separate thread which does the actual work.
8484

85-
if ((workerThread == null) ||
85+
if ((workerThread == null) ||
8686
((workerThread.ThreadState &
8787
(System.Threading.ThreadState.Unstarted | System.Threading.ThreadState.Stopped)) != 0))
8888
{
@@ -95,21 +95,21 @@ protected override void OnStart(string[] args)
9595
}
9696
if (workerThread != null)
9797
{
98-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
99-
" - Worker thread state = " +
98+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
99+
" - Worker thread state = " +
100100
workerThread.ThreadState.ToString(),
101101
"OnStart");
102102
}
103103
}
104-
104+
105105
// <Snippet4>
106106
// Stop this service.
107107
protected override void OnStop()
108108
{
109109
// Signal the worker thread to exit.
110110
if ((workerThread != null) && (workerThread.IsAlive))
111111
{
112-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
112+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
113113
" - Stopping service worker thread.",
114114
"OnStop");
115115

@@ -120,8 +120,8 @@ protected override void OnStop()
120120
}
121121
if (workerThread != null)
122122
{
123-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
124-
" - Worker thread state = " +
123+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
124+
" - Worker thread state = " +
125125
workerThread.ThreadState.ToString(),
126126
"OnStop");
127127
}
@@ -133,22 +133,22 @@ protected override void OnStop()
133133
protected override void OnPause()
134134
{
135135
// Pause the worker thread.
136-
if ((workerThread != null) &&
136+
if ((workerThread != null) &&
137137
(workerThread.IsAlive) &&
138-
((workerThread.ThreadState &
138+
((workerThread.ThreadState &
139139
(System.Threading.ThreadState.Suspended | System.Threading.ThreadState.SuspendRequested)) == 0))
140140
{
141-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
141+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
142142
" - Suspending service worker thread.",
143143
"OnPause");
144144

145145
workerThread.Suspend();
146146
}
147-
147+
148148
if (workerThread != null)
149149
{
150-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
151-
" - Worker thread state = " +
150+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
151+
" - Worker thread state = " +
152152
workerThread.ThreadState.ToString(),
153153
"OnPause");
154154
}
@@ -161,31 +161,31 @@ protected override void OnContinue()
161161
{
162162

163163
// Signal the worker thread to continue.
164-
if ((workerThread != null) &&
165-
((workerThread.ThreadState &
164+
if ((workerThread != null) &&
165+
((workerThread.ThreadState &
166166
(System.Threading.ThreadState.Suspended | System.Threading.ThreadState.SuspendRequested)) != 0))
167167
{
168-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
168+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
169169
" - Resuming service worker thread.",
170170
"OnContinue");
171171

172172
workerThread.Resume();
173173
}
174174
if (workerThread != null)
175175
{
176-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
177-
" - Worker thread state = " +
176+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
177+
" - Worker thread state = " +
178178
workerThread.ThreadState.ToString(),
179179
"OnContinue");
180180
}
181181
}
182182
// </Snippet6>
183-
183+
184184
// <Snippet7>
185185
// Handle a custom command.
186186
protected override void OnCustomCommand(int command)
187187
{
188-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
188+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
189189
" - Custom command received: " +
190190
command.ToString(),
191191
"OnCustomCommand");
@@ -211,39 +211,39 @@ protected override void OnCustomCommand(int command)
211211
case (int) SimpleServiceCustomCommands.CheckWorker:
212212

213213
// Log the current worker thread state.
214-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
214+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
215215
" - Worker thread state = " +
216216
workerThread.ThreadState.ToString(),
217217
"OnCustomCommand");
218218

219219
break;
220-
220+
221221
default:
222-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
222+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
223223
" - Unrecognized custom command ignored!",
224224
"OnCustomCommand");
225225
break;
226226
}
227227
}
228228
// </Snippet7>
229229

230-
// Define a simple method that runs as the worker thread of
231-
// the service.
230+
// Define a simple method that runs as the worker thread of
231+
// the service.
232232
public void ServiceWorkerMethod()
233233
{
234-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
234+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
235235
" - Starting service worker thread.",
236236
"Worker");
237-
238-
try
237+
238+
try
239239
{
240-
do
240+
do
241241
{
242242
// Wake up every 10 seconds and write
243243
// a message to the trace output.
244244

245245
Thread.Sleep(10000);
246-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
246+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
247247
" - heartbeat cycle.",
248248
"Worker");
249249
}
@@ -253,19 +253,19 @@ public void ServiceWorkerMethod()
253253
{
254254
// Another thread has signalled that this thread
255255
// must terminate. Typically, this occurs when
256-
// the main service thread gets a service stop
256+
// the main service thread gets a service stop
257257
// command.
258258

259259
// Write a trace line indicating the worker thread
260260
// is exiting. Notice that this simple thread does
261261
// not have any local objects or data to clean up.
262262

263-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
263+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
264264
" - Thread abort signalled.",
265265
"Worker");
266266
}
267267

268-
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
268+
Trace.WriteLine(DateTime.Now.ToLongTimeString() +
269269
" - Exiting service worker thread.",
270270
"Worker");
271271
}

samples/snippets/csharp/VS_Snippets_CLR/ServiceProcess_serviceinstaller/CS/simpleserviceinstaller.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
// It defines the instance SimpleServiceInstaller with the
55
// attribute RunInstallerAttribute.
66
//
7-
// When this file is built with the SimpleService.cs file,
7+
// When this file is built with the SimpleService.cs file,
88
// the resulting executable can be used to install the service.
99
//
1010
// Steps:
11-
// 1) Run this program using the following command:
11+
// 1) Run this program using the following command:
1212
// InstallUtil.exe <filename.exe>
1313
// 2) Uninstall the service created in step 1 using the
1414
// following command:
1515
// InstallUtil.exe /u <filename.exe>
1616

17-
//
17+
//
1818
using System;
1919
using System.Diagnostics;
2020
using System.Collections;
@@ -33,12 +33,12 @@ public SimpleServiceInstaller()
3333
// <Snippet3>
3434
simpleServiceProcessInstaller = new ServiceProcessInstaller();
3535
simpleServiceInstaller = new ServiceInstaller();
36-
36+
3737
// Set the account properties for the service process.
3838
simpleServiceProcessInstaller.Account = ServiceAccount.LocalService;
39-
39+
4040
// Set the installation properties for the service.
41-
// The ServiceInstaller.ServiceName must match the
41+
// The ServiceInstaller.ServiceName must match the
4242
// ServiceBase.ServiceName set in the service
4343
// implementation that is installed by this installer.
4444
simpleServiceInstaller.ServiceName = "SimpleService";
@@ -58,4 +58,4 @@ public static void InstallMain()
5858
Console.WriteLine("Usage: InstallUtil.exe [<install>.exe | <install>.dll]");
5959
}
6060
}
61-
//
61+
//

0 commit comments

Comments
 (0)