Skip to content

Commit a87f91e

Browse files
Names -> Keywords
Replacing full type names with keywords when appropriate Files affected: service.cs, service.cs, program.cs, order.cs, source.cs, services.cs, services.cs, snippets.cs. See dotnet#6920
1 parent 9914215 commit a87f91e

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

samples/snippets/csharp/VS_Snippets_CFX/s_ueservicehost/cs/service.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Configuration;
33
using System.ServiceModel;
44

@@ -121,7 +121,7 @@ public static void Snippet5()
121121
// <Snippet5>
122122
BasicHttpBinding binding = new BasicHttpBinding();
123123
Uri listenUri = new Uri("http://localhost:8000/MyListenUri");
124-
String address = "http://localhost:8000/servicemodelsamples/service2";
124+
string address = "http://localhost:8000/servicemodelsamples/service2";
125125
serviceHost.AddServiceEndpoint(typeof(ICalculator), binding, address, listenUri);
126126
// </Snippet5>
127127
}

samples/snippets/csharp/VS_Snippets_CFX/s_uespnendpointidentity/cs/service.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace ServerInitiatedNego
1+
namespace ServerInitiatedNego
22
{
33
using System;
44
using System.Collections.Generic;
@@ -41,7 +41,7 @@ static EndpointIdentity CreateIdentity()
4141
sid.IsWellKnown(WellKnownSidType.LocalServiceSid))
4242
{
4343
identity = EndpointIdentity.CreateSpnIdentity(
44-
String.Format(CultureInfo.InvariantCulture, "host/{0}", GetMachineName()));
44+
string.Format(CultureInfo.InvariantCulture, "host/{0}", GetMachineName()));
4545
}
4646
else
4747
{
@@ -80,7 +80,7 @@ static EndpointIdentity CreateSpnIdentity()
8080

8181
SpnEndpointIdentity identity = null;
8282

83-
identity = new SpnEndpointIdentity(String.Format(CultureInfo.InvariantCulture, "host/{0}", GetMachineName()));
83+
identity = new SpnEndpointIdentity(string.Format(CultureInfo.InvariantCulture, "host/{0}", GetMachineName()));
8484

8585
return identity;
8686
}

samples/snippets/csharp/VS_Snippets_CFX/s_uewsdualhttpsecurity/cs/program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Text;
44
using System.Xml;
@@ -29,7 +29,7 @@ static void WSDualHttpMain()
2929
new WSDualHttpBinding(WSDualHttpSecurityMode.Message);
3030
// </Snippet3>
3131

32-
/* String clientBaseAddress = "http://localhost:8080/Discovery/" + Guid.NewGuid().ToString();
32+
/* string clientBaseAddress = "http://localhost:8080/Discovery/" + Guid.NewGuid().ToString();
3333
Uri clientBaseAddressUri = new Uri(clientBaseAddress);
3434
WSDualHttpBinding bindingClientBaseAddress =
3535
new WSDualHttpBinding(clientBaseAddressUri);

samples/snippets/csharp/VS_Snippets_CFX/s_wcftomsmq/cs/order.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-

1+
22
// Copyright (c) Microsoft Corporation. All Rights Reserved.
33

44
using System;
@@ -17,7 +17,7 @@ public class PurchaseOrderLineItem
1717

1818
public override string ToString()
1919
{
20-
String displayString = "Order LineItem: " + quantity + " of " + productId + " @unit price: $" + unitCost + "\n";
20+
string displayString = "Order LineItem: " + quantity + " of " + productId + " @unit price: $" + unitCost + "\n";
2121
return displayString;
2222
}
2323

samples/snippets/csharp/VS_Snippets_CFX/samlattribute/cs/source.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//-----------------------------------------------------------------------------
1+
//-----------------------------------------------------------------------------
22
// Copyright (c) Microsoft Corporation. All rights reserved.
33
//-----------------------------------------------------------------------------
44
using System;
@@ -91,7 +91,7 @@ private static void EnsurePurchaseLimitSufficient(string bookName)
9191
{
9292
if (!CheckIfPurchaseLimitMet(bookName))
9393
{
94-
throw new FaultException(String.Format("Purchase limit not sufficient to purchase '{0}'", bookName));
94+
throw new FaultException(string.Format("Purchase limit not sufficient to purchase '{0}'", bookName));
9595
}
9696
}
9797

@@ -310,7 +310,7 @@ protected static void EnsureRequestSecurityTokenAction(Message message)
310310
throw new ArgumentNullException("message");
311311

312312
if (message.Headers.Action != Constants.Trust.Actions.Issue)
313-
throw new InvalidOperationException(String.Format("Bad or Unsupported Action: {0}", message.Headers.Action));
313+
throw new InvalidOperationException(string.Format("Bad or Unsupported Action: {0}", message.Headers.Action));
314314
}
315315

316316
/// <summary>
@@ -474,7 +474,7 @@ public abstract class RequestSecurityTokenBase : BodyWriter
474474
/// Default constructor.
475475
/// </summary>
476476
protected RequestSecurityTokenBase()
477-
: this(String.Empty, String.Empty, 0, null)
477+
: this(string.Empty, string.Empty, 0, null)
478478
{
479479
}
480480

@@ -555,7 +555,7 @@ public class RequestSecurityToken : RequestSecurityTokenBase
555555
/// </summary>
556556
public RequestSecurityToken()
557557
:
558-
this(String.Empty, String.Empty, 0, null, null)
558+
this(string.Empty, string.Empty, 0, null, null)
559559
{
560560
}
561561

@@ -694,10 +694,10 @@ private static RequestSecurityToken ProcessRequestSecurityTokenElement(XmlReader
694694
int initialDepth = xr.Depth;
695695

696696
// Extract the @Context attribute value.
697-
string context = xr.GetAttribute(Constants.Trust.Attributes.Context, String.Empty);
697+
string context = xr.GetAttribute(Constants.Trust.Attributes.Context, string.Empty);
698698

699699
// Set up some default values.
700-
string tokenType = String.Empty;
700+
string tokenType = string.Empty;
701701
int keySize = 0;
702702
EndpointAddress appliesTo = null;
703703
SecurityToken entropy = null;
@@ -958,7 +958,7 @@ public class RequestSecurityTokenResponse : RequestSecurityTokenBase
958958
/// Default constructor.
959959
/// </summary>
960960
public RequestSecurityTokenResponse()
961-
: this(String.Empty, String.Empty, 0, null, null, null, false)
961+
: this(string.Empty, string.Empty, 0, null, null, null, false)
962962
{
963963
}
964964

@@ -1204,7 +1204,7 @@ static X509Certificate2 LookupCertificate(StoreName storeName, StoreLocation sto
12041204
subjectDistinguishedName, false);
12051205
if (certs.Count != 1)
12061206
{
1207-
throw new Exception(String.Format("FedUtil: Certificate {0} not found or more than one certificate found", subjectDistinguishedName));
1207+
throw new Exception(string.Format("FedUtil: Certificate {0} not found or more than one certificate found", subjectDistinguishedName));
12081208
}
12091209
return (X509Certificate2)certs[0];
12101210
}
@@ -1351,7 +1351,7 @@ public static void LoadAppSettings()
13511351
/*
13521352
BookDB = ConfigurationManager.AppSettings["bookDB"];
13531353
CheckIfLoaded(BookDB);
1354-
BookDB = String.Format("{0}\\{1}", System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath, BookDB);
1354+
BookDB = string.Format("{0}\\{1}", System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath, BookDB);
13551355
13561356
CertDistinguishedName = ConfigurationManager.AppSettings["certDistinguishedName"];
13571357
CheckIfLoaded(CertDistinguishedName);
@@ -1370,7 +1370,7 @@ public static void LoadAppSettings()
13701370
/// </summary>
13711371
private static void CheckIfLoaded(string s)
13721372
{
1373-
if (String.IsNullOrEmpty(s))
1373+
if (string.IsNullOrEmpty(s))
13741374
{
13751375
throw new ConfigurationErrorsException("Required Configuration Element(s) missing at BookStoreSTS. Please check the STS configuration file.");
13761376
}

samples/snippets/csharp/VS_Snippets_CFX/sba.transactions/cs/services.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <snippet2>
1+
// <snippet2>
22
using System;
33
using System.ServiceModel;
44
using System.Transactions;
@@ -61,7 +61,7 @@ public string TxWork(string message)
6161
TransactionInformation info = Transaction.Current.TransactionInformation;
6262
Console.WriteLine("The distributed tx ID: {0}.", info.DistributedIdentifier);
6363
Console.WriteLine("The tx status: {0}.", info.Status);
64-
return String.Format("Hello. This was object {0}.",myID.ToString()) ;
64+
return string.Format("Hello. This was object {0}.",myID.ToString()) ;
6565
}
6666

6767
public void Dispose()

samples/snippets/csharp/VS_Snippets_CFX/sba.transactiontimeout/cs/services.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <snippet2>
1+
// <snippet2>
22
using System;
33
using System.ServiceModel;
44
using System.Transactions;
@@ -63,7 +63,7 @@ public string TxWork(string message)
6363
TransactionInformation info = Transaction.Current.TransactionInformation;
6464
Console.WriteLine("The distributed tx ID: {0}.", info.DistributedIdentifier);
6565
Console.WriteLine("The tx status: {0}.", info.Status);
66-
return String.Format("Hello. This was object {0}.",myID.ToString()) ;
66+
return string.Format("Hello. This was object {0}.",myID.ToString()) ;
6767
}
6868

6969
public void Dispose()

samples/snippets/csharp/VS_Snippets_CFX/sendactivity/cs/snippets.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Workflow.Activities;
33
using System.Workflow.ComponentModel;
44
using System.Collections.Generic;
@@ -100,7 +100,7 @@ void Container6()
100100
{
101101
//SendActivity.ReturnValuePropertyName
102102
//<snippet6>
103-
String retValName = SendActivity.ReturnValuePropertyName;
103+
string retValName = SendActivity.ReturnValuePropertyName;
104104
//</snippet6>
105105
}
106106
void Container7()
@@ -165,19 +165,19 @@ void Container12()
165165
SendActivity sendActivity1 = new SendActivity();
166166
ChannelToken channelToken1 = new ChannelToken();
167167
sendActivity1.ChannelToken = channelToken1;
168-
Dictionary<String, String> Context = (Dictionary<String, String>)SendActivity.GetContext(sendActivity1, channelToken1, contractType);
168+
Dictionary<string, string> Context = (Dictionary<string, string>)SendActivity.GetContext(sendActivity1, channelToken1, contractType);
169169
//</snippet12>
170170
}
171171

172172
void Container15()
173173
{
174-
//SendActivity.GetContext(Activity, String, String, Type)
174+
//SendActivity.GetContext(Activity, string, string, Type)
175175
Type contractType = typeof(string);
176-
String endpointName = "";
177-
String ownerActivityName = "";
176+
string endpointName = "";
177+
string ownerActivityName = "";
178178
//<snippet15>
179179
SendActivity sendActivity1 = new SendActivity();
180-
Dictionary<String, String> Context = (Dictionary<String, String>)SendActivity.GetContext(sendActivity1, endpointName, ownerActivityName, contractType);
180+
Dictionary<string, string> Context = (Dictionary<string, string>)SendActivity.GetContext(sendActivity1, endpointName, ownerActivityName, contractType);
181181
//</snippet15>
182182
}
183183
void Container16()
@@ -190,7 +190,7 @@ void Container16()
190190
}
191191
void Container17()
192192
{
193-
//SendActivity.SendActivity(String)
193+
//SendActivity.SendActivity(string)
194194
//<snippet17>
195195
SendActivity RequestQuoteFromShipper3;
196196
RequestQuoteFromShipper3 = new System.Workflow.Activities.SendActivity("RequestQuoteFromShipper3");

0 commit comments

Comments
 (0)