diff --git a/samples/snippets/cpp/VS_Snippets_Remoting/ChannelServices_GetChannel/CPP/ChannelServices_GetChannel_Share.cs b/samples/snippets/cpp/VS_Snippets_Remoting/ChannelServices_GetChannel/CPP/ChannelServices_GetChannel_Share.cs
index 8d381336138..d20fed25080 100644
--- a/samples/snippets/cpp/VS_Snippets_Remoting/ChannelServices_GetChannel/CPP/ChannelServices_GetChannel_Share.cs
+++ b/samples/snippets/cpp/VS_Snippets_Remoting/ChannelServices_GetChannel/CPP/ChannelServices_GetChannel_Share.cs
@@ -1,9 +1,9 @@
/*
This program implments the remote method which will be called by the
- client.
+ client.
*/
using System;
-namespace RemotingSamples
+namespace RemotingSamples
{
public class HelloServer : MarshalByRefObject
{
diff --git a/samples/snippets/cpp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CPP/ChannelServices_SyncDispatchMessage_share.cs b/samples/snippets/cpp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CPP/ChannelServices_SyncDispatchMessage_share.cs
index 8c7f8320c66..06572db6df6 100644
--- a/samples/snippets/cpp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CPP/ChannelServices_SyncDispatchMessage_share.cs
+++ b/samples/snippets/cpp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CPP/ChannelServices_SyncDispatchMessage_share.cs
@@ -1,6 +1,6 @@
/*
- The class 'PrintServer' is derived from 'MarshalByRefObject' to
- make it remotable.
+ The class 'PrintServer' is derived from 'MarshalByRefObject' to
+ make it remotable.
*/
using System;
using System.Runtime.Remoting;
@@ -8,7 +8,7 @@ public class PrintServer : MarshalByRefObject
{
public int MyPrintMethod(String myString, double fValue, int iValue)
{
- Console.WriteLine("PrintServer.MyPrintMethod {0} {1} {2}",
+ Console.WriteLine("PrintServer.MyPrintMethod {0} {1} {2}",
myString, fValue, iValue);
return iValue;
}
diff --git a/samples/snippets/cpp/VS_Snippets_Remoting/IChannelSender/CPP/IChannelSender_Share.cs b/samples/snippets/cpp/VS_Snippets_Remoting/IChannelSender/CPP/IChannelSender_Share.cs
index 850f476a8f0..c9e87d01e4d 100644
--- a/samples/snippets/cpp/VS_Snippets_Remoting/IChannelSender/CPP/IChannelSender_Share.cs
+++ b/samples/snippets/cpp/VS_Snippets_Remoting/IChannelSender/CPP/IChannelSender_Share.cs
@@ -4,14 +4,14 @@ define the methods to execute from the client. */
using System;
-public class MyHelloServer : MarshalByRefObject
+public class MyHelloServer : MarshalByRefObject
{
- public MyHelloServer()
+ public MyHelloServer()
{
Console.WriteLine("HelloServer activated");
}
- public String myHelloMethod(String myString)
+ public String myHelloMethod(String myString)
{
Console.WriteLine("Hello.HelloMethod : {0}", myString);
return "Hi there " + myString;
diff --git a/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsRemotelyActivatedClientType1_Client/CPP/RemotingConfiguration_IsRemotelyActivatedClientType1_Shared.cs b/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsRemotelyActivatedClientType1_Client/CPP/RemotingConfiguration_IsRemotelyActivatedClientType1_Shared.cs
index bf83c7a65db..9dd43a6b077 100644
--- a/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsRemotelyActivatedClientType1_Client/CPP/RemotingConfiguration_IsRemotelyActivatedClientType1_Shared.cs
+++ b/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsRemotelyActivatedClientType1_Client/CPP/RemotingConfiguration_IsRemotelyActivatedClientType1_Shared.cs
@@ -1,13 +1,13 @@
using System;
- public class MyServerImpl :MarshalByRefObject
+ public class MyServerImpl :MarshalByRefObject
{
public MyServerImpl()
{
Console.WriteLine("Server Activated...");
}
- public String MyMethod(String name)
+ public String MyMethod(String name)
{
return "The client requests to "+name;
}
diff --git a/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsRemotelyActivatedClientType2_Client/CPP/RemotingConfiguration_IsRemotelyActivatedClientType2_Shared.cs b/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsRemotelyActivatedClientType2_Client/CPP/RemotingConfiguration_IsRemotelyActivatedClientType2_Shared.cs
index ae75fb10faa..9d40e579cdc 100644
--- a/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsRemotelyActivatedClientType2_Client/CPP/RemotingConfiguration_IsRemotelyActivatedClientType2_Shared.cs
+++ b/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsRemotelyActivatedClientType2_Client/CPP/RemotingConfiguration_IsRemotelyActivatedClientType2_Shared.cs
@@ -1,6 +1,6 @@
using System;
- public class MyServerImpl :MarshalByRefObject
+ public class MyServerImpl :MarshalByRefObject
{
int i;
public MyServerImpl()
@@ -9,7 +9,7 @@ public MyServerImpl()
Console.WriteLine("Server Activated...");
}
- public String MyMethod(String name)
+ public String MyMethod(String name)
{
i=i+1;
return "The client requests to "+name +i+" time";
diff --git a/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsWellKnownClientType1_Client/CPP/RemotingConfiguration_IsWellKnownClientType1_Shared.cs b/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsWellKnownClientType1_Client/CPP/RemotingConfiguration_IsWellKnownClientType1_Shared.cs
index 876f4fe351a..df325fb217f 100644
--- a/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsWellKnownClientType1_Client/CPP/RemotingConfiguration_IsWellKnownClientType1_Shared.cs
+++ b/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsWellKnownClientType1_Client/CPP/RemotingConfiguration_IsWellKnownClientType1_Shared.cs
@@ -2,12 +2,12 @@
public class MyServerImpl :MarshalByRefObject
{
- public MyServerImpl()
+ public MyServerImpl()
{
Console.WriteLine("Server Activated");
}
- public String MyMethod(String name)
+ public String MyMethod(String name)
{
return "The string from client is " + name;
}
diff --git a/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsWellKnownClientType2_Client/CPP/RemotingConfiguration_IsWellKnownClientType2_Shared.cs b/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsWellKnownClientType2_Client/CPP/RemotingConfiguration_IsWellKnownClientType2_Shared.cs
index 0b1687a63f1..617ec08c1f3 100644
--- a/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsWellKnownClientType2_Client/CPP/RemotingConfiguration_IsWellKnownClientType2_Shared.cs
+++ b/samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_IsWellKnownClientType2_Client/CPP/RemotingConfiguration_IsWellKnownClientType2_Shared.cs
@@ -3,12 +3,12 @@
public class MyServerImpl :MarshalByRefObject
{
- public MyServerImpl()
+ public MyServerImpl()
{
Console.WriteLine("Server Activated");
}
- public String MyMethod(String name)
+ public String MyMethod(String name)
{
Console.WriteLine(name);
return "The string from server : " + name;
diff --git a/samples/snippets/csharp/System.DateTime/Calendar.cs b/samples/snippets/csharp/System.DateTime/Calendar.cs
index 80ed58656ff..e51093abbc5 100644
--- a/samples/snippets/csharp/System.DateTime/Calendar.cs
+++ b/samples/snippets/csharp/System.DateTime/Calendar.cs
@@ -106,7 +106,7 @@ private static void CalculateWeeks()
// Date : 18/8/1395
// Day of Week: Sunday
// Week of year: 34
- //
+ //
// Using the Gregorian calendar
// Date : 18/08/0852
// Day of Week: Sunday
diff --git a/samples/snippets/csharp/System.DateTime/Parsing.cs b/samples/snippets/csharp/System.DateTime/Parsing.cs
index defc4b472eb..da4deafd7ed 100644
--- a/samples/snippets/csharp/System.DateTime/Parsing.cs
+++ b/samples/snippets/csharp/System.DateTime/Parsing.cs
@@ -15,7 +15,7 @@ public static void Snippets()
private static void ParseStandardFormats()
{
//
- System.Threading.Thread.CurrentThread.CurrentCulture =
+ System.Threading.Thread.CurrentThread.CurrentCulture =
System.Globalization.CultureInfo.CreateSpecificCulture("en-GB");
var date1 = new DateTime(2013, 6, 1, 12, 32, 30);
@@ -73,7 +73,7 @@ private static void ParseISO8601()
{
//
var iso8601String = "20080501T08:30:52Z";
- DateTime dateISO8602 = DateTime.ParseExact(iso8601String, "yyyyMMddTHH:mm:ssZ",
+ DateTime dateISO8602 = DateTime.ParseExact(iso8601String, "yyyyMMddTHH:mm:ssZ",
System.Globalization.CultureInfo.InvariantCulture);
Console.WriteLine($"{iso8601String} --> {dateISO8602:g}");
//
diff --git a/samples/snippets/csharp/System.DateTime/StringFormat.cs b/samples/snippets/csharp/System.DateTime/StringFormat.cs
index 5255c5fbf7f..ed52e0bb172 100644
--- a/samples/snippets/csharp/System.DateTime/StringFormat.cs
+++ b/samples/snippets/csharp/System.DateTime/StringFormat.cs
@@ -46,7 +46,7 @@ private static void ShowCultureSpecificFullDateAndTime()
var date1 = new DateTime(2008, 3, 1, 7, 0, 0);
Console.WriteLine(date1.ToString("F", new System.Globalization.CultureInfo("fr-FR")));
// Displays samedi 1 mars 2008 07:00:00
- //
+ //
}
private static void ShowIso8601Format()
@@ -55,7 +55,7 @@ private static void ShowIso8601Format()
var date1 = new DateTime(2008, 3, 1, 7, 0, 0);
Console.WriteLine(date1.ToString("yyyyMMddTHH:mm:ssZ"));
// Displays 20080301T07:00:00Z
- //
+ //
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData Constraint Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData Constraint Example/CS/source.cs
index 9bbb7e9cc94..37746c63143 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData Constraint Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData Constraint Example/CS/source.cs
@@ -14,30 +14,30 @@ private void GetConstraints(DataTable dataTable)
// Print the table's name.
Console.WriteLine("TableName: " + dataTable.TableName);
- // Iterate through the collection and
+ // Iterate through the collection and
// print each name and type value.
- foreach(Constraint constraint in dataTable.Constraints )
+ foreach(Constraint constraint in dataTable.Constraints )
{
- Console.WriteLine("Constraint Name: "
+ Console.WriteLine("Constraint Name: "
+ constraint.ConstraintName);
- Console.WriteLine("Type: "
+ Console.WriteLine("Type: "
+ constraint.GetType().ToString());
- // If the constraint is a UniqueConstraint,
+ // If the constraint is a UniqueConstraint,
// print its properties using a function below.
- if(constraint is UniqueConstraint)
+ if(constraint is UniqueConstraint)
{
PrintUniqueConstraintProperties(constraint);
}
- // If the constraint is a ForeignKeyConstraint,
+ // If the constraint is a ForeignKeyConstraint,
// print its properties using a function below.
- if(constraint is ForeignKeyConstraint)
+ if(constraint is ForeignKeyConstraint)
{
PrintForeigKeyConstraintProperties(constraint);
}
}
}
-
+
private void PrintUniqueConstraintProperties(
Constraint constraint)
{
@@ -49,36 +49,36 @@ private void PrintUniqueConstraintProperties(
columnArray = uniqueConstraint.Columns;
// Print each column's name.
- for(int i = 0;i
- public static void ClearConstraints(DataSet dataSet)
+ public static void ClearConstraints(DataSet dataSet)
{
foreach (DataTable table in dataSet.Tables)
table.Constraints.Clear();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.CollectionChanged Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.CollectionChanged Example/CS/source.cs
index 67945ce309d..c01c7720115 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.CollectionChanged Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.CollectionChanged Example/CS/source.cs
@@ -19,15 +19,15 @@ private static void ConstraintCollectionChanged()
DataTable customersTable = new DataTable("Customers");
customersTable.Columns.Add("id", typeof(int));
customersTable.Columns.Add("Name", typeof(string));
- customersTable.Constraints.CollectionChanged +=
- new System.ComponentModel.CollectionChangeEventHandler(
+ customersTable.Constraints.CollectionChanged +=
+ new System.ComponentModel.CollectionChangeEventHandler(
Collection_Changed);
// Create Orders table.
DataTable ordersTable = new DataTable("Orders");
ordersTable.Columns.Add("CustID", typeof(int));
ordersTable.Columns.Add("CustName", typeof(string));
- ordersTable.Constraints.CollectionChanged +=
+ ordersTable.Constraints.CollectionChanged +=
new System.ComponentModel.CollectionChangeEventHandler(
Collection_Changed);
@@ -43,22 +43,22 @@ private static void ConstraintCollectionChanged()
// Remove constraints.
customersTable.Constraints.RemoveAt(0);
- // Results in an Exception. You can't remove
+ // Results in an Exception. You can't remove
// a primary key constraint.
- ordersTable.Constraints.RemoveAt(0);
+ ordersTable.Constraints.RemoveAt(0);
}
catch(Exception ex)
{
// Process exception and return.
- Console.WriteLine("Exception of type {0} occurred.",
+ Console.WriteLine("Exception of type {0} occurred.",
ex.GetType());
}
}
- private static void Collection_Changed(object sender,
+ private static void Collection_Changed(object sender,
System.ComponentModel.CollectionChangeEventArgs ex)
{
- Console.WriteLine("List_Changed Event: '{0}'\t element={1}",
+ Console.WriteLine("List_Changed Event: '{0}'\t element={1}",
ex.Action, ex.Element);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Contains Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Contains Example/CS/source.cs
index 227f0dbb358..1dba7af275a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Contains Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Contains Example/CS/source.cs
@@ -10,18 +10,18 @@ public static void RemoveConstraint(
{
try
{
- if(constraints.Contains(constraint.ConstraintName))
+ if(constraints.Contains(constraint.ConstraintName))
{
- if(constraints.CanRemove(constraint))
+ if(constraints.CanRemove(constraint))
{
constraints.Remove(constraint.ConstraintName);
}
}
}
- catch(Exception e)
+ catch(Exception e)
{
// Process exception and return.
- Console.WriteLine("Exception of type {0} occurred.",
+ Console.WriteLine("Exception of type {0} occurred.",
e.GetType());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.IndexOf Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.IndexOf Example/CS/source.cs
index 6a36995c288..1d4c7526322 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.IndexOf Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.IndexOf Example/CS/source.cs
@@ -12,19 +12,19 @@ private void RemoveConstraint(
{
try
{
- if(constraints.Contains(constraint.ConstraintName))
+ if(constraints.Contains(constraint.ConstraintName))
{
- if(constraints.CanRemove(constraint))
+ if(constraints.CanRemove(constraint))
{
constraints.RemoveAt(
constraints.IndexOf(constraint.ConstraintName));
}
}
}
- catch(Exception e)
+ catch(Exception e)
{
// Process exception and return.
- Console.WriteLine("Exception of type {0} occurred.",
+ Console.WriteLine("Exception of type {0} occurred.",
e.GetType());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.IndexOf1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.IndexOf1 Example/CS/source.cs
index 9e7733c69cb..f1934215f05 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.IndexOf1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.IndexOf1 Example/CS/source.cs
@@ -12,18 +12,18 @@ private void RemoveConstraint(
{
try
{
- if(constraints.Contains(constraint.ConstraintName))
+ if(constraints.Contains(constraint.ConstraintName))
{
- if(constraints.CanRemove(constraint))
+ if(constraints.CanRemove(constraint))
{
constraints.RemoveAt(constraints.IndexOf(constraint));
}
}
}
- catch(Exception e)
+ catch(Exception e)
{
// Process exception and return.
- Console.WriteLine("Exception of type {0} occurred.",
+ Console.WriteLine("Exception of type {0} occurred.",
e.GetType());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Remove Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Remove Example/CS/source.cs
index 1c4faac60cf..ac5c9dd14ee 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Remove Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Remove Example/CS/source.cs
@@ -2,11 +2,11 @@
using System.Data;
using System.Windows.Forms;
-public class Form1 : Form
+public class Form1 : Form
{
//
- private void RemoveConstraint(DataTable table,
+ private void RemoveConstraint(DataTable table,
Constraint constraint)
{
if(table.Constraints.Contains(constraint.ConstraintName))
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Remove1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Remove1 Example/CS/source.cs
index e3651379020..bf3155a3904 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Remove1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.Remove1 Example/CS/source.cs
@@ -7,7 +7,7 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void RemoveConstraint(ConstraintCollection constraints,
+ private void RemoveConstraint(ConstraintCollection constraints,
Constraint constraint)
{
if(constraints.Contains(constraint.ConstraintName))
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.RemoveAt Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.RemoveAt Example/CS/source.cs
index 7a36801054f..849093f4af5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.RemoveAt Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.RemoveAt Example/CS/source.cs
@@ -7,24 +7,24 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void RemoveConstraint(ConstraintCollection constraints,
+ private void RemoveConstraint(ConstraintCollection constraints,
Constraint constraint)
{
try
{
- if(constraints.Contains(constraint.ConstraintName))
+ if(constraints.Contains(constraint.ConstraintName))
{
- if(constraints.CanRemove(constraint))
+ if(constraints.CanRemove(constraint))
{
constraints.RemoveAt(constraints.IndexOf(
constraint.ConstraintName));
}
}
}
- catch(Exception e)
+ catch(Exception e)
{
// Process exception and return.
- Console.WriteLine("Exception of type {0} occurred.",
+ Console.WriteLine("Exception of type {0} occurred.",
e.GetType());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.this1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.this1 Example/CS/source.cs
index 61535e7a3f6..98ca89a8173 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.this1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ConstraintCollection.this1 Example/CS/source.cs
@@ -11,7 +11,7 @@ private void GetConstraint(DataTable table)
{
if(table.Constraints.Contains("CustomersOrdersConstraint"))
{
- Constraint constraint =
+ Constraint constraint =
table.Constraints["CustomersOrdersConstraint"];
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataAdapter.IDataAdapter.Update Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataAdapter.IDataAdapter.Update Example/CS/source.cs
index f47cf11777b..b602f6e7c67 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataAdapter.IDataAdapter.Update Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataAdapter.IDataAdapter.Update Example/CS/source.cs
@@ -48,7 +48,7 @@ static private DataSet CreateCommandAndUpdate(
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Provider=sqloledb;Data Source=(local);Initial Catalog=Northwind;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn Example/CS/source.cs
index 0e067df35db..1fabf815759 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn Example/CS/source.cs
@@ -8,32 +8,32 @@ public class Form1: Form
//
private void MakeTable()
- {
- // Create a DataTable.
+ {
+ // Create a DataTable.
DataTable table = new DataTable("Product");
- // Create a DataColumn and set various properties.
- DataColumn column = new DataColumn();
- column.DataType = System.Type.GetType("System.Decimal");
- column.AllowDBNull = false;
- column.Caption = "Price";
- column.ColumnName = "Price";
- column.DefaultValue = 25;
+ // Create a DataColumn and set various properties.
+ DataColumn column = new DataColumn();
+ column.DataType = System.Type.GetType("System.Decimal");
+ column.AllowDBNull = false;
+ column.Caption = "Price";
+ column.ColumnName = "Price";
+ column.DefaultValue = 25;
- // Add the column to the table.
- table.Columns.Add(column);
+ // Add the column to the table.
+ table.Columns.Add(column);
- // Add 10 rows and set values.
- DataRow row;
+ // Add 10 rows and set values.
+ DataRow row;
for(int i = 0; i < 10; i++)
- {
- row = table.NewRow();
- row["Price"] = i + 1;
+ {
+ row = table.NewRow();
+ row["Price"] = i + 1;
- // Be sure to add the new row to the
- // DataRowCollection.
- table.Rows.Add(row);
- }
+ // Be sure to add the new row to the
+ // DataRowCollection.
+ table.Rows.Add(row);
+ }
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.AllowDBNull Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.AllowDBNull Example/CS/source.cs
index d8818a497cb..a20e756228f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.AllowDBNull Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.AllowDBNull Example/CS/source.cs
@@ -10,7 +10,7 @@ public class Form1: Form
private void AddNullAllowedColumn()
{
DataColumn column;
- column = new DataColumn("classID",
+ column = new DataColumn("classID",
System.Type.GetType("System.Int32"));
column.AllowDBNull = true;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Caption Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Caption Example/CS/source.cs
index 4647911f74f..ffee9f428a0 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Caption Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Caption Example/CS/source.cs
@@ -14,17 +14,17 @@ private void CreateDataTable()
table = new DataTable("Customers");
//CustomerID column
- column = table.Columns.Add("CustomerID",
+ column = table.Columns.Add("CustomerID",
System.Type.GetType("System.Int32"));
column.Unique = true;
//CustomerName column
- column = table.Columns.Add("CustomerName",
+ column = table.Columns.Add("CustomerName",
System.Type.GetType("System.String"));
column.Caption = "Name";
//CreditLimit
- column = table.Columns.Add("CreditLimit",
+ column = table.Columns.Add("CreditLimit",
System.Type.GetType("System.Double"));
column.DefaultValue = 0;
column.Caption = "Limit";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ColumnMapping Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ColumnMapping Example/CS/source.cs
index d4c83d9e201..05b2321e487 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ColumnMapping Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ColumnMapping Example/CS/source.cs
@@ -10,7 +10,7 @@ public class Form1: Form
private void AddColumn(DataTable table)
{
// Create a new column and set its properties.
- DataColumn column = new DataColumn("column",
+ DataColumn column = new DataColumn("column",
typeof(int), "", MappingType.Attribute);
column.DataType = Type.GetType("System.String");
column.ColumnMapping = MappingType.Element;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ColumnName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ColumnName Example/CS/source.cs
index b4c18c32f24..cd54d12bfa2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ColumnName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ColumnName Example/CS/source.cs
@@ -18,7 +18,7 @@ private void PrintColumnNames(DataSet dataSet)
}
}
}
-
+
private void AddColumn(DataTable table)
{
DataColumn column;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn2 Example/CS/source.cs
index c77382272a1..a690dce4944 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn2 Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
//
private void AddDataColumn(DataTable table)
{
- System.Type typeInt32 =
+ System.Type typeInt32 =
System.Type.GetType("System.Int32");
DataColumn column = new DataColumn("id", typeInt32);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn3 Example/CS/source.cs
index a38715fdab0..27403d9d3e8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn3 Example/CS/source.cs
@@ -12,9 +12,9 @@ private void AddDataColumn(DataTable table)
System.Type decimalType;
decimalType = System.Type.GetType("System.Decimal");
- // Create the column. The name is 'Tax,' with data type Decimal,and
+ // Create the column. The name is 'Tax,' with data type Decimal,and
// an expression ('UnitPrice * .0862) to calculate the tax.
- DataColumn column = new DataColumn("Tax",
+ DataColumn column = new DataColumn("Tax",
decimalType, "UnitPrice * .0862");
// Set various properties.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn4 Example/CS/source.cs
index 9f4875f6507..af3f63964c8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataColumn4 Example/CS/source.cs
@@ -9,15 +9,15 @@ public class Form1: Form
//
private void CreateComputedColumn(DataTable table)
{
- System.Type myDataType =
+ System.Type myDataType =
System.Type.GetType("System.Decimal");
- // The expression multiplies the "Price" column value
+ // The expression multiplies the "Price" column value
// by the "Quantity" to create the "Total" column.
string expression = "Price * Quantity";
// Create the column, setting the type to Attribute.
- DataColumn column = new DataColumn("Total", myDataType,
+ DataColumn column = new DataColumn("Total", myDataType,
expression, MappingType.Attribute);
// Set various properties.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataType Example/CS/source.cs
index 4d9d5f14dc5..e4f558d0a70 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.DataType Example/CS/source.cs
@@ -8,17 +8,17 @@ public class Form1: Form
//
public DataTable MakeDataTable(){
-
+
DataTable myTable;
- DataRow myNewRow;
+ DataRow myNewRow;
// Create a new DataTable.
myTable = new DataTable("My Table");
// Create DataColumn objects of data types.
DataColumn colString = new DataColumn("StringCol");
colString.DataType = System.Type.GetType("System.String");
- myTable.Columns.Add(colString);
-
+ myTable.Columns.Add(colString);
+
DataColumn colInt32 = new DataColumn("Int32Col");
colInt32.DataType = System.Type.GetType("System.Int32");
myTable.Columns.Add(colInt32);
@@ -54,7 +54,7 @@ public DataTable MakeDataTable(){
myNewRow["DecimalCol"] = 64.0021;
myNewRow["ByteArrayCol"] = new Byte[] { 1, 5, 120 };
myTable.Rows.Add(myNewRow);
- return myTable;
+ return myTable;
}
//
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Expression Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Expression Example/CS/source.cs
index a434a8ce478..4fb3ec30e10 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Expression Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Expression Example/CS/source.cs
@@ -10,25 +10,25 @@ public class Form1: Form
private void CalcColumns()
{
DataTable table = new DataTable ();
-
+
// Create the first column.
DataColumn priceColumn = new DataColumn();
priceColumn.DataType = System.Type.GetType("System.Decimal");
priceColumn.ColumnName = "price";
priceColumn.DefaultValue = 50;
-
+
// Create the second, calculated, column.
DataColumn taxColumn = new DataColumn();
taxColumn.DataType = System.Type.GetType("System.Decimal");
taxColumn.ColumnName = "tax";
taxColumn.Expression = "price * 0.0862";
-
+
// Create third column.
DataColumn totalColumn = new DataColumn();
totalColumn.DataType = System.Type.GetType("System.Decimal");
totalColumn.ColumnName = "total";
totalColumn.Expression = "price + tax";
-
+
// Add columns to DataTable.
table.Columns.Add(priceColumn);
table.Columns.Add(taxColumn);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ExtendedProperties Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ExtendedProperties Example/CS/source.cs
index 16130e3d829..75105d2676d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ExtendedProperties Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.ExtendedProperties Example/CS/source.cs
@@ -11,7 +11,7 @@ private void SetProperty(DataColumn column)
{
column.ExtendedProperties.Add("TimeStamp", DateTime.Now);
}
-
+
private void GetProperty(DataColumn column)
{
Console.WriteLine(column.ExtendedProperties["TimeStamp"].ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Ordinal Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Ordinal Example/CS/source.cs
index a40f14796dc..5a8b4b83bc8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Ordinal Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumn.Ordinal Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
//
private void PrintColumnDetails(DataColumn column)
{
- // Print the Ordinal, ColumnName, and
+ // Print the Ordinal, ColumnName, and
// DataType of the column.
Console.WriteLine(column.Ordinal);
Console.WriteLine(column.ColumnName);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Clear Example/CS/source.cs
index d20611b7493..f2f8f7a2c15 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Clear Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
private void ClearColumnsCollection(DataTable table)
{
DataColumnCollection columns;
- // Get the DataColumnCollection from a
+ // Get the DataColumnCollection from a
// DataTable in a DataSet.
columns = table.Columns;
columns.Clear();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.CollectionChanged Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.CollectionChanged Example/CS/source.cs
index 7f453a92b08..6017291fd99 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.CollectionChanged Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.CollectionChanged Example/CS/source.cs
@@ -10,17 +10,17 @@ public class Form1: Form
private void AddEventHandler(DataTable table)
{
DataColumnCollection columns = table.Columns;
- columns.CollectionChanged += new
+ columns.CollectionChanged += new
System.ComponentModel.CollectionChangeEventHandler(
ColumnsCollection_Changed);
}
-
- private void ColumnsCollection_Changed(object sender,
+
+ private void ColumnsCollection_Changed(object sender,
System.ComponentModel.CollectionChangeEventArgs e)
{
- DataColumnCollection columns =
+ DataColumnCollection columns =
(DataColumnCollection) sender;
- Console.WriteLine("ColumnsCollectionChanged: "
+ Console.WriteLine("ColumnsCollectionChanged: "
+ columns.Count);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Contains Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Contains Example/CS/source.cs
index aef5d6a49b6..8002fc4ee7b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Contains Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Contains Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Sample
private void RemoveColumn(string columnName, DataTable table)
{
DataColumnCollection columns = table.Columns;
-
+
if (columns.Contains(columnName))
if (columns.CanRemove(columns[columnName]))
columns.Remove(columnName);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.IndexOf Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.IndexOf Example/CS/source.cs
index 54794bdc22f..2dc033da39a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.IndexOf Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.IndexOf Example/CS/source.cs
@@ -10,7 +10,7 @@ public class Form1: Form
private void GetIndex(DataTable table)
{
DataColumnCollection columns = table.Columns;
- if(columns.Contains("City"))
+ if(columns.Contains("City"))
{
Console.WriteLine(columns.IndexOf("City"));
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Remove Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Remove Example/CS/source.cs
index e24b096ca1b..63e37de369c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Remove Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Remove Example/CS/source.cs
@@ -9,10 +9,10 @@ public class Form1: Form
//
private void TestAndRemove(DataColumn colToRemove)
{
- DataColumnCollection columns;
+ DataColumnCollection columns;
// Get the DataColumnCollection from a DataTable in a DataSet.
columns = DataSet1.Tables["Orders"].Columns;
-
+
if(columns.Contains(colToRemove.ColumnName))
{
columns.Remove(colToRemove);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Remove1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Remove1 Example/CS/source.cs
index bb4dfe09838..2504824a937 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Remove1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnCollection.Remove1 Example/CS/source.cs
@@ -10,11 +10,11 @@ public class Form1: Form
private void RemoveColumnByName(string columnName)
{
// Get the DataColumnCollection from a DataTable in a DataSet.
- DataColumnCollection columns =
+ DataColumnCollection columns =
ds.Tables["Suppliers"].Columns;
if(columns.Contains(columnName))
- if(columns.CanRemove(columns[columnName]))
+ if(columns.CanRemove(columns[columnName]))
columns.Remove(columnName);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping Example/CS/source.cs
index 1382692d295..0351a687130 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping Example/CS/source.cs
@@ -17,7 +17,7 @@ public void AddDataColumnMapping() {
DataColumnMapping mapping =
new DataColumnMapping("Description","DataDescription");
columnMappings.Add((Object) mapping);
- Console.WriteLine("Column {0} added to column mapping collection {1}.",
+ Console.WriteLine("Column {0} added to column mapping collection {1}.",
mapping.ToString(), columnMappings.ToString());
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataColumnMapping Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataColumnMapping Example/CS/source.cs
index d63509774b2..41f4117cdaf 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataColumnMapping Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataColumnMapping Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Form1: Form
protected DataSet DataSet1;
//
- public void CreateDataColumnMapping()
+ public void CreateDataColumnMapping()
{
DataColumnMapping mapping = new DataColumnMapping();
mapping.SourceColumn = "Description";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataColumnMapping1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataColumnMapping1 Example/CS/source.cs
index 08bb7009a6c..343c6776472 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataColumnMapping1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataColumnMapping1 Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Form1: Form
protected DataSet DataSet1;
//
- public void CreateDataColumnMapping()
+ public void CreateDataColumnMapping()
{
DataColumnMapping mapping =
new DataColumnMapping("Description","DataDescription");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataSetColumn Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataSetColumn Example/CS/source.cs
index d63509774b2..41f4117cdaf 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataSetColumn Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMapping.DataSetColumn Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Form1: Form
protected DataSet DataSet1;
//
- public void CreateDataColumnMapping()
+ public void CreateDataColumnMapping()
{
DataColumnMapping mapping = new DataColumnMapping();
mapping.SourceColumn = "Description";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection Example/CS/source.cs
index 085b7108427..1fa7ba57892 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
//
- public void ShowColumnMappings()
+ public void ShowColumnMappings()
{
// ...
// create tableMapping
@@ -18,7 +18,7 @@ public void ShowColumnMappings()
tableMapping.ColumnMappings.Add("Description","DataDescription");
tableMapping.ColumnMappings.Add("Picture","DataPicture");
Console.WriteLine("Column Mappings");
- for(int i=0;i < tableMapping.ColumnMappings.Count;i++)
+ for(int i=0;i < tableMapping.ColumnMappings.Count;i++)
{
Console.WriteLine(" {0} {1}", i,
tableMapping.ColumnMappings[i].ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Add Example/CS/source.cs
index 4aac516fb04..d8d72097034 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Add Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
protected DataColumnMapping mapping;
//
- public void ChangedMyMind()
+ public void ChangedMyMind()
{
// ...
// create mappings and mapping
@@ -18,7 +18,7 @@ public void ChangedMyMind()
{
mappings.Remove((Object) mapping);
}
- else
+ else
{
mappings.Add((Object) mapping);
Console.WriteLine("Index of new mapping: "
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Clear Example/CS/source.cs
index 257c059d147..c87810fe6df 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Clear Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Form1: Form
protected DataColumnMappingCollection mappings;
//
- public bool PushIntoArray()
+ public bool PushIntoArray()
{
// ...
// create mappings
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Contains1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Contains1 Example/CS/source.cs
index 513d38a732d..d80ec6151fa 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Contains1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Contains1 Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
protected DataColumnMapping mapping;
//
- public void ChangedMyMind()
+ public void ChangedMyMind()
{
// ...
// create mappings and mapping
@@ -18,7 +18,7 @@ public void ChangedMyMind()
{
mappings.Remove((Object) mapping);
}
- else
+ else
{
mappings.Add((Object) mapping);
Console.WriteLine("Index of new mapping: " +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Count Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Count Example/CS/source.cs
index 28b8530630c..69c4a2e1da4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Count Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.Count Example/CS/source.cs
@@ -7,9 +7,9 @@ public class Form1: Form
{
//
- public void CreateColumnMappings()
+ public void CreateColumnMappings()
{
- DataColumnMappingCollection mappings =
+ DataColumnMappingCollection mappings =
new DataColumnMappingCollection();
mappings.Add("Category Name","DataCategory");
mappings.Add("Description","DataDescription");
@@ -17,7 +17,7 @@ public void CreateColumnMappings()
string message = "ColumnMappings:\n";
for(int i=0;i < mappings.Count;i++)
{
- message += i.ToString() + " "
+ message += i.ToString() + " "
+ mappings[i].ToString() + "\n";
}
Console.WriteLine(message);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.DataColumnMappingCollection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.DataColumnMappingCollection Example/CS/source.cs
index a2012da702d..0a5c8faebeb 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.DataColumnMappingCollection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.DataColumnMappingCollection Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Form1: Form
protected DataSet DataSet1;
//
- public void CreateColumnMappings()
+ public void CreateColumnMappings()
{
DataColumnMappingCollection mappings =
new DataColumnMappingCollection();
@@ -18,7 +18,7 @@ public void CreateColumnMappings()
string myMessage = "ColumnMappings:\n";
for(int i=0;i < mappings.Count;i++)
{
- myMessage += i.ToString() + " "
+ myMessage += i.ToString() + " "
+ mappings[i].ToString() + "\n";
}
Console.WriteLine(myMessage);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.GetByDataSetColumn Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.GetByDataSetColumn Example/CS/source.cs
index e81bdcf078d..f0ff7dddeda 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.GetByDataSetColumn Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.GetByDataSetColumn Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
protected DataColumnMapping mapping;
//
- public void FindDataColumnMapping()
+ public void FindDataColumnMapping()
{
// ...
// create mappings and mapping
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.GetColumnMappingBySchemaAction Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.GetColumnMappingBySchemaAction Example/CS/source.cs
index e3b95fa0f5f..f271f51518e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.GetColumnMappingBySchemaAction Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.GetColumnMappingBySchemaAction Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
protected DataColumnMapping mapping;
//
- public void FindDataColumnMapping()
+ public void FindDataColumnMapping()
{
// ...
// create mappings and mapping
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.RemoveAt Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.RemoveAt Example/CS/source.cs
index db508f2d003..49889140871 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.RemoveAt Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.RemoveAt Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
//
- public void RemoveDataColumnMapping()
+ public void RemoveDataColumnMapping()
{
// ...
// create mappings
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.RemoveAt1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.RemoveAt1 Example/CS/source.cs
index 61488267465..6a5d1e7ccef 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.RemoveAt1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.RemoveAt1 Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
//
- public void RemoveDataColumnMapping()
+ public void RemoveDataColumnMapping()
{
// ...
// create columnMappings
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.this1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.this1 Example/CS/source.cs
index 2fbf5913c8d..6943046d9df 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.this1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataColumnMappingCollection.this1 Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Form1: Form
protected DataColumnMappingCollection columnMappings;
//
- public void FindDataColumnMapping()
+ public void FindDataColumnMapping()
{
// ...
// create columnMappings
@@ -19,9 +19,9 @@ public void FindDataColumnMapping()
}
else
{
- Console.WriteLine("Name {0}",
+ Console.WriteLine("Name {0}",
columnMappings["Description"].ToString());
- Console.WriteLine("Index: {0}",
+ Console.WriteLine("Index: {0}",
columnMappings.IndexOf("Description").ToString());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelation Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelation Example/CS/source.cs
index f0dc34919fa..87018f287a2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelation Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelation Example/CS/source.cs
@@ -8,17 +8,17 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void CreateRelation()
+ private void CreateRelation()
{
- // Get the DataColumn objects from two DataTable objects
+ // Get the DataColumn objects from two DataTable objects
// in a DataSet. Code to get the DataSet not shown here.
- DataColumn parentColumn =
+ DataColumn parentColumn =
DataSet1.Tables["Customers"].Columns["CustID"];
- DataColumn childColumn =
+ DataColumn childColumn =
DataSet1.Tables["Orders"].Columns["CustID"];
// Create DataRelation.
DataRelation relCustOrder;
- relCustOrder = new DataRelation("CustomersOrders",
+ relCustOrder = new DataRelation("CustomersOrders",
parentColumn, childColumn);
// Add the relation to the DataSet.
DataSet1.Relations.Add(relCustOrder);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelation.DataRelation/CS/datarelation.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelation.DataRelation/CS/datarelation.cs
index 10878aa8b70..cc3b77518cd 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelation.DataRelation/CS/datarelation.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelation.DataRelation/CS/datarelation.cs
@@ -13,12 +13,12 @@ public class Sample
private void CreateRelation()
{
// Code to get the DataSet not shown here.
- // Get the DataColumn objects from two DataTable
+ // Get the DataColumn objects from two DataTable
// objects in a DataSet.
- DataColumn[] parentCols = new DataColumn[]
+ DataColumn[] parentCols = new DataColumn[]
{DataSet1.Tables["Customers"].Columns["CustID"],
DataSet1.Tables["Customers"].Columns["OrdID"]};
- DataColumn[] childCols= new DataColumn[]
+ DataColumn[] childCols= new DataColumn[]
{DataSet1.Tables["Orders"].Columns["CustID"],
DataSet1.Tables["Orders"].Columns["OrdID"]};
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelationCollection.Add1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelationCollection.Add1 Example/CS/source.cs
index 43d8ecc140b..34870ff46b4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelationCollection.Add1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelationCollection.Add1 Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void AddRelation()
+ private void AddRelation()
{
DataTable table = new DataTable();
DataColumn column1 = table.Columns.Add("Column1");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelationCollection.AddRange Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelationCollection.AddRange Example/CS/source.cs
index bfb0499c7e7..cd295e8aad9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelationCollection.AddRange Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRelationCollection.AddRange Example/CS/source.cs
@@ -46,17 +46,17 @@ static void Main()
//
public static void AddRelations(DataSet dataSet)
{
- DataRelation customerOrders =
+ DataRelation customerOrders =
new DataRelation("CustomerOrders",
dataSet.Tables["Customers"].Columns["customerId"],
dataSet.Tables["Orders"].Columns["customerId"]);
- DataRelation orderDetails =
+ DataRelation orderDetails =
new DataRelation("OrderDetail",
dataSet.Tables["Orders"].Columns["orderId"],
dataSet.Tables["OrderDetails"].Columns["orderId"]);
- dataSet.Relations.AddRange(new DataRelation[]
+ dataSet.Relations.AddRange(new DataRelation[]
{customerOrders, orderDetails});
// Display names of all relations.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow Example/CS/source.cs
index 368465825db..3e4445b3b7c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow Example/CS/source.cs
@@ -15,7 +15,7 @@ private void CreateNewDataRow()
DataTable table;
table = MakeNamesTable();
- // Once a table has been created, use the
+ // Once a table has been created, use the
// NewRow to create a DataRow.
DataRow row;
row = table.NewRow();
@@ -24,16 +24,16 @@ private void CreateNewDataRow()
row["fName"] = "John";
row["lName"] = "Smith";
table.Rows.Add(row);
-
+
foreach(DataColumn column in table.Columns)
Console.WriteLine(column.ColumnName);
dataGrid1.DataSource=table;
}
-
+
private DataTable MakeNamesTable()
{
// Create a new DataTable titled 'Names.'
- DataTable namesTable = new DataTable("Names");
+ DataTable namesTable = new DataTable("Names");
// Add three column objects to the table.
DataColumn idColumn = new DataColumn();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.AcceptChanges Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.AcceptChanges Example/CS/source.cs
index 8771db07691..7d871205470 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.AcceptChanges Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.AcceptChanges Example/CS/source.cs
@@ -13,29 +13,29 @@ private void DemonstrateAcceptChanges()
//Run a function to create a DataTable with one column.
DataTable table = MakeTable();
DataRow row;
-
+
// Create a new DataRow.
row = table.NewRow();
// Detached row.
Console.WriteLine("New Row " + row.RowState);
-
+
table.Rows.Add(row);
// New row.
Console.WriteLine("AddRow " + row.RowState);
-
+
table.AcceptChanges();
// Unchanged row.
Console.WriteLine("AcceptChanges " + row.RowState);
-
+
row["FirstName"] = "Scott";
// Modified row.
Console.WriteLine("Modified " + row.RowState);
-
+
row.Delete();
// Deleted row.
Console.WriteLine("Deleted " + row.RowState);
}
-
+
private DataTable MakeTable()
{
// Make a simple table with one column.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.BeginEdit Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.BeginEdit Example/CS/source.cs
index 87aefa1e66f..7a4157b77b2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.BeginEdit Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.BeginEdit Example/CS/source.cs
@@ -11,9 +11,9 @@ public class Form1: Form
private void DemonstrateRowBeginEdit()
{
DataTable table = new DataTable("table1");
- DataColumn column = new
+ DataColumn column = new
DataColumn("col1",Type.GetType("System.Int32"));
- table.RowChanged+=new
+ table.RowChanged+=new
DataRowChangeEventHandler(Row_Changed);
table.Columns.Add(column);
@@ -22,7 +22,7 @@ private void DemonstrateRowBeginEdit()
// Add five rows.
DataRow newRow;
-
+
for(int i = 0;i<5; i++)
{
// RowChanged event will occur for every addition.
@@ -38,12 +38,12 @@ private void DemonstrateRowBeginEdit()
"\n Begin Edit and print original and proposed values \n");
foreach(DataRow row in table.Rows)
{
-
+
row.BeginEdit();
row[0]=(int) row[0]+10;
- Console.Write("\table Original \table" +
+ Console.Write("\table Original \table" +
row[0, DataRowVersion.Original]);
- Console.Write("\table Proposed \table" +
+ Console.Write("\table Proposed \table" +
row[0,DataRowVersion.Proposed] + "\n");
}
Console.WriteLine("\n");
@@ -64,16 +64,16 @@ to be enforced.*/
catch(Exception e)
{
// Process exception and return.
- Console.WriteLine("Exception of type {0} occurred.",
+ Console.WriteLine("Exception of type {0} occurred.",
e.GetType());
}
}
-
- private void Row_Changed(object sender,
+
+ private void Row_Changed(object sender,
System.Data.DataRowChangeEventArgs e)
{
DataTable table = (DataTable) sender;
- Console.WriteLine("RowChanged " + e.Action.ToString()
+ Console.WriteLine("RowChanged " + e.Action.ToString()
+ "\table" + e.Row.ItemArray[0]);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.CancelEdit Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.CancelEdit Example/CS/source.cs
index 63284fe3d56..a388c78e8cc 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.CancelEdit Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.CancelEdit Example/CS/source.cs
@@ -18,11 +18,11 @@ private void AcceptOrReject(DataRow row)
else
row.CancelEdit();
}
-
+
private bool ValidateRow(DataRow thisRow)
{
- bool isValid = true;
- // Insert code to validate the row values.
+ bool isValid = true;
+ // Insert code to validate the row values.
// Set the isValid variable.
return isValid;
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.ClearErrors Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.ClearErrors Example/CS/source.cs
index c4814f48583..ab3c8cad026 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.ClearErrors Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.ClearErrors Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
private void GetAllErrs(DataRow row)
{
// Declare an array variable for DataColumn objects.
- DataColumn[] colArr;
+ DataColumn[] colArr;
// If the Row has errors, check use GetColumnsInError.
if(row.HasErrors)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.Delete Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.Delete Example/CS/source.cs
index a224624bd5e..f2fdf22fd11 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.Delete Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.Delete Example/CS/source.cs
@@ -15,14 +15,14 @@ private void DemonstrateDeleteRow()
DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"));
idColumn.AutoIncrement=true;
- DataColumn itemColumn = new DataColumn("item",
+ DataColumn itemColumn = new DataColumn("item",
Type.GetType("System.String"));
table.Columns.Add(idColumn);
table.Columns.Add(itemColumn);
// Add ten rows.
DataRow newRow;
-
+
for(int i = 0; i <10; i++)
{
newRow = table.NewRow();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetChildRows2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetChildRows2 Example/CS/source.cs
index 145d5683456..5162de93013 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetChildRows2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetChildRows2 Example/CS/source.cs
@@ -8,9 +8,9 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void GetChildRowsFromDataRelation(DataTable table)
+ private void GetChildRowsFromDataRelation(DataTable table)
{
- DataRow[] arrRows;
+ DataRow[] arrRows;
foreach(DataRelation relation in table.ChildRelations)
{
foreach(DataRow row in table.Rows)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetChildRows3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetChildRows3 Example/CS/source.cs
index 345a17843df..bdd5c1cfddd 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetChildRows3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetChildRows3 Example/CS/source.cs
@@ -8,14 +8,14 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void GetChildRowsFromDataRelation(DataTable table )
+ private void GetChildRowsFromDataRelation(DataTable table )
{
- DataRow[] arrRows;
+ DataRow[] arrRows;
foreach(DataRelation relation in table.ChildRelations)
{
foreach(DataRow row in table.Rows)
{
- arrRows = row.GetChildRows(relation,
+ arrRows = row.GetChildRows(relation,
DataRowVersion.Proposed);
// Print values of rows.
for(int i = 0; i < arrRows.Length; i++)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow Example/CS/source.cs
index 729ac6dc6d9..1326904d624 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow Example/CS/source.cs
@@ -12,7 +12,7 @@ private void GetParentRowForTable(
DataTable thisTable, string relation)
{
if(thisTable ==null){return;}
- // For each row in the table, print column 1
+ // For each row in the table, print column 1
// of the parent DataRow.
DataRow parentRow;
foreach(DataRow row in thisTable.Rows)
@@ -22,7 +22,7 @@ private void GetParentRowForTable(
Console.Write("\table parent row: " + parentRow[1]+ "\n");
}
}
-
+
private void CallGetParentRowForTable()
{
// An example of calling the function.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow1 Example/CS/source.cs
index c18c5ac480e..056391e321e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow1 Example/CS/source.cs
@@ -8,11 +8,11 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void GetParentRowForTable(DataTable thisTable,
+ private void GetParentRowForTable(DataTable thisTable,
string relation, DataRowVersion version)
{
if(thisTable ==null){return;}
- // For each row in the table, print column 1
+ // For each row in the table, print column 1
// of the parent DataRow.
DataRow parentRow;
foreach(DataRow row in thisTable.Rows)
@@ -22,7 +22,7 @@ private void GetParentRowForTable(DataTable thisTable,
Console.Write("\t parent row: " + parentRow[1]+ "\n");
}
}
-
+
private void CallGetParentRowForTable()
{
// An example of calling the function.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow2 Example/CS/source.cs
index 622b80e67ee..450a999559c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow2 Example/CS/source.cs
@@ -8,11 +8,11 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void GetParentRowForTable(DataTable thisTable,
+ private void GetParentRowForTable(DataTable thisTable,
DataRelation relation)
{
if(thisTable ==null){return;}
- // For each row in the table, print column 1
+ // For each row in the table, print column 1
// of the parent DataRow.
DataRow parentRow;
foreach(DataRow row in thisTable.Rows)
@@ -22,7 +22,7 @@ private void GetParentRowForTable(DataTable thisTable,
Console.Write("\table parent row: " + parentRow[1]+ "\n");
}
}
-
+
private void CallGetParentRowForTable()
{
// An example of calling the function.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow3 Example/CS/source.cs
index 5fd953d68a8..c9e3dd24048 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.GetParentRow3 Example/CS/source.cs
@@ -8,12 +8,12 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void GetParentRowForTable(DataTable thisTable,
+ private void GetParentRowForTable(DataTable thisTable,
DataRelation relation,
- DataRowVersion version)
+ DataRowVersion version)
{
if(thisTable ==null){return;}
- // For each row in the table, print column 1 of the
+ // For each row in the table, print column 1 of the
// parent DataRow.
DataRow parentRow;
foreach(DataRow row in thisTable.Rows)
@@ -23,8 +23,8 @@ private void GetParentRowForTable(DataTable thisTable,
Console.Write("\table parent row: " + parentRow[1]+ "\n");
}
}
-
- private void CallGetParentRowForTable()
+
+ private void CallGetParentRowForTable()
{
// An example of calling the function.
DataTable thisTable = DataSet1.Tables["Products"];
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.HasErrors Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.HasErrors Example/CS/source.cs
index c4814f48583..ab3c8cad026 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.HasErrors Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.HasErrors Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
private void GetAllErrs(DataRow row)
{
// Declare an array variable for DataColumn objects.
- DataColumn[] colArr;
+ DataColumn[] colArr;
// If the Row has errors, check use GetColumnsInError.
if(row.HasErrors)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.ItemArray Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.ItemArray Example/CS/source.cs
index d4ad9645192..746d9f8c13d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.ItemArray Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.ItemArray Example/CS/source.cs
@@ -26,23 +26,23 @@ private void CreateRowsWithItemArray()
}
PrintTable(dt);
}
-
+
private DataTable MakeTableWithAutoIncrement()
{
// Make a table with one AutoIncrement column.
DataTable table = new DataTable("table");
- DataColumn idColumn = new DataColumn("id",
+ DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"));
idColumn.AutoIncrement = true;
idColumn.AutoIncrementSeed = 10;
table.Columns.Add(idColumn);
-
- DataColumn firstNameColumn = new DataColumn("Item",
+
+ DataColumn firstNameColumn = new DataColumn("Item",
Type.GetType("System.String"));
table.Columns.Add(firstNameColumn);
return table;
}
-
+
private void PrintTable(DataTable table)
{
foreach(DataRow row in table.Rows)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.RowError Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.RowError Example/CS/source.cs
index 0bc76e77091..8478b82aed4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.RowError Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.RowError Example/CS/source.cs
@@ -11,18 +11,18 @@ public class Form1: Form
//
private void SetRowErrors(DataTable table)
{
- // Set error text for ten rows.
+ // Set error text for ten rows.
for(int i = 0; i < 10; i++)
{
// Insert column 1 value into each error.
- table.Rows[i].RowError = "ERROR: "
+ table.Rows[i].RowError = "ERROR: "
+ table.Rows[i][1];
}
// Get the DataSet for the table, and test it for errors.
DataSet dataSet = table.DataSet;
TestForErrors(dataSet);
}
-
+
private void TestForErrors(DataSet dataSet)
{
// Test for errors. If DataSet has errors, test each table.
@@ -31,19 +31,19 @@ private void TestForErrors(DataSet dataSet)
foreach(DataTable tempDataTable in dataSet.Tables)
{
// If the table has errors, then print them.
- if(tempDataTable.HasErrors)
+ if(tempDataTable.HasErrors)
PrintRowErrs(tempDataTable);
}
// Refresh the DataGrid to see the error-marked rows.
dataGrid1.Refresh();
}
}
-
+
private void PrintRowErrs(DataTable table)
{
foreach(DataRow row in table.Rows)
{
- if(row.HasErrors)
+ if(row.HasErrors)
{
Console.WriteLine(row.RowError);
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.RowState Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.RowState Example/CS/source.cs
index 709d0c64393..3ec93ed21ea 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.RowState Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.RowState Example/CS/source.cs
@@ -13,29 +13,29 @@ private void DemonstrateRowState()
// Run a function to create a DataTable with one column.
DataTable table = MakeTable();
DataRow row;
-
+
// Create a new DataRow.
row = table.NewRow();
// Detached row.
Console.WriteLine("New Row " + row.RowState);
-
+
table.Rows.Add(row);
// New row.
Console.WriteLine("AddRow " + row.RowState);
-
+
table.AcceptChanges();
// Unchanged row.
Console.WriteLine("AcceptChanges " + row.RowState);
-
+
row["FirstName"] = "Scott";
// Modified row.
Console.WriteLine("Modified " + row.RowState);
-
+
row.Delete();
// Deleted row.
Console.WriteLine("Deleted " + row.RowState);
}
-
+
private DataTable MakeTable()
{
// Make a simple table with one column.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.SetColumnError Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.SetColumnError Example/CS/source.cs
index 2aa4001acf2..e0d4673968a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.SetColumnError Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.SetColumnError Example/CS/source.cs
@@ -15,7 +15,7 @@ private void SetColError(DataRow row, int columnIndex)
// Set the error for the specified column of the row.
row.SetColumnError(columnIndex, errorString);
}
-
+
private void PrintColError(DataRow row, int columnIndex)
{
// Print the error of a specified column.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this Example/CS/source.cs
index 897ba47bba1..5da601862d7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this Example/CS/source.cs
@@ -8,13 +8,13 @@ public class Form1: Form
protected DataSet DataSet1;
//
- private void DataGrid1_Click(object sender,
+ private void DataGrid1_Click(object sender,
System.EventArgs e)
{
// Get the DataTable the grid is bound to.
DataGrid thisGrid = (DataGrid) sender;
DataTable table = (DataTable) thisGrid.DataSource;
- DataRow currentRow =
+ DataRow currentRow =
table.Rows[thisGrid.CurrentCell.RowNumber];
// Get the value of the column 1 in the DataTable.
@@ -22,7 +22,7 @@ private void DataGrid1_Click(object sender,
// You can also use the name of the column:
// Console.WriteLine(currentRow["FirstName"])
}
-
+
private void SetDataRowValue(DataGrid grid, object newValue)
{
// Set the value of the last column in the last row of a DataGrid.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this1 Example/CS/source.cs
index eb2b994d923..bee0c3600cd 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this1 Example/CS/source.cs
@@ -14,7 +14,7 @@ private void DataGrid1_Click(
// Get the DataTable the grid is bound to.
DataGrid thisGrid = (DataGrid) sender;
DataTable table = (DataTable) thisGrid.DataSource;
- DataRow currentRow =
+ DataRow currentRow =
table.Rows[thisGrid.CurrentCell.RowNumber];
// Get the value of the column 1 in the DataTable.
@@ -22,11 +22,11 @@ private void DataGrid1_Click(
// You can also use the index:
// Console.WriteLine(currentRow[1]);
}
-
+
private void SetDataRowValue(
DataGrid grid, object newValue)
{
- // Set the value of the first column in
+ // Set the value of the first column in
// the last row of a DataGrid.
DataTable table = (DataTable) grid.DataSource;
DataRow row = table.Rows[table.Rows.Count-1];
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this4 Example/CS/source.cs
index 3ec17fcc22b..b8082fb52dc 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this4 Example/CS/source.cs
@@ -11,14 +11,14 @@ public class Form1: Form
//
private void DataGrid1_Click(object sender, System.EventArgs e)
{
- // Set the current row using the RowNumber
+ // Set the current row using the RowNumber
// property of the CurrentCell.
DataRow currentRow =
((DataTable)(DataGrid1.DataSource)).
Rows[DataGrid1.CurrentCell.RowNumber];
// Print the current value of the column named "FirstName."
- Console.WriteLine(currentRow["FirstName",
+ Console.WriteLine(currentRow["FirstName",
DataRowVersion.Current]);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this5 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this5 Example/CS/source.cs
index 19bb53d747c..2ddf4c40570 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this5 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRow.this5 Example/CS/source.cs
@@ -9,13 +9,13 @@ public class Form1: Form
protected DataGrid DataGrid1;
//
- private void DataGrid1_Click(object sender,
- System.EventArgs e)
+ private void DataGrid1_Click(object sender,
+ System.EventArgs e)
{
- DataTable dataGridTable =
+ DataTable dataGridTable =
(DataTable)DataGrid1.DataSource;
- // Set the current row using the RowNumber
+ // Set the current row using the RowNumber
// property of the CurrentCell.
DataRow currentRow = dataGridTable.Rows[DataGrid1.CurrentCell.RowNumber];
DataColumn column = dataGridTable.Columns[1];
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection Example/CS/source.cs
index e18ce5d082e..c7a3167b073 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection Example/CS/source.cs
@@ -19,7 +19,7 @@ private void ShowRows(DataTable table)
Console.WriteLine(row[1]);
}
}
-
+
private void AddRow(DataTable table)
{
DataRowCollection rowCollection = table.Rows;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection.Add Example/CS/source.cs
index e18ce5d082e..c7a3167b073 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection.Add Example/CS/source.cs
@@ -19,7 +19,7 @@ private void ShowRows(DataTable table)
Console.WriteLine(row[1]);
}
}
-
+
private void AddRow(DataTable table)
{
DataRowCollection rowCollection = table.Rows;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection.Find Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection.Find Example/CS/source.cs
index 24f1b147637..61f7efe16cf 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection.Find Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowCollection.Find Example/CS/source.cs
@@ -9,10 +9,10 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- private void FindInPrimaryKeyColumn(DataTable table,
+ private void FindInPrimaryKeyColumn(DataTable table,
long pkValue)
{
- // Find the number pkValue in the primary key
+ // Find the number pkValue in the primary key
// column of the table.
DataRow foundRow = table.Rows.Find(pkValue);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowState Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowState Example/CS/source.cs
index 8b04fc33d84..94bf700e054 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowState Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowState Example/CS/source.cs
@@ -13,29 +13,29 @@ private void DemonstrateRowState() {
//Run a function to create a DataTable with one column.
DataTable myTable = MakeTable();
DataRow myRow;
-
+
// Create a new DataRow.
myRow = myTable.NewRow();
// Detached row.
Console.WriteLine("New Row " + myRow.RowState);
-
+
myTable.Rows.Add(myRow);
// New row.
Console.WriteLine("AddRow " + myRow.RowState);
-
+
myTable.AcceptChanges();
// Unchanged row.
Console.WriteLine("AcceptChanges " + myRow.RowState);
-
+
myRow["FirstName"] = "Scott";
// Modified row.
Console.WriteLine("Modified " + myRow.RowState);
-
+
myRow.Delete();
// Deleted row.
Console.WriteLine("Deleted " + myRow.RowState);
}
-
+
private DataTable MakeTable(){
// Make a simple table with one column.
DataTable dt = new DataTable("myTable");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowView.BeginEdit Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowView.BeginEdit Example/CS/source.cs
index 0ccb24f9259..df60b105fa7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowView.BeginEdit Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowView.BeginEdit Example/CS/source.cs
@@ -9,20 +9,20 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- private void EditDataRowView(DataRowView rowView,
- string columnToEdit)
+ private void EditDataRowView(DataRowView rowView,
+ string columnToEdit)
{
rowView.BeginEdit();
rowView[columnToEdit] = textBox1.Text;
// Validate the input with a function.
if (ValidateCompanyName(rowView[columnToEdit]))
- rowView.EndEdit();
+ rowView.EndEdit();
else
rowView.CancelEdit();
}
-
- private bool ValidateCompanyName(object valuetoCheck)
+
+ private bool ValidateCompanyName(object valuetoCheck)
{
// Insert code to validate the value.
return true;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowView.Row Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowView.Row Example/CS/source.cs
index 48fb98d2613..6bbe2916e5c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowView.Row Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataRowView.Row Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- private void ShowColumn3()
+ private void ShowColumn3()
{
DataView view = (DataView) dataGrid1.DataSource;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet Example/CS/source.cs
index a6cc38ab455..db5bf0d81f8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet Example/CS/source.cs
@@ -43,7 +43,7 @@ private static void ConnectToData(string connectionString)
adapter.Fill(dataSet);
// Create a second Adapter and Command to get
- // the Products table, a child table of Suppliers.
+ // the Products table, a child table of Suppliers.
SqlDataAdapter productsAdapter = new SqlDataAdapter();
productsAdapter.TableMappings.Add("Table", "Products");
@@ -77,7 +77,7 @@ private static void ConnectToData(string connectionString)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=Northwind;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Clear Example/CS/source.cs
index c0a139f386f..8d83310ab91 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Clear Example/CS/source.cs
@@ -15,7 +15,7 @@ private void ClearDataSet(DataSet dataSet)
// To test, print the number rows in each table.
foreach(DataTable table in dataSet.Tables)
{
- Console.WriteLine(table.TableName + "Rows.Count = "
+ Console.WriteLine(table.TableName + "Rows.Count = "
+ table.Rows.Count.ToString());
}
// Clear all rows of each table.
@@ -24,7 +24,7 @@ private void ClearDataSet(DataSet dataSet)
// Print the number of rows again.
foreach(DataTable table in dataSet.Tables)
{
- Console.WriteLine(table.TableName + "Rows.Count = "
+ Console.WriteLine(table.TableName + "Rows.Count = "
+ table.Rows.Count.ToString());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.DataSetName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.DataSetName Example/CS/source.cs
index d937b263e8e..c90c68daf06 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.DataSetName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.DataSetName Example/CS/source.cs
@@ -20,7 +20,7 @@ private void CreateDataSet()
// Add a DataColumn to the DataTable.
dataSet.Tables["Suppliers"].Columns.Add
- (new DataColumn("CompanyName",
+ (new DataColumn("CompanyName",
System.Type.GetType("System.String")));
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.EnforceConstraints Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.EnforceConstraints Example/CS/source.cs
index ec866f4e8ed..8268f6c6d9b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.EnforceConstraints Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.EnforceConstraints Example/CS/source.cs
@@ -12,18 +12,18 @@ public class Form1: Form
//
private void DemonstrateEnforceConstraints()
{
- // Create a DataSet with one table, one column and
+ // Create a DataSet with one table, one column and
// a UniqueConstraint.
DataSet dataSet= new DataSet("dataSet");
DataTable table = new DataTable("table");
DataColumn column = new DataColumn("col1");
- // A UniqueConstraint is added when the Unique
+ // A UniqueConstraint is added when the Unique
// property is true.
column.Unique=true;
table.Columns.Add(column);
dataSet.Tables.Add(table);
- Console.WriteLine("constraints.count: " +
+ Console.WriteLine("constraints.count: " +
table.Constraints.Count);
// add five rows.
@@ -35,7 +35,7 @@ private void DemonstrateEnforceConstraints()
table.Rows.Add(row);
}
table.AcceptChanges();
-
+
dataSet.EnforceConstraints=false;
// Change the values of all rows to 1.
foreach(DataRow thisRow in table.Rows)
@@ -50,7 +50,7 @@ private void DemonstrateEnforceConstraints()
catch(System.Data.ConstraintException e)
{
// Process exception and return.
- Console.WriteLine("Exception of type {0} occurred.",
+ Console.WriteLine("Exception of type {0} occurred.",
e.GetType());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetChanges Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetChanges Example/CS/source.cs
index 6495b882637..ec290688555 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetChanges Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetChanges Example/CS/source.cs
@@ -12,21 +12,21 @@ public class Form1: Form
//
private void DemonstrateMerge()
{
- // Create a DataSet with one table, two columns,
+ // Create a DataSet with one table, two columns,
// and three rows.
DataSet dataSet = new DataSet("dataSet");
DataTable table = new DataTable("Items");
- DataColumn idColumn = new DataColumn("id",
+ DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"),"");
idColumn.AutoIncrement=true;
- DataColumn itemColumn = new DataColumn("Item",
+ DataColumn itemColumn = new DataColumn("Item",
Type.GetType("System.Int32"),"");
// DataColumn array to set primary key.
DataColumn[] keyColumn= new DataColumn[1];
DataRow row;
- // Create variable for temporary DataSet.
+ // Create variable for temporary DataSet.
DataSet changesDataSet;
// Add RowChanged event handler for the table.
@@ -63,9 +63,9 @@ private void DemonstrateMerge()
table.Rows[1].RowError= "over 100";
PrintValues(dataSet, "Modified and New Values");
- // If the table has changes or errors,
+ // If the table has changes or errors,
// create a subset DataSet.
- if(dataSet.HasChanges(DataRowState.Modified |
+ if(dataSet.HasChanges(DataRowState.Modified |
DataRowState.Added)&& dataSet.HasErrors)
{
// Use GetChanges to extract subset.
@@ -94,18 +94,18 @@ private void DemonstrateMerge()
new DataColumn("newColumn"));
PrintValues(changesDataSet, "Reconciled subset values");
// Merge changes back to first DataSet.
- dataSet.Merge(changesDataSet, false,
+ dataSet.Merge(changesDataSet, false,
System.Data.MissingSchemaAction.Add);
}
PrintValues(dataSet, "Merged Values");
}
-
+
private void Row_Changed(object sender, DataRowChangeEventArgs e)
{
- Console.WriteLine("Row Changed " + e.Action.ToString()
+ Console.WriteLine("Row Changed " + e.Action.ToString()
+ "\table" + e.Row.ItemArray[0]);
}
-
+
private void PrintValues(DataSet dataSet, string label)
{
Console.WriteLine(label + "\n");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetChanges1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetChanges1 Example/CS/source.cs
index 834f4d07276..f88778bad8c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetChanges1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetChanges1 Example/CS/source.cs
@@ -20,7 +20,7 @@ private void UpdateDataSet(DataSet dataSet)
// Create temporary DataSet variable and
// GetChanges for modified rows only.
- DataSet tempDataSet =
+ DataSet tempDataSet =
dataSet.GetChanges(DataRowState.Modified);
// Check the DataSet for errors.
@@ -28,7 +28,7 @@ private void UpdateDataSet(DataSet dataSet)
{
// Insert code to resolve errors.
}
- // After fixing errors, update the data source with
+ // After fixing errors, update the data source with
// the DataAdapter used to create the DataSet.
adapter.Update(tempDataSet);
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetXml Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetXml Example/CS/source.cs
index abd5908fe9d..e73da0197ca 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetXml Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetXml Example/CS/source.cs
@@ -11,7 +11,7 @@ public static void Main()
//
private static void DemonstrateGetXml()
{
- // Create a DataSet with one table containing
+ // Create a DataSet with one table containing
// two columns and 10 rows.
DataSet dataSet = new DataSet("dataSet");
DataTable table = dataSet.Tables.Add("Items");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetXmlSchema Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetXmlSchema Example/CS/source.cs
index abd5908fe9d..e73da0197ca 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetXmlSchema Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.GetXmlSchema Example/CS/source.cs
@@ -11,7 +11,7 @@ public static void Main()
//
private static void DemonstrateGetXml()
{
- // Create a DataSet with one table containing
+ // Create a DataSet with one table containing
// two columns and 10 rows.
DataSet dataSet = new DataSet("dataSet");
DataTable table = dataSet.Tables.Add("Items");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.HasChanges Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.HasChanges Example/CS/source.cs
index f0164e1b06c..b51bd545866 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.HasChanges Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.HasChanges Example/CS/source.cs
@@ -28,7 +28,7 @@ private void UpdateDataSet(DataSet dataSet)
{
// Insert code to resolve errors.
}
- // After fixing errors, update the data source with
+ // After fixing errors, update the data source with
// the DataAdapter used to create the DataSet.
myOleDbDataAdapter.Update(tempDataSet);
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.HasErrors Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.HasErrors Example/CS/source.cs
index d4a5f415d99..6a5f79b92d1 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.HasErrors Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.HasErrors Example/CS/source.cs
@@ -22,7 +22,7 @@ private void CheckForErrors()
PrintRowErrs(DataSet1);
}
}
-
+
private void PrintRowErrs(DataSet dataSet)
{
foreach(DataTable table in dataSet.Tables)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge Example/CS/source.cs
index 1f24ffafac4..82f3c10db26 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge Example/CS/source.cs
@@ -10,25 +10,25 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- private void DemonstrateMerge()
+ private void DemonstrateMerge()
{
// Create a DataSet with one table, two columns, and three rows.
DataSet dataSet = new DataSet("dataSet");
DataTable table = new DataTable("Items");
- DataColumn idColumn = new DataColumn("id",
+ DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"));
idColumn.AutoIncrement=true;
- DataColumn itemColumn = new DataColumn("Item",
+ DataColumn itemColumn = new DataColumn("Item",
Type.GetType("System.Int32"));
// DataColumn array to set primary key.
DataColumn[] keyColumn= new DataColumn[1];
DataRow row;
- // Create variable for temporary DataSet.
+ // Create variable for temporary DataSet.
DataSet changeDataSet;
- // Add columns to table, and table to DataSet.
+ // Add columns to table, and table to DataSet.
table.Columns.Add(idColumn);
table.Columns.Add(itemColumn);
dataSet.Tables.Add(table);
@@ -62,7 +62,7 @@ private void DemonstrateMerge()
table.Rows[1].RowError= "over 100";
PrintValues(dataSet, "Modified and New Values");
// If the table has changes or errors, create a subset DataSet.
- if(dataSet.HasChanges(DataRowState.Modified |
+ if(dataSet.HasChanges(DataRowState.Modified |
DataRowState.Added)& dataSet.HasErrors)
{
// Use GetChanges to extract subset.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge2 Example/CS/source.cs
index 7bf659fa3ae..d15bb050333 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge2 Example/CS/source.cs
@@ -12,20 +12,20 @@ public class Form1: Form
//
private void DemonstrateMergeMissingSchema()
{
- // Create a DataSet with one table, two columns,
+ // Create a DataSet with one table, two columns,
// and three rows.
DataSet dataSet = new DataSet("dataSet");
DataTable table = new DataTable("Items");
- DataColumn idColumn = new DataColumn("id",
+ DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"));
idColumn.AutoIncrement=true;
- DataColumn itemColumn = new DataColumn("Item",
+ DataColumn itemColumn = new DataColumn("Item",
Type.GetType("System.Int32"));
// DataColumn array to set primary key.
DataColumn[] keyColumn= new DataColumn[1];
DataRow row;
- // Create variable for temporary DataSet.
+ // Create variable for temporary DataSet.
DataSet changeDataSet;
// Add RowChanged event handler for the table.
@@ -64,7 +64,7 @@ private void DemonstrateMergeMissingSchema()
table.Rows[1].RowError= "over 100";
PrintValues(dataSet, "Modified and New Values");
// If the table has changes or errors, create a subset DataSet.
- if(dataSet.HasChanges(DataRowState.Modified |
+ if(dataSet.HasChanges(DataRowState.Modified |
DataRowState.Added)& dataSet.HasErrors)
{
// Use GetChanges to extract subset.
@@ -80,7 +80,7 @@ private void DemonstrateMergeMissingSchema()
foreach(DataRow changeRow in changeTable.Rows)
{
//Console.WriteLine(changeRow["Item"]);
- if((int)changeRow["Item",
+ if((int)changeRow["Item",
DataRowVersion.Current ]> 100)
{
changeRow.RejectChanges();
@@ -105,13 +105,13 @@ private void DemonstrateMergeMissingSchema()
}
PrintValues(dataSet, "Merged Values");
}
-
+
private void Row_Changed(object sender, DataRowChangeEventArgs e)
{
- Console.WriteLine("Row Changed " + e.Action.ToString()
+ Console.WriteLine("Row Changed " + e.Action.ToString()
+ "\table" + e.Row.ItemArray[0]);
}
-
+
private void PrintValues(DataSet dataSet, string label)
{
Console.WriteLine("\n" + label);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge3 Example/CS/source.cs
index 52391625a4a..d9feae8b477 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge3 Example/CS/source.cs
@@ -20,9 +20,9 @@ private void DemonstrateMergeTable()
dataSet.Tables.Add(table);
// Add columns
- DataColumn c1 = new DataColumn("id",
+ DataColumn c1 = new DataColumn("id",
Type.GetType("System.Int32"),"");
- DataColumn c2 = new DataColumn("Item",
+ DataColumn c2 = new DataColumn("Item",
Type.GetType("System.Int32"),"");
table.Columns.Add(c1);
table.Columns.Add(c2);
@@ -35,7 +35,7 @@ private void DemonstrateMergeTable()
table.PrimaryKey=keyCol;
// Add a RowChanged event handler for the table.
- table.RowChanged += new
+ table.RowChanged += new
DataRowChangeEventHandler(Row_Changed);
// Add ten rows.
@@ -70,14 +70,14 @@ private void DemonstrateMergeTable()
dataSet.Merge(t2);
PrintValues(dataSet, "Merged With table.");
}
-
- private void Row_Changed(object sender,
+
+ private void Row_Changed(object sender,
DataRowChangeEventArgs e)
{
- Console.WriteLine("Row Changed " + e.Action.ToString()
+ Console.WriteLine("Row Changed " + e.Action.ToString()
+ "\table" + e.Row.ItemArray[0]);
}
-
+
private void PrintValues(DataSet dataSet, string label)
{
Console.WriteLine("\n" + label);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge4 Example/CS/source.cs
index d065c77dd75..bb69fc0cb16 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.Merge4 Example/CS/source.cs
@@ -20,10 +20,10 @@ private void DemonstrateMergeTableAddSchema()
dataSet.Tables.Add(table);
// Create and add two columns to the DataTable
- DataColumn idColumn = new DataColumn("id",
+ DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"),"");
idColumn.AutoIncrement=true;
- DataColumn itemColumn = new DataColumn("Item",
+ DataColumn itemColumn = new DataColumn("Item",
Type.GetType("System.Int32"),"");
table.Columns.Add(idColumn);
table.Columns.Add(itemColumn);
@@ -51,7 +51,7 @@ private void DemonstrateMergeTableAddSchema()
DataTable cloneTable = table.Clone();
cloneTable.Columns.Add("extra", typeof(string));
- // Add two rows. Note that the id column can'table be the
+ // Add two rows. Note that the id column can'table be the
// same as existing rows in the DataSet table.
DataRow newRow;
newRow=cloneTable.NewRow();
@@ -59,7 +59,7 @@ private void DemonstrateMergeTableAddSchema()
newRow["Item"]=555;
newRow["extra"]= "extra Column 1";
cloneTable.Rows.Add(newRow);
-
+
newRow=cloneTable.NewRow();
newRow["id"]= 13;
newRow["Item"]=665;
@@ -71,14 +71,14 @@ private void DemonstrateMergeTableAddSchema()
dataSet.Merge(cloneTable,false,MissingSchemaAction.Add);
PrintValues(dataSet, "Merged With Table, Schema Added");
}
-
- private void Row_Changed(object sender,
+
+ private void Row_Changed(object sender,
DataRowChangeEventArgs e)
{
- Console.WriteLine("Row Changed " + e.Action.ToString()
+ Console.WriteLine("Row Changed " + e.Action.ToString()
+ "\table" + e.Row.ItemArray[0]);
}
-
+
private void PrintValues(DataSet dataSet, string label)
{
Console.WriteLine("\n" + label);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.MergeFailed Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.MergeFailed Example/CS/source.cs
index 1423e2d3139..d427c6b6981 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.MergeFailed Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.MergeFailed Example/CS/source.cs
@@ -29,7 +29,7 @@ private static void DemonstrateMergeFailedEvent()
// Add MergeFailed event handler for the table.
dataSet.MergeFailed += new MergeFailedEventHandler(Merge_Failed);
- // Create a second DataTable identical to the first,
+ // Create a second DataTable identical to the first,
DataTable t2 = table.Clone();
// Set the primary key of the new table to the second column.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.OnRemoveTable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.OnRemoveTable Example/CS/source.cs
index 6e76493871b..d73b8aa88c7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.OnRemoveTable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.OnRemoveTable Example/CS/source.cs
@@ -22,7 +22,7 @@ public class DerivedDataSet: DataSet
protected override void OnRemoveTable(DataTable table)
{
Console.WriteLine(
- "The '{0}' DataTable has been removed from the DataSet",
+ "The '{0}' DataTable has been removed from the DataSet",
table.TableName);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml Example/CS/source.cs
index bb90fa1ce84..64da1c2278b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml Example/CS/source.cs
@@ -16,7 +16,7 @@ private void DemonstrateReadWriteXMLDocumentWithXMLReader()
DataSet OriginalDataSet = new DataSet("dataSet");
OriginalDataSet.Namespace= "NetFrameWork";
DataTable table = new DataTable("table");
- DataColumn idColumn = new DataColumn("id",
+ DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"));
idColumn.AutoIncrement= true;
@@ -35,43 +35,43 @@ private void DemonstrateReadWriteXMLDocumentWithXMLReader()
}
OriginalDataSet.AcceptChanges();
- // Print out values of each table in the DataSet
+ // Print out values of each table in the DataSet
// using the function defined below.
PrintValues(OriginalDataSet, "Original DataSet");
// Write the XML schema and data to file with FileStream.
string xmlFilename = "XmlDocument.xml";
- // Create FileStream
- System.IO.FileStream fsWriteXml =
+ // Create FileStream
+ System.IO.FileStream fsWriteXml =
new System.IO.FileStream
(xmlFilename, System.IO.FileMode.Create);
// Create an XmlTextWriter to write the file.
- System.Xml.XmlTextWriter xmlWriter =
+ System.Xml.XmlTextWriter xmlWriter =
new System.Xml.XmlTextWriter
(fsWriteXml, System.Text.Encoding.Unicode);
// Use WriteXml to write the document.
- OriginalDataSet.WriteXml(xmlWriter, XmlWriteMode.WriteSchema);
+ OriginalDataSet.WriteXml(xmlWriter, XmlWriteMode.WriteSchema);
// Close the FileStream.
fsWriteXml.Close();
-
+
// Dispose of the original DataSet.
OriginalDataSet.Dispose();
// Create a new DataSet.
DataSet newDataSet = new DataSet("New DataSet");
-
- // Read the XML document back in.
+
+ // Read the XML document back in.
// Create new FileStream to read schema with.
- System.IO.FileStream fsReadXml =
+ System.IO.FileStream fsReadXml =
new System.IO.FileStream
(xmlFilename, System.IO.FileMode.Open);
// Create an XmlTextReader to read the file.
- System.Xml.XmlTextReader xmlReader =
+ System.Xml.XmlTextReader xmlReader =
new System.Xml.XmlTextReader(fsReadXml);
// Read the XML document into the DataSet.
@@ -79,12 +79,12 @@ private void DemonstrateReadWriteXMLDocumentWithXMLReader()
// Close the XmlTextReader
xmlReader.Close();
-
- // Print out values of each table in the DataSet
+
+ // Print out values of each table in the DataSet
// fusing the unction defined below.
PrintValues(newDataSet,"New DataSet");
}
-
+
private void PrintValues(DataSet dataSet, string label)
{
Console.WriteLine("\n" + label);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml1 Example/CS/source.cs
index c1bbf60c33c..29a1b2785cc 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml1 Example/CS/source.cs
@@ -15,7 +15,7 @@ private void DemonstrateReadWriteXMLDocumentWithFileStream()
// Create a DataSet with one table and two columns.
DataSet originalDataSet = new DataSet("dataSet");
DataTable table = new DataTable("table");
- DataColumn idColumn = new DataColumn("id",
+ DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"));
idColumn.AutoIncrement= true;
@@ -34,7 +34,7 @@ private void DemonstrateReadWriteXMLDocumentWithFileStream()
}
originalDataSet.AcceptChanges();
- // Print out values of each table in the DataSet
+ // Print out values of each table in the DataSet
// using the function defined below.
PrintValues(originalDataSet, "Original DataSet");
@@ -48,23 +48,23 @@ private void DemonstrateReadWriteXMLDocumentWithFileStream()
// Close the FileStream.
streamWrite.Close();
-
+
// Dispose of the original DataSet.
originalDataSet.Dispose();
// Create a new DataSet.
DataSet newDataSet = new DataSet("New DataSet");
-
- // Read the XML document back in.
+
+ // Read the XML document back in.
// Create new FileStream to read schema with.
System.IO.FileStream streamRead = new System.IO.FileStream
(xmlFilename,System.IO.FileMode.Open);
newDataSet.ReadXml(streamRead);
- // Print out values of each table in the DataSet
+ // Print out values of each table in the DataSet
// using the function defined below.
PrintValues(newDataSet,"New DataSet");
}
-
+
private void PrintValues(DataSet dataSet, string label)
{
Console.WriteLine("\n" + label);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml2 Example/CS/source.cs
index c1bbf60c33c..29a1b2785cc 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml2 Example/CS/source.cs
@@ -15,7 +15,7 @@ private void DemonstrateReadWriteXMLDocumentWithFileStream()
// Create a DataSet with one table and two columns.
DataSet originalDataSet = new DataSet("dataSet");
DataTable table = new DataTable("table");
- DataColumn idColumn = new DataColumn("id",
+ DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"));
idColumn.AutoIncrement= true;
@@ -34,7 +34,7 @@ private void DemonstrateReadWriteXMLDocumentWithFileStream()
}
originalDataSet.AcceptChanges();
- // Print out values of each table in the DataSet
+ // Print out values of each table in the DataSet
// using the function defined below.
PrintValues(originalDataSet, "Original DataSet");
@@ -48,23 +48,23 @@ private void DemonstrateReadWriteXMLDocumentWithFileStream()
// Close the FileStream.
streamWrite.Close();
-
+
// Dispose of the original DataSet.
originalDataSet.Dispose();
// Create a new DataSet.
DataSet newDataSet = new DataSet("New DataSet");
-
- // Read the XML document back in.
+
+ // Read the XML document back in.
// Create new FileStream to read schema with.
System.IO.FileStream streamRead = new System.IO.FileStream
(xmlFilename,System.IO.FileMode.Open);
newDataSet.ReadXml(streamRead);
- // Print out values of each table in the DataSet
+ // Print out values of each table in the DataSet
// using the function defined below.
PrintValues(newDataSet,"New DataSet");
}
-
+
private void PrintValues(DataSet dataSet, string label)
{
Console.WriteLine("\n" + label);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml3 Example/CS/source.cs
index 0dd00a3471e..5227bad51ad 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXml3 Example/CS/source.cs
@@ -16,7 +16,7 @@ private void DemonstrateReadWriteXMLDocumentWithStreamReader()
DataSet OriginalDataSet = new DataSet("dataSet");
OriginalDataSet.Namespace= "NetFrameWork";
DataTable table = new DataTable("table");
- DataColumn idColumn = new DataColumn("id",
+ DataColumn idColumn = new DataColumn("id",
Type.GetType("System.Int32"));
idColumn.AutoIncrement= true;
@@ -35,7 +35,7 @@ private void DemonstrateReadWriteXMLDocumentWithStreamReader()
}
OriginalDataSet.AcceptChanges();
- // Print out values of each table in the DataSet
+ // Print out values of each table in the DataSet
// using the function defined below.
PrintValues(OriginalDataSet, "Original DataSet");
@@ -54,11 +54,11 @@ private void DemonstrateReadWriteXMLDocumentWithStreamReader()
// Read the XML document into the DataSet.
newDataSet.ReadXml(xmlFilename);
- // Print out values of each table in the DataSet
+ // Print out values of each table in the DataSet
// using the function defined below.
PrintValues(newDataSet,"New DataSet");
}
-
+
private void PrintValues(DataSet dataSet, string label)
{
Console.WriteLine("\n" + label);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema Example/CS/source.cs
index 8376d77e156..4c0a5a9cf50 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema Example/CS/source.cs
@@ -23,7 +23,7 @@ private void ReadSchemaFromXmlTextReader()
(filename,System.IO.FileMode.Open);
// Create a new XmlTextReader object with the FileStream.
- System.Xml.XmlTextReader xmlReader=
+ System.Xml.XmlTextReader xmlReader=
new System.Xml.XmlTextReader(stream);
// Read the schema into the DataSet and close the reader.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema1 Example/CS/source.cs
index 65284ea88d1..dc32cdc6113 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema1 Example/CS/source.cs
@@ -16,9 +16,9 @@ private void ReadSchemaFromFileStream(DataSet thisDataSet)
// Modify this for your purposes.
string filename="Schema.xml";
- // Create the FileStream object with the file name,
+ // Create the FileStream object with the file name,
// and set to open the file.
- System.IO.FileStream stream =
+ System.IO.FileStream stream =
new System.IO.FileStream(filename,System.IO.FileMode.Open);
// Read the schema into the DataSet.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema2 Example/CS/source.cs
index 07f39435684..910680b2ce6 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ReadXmlSchema2 Example/CS/source.cs
@@ -19,7 +19,7 @@ private void ReadSchemaFromStreamReader()
string filename="Schema.xml";
// Create a StreamReader object with the file path and name.
- System.IO.StreamReader readStream =
+ System.IO.StreamReader readStream =
new System.IO.StreamReader(filename);
// Invoke the ReadXmlSchema method with the StreamReader object.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.RejectChanges Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.RejectChanges Example/CS/source.cs
index 4defd59fccd..5f7e75f7689 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.RejectChanges Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.RejectChanges Example/CS/source.cs
@@ -16,12 +16,12 @@ private void RejectChangesInDataSet()
DerivedDataSet derivedData = new DerivedDataSet();
// Insert code to change values.
-
+
// Invoke the RejectChanges method in the derived class.
derivedData.RejectDataSetChanges();
}
- public class DerivedDataSet:System.Data.DataSet
+ public class DerivedDataSet:System.Data.DataSet
{
public void RejectDataSetChanges()
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ShouldSerializeRelations Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ShouldSerializeRelations Example/CS/source.cs
index 9cab7f16321..f11fbfaa6a4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ShouldSerializeRelations Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ShouldSerializeRelations Example/CS/source.cs
@@ -5,11 +5,11 @@
using System.Windows.Forms;
//
-public class DerivedDataSet:System.Data.DataSet
+public class DerivedDataSet:System.Data.DataSet
{
public void ResetDataSetRelations()
{
- // Check the ShouldSerializeRelations methods
+ // Check the ShouldSerializeRelations methods
// before invoking Reset.
if(!this.ShouldSerializeRelations())
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ShouldSerializeTables Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ShouldSerializeTables Example/CS/source.cs
index 1c3b5c67d60..cc2ec9e0b92 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ShouldSerializeTables Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.ShouldSerializeTables Example/CS/source.cs
@@ -5,11 +5,11 @@
using System.Windows.Forms;
//
-public class DerivedDataSet:System.Data.DataSet
+public class DerivedDataSet:System.Data.DataSet
{
public void ResetDataSetRelations()
{
- // Check the ShouldPersistTable method
+ // Check the ShouldPersistTable method
// before invoking Reset.
if(!this.ShouldSerializeTables())
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml Example/CS/source.cs
index 735ec633ecb..a5fcf6a700a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml Example/CS/source.cs
@@ -10,7 +10,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- private void WriteXmlToFile(DataSet thisDataSet)
+ private void WriteXmlToFile(DataSet thisDataSet)
{
if (thisDataSet == null) { return; }
@@ -22,7 +22,7 @@ private void WriteXmlToFile(DataSet thisDataSet)
(filename, System.IO.FileMode.Create);
// Write to the file with the WriteXml method.
- thisDataSet.WriteXml(stream);
+ thisDataSet.WriteXml(stream);
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml6 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml6 Example/CS/source.cs
index 602e4441e73..c813d47f39d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml6 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml6 Example/CS/source.cs
@@ -10,7 +10,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- private void WriteXmlToFile(DataSet thisDataSet)
+ private void WriteXmlToFile(DataSet thisDataSet)
{
if (thisDataSet == null) { return; }
@@ -22,12 +22,12 @@ private void WriteXmlToFile(DataSet thisDataSet)
(filename, System.IO.FileMode.Create);
// Create an XmlTextWriter with the fileStream.
- System.Xml.XmlTextWriter xmlWriter =
- new System.Xml.XmlTextWriter(stream,
+ System.Xml.XmlTextWriter xmlWriter =
+ new System.Xml.XmlTextWriter(stream,
System.Text.Encoding.Unicode);
// Write to the file with the WriteXml method.
- thisDataSet.WriteXml(xmlWriter);
+ thisDataSet.WriteXml(xmlWriter);
xmlWriter.Close();
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml7 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml7 Example/CS/source.cs
index 923ed723095..b8b92a8f7e0 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml7 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXml7 Example/CS/source.cs
@@ -10,7 +10,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- private void WriteXmlToFile(DataSet thisDataSet)
+ private void WriteXmlToFile(DataSet thisDataSet)
{
if (thisDataSet == null) { return; }
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXmlSchema Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXmlSchema Example/CS/source.cs
index 9135f74839d..1439137d482 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXmlSchema Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXmlSchema Example/CS/source.cs
@@ -15,9 +15,9 @@ private void WriteSchemaWithFileStream(DataSet thisDataSet)
// Set the file path and name. Modify this for your purposes.
string filename="Schema.xml";
- // Create the FileStream object with the file name.
+ // Create the FileStream object with the file name.
// Use FileMode.Create.
- System.IO.FileStream stream =
+ System.IO.FileStream stream =
new System.IO.FileStream(filename,System.IO.FileMode.Create);
// Write the schema to the file.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXmlSchema2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXmlSchema2 Example/CS/source.cs
index bd0b124de3e..c18b9bdfd97 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXmlSchema2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataSet.WriteXmlSchema2 Example/CS/source.cs
@@ -20,8 +20,8 @@ private void WriteSchemaWithXmlTextWriter(DataSet thisDataSet)
(filename,System.IO.FileMode.Create);
// Create a new XmlTextWriter object with the FileStream.
- System.Xml.XmlTextWriter writer =
- new System.Xml.XmlTextWriter(stream,
+ System.Xml.XmlTextWriter writer =
+ new System.Xml.XmlTextWriter(stream,
System.Text.Encoding.Unicode);
// Write the schema into the DataSet and close the reader.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable Example/CS/source.cs
index bdb7460e077..0c9f2130bef 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable Example/CS/source.cs
@@ -12,16 +12,16 @@ public class Form1: Form
//
// Put the next line into the Declarations section.
private System.Data.DataSet dataSet;
-
+
private void MakeDataTables()
{
- // Run all of the functions.
+ // Run all of the functions.
MakeParentTable();
MakeChildTable();
MakeDataRelation();
BindToDataGrid();
}
-
+
private void MakeParentTable()
{
// Create a new DataTable.
@@ -29,9 +29,9 @@ private void MakeParentTable()
// Declare variables for DataColumn and DataRow objects.
DataColumn column;
DataRow row;
-
- // Create new DataColumn, set DataType,
- // ColumnName and add to DataTable.
+
+ // Create new DataColumn, set DataType,
+ // ColumnName and add to DataTable.
column = new DataColumn();
column.DataType = System.Type.GetType("System.Int32");
column.ColumnName = "id";
@@ -39,7 +39,7 @@ private void MakeParentTable()
column.Unique = true;
// Add the Column to the DataColumnCollection.
table.Columns.Add(column);
-
+
// Create second column.
column = new DataColumn();
column.DataType = System.Type.GetType("System.String");
@@ -50,18 +50,18 @@ private void MakeParentTable()
column.Unique = false;
// Add the column to the table.
table.Columns.Add(column);
-
+
// Make the ID column the primary key column.
DataColumn[] PrimaryKeyColumns = new DataColumn[1];
PrimaryKeyColumns[0] = table.Columns["id"];
table.PrimaryKey = PrimaryKeyColumns;
-
+
// Instantiate the DataSet variable.
dataSet = new DataSet();
// Add the new DataTable to the DataSet.
dataSet.Tables.Add(table);
-
- // Create three new DataRow objects and add
+
+ // Create three new DataRow objects and add
// them to the DataTable
for (int i = 0; i<= 2; i++)
{
@@ -71,14 +71,14 @@ private void MakeParentTable()
table.Rows.Add(row);
}
}
-
+
private void MakeChildTable()
{
// Create a new DataTable.
DataTable table = new DataTable("childTable");
DataColumn column;
DataRow row;
-
+
// Create first column and add to the DataTable.
column = new DataColumn();
column.DataType= System.Type.GetType("System.Int32");
@@ -90,7 +90,7 @@ private void MakeChildTable()
// Add the column to the DataColumnCollection.
table.Columns.Add(column);
-
+
// Create second column.
column = new DataColumn();
column.DataType= System.Type.GetType("System.String");
@@ -100,7 +100,7 @@ private void MakeChildTable()
column.ReadOnly = false;
column.Unique = false;
table.Columns.Add(column);
-
+
// Create third column.
column = new DataColumn();
column.DataType= System.Type.GetType("System.Int32");
@@ -110,10 +110,10 @@ private void MakeChildTable()
column.ReadOnly = false;
column.Unique = false;
table.Columns.Add(column);
-
+
dataSet.Tables.Add(table);
- // Create three sets of DataRow objects,
+ // Create three sets of DataRow objects,
// five rows each, and add to DataTable.
for(int i = 0; i <= 4; i ++)
{
@@ -140,23 +140,23 @@ private void MakeChildTable()
table.Rows.Add(row);
}
}
-
+
private void MakeDataRelation()
{
- // DataRelation requires two DataColumn
+ // DataRelation requires two DataColumn
// (parent and child) and a name.
- DataColumn parentColumn =
+ DataColumn parentColumn =
dataSet.Tables["ParentTable"].Columns["id"];
- DataColumn childColumn =
+ DataColumn childColumn =
dataSet.Tables["ChildTable"].Columns["ParentID"];
- DataRelation relation = new
+ DataRelation relation = new
DataRelation("parent2Child", parentColumn, childColumn);
dataSet.Tables["ChildTable"].ParentRelations.Add(relation);
}
-
+
private void BindToDataGrid()
{
- // Instruct the DataGrid to bind to the DataSet, with the
+ // Instruct the DataGrid to bind to the DataSet, with the
// ParentTable as the topmost DataTable.
dataGrid1.SetDataBinding(dataSet,"ParentTable");
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.AcceptChanges Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.AcceptChanges Example/CS/source.cs
index b41a7a8c6c8..3cecc35d457 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.AcceptChanges Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.AcceptChanges Example/CS/source.cs
@@ -14,7 +14,7 @@ private void AcceptOrReject(DataTable table)
{
// If there are errors, try to reconcile.
if(table.HasErrors)
- {
+ {
if(Reconcile(table))
{
// Fixed all errors.
@@ -32,7 +32,7 @@ private void AcceptOrReject(DataTable table)
table.AcceptChanges();
}
}
-
+
private bool Reconcile(DataTable thisTable)
{
foreach(DataRow row in thisTable.Rows)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ChildRelations Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ChildRelations Example/CS/source.cs
index 6f965afafb6..048bae9a110 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ChildRelations Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ChildRelations Example/CS/source.cs
@@ -59,7 +59,7 @@ public static DataSet CreateDataSet()
{
// add customer record
dataSet.Tables["Customers"].Rows.Add(
- new object[] { customerId,
+ new object[] { customerId,
string.Format("customer{0}", customerId) });
// add 5 order records for each customer
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Clear Example/CS/source.cs
index 6637aebb0ab..6a5f9bd3349 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Clear Example/CS/source.cs
@@ -19,7 +19,7 @@ private void ClearTable(DataTable table)
catch (DataException e)
{
// Process exception and return.
- Console.WriteLine("Exception of type {0} occurred.",
+ Console.WriteLine("Exception of type {0} occurred.",
e.GetType());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ColumnChanged Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ColumnChanged Example/CS/source.cs
index d4f617b5b84..f9388c3f089 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ColumnChanged Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ColumnChanged Example/CS/source.cs
@@ -22,14 +22,14 @@ private static void DataTableColumnChanged()
custTable.PrimaryKey = new DataColumn[] { custTable.Columns["id"] };
// add a ColumnChanged event handler for the table.
- custTable.ColumnChanged += new
+ custTable.ColumnChanged += new
DataColumnChangeEventHandler(Column_Changed );
// add ten rows
for(int id=1; id<=10; id++)
{
custTable.Rows.Add(
- new object[] { id, string.Format("customer{0}", id),
+ new object[] { id, string.Format("customer{0}", id),
string.Format("address{0}", id) });
}
@@ -44,7 +44,7 @@ private static void DataTableColumnChanged()
private static void Column_Changed(object sender, DataColumnChangeEventArgs e )
{
- Console.WriteLine("Column_Changed Event: name={0}; Column={1}; original name={2}",
+ Console.WriteLine("Column_Changed Event: name={0}; Column={1}; original name={2}",
e.Row["name"], e.Column.ColumnName, e.Row["name", DataRowVersion.Original]);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ColumnChanging Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ColumnChanging Example/CS/source.cs
index 6fffce49d6b..65741e37ba8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ColumnChanging Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.ColumnChanging Example/CS/source.cs
@@ -22,7 +22,7 @@ private static void DataTableColumnChanging()
custTable.PrimaryKey = new DataColumn[] { custTable.Columns["id"] };
// add a ColumnChanging event handler for the table.
- custTable.ColumnChanging += new
+ custTable.ColumnChanging += new
DataColumnChangeEventHandler(Column_Changing );
// add ten rows
@@ -42,11 +42,11 @@ private static void DataTableColumnChanging()
}
}
- private static void Column_Changing(object sender,
+ private static void Column_Changing(object sender,
DataColumnChangeEventArgs e )
{
Console.WriteLine(
- "Column_Changing Event: name={0}; Column={1}; proposed name={2}",
+ "Column_Changing Event: name={0}; Column={1}; proposed name={2}",
e.Row["name"], e.Column.ColumnName, e.ProposedValue );
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Constraints Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Constraints Example/CS/source.cs
index 6be69fe158b..3d17aa9b773 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Constraints Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Constraints Example/CS/source.cs
@@ -8,10 +8,10 @@ public class Form1
protected DataSet DataSet1;
//
- private void CreateConstraint(DataSet dataSet,
+ private void CreateConstraint(DataSet dataSet,
string table1, string table2, string column1, string column2)
{
- ForeignKeyConstraint idKeyRestraint = new
+ ForeignKeyConstraint idKeyRestraint = new
ForeignKeyConstraint(dataSet.Tables[table1].Columns[column1],
dataSet.Tables[table2].Columns[column2]);
@@ -21,7 +21,7 @@ private void CreateConstraint(DataSet dataSet,
// Set AcceptRejectRule to cascade changes.
idKeyRestraint.AcceptRejectRule = AcceptRejectRule.Cascade;
-
+
dataSet.Tables[table1].Constraints.Add(idKeyRestraint);
dataSet.EnforceConstraints = true;
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataSet Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataSet Example/CS/source.cs
index 61261ab18a1..9c3c8835bd6 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataSet Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataSet Example/CS/source.cs
@@ -13,7 +13,7 @@ public class Form1: Form
private DataSet GetDataSetFromTable()
{
DataTable table;
-
+
// Check to see if the DataGrid's DataSource
// is a DataTable.
if( dataGrid1.DataSource is DataTable)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataTable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataTable Example/CS/source.cs
index 63ce34a39de..51313007229 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataTable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataTable Example/CS/source.cs
@@ -14,25 +14,25 @@ private void MakeDataTableAndDisplay()
{
// Create new DataTable.
DataTable table = new DataTable();
-
+
// Declare DataColumn and DataRow variables.
DataColumn column;
DataRow row;
-
+
// Create new DataColumn, set DataType, ColumnName
- // and add to DataTable.
+ // and add to DataTable.
column = new DataColumn();
column.DataType = System.Type.GetType("System.Int32");
column.ColumnName = "id";
table.Columns.Add(column);
-
+
// Create second column.
column = new DataColumn();
column.DataType = Type.GetType("System.String");
column.ColumnName = "item";
table.Columns.Add(column);
-
- // Create new DataRow objects and add to DataTable.
+
+ // Create new DataRow objects and add to DataTable.
for(int i = 0; i < 10; i++)
{
row = table.NewRow();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataTable1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataTable1 Example/CS/source.cs
index dc8d1af5bb7..6be96c2b776 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataTable1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DataTable1 Example/CS/source.cs
@@ -14,25 +14,25 @@ private void MakeDataTableAndDisplay()
{
// Create new DataTable.
DataTable table = new DataTable("table");
-
+
// Declare DataColumn and DataRow variables.
DataColumn column;
DataRow row;
-
- // Create new DataColumn, set DataType,
- // ColumnName and add to DataTable.
+
+ // Create new DataColumn, set DataType,
+ // ColumnName and add to DataTable.
column = new DataColumn();
column.DataType = System.Type.GetType("System.Int32");
column.ColumnName = "id";
table.Columns.Add(column);
-
+
// Create second column.
column = new DataColumn();
column.DataType = Type.GetType("System.String");
column.ColumnName = "item";
table.Columns.Add(column);
-
- // Create new DataRow objects and add to DataTable.
+
+ // Create new DataRow objects and add to DataTable.
for(int i = 0; i < 10; i++)
{
row = table.NewRow();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DefaultView Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DefaultView Example/CS/source.cs
index 9fcb8b80b17..e602e619428 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DefaultView Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.DefaultView Example/CS/source.cs
@@ -13,18 +13,18 @@ public class Form1: Form
private void BindDataGrid()
{
DataTable table = new DataTable();
-
+
// Insert code to populate a DataTable with data.
// Bind grid to DataTable.
dataGrid1.DataSource = table;
}
-
+
private void ChangeRowFilter()
{
DataTable gridTable = (DataTable) dataGrid1.DataSource;
- // Set the RowFilter to display a company names that
+ // Set the RowFilter to display a company names that
// begin with A through I..
gridTable.DefaultView.RowFilter = "CompanyName < 'I'";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetChanges Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetChanges Example/CS/source.cs
index 3238be5ef91..88077112290 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetChanges Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetChanges Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Sample
{
//
- private void UpdateDataTable(DataTable table,
+ private void UpdateDataTable(DataTable table,
OleDbDataAdapter myDataAdapter)
{
DataTable xDataTable = table.GetChanges();
@@ -16,7 +16,7 @@ private void UpdateDataTable(DataTable table,
// Insert code to resolve errors.
}
- // After fixing errors, update the database with the DataAdapter
+ // After fixing errors, update the database with the DataAdapter
myDataAdapter.Update(xDataTable);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetChanges1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetChanges1 Example/CS/source.cs
index 13683d6b573..50e575ba94e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetChanges1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetChanges1 Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Sample
{
//
- private void ProcessDeletes(DataTable table,
+ private void ProcessDeletes(DataTable table,
OleDbDataAdapter adapter)
{
DataTable changeTable = table.GetChanges(DataRowState.Deleted);
@@ -16,7 +16,7 @@ private void ProcessDeletes(DataTable table,
// Insert code to resolve errors.
}
- // After fixing errors, update the database with the DataAdapter
+ // After fixing errors, update the database with the DataAdapter
adapter.Update(changeTable);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetErrors Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetErrors Example/CS/source.cs
index 0d3e4c1beca..e032be69ddc 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetErrors Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.GetErrors Example/CS/source.cs
@@ -12,8 +12,8 @@ public class Form1: Form
//
private void PrintAllErrs(DataSet dataSet)
{
- DataRow[] rowsInError;
-
+ DataRow[] rowsInError;
+
foreach(DataTable table in dataSet.Tables)
{
// Test if the table has errors. If not, skip it.
@@ -26,7 +26,7 @@ private void PrintAllErrs(DataSet dataSet)
{
foreach(DataColumn column in table.Columns)
{
- Console.WriteLine(column.ColumnName + " " +
+ Console.WriteLine(column.ColumnName + " " +
rowsInError[i].GetColumnError(column));
}
// Clear the row errors
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.HasErrors Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.HasErrors Example/CS/source.cs
index ed1866d80e8..1280c7f8a7b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.HasErrors Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.HasErrors Example/CS/source.cs
@@ -10,16 +10,16 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- private void CheckForErrors(DataSet dataSet)
+ private void CheckForErrors(DataSet dataSet)
{
// Invoke GetChanges on the DataSet to create a reduced set.
DataSet thisDataSet = dataSet.GetChanges();
// Check each table's HasErrors property.
- foreach(DataTable table in thisDataSet.Tables)
+ foreach(DataTable table in thisDataSet.Tables)
{
// If HasErrors is true, reconcile errors.
- if(table.HasErrors)
+ if(table.HasErrors)
{
// Insert code to reconcile errors.
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Locale Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Locale Example/CS/source.cs
index cde90192389..942bd4b0e0c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Locale Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Locale Example/CS/source.cs
@@ -20,7 +20,7 @@ private void ChangeCultureInfo(DataTable table)
table.Locale = myCultureInfo;
// Print the new LCID.
- Console.WriteLine(table.Locale.LCID);
+ Console.WriteLine(table.Locale.LCID);
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.NewRow Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.NewRow Example/CS/source.cs
index 83a149df5f5..07cea4ba654 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.NewRow Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.NewRow Example/CS/source.cs
@@ -17,22 +17,22 @@ private void MakeDataTableAndDisplay()
// Declare DataColumn and DataRow variables.
DataColumn column;
- DataRow row;
+ DataRow row;
DataView view;
- // Create new DataColumn, set DataType, ColumnName and add to DataTable.
+ // Create new DataColumn, set DataType, ColumnName and add to DataTable.
column = new DataColumn();
column.DataType = System.Type.GetType("System.Int32");
column.ColumnName = "id";
table.Columns.Add(column);
-
+
// Create second column.
column = new DataColumn();
column.DataType = Type.GetType("System.String");
column.ColumnName = "item";
table.Columns.Add(column);
-
- // Create new DataRow objects and add to DataTable.
+
+ // Create new DataRow objects and add to DataTable.
for(int i = 0; i < 10; i++)
{
row = table.NewRow();
@@ -40,7 +40,7 @@ private void MakeDataTableAndDisplay()
row["item"] = "item " + i.ToString();
table.Rows.Add(row);
}
-
+
// Create a DataView using the DataTable.
view = new DataView(table);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.PrimaryKey Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.PrimaryKey Example/CS/source.cs
index 06faaceffc5..a5870d7cb25 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.PrimaryKey Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.PrimaryKey Example/CS/source.cs
@@ -23,7 +23,7 @@ private void GetPrimaryKeys(DataTable table)
Console.WriteLine($"{columns[i].ColumnName} {columns[i].DataType}");
}
}
-
+
private void SetPrimaryKeys()
{
// Create a new DataTable and set two DataColumn objects as primary keys.
@@ -41,7 +41,7 @@ private void SetPrimaryKeys()
// Add the column to the array.
keys[0] = column;
-
+
// Create column 2 and add it to the array.
column = new DataColumn();
column.DataType = Type.GetType("System.String");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowChanged Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowChanged Example/CS/source.cs
index db7461d2afd..dc310132043 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowChanged Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowChanged Example/CS/source.cs
@@ -28,7 +28,7 @@ private static void DataTableRowChanged()
for(int id=1; id<=10; id++)
{
custTable.Rows.Add(
- new object[] { id, string.Format("customer{0}", id),
+ new object[] { id, string.Format("customer{0}", id),
string.Format("address{0}", id) });
}
@@ -43,7 +43,7 @@ private static void DataTableRowChanged()
private static void Row_Changed(object sender, DataRowChangeEventArgs e)
{
- Console.WriteLine("Row_Changed Event: name={0}; action={1}",
+ Console.WriteLine("Row_Changed Event: name={0}; action={1}",
e.Row["name"], e.Action);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowChanging Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowChanging Example/CS/source.cs
index 201e67a918f..977a756bbd0 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowChanging Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowChanging Example/CS/source.cs
@@ -28,7 +28,7 @@ private static void DataTableRowChanging()
for(int id=1; id<=10; id++)
{
custTable.Rows.Add(
- new object[] { id, string.Format("customer{0}", id),
+ new object[] { id, string.Format("customer{0}", id),
string.Format("address{0}", id) });
}
@@ -43,7 +43,7 @@ private static void DataTableRowChanging()
private static void Row_Changing(object sender, DataRowChangeEventArgs e)
{
- Console.WriteLine("Row_Changing Event: name={0}; action={1}",
+ Console.WriteLine("Row_Changing Event: name={0}; action={1}",
e.Row["name"], e.Action);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowDeleted Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowDeleted Example/CS/source.cs
index cbffdc9ca16..1601b79bc96 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowDeleted Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowDeleted Example/CS/source.cs
@@ -28,7 +28,7 @@ private static void DataTableRowDeleted()
for(int id=1; id<=10; id++)
{
customerTable.Rows.Add(
- new object[] { id, string.Format("customer{0}", id),
+ new object[] { id, string.Format("customer{0}", id),
string.Format("address{0}", id) });
}
@@ -41,7 +41,7 @@ private static void DataTableRowDeleted()
private static void Row_Deleted(object sender, DataRowChangeEventArgs e)
{
- Console.WriteLine("Row_Deleted Event: name={0}; action={1}",
+ Console.WriteLine("Row_Deleted Event: name={0}; action={1}",
e.Row["name", DataRowVersion.Original], e.Action);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowDeleting Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowDeleting Example/CS/source.cs
index d6d4fe540dc..cc9050b3918 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowDeleting Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.RowDeleting Example/CS/source.cs
@@ -19,7 +19,7 @@ private static void DataTableRowDeleting()
// set PrimaryKey
customerTable.Columns[ "id" ].Unique = true;
- customerTable.PrimaryKey = new DataColumn[]
+ customerTable.PrimaryKey = new DataColumn[]
{ customerTable.Columns["id"] };
// add a RowDeleting event handler for the table.
@@ -28,8 +28,8 @@ private static void DataTableRowDeleting()
// add ten rows
for( int id=1; id<=10; id++)
{
- customerTable.Rows.Add(
- new object[] { id, string.Format("customer{0}", id),
+ customerTable.Rows.Add(
+ new object[] { id, string.Format("customer{0}", id),
string.Format("address{0}", id) });
}
@@ -40,10 +40,10 @@ private static void DataTableRowDeleting()
row.Delete();
}
- private static void Row_Deleting( object sender,
+ private static void Row_Deleting( object sender,
DataRowChangeEventArgs e )
{
- Console.WriteLine( "Row_Deleting Event: name={0}; action={1}",
+ Console.WriteLine( "Row_Deleting Event: name={0}; action={1}",
e.Row["name"], e.Action );
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Rows Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Rows Example/CS/source.cs
index 093a6a68b93..bf4b3f55abe 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Rows Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Rows Example/CS/source.cs
@@ -30,7 +30,7 @@ private void AddARow(DataSet dataSet)
{
DataTable table;
table = dataSet.Tables["Suppliers"];
- // Use the NewRow method to create a DataRow with
+ // Use the NewRow method to create a DataRow with
// the table's schema.
DataRow newRow = table.NewRow();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Select2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Select2 Example/CS/source.cs
index 9f695d9db68..4237959edcc 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Select2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Select2 Example/CS/source.cs
@@ -2,13 +2,13 @@
using System;
using System.Data;
-public class A {
+public class A {
- public static void Main() {
+ public static void Main() {
DataTable table = new DataTable("Orders");
table.Columns.Add("OrderID", typeof(Int32));
table.Columns.Add("OrderQuantity", typeof(Int32));
- table.Columns.Add("CompanyName", typeof(string));
+ table.Columns.Add("CompanyName", typeof(string));
table.Columns.Add("Date", typeof(DateTime));
DataRow newRow = table.NewRow();
@@ -19,7 +19,7 @@ public static void Main() {
// Add the row to the rows collection.
table.Rows.Add(newRow);
-
+
DataRow newRow2 = table.NewRow();
newRow2["OrderID"] = 2;
newRow2["OrderQuantity"] = 2;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Select3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Select3 Example/CS/source.cs
index 5a1c6098634..0a382f9b1fb 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Select3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTable.Select3 Example/CS/source.cs
@@ -19,7 +19,7 @@ private static void GetRowsByFilter()
// Set PrimaryKey
customerTable.Columns[ "id" ].Unique = true;
- customerTable.PrimaryKey = new DataColumn[]
+ customerTable.PrimaryKey = new DataColumn[]
{ customerTable.Columns["id"] };
// Add ten rows
@@ -44,8 +44,8 @@ private static void GetRowsByFilter()
// Sort descending by column named CompanyName.
sortOrder = "name DESC";
// Use the Select method to find all rows matching the filter.
- DataRow[] foundRows =
- customerTable.Select(expression, sortOrder,
+ DataRow[] foundRows =
+ customerTable.Select(expression, sortOrder,
DataViewRowState.Added);
PrintRows(foundRows, "filtered rows");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection Example/CS/source.cs
index 8726d8cecd1..ba2db8f613a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection Example/CS/source.cs
@@ -7,7 +7,7 @@ public class Sample
//
private void GetTables(DataSet dataSet)
{
- // Get Each DataTable in the DataTableCollection and
+ // Get Each DataTable in the DataTableCollection and
// print each row value.
foreach (DataTable table in dataSet.Tables)
foreach (DataRow row in table.Rows)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add Example/CS/source.cs
index f774de3d754..cc897dc7090 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add Example/CS/source.cs
@@ -12,16 +12,16 @@ public class Form1: Form
//
private void AddDataTable()
{
- // Get the DataTableCollection of a DataGrid
+ // Get the DataTableCollection of a DataGrid
// control's DataSet.
- DataTableCollection tables =
+ DataTableCollection tables =
((DataSet)DataGrid1.DataSource).Tables;
// Create a new DataTable.
DataTable table = new DataTable();
// Code to add columns and rows not shown here.
-
+
// Add the table to the DataTableCollection.
tables.Add(table);
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add1 Example/CS/source.cs
index 4bd76d2b38f..6ba420693e9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add1 Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
//
private void AddTable()
{
- // Presuming a DataGrid is displaying more than one table,
+ // Presuming a DataGrid is displaying more than one table,
// get its DataSet.
DataSet thisDataSet = (DataSet)DataGrid1.DataSource;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add2 Example/CS/source.cs
index 4c38ddd8616..640510e5b91 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Add2 Example/CS/source.cs
@@ -12,13 +12,13 @@ public class Form1: Form
//
private void AddTables()
{
- // Presuming a DataGrid is displaying more than one table,
+ // Presuming a DataGrid is displaying more than one table,
// get its DataSet.
DataSet thisDataSet = (DataSet)DataGrid1.DataSource;
for (int i = 0; i < 3; i++)
thisDataSet.Tables.Add();
- Console.WriteLine(thisDataSet.Tables.Count.ToString()
+ Console.WriteLine(thisDataSet.Tables.Count.ToString()
+ " tables");
foreach (DataTable table in thisDataSet.Tables)
Console.WriteLine(table.TableName);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.CollectionChanging Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.CollectionChanging Example/CS/source.cs
index 1eeaf1e6565..e8553d0c80e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.CollectionChanging Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.CollectionChanging Example/CS/source.cs
@@ -14,7 +14,7 @@ public static void TableCollectionCollectionChanging()
// Create a DataSet with two tables
DataSet dataSet = new DataSet();
- // Assign the event-handler function for the
+ // Assign the event-handler function for the
// CollectionChangeEvent.
dataSet.Tables.CollectionChanging +=
new System.ComponentModel.CollectionChangeEventHandler(
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Contains Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Contains Example/CS/source.cs
index 191c442faee..2e463f7d927 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Contains Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Contains Example/CS/source.cs
@@ -19,7 +19,7 @@ private void TestForTableName()
DataTableCollection tablesCol = thisDataSet.Tables;
// Check if the named table exists.
- if (tablesCol.Contains("Suppliers"))
+ if (tablesCol.Contains("Suppliers"))
Console.WriteLine("Table named Suppliers exists");
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Remove Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Remove Example/CS/source.cs
index 20612c988e1..80ac7cbbbbb 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Remove Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Remove Example/CS/source.cs
@@ -30,25 +30,25 @@ public static void DataTableCollectionCanRemove()
// create Customer table
DataTable customersTable = new DataTable("Customers");
- customersTable.Columns.Add("customerId",
+ customersTable.Columns.Add("customerId",
typeof(int) ).AutoIncrement = true;
- customersTable.Columns.Add("name",
+ customersTable.Columns.Add("name",
typeof(string));
- customersTable.PrimaryKey = new DataColumn[]
+ customersTable.PrimaryKey = new DataColumn[]
{ customersTable.Columns["customerId"] };
// create Orders table
DataTable ordersTable = new DataTable("Orders");
- ordersTable.Columns.Add("orderId",
+ ordersTable.Columns.Add("orderId",
typeof(int) ).AutoIncrement = true;
- ordersTable.Columns.Add("customerId",
+ ordersTable.Columns.Add("customerId",
typeof(int) );
- ordersTable.Columns.Add("amount",
+ ordersTable.Columns.Add("amount",
typeof(double));
- ordersTable.PrimaryKey = new DataColumn[]
+ ordersTable.PrimaryKey = new DataColumn[]
{ ordersTable.Columns["orderId"] };
- dataSet.Tables.AddRange(new DataTable[]
+ dataSet.Tables.AddRange(new DataTable[]
{customersTable, ordersTable });
// remove all tables
@@ -64,7 +64,7 @@ public static void DataTableCollectionCanRemove()
}
}
- Console.WriteLine("dataSet has {0} tables",
+ Console.WriteLine("dataSet has {0} tables",
dataSet.Tables.Count);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Remove1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Remove1 Example/CS/source.cs
index 4789d802b72..3bab27b52a4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Remove1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableCollection.Remove1 Example/CS/source.cs
@@ -18,7 +18,7 @@ private void RemoveTables()
// Presuming a DataGrid is displaying more than one table, get its DataSet.
DataSet thisDataSet = (DataSet)DataGrid1.DataSource;
DataTableCollection tablesCol = thisDataSet.Tables;
- if (tablesCol.Contains(name) && tablesCol.CanRemove(tablesCol[name]))
+ if (tablesCol.Contains(name) && tablesCol.CanRemove(tablesCol[name]))
tablesCol.Remove(name);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping Example/CS/source.cs
index 5479c3dcba3..58c8722cf73 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected DataTableMappingCollection tableMappings;
//
- public void AddDataTableMapping()
+ public void AddDataTableMapping()
{
// ...
// create tableMappings
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.ColumnMappings Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.ColumnMappings Example/CS/source.cs
index 972a1bfa44a..b713a0b3eb5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.ColumnMappings Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.ColumnMappings Example/CS/source.cs
@@ -12,16 +12,16 @@ public class Form1: Form
protected DataColumnMappingCollection mappings;
//
- public void CreateDataTableMapping()
+ public void CreateDataTableMapping()
{
// ...
// create mappings
// ...
DataColumnMapping[] columns = {};
- // Copy mappings to array
+ // Copy mappings to array
mappings.CopyTo(columns, 0);
DataTableMapping mapping =
- new DataTableMapping("Categories", "DataCategories", columns);
+ new DataTableMapping("Categories", "DataCategories", columns);
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataSetTable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataSetTable Example/CS/source.cs
index 0331811e7db..7c00f48f18f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataSetTable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataSetTable Example/CS/source.cs
@@ -10,7 +10,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateDataTableMapping()
+ public void CreateDataTableMapping()
{
DataTableMapping mapping = new DataTableMapping();
mapping.SourceTable = "Categories";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping Example/CS/source.cs
index 0331811e7db..7c00f48f18f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping Example/CS/source.cs
@@ -10,7 +10,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateDataTableMapping()
+ public void CreateDataTableMapping()
{
DataTableMapping mapping = new DataTableMapping();
mapping.SourceTable = "Categories";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping1 Example/CS/source.cs
index 792bbff1c19..52bb04caf76 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping1 Example/CS/source.cs
@@ -10,9 +10,9 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateDataTableMapping()
+ public void CreateDataTableMapping()
{
- DataTableMapping mapping =
+ DataTableMapping mapping =
new DataTableMapping("Categories","DataCategories");
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping2 Example/CS/source.cs
index d3c649da3a0..06ddd9f9f1f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.DataTableMapping2 Example/CS/source.cs
@@ -12,17 +12,17 @@ public class Form1: Form
protected DataColumnMappingCollection mappings;
//
- public void CreateDataTableMapping()
+ public void CreateDataTableMapping()
{
// ...
// create mappings
// ...
-
+
DataColumnMapping[] columns1 = {};
mappings.CopyTo(columns1, 0);
DataTableMapping mapping =
new DataTableMapping("Categories", "DataCategories", columns1);
-
+
DataColumnMapping[] columns2 = {};
mapping.ColumnMappings.CopyTo(columns2, 0);
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.GetDataTableBySchemaAction Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.GetDataTableBySchemaAction Example/CS/source.cs
index e4b142c2634..be65392364d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.GetDataTableBySchemaAction Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.GetDataTableBySchemaAction Example/CS/source.cs
@@ -13,7 +13,7 @@ public class Form1: Form
protected DataTableMapping mapping;
//
- public void CreateDataTable()
+ public void CreateDataTable()
{
// ...
// create dataSet and mapping
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.ToString Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.ToString Example/CS/source.cs
index 94a084b9c0c..7d2049b6d07 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.ToString Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMapping.ToString Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected DataTableMappingCollection mappings;
//
- public void AddDataTableMapping()
+ public void AddDataTableMapping()
{
// ...
// create mappings
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection Example/CS/source.cs
index d45fd57116f..d80ad6dc8d2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected DataAdapter adapter;
//
- public void ShowTableMappings()
+ public void ShowTableMappings()
{
// ...
// create adapter
@@ -21,7 +21,7 @@ public void ShowTableMappings()
adapter.TableMappings.Add("Orders","DataOrders");
adapter.TableMappings.Add("Products","DataProducts");
string message = "Table Mappings:\n";
- for(int i=0;i < adapter.TableMappings.Count;i++)
+ for(int i=0;i < adapter.TableMappings.Count;i++)
{
message += i.ToString() + " "
+ adapter.TableMappings[i].ToString() + "\n";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Add Example/CS/source.cs
index 267c3a93ea8..5070a6dccb2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Add Example/CS/source.cs
@@ -13,7 +13,7 @@ public class Form1: Form
protected DataTableMapping mapping;
//
- public void ChangedMyMind()
+ public void ChangedMyMind()
{
// ...
// create mappings and mapping
@@ -22,7 +22,7 @@ public void ChangedMyMind()
{
mappings.Remove((Object) mapping);
}
- else
+ else
{
mappings.Add((Object) mapping);
Console.WriteLine("Index of new mapping: "
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Clear Example/CS/source.cs
index 8d6d326ff0c..bac03a92098 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Clear Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected DataTableMappingCollection mappings;
//
- public void PushIntoArray()
+ public void PushIntoArray()
{
// ...
// create DataTableMappingCollection collection mappings
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Contains1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Contains1 Example/CS/source.cs
index 267c3a93ea8..5070a6dccb2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Contains1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Contains1 Example/CS/source.cs
@@ -13,7 +13,7 @@ public class Form1: Form
protected DataTableMapping mapping;
//
- public void ChangedMyMind()
+ public void ChangedMyMind()
{
// ...
// create mappings and mapping
@@ -22,7 +22,7 @@ public void ChangedMyMind()
{
mappings.Remove((Object) mapping);
}
- else
+ else
{
mappings.Add((Object) mapping);
Console.WriteLine("Index of new mapping: "
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Count Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Count Example/CS/source.cs
index a680ca58aad..5e0f3b73b0b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Count Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.Count Example/CS/source.cs
@@ -10,9 +10,9 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateTableMappings()
+ public void CreateTableMappings()
{
- DataTableMappingCollection mappings =
+ DataTableMappingCollection mappings =
new DataTableMappingCollection();
mappings.Add("Categories","DataCategories");
mappings.Add("Orders","DataOrders");
@@ -20,7 +20,7 @@ public void CreateTableMappings()
string message = "TableMappings:\n";
for(int i=0;i < mappings.Count;i++)
{
- message += i.ToString() + " "
+ message += i.ToString() + " "
+ mappings[i].ToString() + "\n";
}
Console.WriteLine(message);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.DataTableMappingCollection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.DataTableMappingCollection Example/CS/source.cs
index a680ca58aad..5e0f3b73b0b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.DataTableMappingCollection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.DataTableMappingCollection Example/CS/source.cs
@@ -10,9 +10,9 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateTableMappings()
+ public void CreateTableMappings()
{
- DataTableMappingCollection mappings =
+ DataTableMappingCollection mappings =
new DataTableMappingCollection();
mappings.Add("Categories","DataCategories");
mappings.Add("Orders","DataOrders");
@@ -20,7 +20,7 @@ public void CreateTableMappings()
string message = "TableMappings:\n";
for(int i=0;i < mappings.Count;i++)
{
- message += i.ToString() + " "
+ message += i.ToString() + " "
+ mappings[i].ToString() + "\n";
}
Console.WriteLine(message);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.GetByDataSetTable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.GetByDataSetTable Example/CS/source.cs
index 46fdb383813..14ab8db283d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.GetByDataSetTable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.GetByDataSetTable Example/CS/source.cs
@@ -13,7 +13,7 @@ public class Form1: Form
protected DataTableMapping mapping;
//
- public void FindDataTableMapping()
+ public void FindDataTableMapping()
{
// ...
// create mappings and mapping
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.GetTableMappingBySchemaAction Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.GetTableMappingBySchemaAction Example/CS/source.cs
index 6cfce944760..8a2e7b8e6f4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.GetTableMappingBySchemaAction Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.GetTableMappingBySchemaAction Example/CS/source.cs
@@ -13,12 +13,12 @@ public class Form1: Form
protected DataTableMapping mapping;
//
- public void FindDataTableMapping()
+ public void FindDataTableMapping()
{
// ...
// create mappings and mapping
// ...
- if (mappings.Contains("Categories"))
+ if (mappings.Contains("Categories"))
{
mapping = DataTableMappingCollection.GetTableMappingBySchemaAction
(mappings, "Categories", "", MissingMappingAction.Ignore);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.RemoveAt Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.RemoveAt Example/CS/source.cs
index 251626d7032..b405514a787 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.RemoveAt Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.RemoveAt Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected DataTableMappingCollection mappings;
//
- public void RemoveDataTableMapping()
+ public void RemoveDataTableMapping()
{
// ...
// create mappings
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.RemoveAt1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.RemoveAt1 Example/CS/source.cs
index c5f464640ad..3d56a5b922f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.RemoveAt1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.RemoveAt1 Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataTableMappingCollection mappings;
//
- public void RemoveDataTableMapping()
+ public void RemoveDataTableMapping()
{
// ...
// create mappings
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.this1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.this1 Example/CS/source.cs
index 8b91517a6ec..575d49609d3 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.this1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataTableMappingCollection.this1 Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected DataTableMappingCollection mappings;
//
- public void FindDataTableMapping()
+ public void FindDataTableMapping()
{
// ...
// create mappings
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView Example/CS/source.cs
index 4c6fea2cdbb..e9770a78e13 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView Example/CS/source.cs
@@ -30,19 +30,19 @@ private void DemonstrateDataView()
table.AcceptChanges();
table.Rows[0]["item"]="cat";
table.Rows[1]["item"] = "dog";
-
+
// Create two DataView objects with the same table.
DataView firstView = new DataView(table);
DataView secondView = new DataView(table);
-
+
// Print current table values.
PrintTableOrView(table,"Current Values in Table");
-
- // Set first DataView to show only modified
+
+ // Set first DataView to show only modified
// versions of original rows.
firstView.RowStateFilter=DataViewRowState.ModifiedOriginal;
- // Print values.
+ // Print values.
PrintTableOrView(firstView,"First DataView: ModifiedOriginal");
// Add one New row to the second view.
@@ -50,15 +50,15 @@ private void DemonstrateDataView()
rowView=secondView.AddNew();
rowView["item"] = "fish";
- // Set second DataView to show modified versions of
+ // Set second DataView to show modified versions of
// current rows, or New rows.
- secondView.RowStateFilter=DataViewRowState.ModifiedCurrent
+ secondView.RowStateFilter=DataViewRowState.ModifiedCurrent
| DataViewRowState.Added;
// Print modified and Added rows.
- PrintTableOrView(secondView,
+ PrintTableOrView(secondView,
"Second DataView: ModifiedCurrent | Added");
}
-
+
private void PrintTableOrView(DataTable table, string label)
{
// This function prints values in the table or DataView.
@@ -69,10 +69,10 @@ private void PrintTableOrView(DataTable table, string label)
}
Console.WriteLine();
}
-
+
private void PrintTableOrView(DataView view, string label)
{
-
+
// This overload prints values in the table or DataView.
Console.WriteLine("\n" + label);
for(int i = 0; i
private void MakeDataView(DataSet dataSet)
{
- DataView view = new DataView(dataSet.Tables["Suppliers"],
- "Country = 'UK'", "CompanyName",
+ DataView view = new DataView(dataSet.Tables["Suppliers"],
+ "Country = 'UK'", "CompanyName",
DataViewRowState.CurrentRows);
view.AllowEdit = true;
view.AllowNew = true;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.ListChanged Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.ListChanged Example/CS/source.cs
index 3c63aeaf949..552985f7305 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.ListChanged Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.ListChanged Example/CS/source.cs
@@ -5,17 +5,17 @@
public class Sample
{
//
- public void CreateDataView(DataTable table)
+ public void CreateDataView(DataTable table)
{
- DataView view = new DataView(table, "",
+ DataView view = new DataView(table, "",
"ContactName", DataViewRowState.CurrentRows);
- view.ListChanged += new
+ view.ListChanged += new
System.ComponentModel.ListChangedEventHandler(
OnListChanged);
}
- private void OnListChanged(object sender,
+ private void OnListChanged(object sender,
System.ComponentModel.ListChangedEventArgs args)
{
Console.WriteLine("ListChanged:");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.RowFilter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.RowFilter Example/CS/source.cs
index f3e406b0b24..a919436a497 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.RowFilter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.RowFilter Example/CS/source.cs
@@ -15,7 +15,7 @@ private static void DemostrateDataView() {
// Create a DataTable with one column
DataTable dt = new DataTable("MyTable");
DataColumn column = new DataColumn("Col", typeof(int));
- dt.Columns.Add(column);
+ dt.Columns.Add(column);
// Add 5 rows on Added state
for (int i = 0; i < 5; i++) {
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.Sort Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.Sort Example/CS/source.cs
index 27830dfd29d..2fbe17b6794 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.Sort Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.Sort Example/CS/source.cs
@@ -8,7 +8,7 @@ static void Main(string[] args) {
locationTable.Columns.Add("State");
locationTable.Columns.Add("ZipCode");
- // Add data
+ // Add data
locationTable.Rows.Add("Washington", "98052");
locationTable.Rows.Add("California", "90001");
locationTable.Rows.Add("Hawaii", "96807");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.Table Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.Table Example/CS/source.cs
index afbee557814..b2559a5f032 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.Table Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DataView.Table Example/CS/source.cs
@@ -18,7 +18,7 @@ private static void DemonstrateDataViewTable()
DataColumn column = table.Columns.Add("ProductID",
typeof(int) );
column.AutoIncrement = true;
- column = table.Columns.Add("ProductName",
+ column = table.Columns.Add("ProductName",
typeof(string));
// populate DataTable.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.DeleteCommand Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.DeleteCommand Example/CS/source.cs
index 6aef481cc7d..551ecccbd91 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.DeleteCommand Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.DeleteCommand Example/CS/source.cs
@@ -28,7 +28,7 @@ public static OleDbDataAdapter CreateCustomerAdapter(
// Create the DeleteCommand.
command = new OleDbCommand(
- "DELETE * FROM Customers WHERE CustomerID = ?",
+ "DELETE * FROM Customers WHERE CustomerID = ?",
connection);
parameter = command.Parameters.Add(
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Fill2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Fill2 Example/CS/source.cs
index 978adc34447..1df830d427c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Fill2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Fill2 Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected OleDbDataAdapter adapter;
//
- public void GetRecords()
+ public void GetRecords()
{
// ...
// create dataSet and adapter
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Fill3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Fill3 Example/CS/source.cs
index a12696150d4..dd99e0dc26b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Fill3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Fill3 Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected OleDbDataAdapter adapter;
//
- public void GetRecords()
+ public void GetRecords()
{
// ...
// create dataSet and adapter
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema1 Example/CS/source.cs
index 341c0142816..96be066147e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema1 Example/CS/source.cs
@@ -51,7 +51,7 @@ public static DataSet GetCustomerData(string dataSetName,
//
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema2 Example/CS/source.cs
index 548e21dbf44..4faa6329574 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema2 Example/CS/source.cs
@@ -51,7 +51,7 @@ public static DataSet GetCustomerData(string dataSetName,
//
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema3/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema3/CS/source.cs
index 41e3d435444..b229ec4b235 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema3/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.FillSchema3/CS/source.cs
@@ -50,7 +50,7 @@ public static DataTable GetCustomerData(string dataSetName,
//
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update Example/CS/source.cs
index d769c5b27ef..6ff493398f2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update Example/CS/source.cs
@@ -32,6 +32,6 @@ public DataSet CreateCmdsAndUpdate(string connectionString,
return customers;
}
}
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update1 Example/CS/source.cs
index ee8df8fda6d..73056ba0d88 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update1 Example/CS/source.cs
@@ -12,7 +12,7 @@ static void Main(string[] args)
}
//
public DataSet CreateCmdsAndUpdate(string connectionString,
- string queryString)
+ string queryString)
{
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
@@ -35,6 +35,6 @@ public DataSet CreateCmdsAndUpdate(string connectionString,
return customers;
}
}
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update2 Example/CS/source.cs
index 25f9905feff..911da42e000 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update2 Example/CS/source.cs
@@ -12,7 +12,7 @@ static void Main(string[] args)
}
//
public DataTable CreateCmdsAndUpdate(string connectionString,
- string queryString)
+ string queryString)
{
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
@@ -33,6 +33,6 @@ public DataTable CreateCmdsAndUpdate(string connectionString,
}
}
- //
+ //
}
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update3/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update3/CS/source.cs
index 2499b281ef6..12ecdf354da 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update3/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData DbDataAdapter.Update3/CS/source.cs
@@ -12,7 +12,7 @@ static void Main(string[] args)
}
//
public DataSet CreateCmdsAndUpdate(string connectionString,
- string queryString, string tableName)
+ string queryString, string tableName)
{
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
@@ -32,6 +32,6 @@ public DataSet CreateCmdsAndUpdate(string connectionString,
return customers;
}
}
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ForeignKeyConstraint.Equals Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ForeignKeyConstraint.Equals Example/CS/source.cs
index 96c510bf89a..a69ef6ce4b8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ForeignKeyConstraint.Equals Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData ForeignKeyConstraint.Equals Example/CS/source.cs
@@ -20,12 +20,12 @@ private void CreateConstraint(DataSet dataSet)
new ForeignKeyConstraint("fkConstraint", parentCol, childCol);
// Test against existing members using the Equals method.
- foreach(ForeignKeyConstraint testConstraint in
+ foreach(ForeignKeyConstraint testConstraint in
dataSet.Tables["Orders"].Constraints)
{
if(fkeyConstraint.Equals(testConstraint)){
Console.WriteLine("Identical ForeignKeyConstraint!");
- // Insert code to delete the duplicate object,
+ // Insert code to delete the duplicate object,
// or stop the procedure.
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.CommandText Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.CommandText Example/CS/source.cs
index 20a94717dbc..b4cd6830289 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.CommandText Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.CommandText Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOleDbCommand()
+ public void CreateOleDbCommand()
{
OleDbCommand command = new OleDbCommand();
command.CommandText = "SELECT * FROM Categories ORDER BY CategoryID;";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.CommandTimeout Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.CommandTimeout Example/CS/source.cs
index da876562bf2..d64670ee6e9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.CommandTimeout Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.CommandTimeout Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateSqlCommand()
+ public void CreateSqlCommand()
{
SqlCommand command = new SqlCommand();
command.CommandTimeout = 15;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.Parameters Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.Parameters Example/CS/source.cs
index 65056391d44..94b1e54e130 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.Parameters Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbCommand.Parameters Example/CS/source.cs
@@ -12,16 +12,16 @@ public class Form1: Form
//
public void CreateSqlCommand(SqlConnection myConnection,
- string queryString, SqlParameter[] paramArray)
+ string queryString, SqlParameter[] paramArray)
{
SqlCommand command = new SqlCommand(queryString, myConnection);
- command.CommandText =
- "SELECT CustomerID, CompanyName FROM Customers "
- + "WHERE Country = @Country AND City = @City";
+ command.CommandText =
+ "SELECT CustomerID, CompanyName FROM Customers "
+ + "WHERE Country = @Country AND City = @City";
command.Parameters.AddRange(paramArray);
string message = "";
- for (int i = 0; i < command.Parameters.Count; i++)
+ for (int i = 0; i < command.Parameters.Count; i++)
{
message += command.Parameters[i].ToString() + "\n";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbConnection.ConnectionString Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbConnection.ConnectionString Example/CS/source.cs
index 8954d233fd9..b11b2b2347c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbConnection.ConnectionString Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData IDbConnection.ConnectionString Example/CS/source.cs
@@ -13,7 +13,7 @@ public class Form1: Form
//
public void CreateOleDbConnection(){
OleDbConnection connection = new OleDbConnection();
- connection.ConnectionString =
+ connection.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Northwind.mdb";
Console.WriteLine("Connection State: " + connection.State.ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcCommand/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcCommand/CS/source.cs
index c898277a99c..92d30cfb7f7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcCommand/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcCommand/CS/source.cs
@@ -11,7 +11,7 @@ static void Main()
//
public void InsertRow(string connectionString, string insertSQL)
{
- using (OdbcConnection connection =
+ using (OdbcConnection connection =
new OdbcConnection(connectionString))
{
// The insertSQL string contains a SQL statement that
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection.Close/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection.Close/CS/source.cs
index 57a3be9136d..8fc9e5585ff 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection.Close/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection.Close/CS/source.cs
@@ -24,7 +24,7 @@ private static void CreateOdbcConnection(string connectionString)
Console.WriteLine("ServerVersion: " + connection.ServerVersion
+ "\nDatabase: " + connection.Database);
- // The connection is automatically closed at
+ // The connection is automatically closed at
// the end of the Using block.
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection.DataSource/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection.DataSource/CS/source.cs
index a4b46dbe7d2..68ddc17f9ea 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection.DataSource/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection.DataSource/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOdbcConnection()
+ public void CreateOdbcConnection()
{
string connectionString = "Driver={SQL Native Client};Server=(local);Trusted_Connection=Yes;Database=AdventureWorks;";
@@ -21,7 +21,7 @@ public void CreateOdbcConnection()
Console.WriteLine("ServerVersion: " + connection.ServerVersion
+ "\nDatabase: " + connection.Database);
- // The connection is automatically closed at
+ // The connection is automatically closed at
// the end of the Using block.
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection/CS/source.cs
index 417e4cd24de..12c69132067 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcConnection/CS/source.cs
@@ -18,7 +18,7 @@ static void Main()
//
static private void InsertRow(string connectionString)
{
- string queryString =
+ string queryString =
"INSERT INTO Customers (CustomerID, CompanyName) Values('NWIND', 'Northwind Traders')";
OdbcCommand command = new OdbcCommand(queryString);
@@ -28,7 +28,7 @@ static private void InsertRow(string connectionString)
connection.Open();
command.ExecuteNonQuery();
- // The connection is automatically closed at
+ // The connection is automatically closed at
// the end of the Using block.
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcDataAdapter/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcDataAdapter/CS/source.cs
index 4c472dfd084..5b2bcb2b56b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcDataAdapter/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcDataAdapter/CS/source.cs
@@ -13,10 +13,10 @@ static void Main()
public DataSet GetDataSetFromAdapter(
DataSet dataSet, string connectionString, string queryString)
{
- using (OdbcConnection connection =
+ using (OdbcConnection connection =
new OdbcConnection(connectionString))
{
- OdbcDataAdapter adapter =
+ OdbcDataAdapter adapter =
new OdbcDataAdapter(queryString, connection);
// Open the connection and fill the DataSet.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcError.Message/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcError.Message/CS/source.cs
index 56a246b6546..0ee29f4b552 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcError.Message/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcError.Message/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid;
//
- public void DisplayOdbcErrorCollection(OdbcException exception)
+ public void DisplayOdbcErrorCollection(OdbcException exception)
{
for (int i=0; i < exception.Errors.Count; i++)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcException.Source/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcException.Source/CS/source.cs
index 9b97687a04b..1c320909435 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcException.Source/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcException.Source/CS/source.cs
@@ -11,17 +11,17 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void ShowOdbcException()
+ public void ShowOdbcException()
{
string mySelectQuery = "SELECT column1 FROM table1";
OdbcConnection myConnection =
new OdbcConnection("DRIVER={SQL Server};SERVER=MyServer;Trusted_connection=yes;DATABASE=northwind;");
OdbcCommand myCommand = new OdbcCommand(mySelectQuery,myConnection);
- try
+ try
{
myCommand.Connection.Open();
}
- catch (OdbcException e)
+ catch (OdbcException e)
{
string errorMessage = "Message: " + e.Message + "\n" +
"Source: " + e.Source;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcException/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcException/CS/source.cs
index d43dd2763fd..575b8976d04 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcException/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcException/CS/source.cs
@@ -11,17 +11,17 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void ShowOdbcException()
+ public void ShowOdbcException()
{
string mySelectQuery = "SELECT column1 FROM table1";
OdbcConnection myConnection =
new OdbcConnection("DRIVER={SQL Server};SERVER=MyServer;Trusted_connection=yes;DATABASE=northwind;");
OdbcCommand myCommand = new OdbcCommand(mySelectQuery,myConnection);
- try
+ try
{
myCommand.Connection.Open();
}
- catch (OdbcException e)
+ catch (OdbcException e)
{
string errorMessages = "";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter/CS/source.cs
index 40fc94fb3ef..9b7742c8305 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOdbcParameter()
+ public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter();
parameter.ParameterName = "Description";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter1/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter1/CS/source.cs
index 04be4c3d623..107d1311409 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter1/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter1/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
//
- public void CreateOdbcParameter()
+ public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter("Description",OdbcType.VarChar);
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter2/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter2/CS/source.cs
index e9065bcdd45..0e59e4b4d4f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter2/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter2/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
//
- public void CreateOdbcParameter()
+ public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter("Description",OdbcType.VarChar,88);
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter3/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter3/CS/source.cs
index 39183acf49c..17b284b9dd8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter3/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter3/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOdbcParameter()
+ public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter("Description",OdbcType.VarChar,
88,"Description");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter4/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter4/CS/source.cs
index 3d9fe168959..d430955a160 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter4/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameter.OdbcParameter4/CS/source.cs
@@ -12,7 +12,7 @@ static void Main()
public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter(
- "Description", OdbcType.VarChar, 11,
+ "Description", OdbcType.VarChar, 11,
ParameterDirection.Output, true, 0, 0, "Description",
DataRowVersion.Current, "garden hose");
Console.WriteLine(parameter.ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add2/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add2/CS/source.cs
index 8235175a390..ea553f70f5e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add2/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add2/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
public OdbcConnection connection;
//
- public void CreateParamCollection()
+ public void CreateParamCollection()
{
OdbcCommand command = new OdbcCommand(
"SELECT * FROM Customers WHERE CustomerID = ?", connection);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add3/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add3/CS/source.cs
index bb251edc6cf..6f69e520c18 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add3/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add3/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOdbcParamColl(OdbcConnection connection)
+ public void CreateOdbcParamColl(OdbcConnection connection)
{
OdbcCommand command = new OdbcCommand(
"SELECT * FROM Customers WHERE CustomerID = ?", connection);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add4/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add4/CS/source.cs
index c475f9fd99d..32b360f99a2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add4/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Add4/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateParameterCollection(OdbcConnection connection)
+ public void CreateParameterCollection(OdbcConnection connection)
{
OdbcCommand command = new OdbcCommand(
"SELECT * FROM Customers WHERE CustomerID = ?", connection);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Count/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Count/CS/source.cs
index 7f5ddb3f51a..246a3b25e61 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Count/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.Count/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateParameterCollection(OdbcCommand command)
+ public void CreateParameterCollection(OdbcCommand command)
{
OdbcParameterCollection paramCollection = command.Parameters;
paramCollection.Add("@CategoryName", OdbcType.Char);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.this1/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.this1/CS/source.cs
index a7544dbf1c3..c0d7ffdb8a5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.this1/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OdbcParameterCollection.this1/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected OdbcParameterCollection parameterCollection;
//
- public void SearchParameters()
+ public void SearchParameters()
{
// ...
// create OdbcParameterCollection parameterCollection
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.CommandText Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.CommandText Example/CS/source.cs
index f234e62c4b1..82db3230a8b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.CommandText Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.CommandText Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateMyOleDbCommand()
+ public void CreateMyOleDbCommand()
{
OleDbCommand command = new OleDbCommand();
command.CommandText = "SELECT * FROM Categories ORDER BY CategoryID";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.Connection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.Connection Example/CS/source.cs
index 8a161ea0a21..7266d41a50d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.Connection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.Connection Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOleDbCommand()
+ public void CreateOleDbCommand()
{
string queryString = "SELECT * FROM Categories ORDER BY CategoryID";
OleDbCommand command = new OleDbCommand(queryString);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteNonQuery Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteNonQuery Example/CS/source.cs
index 63a500df51f..b7cd3303871 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteNonQuery Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteNonQuery Example/CS/source.cs
@@ -19,11 +19,11 @@ static void Main()
static private void CreateOleDbCommand(
string queryString, string connectionString)
{
- using (OleDbConnection connection = new
+ using (OleDbConnection connection = new
OleDbConnection(connectionString))
{
connection.Open();
- OleDbCommand command = new
+ OleDbCommand command = new
OleDbCommand(queryString, connection);
command.ExecuteNonQuery();
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteReader2/CS/mysample.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteReader2/CS/mysample.cs
index 69900a2d133..b6b896ad444 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteReader2/CS/mysample.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteReader2/CS/mysample.cs
@@ -10,13 +10,13 @@ public class Form1: Form
protected DataSet DataSet1;
protected DataGrid dataGrid1;
//
-public void CreateMyOleDbDataReader(string queryString,string connectionString)
+public void CreateMyOleDbDataReader(string queryString,string connectionString)
{
OleDbConnection connection = new OleDbConnection(connectionString);
OleDbCommand command = new OleDbCommand(queryString, connection);
connection.Open();
OleDbDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
- while(reader.Read())
+ while(reader.Read())
{
Console.WriteLine(reader.GetString(0));
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteScalar/CS/mysample.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteScalar/CS/mysample.cs
index becbf7be222..a1cde13c751 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteScalar/CS/mysample.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.ExecuteScalar/CS/mysample.cs
@@ -10,8 +10,8 @@ public class Form1: Form
protected DataSet DataSet1;
protected DataGrid dataGrid1;
//
- public void CreateMyOleDbCommand(string queryString,
- OleDbConnection connection)
+ public void CreateMyOleDbCommand(string queryString,
+ OleDbConnection connection)
{
OleDbCommand command = new OleDbCommand(queryString, connection);
command.Connection.Open();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.OleDbCommand1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.OleDbCommand1 Example/CS/source.cs
index 2299f5e15e3..c9d25b5f54f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.OleDbCommand1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.OleDbCommand1 Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateMyOleDbCommand()
+ public void CreateMyOleDbCommand()
{
string queryString = "SELECT * FROM Categories ORDER BY CategoryID";
OleDbCommand command = new OleDbCommand(queryString);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.Parameters Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.Parameters Example/CS/source.cs
index 60d2f74d4b5..8a06f54016f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.Parameters Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommand.Parameters Example/CS/source.cs
@@ -12,10 +12,10 @@ public class Form1: Form
//
public void CreateMyOleDbCommand(OleDbConnection connection,
- string queryString, OleDbParameter[] parameters)
+ string queryString, OleDbParameter[] parameters)
{
OleDbCommand command = new OleDbCommand(queryString, connection);
- command.CommandText =
+ command.CommandText =
"SELECT CustomerID, CompanyName FROM Customers WHERE Country = ? AND City = ?";
command.Parameters.Add(parameters);
@@ -25,7 +25,7 @@ public void CreateMyOleDbCommand(OleDbConnection connection,
}
string message = "";
- for (int i = 0; i < command.Parameters.Count; i++)
+ for (int i = 0; i < command.Parameters.Count; i++)
{
message += command.Parameters[i].ToString() + "\n";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommandBuilder/CS/mysample.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommandBuilder/CS/mysample.cs
index 02c53095b6c..d16d42435cf 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommandBuilder/CS/mysample.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbCommandBuilder/CS/mysample.cs
@@ -4,7 +4,7 @@
using System.Data.OleDb;
using System.Data.Common;
-public class Form1
+public class Form1
{
static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.ConnectionTimeout Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.ConnectionTimeout Example/CS/source.cs
index d843d40c2aa..0a4fe7ab456 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.ConnectionTimeout Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.ConnectionTimeout Example/CS/source.cs
@@ -9,7 +9,7 @@ static void Main()
}
//
- // The connectionString argument contains the Connect Timeout
+ // The connectionString argument contains the Connect Timeout
// keywords, as follows: "... ;Connect Timeout=30;"
public void InsertRow(string connectionString, string insertSQL)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.Database Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.Database Example/CS/source.cs
index c768e588062..c8a2dff8d16 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.Database Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.Database Example/CS/source.cs
@@ -44,7 +44,7 @@ static void ChangeDatabaseConnection(string connectionString)
connection.Open();
Console.WriteLine("ServerVersion: {0} \nDatabase: {1}",
connection.ServerVersion, connection.Database);
-
+
connection.ChangeDatabase("Northwind");
Console.WriteLine("ServerVersion: {0} \nDatabase: {1}",
connection.ServerVersion, connection.Database);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.GetOleDbSchemaTable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.GetOleDbSchemaTable Example/CS/source.cs
index 28e5fe10676..4b3192631b7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.GetOleDbSchemaTable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbConnection.GetOleDbSchemaTable Example/CS/source.cs
@@ -15,7 +15,7 @@ static void Main()
//
static DataTable GetSchemaTable(string connectionString)
{
- using (OleDbConnection connection = new
+ using (OleDbConnection connection = new
OleDbConnection(connectionString))
{
connection.Open();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter Example/CS/source.cs
index 88853bf8601..d6ac5f40498 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter Example/CS/source.cs
@@ -29,21 +29,21 @@ public static OleDbDataAdapter CreateDataAdapter(string selectCommand,
"DELETE FROM Customers WHERE CustomerID = ?");
// Create the parameters.
- adapter.InsertCommand.Parameters.Add("@CustomerID",
+ adapter.InsertCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.InsertCommand.Parameters.Add("@CompanyName",
+ adapter.InsertCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@CustomerID",
+ adapter.UpdateCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.UpdateCommand.Parameters.Add("@CompanyName",
+ adapter.UpdateCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
- adapter.DeleteCommand.Parameters.Add("@CustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.DeleteCommand.Parameters.Add("@CustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
return adapter;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter Example/CS/source.cs
index f9fe4e90a86..4491bc70220 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter Example/CS/source.cs
@@ -12,9 +12,9 @@ static void Main()
public static OleDbDataAdapter CreateDataAdapter(
OleDbConnection connection)
{
- string selectCommand =
+ string selectCommand =
"SELECT CustomerID, CompanyName FROM Customers";
- OleDbDataAdapter adapter =
+ OleDbDataAdapter adapter =
new OleDbDataAdapter(selectCommand, connection);
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
@@ -32,21 +32,21 @@ public static OleDbDataAdapter CreateDataAdapter(
"DELETE FROM Customers WHERE CustomerID = ?");
// Create the parameters.
- adapter.InsertCommand.Parameters.Add("@CustomerID",
+ adapter.InsertCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.InsertCommand.Parameters.Add("@CompanyName",
+ adapter.InsertCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@CustomerID",
+ adapter.UpdateCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.UpdateCommand.Parameters.Add("@CompanyName",
+ adapter.UpdateCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
- adapter.DeleteCommand.Parameters.Add("@CustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.DeleteCommand.Parameters.Add("@CustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
return adapter;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter1 Example/CS/source.cs
index 88853bf8601..d6ac5f40498 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter1 Example/CS/source.cs
@@ -29,21 +29,21 @@ public static OleDbDataAdapter CreateDataAdapter(string selectCommand,
"DELETE FROM Customers WHERE CustomerID = ?");
// Create the parameters.
- adapter.InsertCommand.Parameters.Add("@CustomerID",
+ adapter.InsertCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.InsertCommand.Parameters.Add("@CompanyName",
+ adapter.InsertCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@CustomerID",
+ adapter.UpdateCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.UpdateCommand.Parameters.Add("@CompanyName",
+ adapter.UpdateCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
- adapter.DeleteCommand.Parameters.Add("@CustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.DeleteCommand.Parameters.Add("@CustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
return adapter;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter2 Example/CS/source.cs
index f9fe4e90a86..4491bc70220 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter2 Example/CS/source.cs
@@ -12,9 +12,9 @@ static void Main()
public static OleDbDataAdapter CreateDataAdapter(
OleDbConnection connection)
{
- string selectCommand =
+ string selectCommand =
"SELECT CustomerID, CompanyName FROM Customers";
- OleDbDataAdapter adapter =
+ OleDbDataAdapter adapter =
new OleDbDataAdapter(selectCommand, connection);
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
@@ -32,21 +32,21 @@ public static OleDbDataAdapter CreateDataAdapter(
"DELETE FROM Customers WHERE CustomerID = ?");
// Create the parameters.
- adapter.InsertCommand.Parameters.Add("@CustomerID",
+ adapter.InsertCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.InsertCommand.Parameters.Add("@CompanyName",
+ adapter.InsertCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@CustomerID",
+ adapter.UpdateCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.UpdateCommand.Parameters.Add("@CompanyName",
+ adapter.UpdateCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
- adapter.DeleteCommand.Parameters.Add("@CustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.DeleteCommand.Parameters.Add("@CustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
return adapter;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter3 Example/CS/source.cs
index f9fe4e90a86..4491bc70220 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.OleDbDataAdapter3 Example/CS/source.cs
@@ -12,9 +12,9 @@ static void Main()
public static OleDbDataAdapter CreateDataAdapter(
OleDbConnection connection)
{
- string selectCommand =
+ string selectCommand =
"SELECT CustomerID, CompanyName FROM Customers";
- OleDbDataAdapter adapter =
+ OleDbDataAdapter adapter =
new OleDbDataAdapter(selectCommand, connection);
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
@@ -32,21 +32,21 @@ public static OleDbDataAdapter CreateDataAdapter(
"DELETE FROM Customers WHERE CustomerID = ?");
// Create the parameters.
- adapter.InsertCommand.Parameters.Add("@CustomerID",
+ adapter.InsertCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.InsertCommand.Parameters.Add("@CompanyName",
+ adapter.InsertCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@CustomerID",
+ adapter.UpdateCommand.Parameters.Add("@CustomerID",
OleDbType.Char, 5, "CustomerID");
- adapter.UpdateCommand.Parameters.Add("@CompanyName",
+ adapter.UpdateCommand.Parameters.Add("@CompanyName",
OleDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
- adapter.DeleteCommand.Parameters.Add("@CustomerID",
- OleDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.DeleteCommand.Parameters.Add("@CustomerID",
+ OleDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
return adapter;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.RowUpdated Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.RowUpdated Example/CS/source.cs
index 2939bc3c46d..9ffb1622c8b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.RowUpdated Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbDataAdapter.RowUpdated Example/CS/source.cs
@@ -20,7 +20,7 @@ public static void CreateDataAdapter(
"SELECT * FROM Customers WHERE CustomerID = 'ALFKI'", connection);
adapter.InsertCommand = new OleDbCommand(
- "INSERT INTO Customers (CustomerID, CompanyName) VALUES(?, ?)",
+ "INSERT INTO Customers (CustomerID, CompanyName) VALUES(?, ?)",
connection);
adapter.InsertCommand.Parameters.Add(
@@ -56,13 +56,13 @@ public static void CreateDataAdapter(
}
}
- protected static void OnRowUpdating(object sender,
+ protected static void OnRowUpdating(object sender,
OleDbRowUpdatingEventArgs args)
{
if (args.StatementType == StatementType.Insert)
{
System.IO.TextWriter writer = System.IO.File.AppendText("Inserts.log");
- writer.WriteLine("{0}: Customer {1} Inserted.",
+ writer.WriteLine("{0}: Customer {1} Inserted.",
DateTime.Now, args.Row["CustomerID"]);
writer.Close();
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbError.Message Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbError.Message Example/CS/source.cs
index 9345b636649..0088fc62635 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbError.Message Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbError.Message Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void DisplayOleDbErrorCollection(OleDbException exception)
+ public void DisplayOleDbErrorCollection(OleDbException exception)
{
for (int i=0; i < exception.Errors.Count; i++)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbError.ToString Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbError.ToString Example/CS/source.cs
index e29a6395cc3..36e8ad5edd5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbError.ToString Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbError.ToString Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void DisplayOleDbErrors(OleDbException exception)
+ public void DisplayOleDbErrors(OleDbException exception)
{
for (int i=0; i < exception.Errors.Count; i++)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbException Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbException Example/CS/source.cs
index bdc3a8107fb..6a43fb098c9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbException Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbException Example/CS/source.cs
@@ -11,18 +11,18 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void ShowOleDbException()
+ public void ShowOleDbException()
{
string mySelectQuery = "SELECT column1 FROM table1";
OleDbConnection myConnection =
new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=");
OleDbCommand myCommand = new OleDbCommand(mySelectQuery,myConnection);
- try
+ try
{
myCommand.Connection.Open();
}
- catch (OleDbException e)
+ catch (OleDbException e)
{
string errorMessages = "";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.DbType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.DbType Example/CS/source.cs
index 34f048dff58..f2485caf966 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.DbType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.DbType Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
-public void CreateOleDbParameter()
+public void CreateOleDbParameter()
{
OleDbParameter parameter = new OleDbParameter("Description", OleDbType.VarChar, 88);
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter Example/CS/source.cs
index 370b3c858dd..1f7bf0a2ffd 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOleDbParameter()
+ public void CreateOleDbParameter()
{
OleDbParameter parameter = new OleDbParameter();
parameter.ParameterName = "Description";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter1 Example/CS/source.cs
index 8be5cd16cd3..b41f4ef89d4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter1 Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
//
- public void CreateOleDbParameter()
+ public void CreateOleDbParameter()
{
OleDbParameter parameter = new OleDbParameter("Description",OleDbType.VarChar);
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter2 Example/CS/source.cs
index 556251e33f3..5f25c28b128 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter2 Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
//
- public void CreateOleDbParameter()
+ public void CreateOleDbParameter()
{
OleDbParameter parameter = new OleDbParameter("Description",OleDbType.VarChar,88);
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter3 Example/CS/source.cs
index ac6f19dc0cf..eea266541d3 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter3 Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
//
- public void CreateOleDbParameter()
+ public void CreateOleDbParameter()
{
OleDbParameter parameter = new OleDbParameter(
"Description",OleDbType.VarChar,
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter4 Example/CS/source.cs
index 5701ded051b..6db93226f1b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter4 Example/CS/source.cs
@@ -13,7 +13,7 @@ static void Main()
public void CreateOleDbParameter()
{
OleDbParameter parameter = new OleDbParameter(
- "Description", OleDbType.VarChar, 11,
+ "Description", OleDbType.VarChar, 11,
ParameterDirection.Output, true, 0, 0, "Description",
DataRowVersion.Current, "garden hose");
Console.WriteLine(parameter.ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter5 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter5 Example/CS/source.cs
index 0ccccb9baec..1496ece9e93 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter5 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameter.OleDbParameter5 Example/CS/source.cs
@@ -12,7 +12,7 @@ public static void Main()
//
- public static void CreateOleDbParameter()
+ public static void CreateOleDbParameter()
{
OleDbParameter myParameter = new OleDbParameter("Description", "Beverages");
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add3 Example/CS/source.cs
index 0b78e18166e..0077b477688 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add3 Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateParameters(OleDbConnection connection)
+ public void CreateParameters(OleDbConnection connection)
{
OleDbCommand command = new OleDbCommand(
"SELECT * FROM Customers WHERE CustomerID = ?", connection);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add4 Example/CS/source.cs
index 882c8abac64..6fee6d4ea91 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add4 Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateParameters(OleDbConnection connection)
+ public void CreateParameters(OleDbConnection connection)
{
OleDbCommand command = new OleDbCommand(
"SELECT * FROM Customers WHERE CustomerID = ?", connection);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add5 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add5 Example/CS/source.cs
index 956ea450fad..43c9930a447 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add5 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add5 Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
public OleDbConnection connection;
//
- public void CreateParameters()
+ public void CreateParameters()
{
OleDbCommand command = new OleDbCommand(
"SELECT * FROM Customers WHERE CustomerID = ?", connection);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add6 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add6 Example/CS/source.cs
index fe514f56435..d36b29c8474 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add6 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Add6 Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
public OleDbConnection connection;
//
- public void CreateParameters()
+ public void CreateParameters()
{
OleDbCommand command = new OleDbCommand(
"SELECT * FROM Customers WHERE CustomerID = ?", connection);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Count Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Count Example/CS/source.cs
index 34ab1493f0f..7fb66e0f05f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Count Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.Count Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateParamCollection(OleDbCommand command)
+ public void CreateParamCollection(OleDbCommand command)
{
OleDbParameterCollection paramCollection = command.Parameters;
paramCollection.Add("@CategoryName", OleDbType.Char);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.this1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.this1 Example/CS/source.cs
index ce14d0f9904..ad596579635 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.this1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OleDbParameterCollection.this1 Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected OleDbParameterCollection parameters;
//
- public void SearchParameters()
+ public void SearchParameters()
{
// ...
// create OleDbParameterCollection parameters
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.CommandText/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.CommandText/CS/source.cs
index 07340fde290..632d0908fb8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.CommandText/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.CommandText/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleCommand()
+ public void CreateOracleCommand()
{
OracleCommand command = new OracleCommand();
command.CommandText = "SELECT * FROM Emp ORDER BY EmpNo";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.CommandType/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.CommandType/CS/source.cs
index 07340fde290..632d0908fb8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.CommandType/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.CommandType/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleCommand()
+ public void CreateOracleCommand()
{
OracleCommand command = new OracleCommand();
command.CommandText = "SELECT * FROM Emp ORDER BY EmpNo";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.Connection/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.Connection/CS/source.cs
index 6fbb5c510dd..48d741e4161 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.Connection/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.Connection/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleCommand()
+ public void CreateOracleCommand()
{
string queryString = "SELECT * FROM Emp ORDER BY EmpNo";
OracleCommand command = new OracleCommand(queryString);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.ExecuteReader2/CS/mysample.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.ExecuteReader2/CS/mysample.cs
index 16f79a5971b..730907bc36d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.ExecuteReader2/CS/mysample.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.ExecuteReader2/CS/mysample.cs
@@ -16,9 +16,9 @@ public void CreateMyOracleDataReader(string queryString, string connectionString
OracleCommand command = new OracleCommand(queryString, connection);
connection.Open();
- // Implicitly closes the connection because
+ // Implicitly closes the connection because
// CommandBehavior.CloseConnection is specified.
- OracleDataReader reader =
+ OracleDataReader reader =
command.ExecuteReader(CommandBehavior.CloseConnection);
while (reader.Read())
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.ExecuteScalar/CS/mysample.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.ExecuteScalar/CS/mysample.cs
index dfcbac2aaf5..defe5abd623 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.ExecuteScalar/CS/mysample.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.ExecuteScalar/CS/mysample.cs
@@ -10,7 +10,7 @@ public class Form1: Form
protected DataSet DataSet1;
protected DataGrid dataGrid1;
//
-public void CreateOracleCommand(string myScalarQuery, OracleConnection connection)
+public void CreateOracleCommand(string myScalarQuery, OracleConnection connection)
{
OracleCommand command = new OracleCommand(myScalarQuery, connection);
command.Connection.Open();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.OracleCommand/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.OracleCommand/CS/source.cs
index 4db28392a87..58765476d6c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.OracleCommand/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.OracleCommand/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleCommand()
+ public void CreateOracleCommand()
{
OracleCommand command = new OracleCommand();
command.CommandType = CommandType.Text;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.OracleCommand2/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.OracleCommand2/CS/source.cs
index 346dcbbacfd..4d29a3e0ab6 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.OracleCommand2/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.OracleCommand2/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleCommand()
+ public void CreateOracleCommand()
{
OracleConnection connection = new OracleConnection("Data Source=Oracle8i;Integrated Security=yes");
string queryString = "SELECT * FROM Emp ORDER BY EmpNo";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.Parameters/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.Parameters/CS/source.cs
index 06f8f91a52d..e757c4babb2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.Parameters/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleCommand.Parameters/CS/source.cs
@@ -16,7 +16,7 @@ public void CreateOracleCommand(OracleConnection connection,
{
OracleCommand command = new OracleCommand(queryString, connection);
- command.CommandText =
+ command.CommandText =
"SELECT * FROM Emp WHERE Job = :pJob AND Sal = :pSal";
for (int j = 0; j < myParamArray.Length; j++)
@@ -24,14 +24,14 @@ public void CreateOracleCommand(OracleConnection connection,
string message = "";
- for (int i = 0; i < command.Parameters.Count; i++)
+ for (int i = 0; i < command.Parameters.Count; i++)
message += command.Parameters[i].ToString() + "\n";
Console.WriteLine(message);
- using (OracleDataReader row = command.ExecuteReader())
+ using (OracleDataReader row = command.ExecuteReader())
{
- while(row.Read())
+ while(row.Read())
{
Console.WriteLine(row.GetValue(0));
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection.BeginTransaction/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection.BeginTransaction/CS/source.cs
index 5f577ce3ae6..db503752df9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection.BeginTransaction/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection.BeginTransaction/CS/source.cs
@@ -25,10 +25,10 @@ public void RunOracleTransaction(string connectionString)
try
{
- command.CommandText =
+ command.CommandText =
"INSERT INTO Dept (DeptNo, Dname, Loc) values (50, 'TECHNOLOGY', 'DENVER')";
command.ExecuteNonQuery();
- command.CommandText =
+ command.CommandText =
"INSERT INTO Dept (DeptNo, Dname, Loc) values (60, 'ENGINEERING', 'KANSAS CITY')";
command.ExecuteNonQuery();
transaction.Commit();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection.BeginTransaction1/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection.BeginTransaction1/CS/source.cs
index 5f577ce3ae6..db503752df9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection.BeginTransaction1/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection.BeginTransaction1/CS/source.cs
@@ -25,10 +25,10 @@ public void RunOracleTransaction(string connectionString)
try
{
- command.CommandText =
+ command.CommandText =
"INSERT INTO Dept (DeptNo, Dname, Loc) values (50, 'TECHNOLOGY', 'DENVER')";
command.ExecuteNonQuery();
- command.CommandText =
+ command.CommandText =
"INSERT INTO Dept (DeptNo, Dname, Loc) values (60, 'ENGINEERING', 'KANSAS CITY')";
command.ExecuteNonQuery();
transaction.Commit();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection/CS/source.cs
index 8c26ec11997..d62b78d4e0d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleConnection/CS/source.cs
@@ -11,7 +11,7 @@ static void Main()
//
public void InsertRow(string connectionString)
{
- string queryString =
+ string queryString =
"INSERT INTO Dept (DeptNo, Dname, Loc) values (50, 'TECHNOLOGY', 'DENVER')";
using (OracleConnection connection = new OracleConnection(connectionString))
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleException/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleException/CS/source.cs
index 0291e9099bd..93caee60a04 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleException/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleException/CS/source.cs
@@ -8,16 +8,16 @@ public class Sample
{
//
- public void ShowOracleException()
+ public void ShowOracleException()
{
OracleConnection myConnection =
new OracleConnection("Data Source=Oracle8i;Integrated Security=yes");
- try
+ try
{
myConnection.Open();
}
- catch (OracleException e)
+ catch (OracleException e)
{
string errorMessage = "Code: " + e.Code + "\n" +
"Message: " + e.Message;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.DbType/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.DbType/CS/source.cs
index a8ba67d801b..bf03c9b3b15 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.DbType/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.DbType/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
-public void CreateOracleDbParameter()
+public void CreateOracleDbParameter()
{
OracleParameter parameter = new OracleParameter();
parameter.ParameterName = "pDName";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter1/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter1/CS/source.cs
index 33692afaa15..c577654e557 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter1/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter1/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleParameter()
+ public void CreateOracleParameter()
{
OracleParameter parameter = new OracleParameter("DName",OracleType.VarChar);
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter2/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter2/CS/source.cs
index 90a2fd07eb1..e8f99101a74 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter2/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter2/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleParameter()
+ public void CreateOracleParameter()
{
OracleParameter parameter = new OracleParameter("DName",OracleType.VarChar,14);
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter3/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter3/CS/source.cs
index 22b6c545e1f..ead26db8c81 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter3/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter3/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleParameter()
+ public void CreateOracleParameter()
{
OracleParameter parameter = new OracleParameter("DName",OracleType.VarChar,
14,"DName");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter4/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter4/CS/source.cs
index aaecb725da9..2f9fc527687 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter4/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter.OracleParameter4/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
-public void CreateOracleParameter()
+public void CreateOracleParameter()
{
OracleParameter parameter = new OracleParameter(
"DName",OracleType.VarChar,
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter/CS/source.cs
index 70230c0954f..32dadab56a1 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameter/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected OracleDataAdapter adapter;
//
-public void AddOracleParameters()
+public void AddOracleParameters()
{
// ...
// create dataSet and adapter
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add2/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add2/CS/source.cs
index 355098dbe7f..06d879f5952 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add2/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add2/CS/source.cs
@@ -13,7 +13,7 @@ public class Form1: Form
public OracleConnection connection;
//
public void CreateOracleParamColl() {
- OracleCommand command = new OracleCommand(
+ OracleCommand command = new OracleCommand(
"SELECT Ename, DeptNo FROM Emp WHERE EmpNo = :pEmpNo", connection);
OracleParameterCollection paramCollection = command.Parameters;
object parameter = new OracleParameter("pEmpNo", OracleType.Number);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add3/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add3/CS/source.cs
index 226d86d3397..31140ffd95b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add3/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add3/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleParamColl(OracleConnection connection)
+ public void CreateOracleParamColl(OracleConnection connection)
{
OracleCommand command = new OracleCommand(
"SELECT Ename, DeptNo FROM Emp WHERE EmpNo = :pEmpNo", connection);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add4/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add4/CS/source.cs
index 4379080c5e6..10ee0baaa26 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add4/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Add4/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleParamColl(OracleConnection connection)
+ public void CreateOracleParamColl(OracleConnection connection)
{
OracleCommand command = new OracleCommand(
"SELECT Ename, DeptNo FROM Emp WHERE EmpNo = :pEmpNo", connection);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Count/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Count/CS/source.cs
index 9f3b320234b..d842b9e8716 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Count/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.Count/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateOracleParamColl(OracleCommand command)
+ public void CreateOracleParamColl(OracleCommand command)
{
OracleParameterCollection paramCollection = command.Parameters;
paramCollection.Add("pDName", OracleType.VarChar);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.this1/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.this1/CS/source.cs
index fc494fa3968..6e52cc5eb44 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.this1/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleParameterCollection.this1/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected OracleParameterCollection parameters;
//
- public void SearchOracleParams()
+ public void SearchOracleParams()
{
// ...
// create OracleParameterCollection parameters
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleRowUpdatedEventArgs/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleRowUpdatedEventArgs/CS/source.cs
index 36cc59c416f..0803753d200 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleRowUpdatedEventArgs/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleRowUpdatedEventArgs/CS/source.cs
@@ -15,55 +15,55 @@ public class Form1: Form
private static void OnRowUpdating(object sender, OracleRowUpdatingEventArgs e) {
PrintEventArgs(e);
}
-
+
//Handler for RowUpdated event.
private static void OnRowUpdated(object sender, OracleRowUpdatedEventArgs e) {
PrintEventArgs(e);
}
-
+
public static int Main(String[] args) {
const string CONNECTION_STRING = "Data Source=Oracle8i;Integrated Security=yes";
const string SELECT_ALL = "SELECT * FROM Scott.Emp";
-
+
//Create DataAdapter.
OracleDataAdapter rAdapter = new OracleDataAdapter(SELECT_ALL, CONNECTION_STRING);
OracleCommandBuilder cb = new OracleCommandBuilder(rAdapter);
-
+
//Create and fill DataSet (Select only first 5 rows.).
DataSet rDataSet = new DataSet();
rAdapter.Fill(rDataSet, 0, 5, "Table");
-
+
//Modify DataSet.
DataTable rTable = rDataSet.Tables["Table"];
rTable.Rows[0][1] = "DYZY";
-
+
//Add handlers.
rAdapter.RowUpdating += new OracleRowUpdatingEventHandler( OnRowUpdating );
rAdapter.RowUpdated += new OracleRowUpdatedEventHandler( OnRowUpdated );
-
- //Update--this operation fires two events (RowUpdating and RowUpdated) for each changed row.
+
+ //Update--this operation fires two events (RowUpdating and RowUpdated) for each changed row.
rAdapter.Update(rDataSet, "Table");
-
+
//Remove handlers.
rAdapter.RowUpdating -= new OracleRowUpdatingEventHandler( OnRowUpdating );
rAdapter.RowUpdated -= new OracleRowUpdatedEventHandler( OnRowUpdated );
return 0;
}
-
+
private static void PrintEventArgs(OracleRowUpdatingEventArgs args) {
Console.WriteLine("OnRowUpdating");
Console.WriteLine(" event args: ("+
- " command=" + args.Command +
- " commandType=" + args.StatementType +
+ " command=" + args.Command +
+ " commandType=" + args.StatementType +
" status=" + args.Status + ")");
}
-
+
private static void PrintEventArgs(OracleRowUpdatedEventArgs args) {
Console.WriteLine("OnRowUpdated");
Console.WriteLine( " event args: ("+
" command=" + args.Command +
- " commandType=" + args.StatementType +
- " recordsAffected=" + args.RecordsAffected +
+ " commandType=" + args.StatementType +
+ " recordsAffected=" + args.RecordsAffected +
" status=" + args.Status + ")" );
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleRowUpdatingEventArgs/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleRowUpdatingEventArgs/CS/source.cs
index 9691079f546..0f09a621202 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleRowUpdatingEventArgs/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData OracleRowUpdatingEventArgs/CS/source.cs
@@ -12,62 +12,62 @@ public class Form1: Form
//
// handler for RowUpdating event
- private static void OnRowUpdating(object sender, OracleRowUpdatingEventArgs e)
+ private static void OnRowUpdating(object sender, OracleRowUpdatingEventArgs e)
{
PrintEventArgs(e);
}
-
+
//Handler for RowUpdated event.
- private static void OnRowUpdated(object sender, OracleRowUpdatedEventArgs e)
+ private static void OnRowUpdated(object sender, OracleRowUpdatedEventArgs e)
{
PrintEventArgs(e);
}
-
- public static int Main(String[] args)
+
+ public static int Main(String[] args)
{
const string CONNECTION_STRING = "Data Source=Oracle8i;Integrated Security=yes";
const string SELECT_ALL = "SELECT * FROM Scott.Emp";
-
+
//Create DataAdapter.
OracleDataAdapter rAdapter = new OracleDataAdapter(SELECT_ALL, CONNECTION_STRING);
-
+
//Create and fill DataSet (Select only first 5 rows.).
DataSet rDataSet = new DataSet();
rAdapter.Fill(rDataSet, 0, 5, "Table");
-
+
//Modify DataSet.
DataTable rTable = rDataSet.Tables["Table"];
rTable.Rows[0][1] = "DYZY";
-
+
//Add handlers.
rAdapter.RowUpdating += new OracleRowUpdatingEventHandler( OnRowUpdating );
rAdapter.RowUpdated += new OracleRowUpdatedEventHandler( OnRowUpdated );
-
- //Update--this operation fires two events (RowUpdating and RowUpdated) for each changed row.
+
+ //Update--this operation fires two events (RowUpdating and RowUpdated) for each changed row.
rAdapter.Update(rDataSet, "Table");
-
+
//Remove handlers.
rAdapter.RowUpdating -= new OracleRowUpdatingEventHandler( OnRowUpdating );
rAdapter.RowUpdated -= new OracleRowUpdatedEventHandler( OnRowUpdated );
return 0;
}
-
- private static void PrintEventArgs(OracleRowUpdatingEventArgs args)
+
+ private static void PrintEventArgs(OracleRowUpdatingEventArgs args)
{
Console.WriteLine("OnRowUpdating");
Console.WriteLine(" event args: ("+
- " command=" + args.Command +
- " commandType=" + args.StatementType +
+ " command=" + args.Command +
+ " commandType=" + args.StatementType +
" status=" + args.Status + ")");
}
-
- private static void PrintEventArgs(OracleRowUpdatedEventArgs args)
+
+ private static void PrintEventArgs(OracleRowUpdatedEventArgs args)
{
Console.WriteLine("OnRowUpdated");
Console.WriteLine(" event args: ("+
" command=" + args.Command +
- " commandType=" + args.StatementType +
- " recordsAffected=" + args.RecordsAffected +
+ " commandType=" + args.StatementType +
+ " recordsAffected=" + args.RecordsAffected +
" status=" + args.Status + ")");
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData RowNotInTableException Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData RowNotInTableException Example/CS/source.cs
index e29a2312cf0..cea14d4d5ec 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData RowNotInTableException Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData RowNotInTableException Example/CS/source.cs
@@ -13,7 +13,7 @@ public class Form1: Form
//
private void DemonstrateRowNotInTableException()
{
- // Create a DataTable with one column and ten rows.
+ // Create a DataTable with one column and ten rows.
DataTable table = new DataTable("NewTable");
DataColumn column = new DataColumn("NewColumn");
table.Columns.Add(column);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand Example/CS/source.cs
index 75a3075a6af..b6bb4114d60 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand Example/CS/source.cs
@@ -17,7 +17,7 @@ static void Main()
//
private static void ReadOrderData(string connectionString)
{
- string queryString =
+ string queryString =
"SELECT OrderID, CustomerID FROM dbo.Orders;";
using (SqlConnection connection = new SqlConnection(
connectionString))
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.Cancel/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.Cancel/CS/source.cs
index 2c2c4fc3326..30a5072b34e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.Cancel/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.Cancel/CS/source.cs
@@ -60,7 +60,7 @@ static void Main()
}
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.CommandText Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.CommandText Example/CS/source.cs
index 0152220c0f1..fcea30bf5f2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.CommandText Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.CommandText Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
-public void CreateCommand()
+public void CreateCommand()
{
SqlCommand command = new SqlCommand();
command.CommandText = "SELECT * FROM Categories ORDER BY CategoryID";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteScalar/CS/mysample.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteScalar/CS/mysample.cs
index 3005944200c..263ef39fca7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteScalar/CS/mysample.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.ExecuteScalar/CS/mysample.cs
@@ -7,9 +7,9 @@ public class Sample
//
public void CreateSqlCommand(
- string queryString, SqlConnection connection)
+ string queryString, SqlConnection connection)
{
- SqlCommand command = new
+ SqlCommand command = new
SqlCommand(queryString, connection);
command.Connection.Open();
command.ExecuteScalar();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.Prepare/CS/Source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.Prepare/CS/Source.cs
index 3db8607338c..f4f66bdee96 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.Prepare/CS/Source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.Prepare/CS/Source.cs
@@ -25,7 +25,7 @@ private static void SqlCommandPrepareEx(string connectionString)
"INSERT INTO Region (RegionID, RegionDescription) " +
"VALUES (@id, @desc)";
SqlParameter idParam = new SqlParameter("@id", SqlDbType.Int, 0);
- SqlParameter descParam =
+ SqlParameter descParam =
new SqlParameter("@desc", SqlDbType.Text, 100);
idParam.Value = 20;
descParam.Value = "First Region";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.SqlCommand1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.SqlCommand1 Example/CS/source.cs
index 6b524444a35..8dcd79c7447 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.SqlCommand1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlCommand.SqlCommand1 Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
-public void CreateCommand()
+public void CreateCommand()
{
string queryString = "SELECT * FROM Categories ORDER BY CategoryID";
SqlCommand command = new SqlCommand(queryString);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.ConnectionString Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.ConnectionString Example/CS/source.cs
index 815e3dc0884..1fd7b8b8bef 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.ConnectionString Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.ConnectionString Example/CS/source.cs
@@ -29,7 +29,7 @@ private static void OpenSqlConnection()
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=MSSQL1;Initial Catalog=AdventureWorks;"
+ "Integrated Security=true;";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.ConnectionTimeout Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.ConnectionTimeout Example/CS/source.cs
index 1d03f5e6cab..2bfd510c840 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.ConnectionTimeout Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.ConnectionTimeout Example/CS/source.cs
@@ -25,9 +25,9 @@ private static void OpenSqlConnection()
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file, using the
- // System.Configuration.ConfigurationSettings.AppSettings property
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file, using the
+ // System.Configuration.ConfigurationSettings.AppSettings property
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI;Connection Timeout=30";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.DataSource Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.DataSource Example/CS/source.cs
index a093478293a..bc02d27efc0 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.DataSource Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.DataSource Example/CS/source.cs
@@ -26,9 +26,9 @@ private static void OpenSqlConnection(string connectionString)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file, using the
- // System.Configuration.ConfigurationSettings.AppSettings property
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file, using the
+ // System.Configuration.ConfigurationSettings.AppSettings property
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI;";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.Database Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.Database Example/CS/source.cs
index 33cd1469ad3..86ddbd7d4c4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.Database Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.Database Example/CS/source.cs
@@ -31,9 +31,9 @@ private static void ChangeSqlDatabase(string connectionString)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file, using the
- // System.Configuration.ConfigurationSettings.AppSettings property
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file, using the
+ // System.Configuration.ConfigurationSettings.AppSettings property
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI;";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.Open Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.Open Example/CS/source.cs
index 2d8ca9874ae..d911f9777bd 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.Open Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.Open Example/CS/source.cs
@@ -26,9 +26,9 @@ private static void OpenSqlConnection(string connectionString)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file, using the
- // System.Configuration.ConfigurationSettings.AppSettings property
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file, using the
+ // System.Configuration.ConfigurationSettings.AppSettings property
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI;";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.PacketSize Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.PacketSize Example/CS/source.cs
index 9a5e4774d7c..fd8708d00b6 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.PacketSize Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.PacketSize Example/CS/source.cs
@@ -24,9 +24,9 @@ private static void OpenSqlConnection()
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file, using the
- // System.Configuration.ConfigurationSettings.AppSettings property
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file, using the
+ // System.Configuration.ConfigurationSettings.AppSettings property
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI;Packet Size=512";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.SqlConnection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.SqlConnection Example/CS/source.cs
index 181ee661481..8502de1a150 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.SqlConnection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.SqlConnection Example/CS/source.cs
@@ -24,9 +24,9 @@ private static void OpenSqlConnection()
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file, using the
- // System.Configuration.ConfigurationManager.ConnectionStrings property
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file, using the
+ // System.Configuration.ConfigurationManager.ConnectionStrings property
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI;";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.SqlConnection1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.SqlConnection1 Example/CS/source.cs
index 5cd940dee8d..fdc388fd8e0 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.SqlConnection1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.SqlConnection1 Example/CS/source.cs
@@ -27,9 +27,9 @@ private static void OpenSqlConnection()
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file, using the
- // System.Configuration.ConfigurationSettings.AppSettings property
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file, using the
+ // System.Configuration.ConfigurationSettings.AppSettings property
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI;";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.WorkstationId Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.WorkstationId Example/CS/source.cs
index 178f2dab3c2..807a72ab250 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.WorkstationId Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlConnection.WorkstationId Example/CS/source.cs
@@ -26,9 +26,9 @@ private static void OpenSqlConnection(string connectionString)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file, using the
- // System.Configuration.ConfigurationSettings.AppSettings property
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file, using the
+ // System.Configuration.ConfigurationSettings.AppSettings property
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI;";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter Example/CS/source.cs
index d5df6e0db1c..d211eb52428 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter Example/CS/source.cs
@@ -12,9 +12,9 @@ public class Form1: Form
//
private static DataSet SelectRows(DataSet dataset,
- string connectionString,string queryString)
+ string connectionString,string queryString)
{
- using (SqlConnection connection =
+ using (SqlConnection connection =
new SqlConnection(connectionString))
{
SqlDataAdapter adapter = new SqlDataAdapter();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.RowUpdated Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.RowUpdated Example/CS/source.cs
index 734bfe52c46..746818e7a92 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.RowUpdated Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.RowUpdated Example/CS/source.cs
@@ -12,65 +12,65 @@ public class Form1: Form
//
// handler for RowUpdating event
- private static void OnRowUpdating(object sender, SqlRowUpdatingEventArgs e)
+ private static void OnRowUpdating(object sender, SqlRowUpdatingEventArgs e)
{
PrintEventArgs(e);
}
-
+
// handler for RowUpdated event
- private static void OnRowUpdated(object sender, SqlRowUpdatedEventArgs e)
+ private static void OnRowUpdated(object sender, SqlRowUpdatedEventArgs e)
{
PrintEventArgs(e);
}
-
- public static int Main()
+
+ public static int Main()
{
- const string connectionString =
+ const string connectionString =
"Integrated Security=SSPI;database=Northwind;server=MSSQL1";
const string queryString = "SELECT * FROM Products";
-
+
// create DataAdapter
SqlDataAdapter adapter = new SqlDataAdapter(queryString, connectionString);
SqlCommandBuilder builder = new SqlCommandBuilder(adapter);
-
+
// Create and fill DataSet (select only first 5 rows)
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, 0, 5, "Table");
-
+
// Modify DataSet
DataTable table = dataSet.Tables["Table"];
table.Rows[0][1] = "new product";
-
+
// add handlers
adapter.RowUpdating += new SqlRowUpdatingEventHandler( OnRowUpdating );
adapter.RowUpdated += new SqlRowUpdatedEventHandler( OnRowUpdated );
-
- // update, this operation fires two events
- // (RowUpdating/RowUpdated) per changed row
+
+ // update, this operation fires two events
+ // (RowUpdating/RowUpdated) per changed row
adapter.Update(dataSet, "Table");
-
+
// remove handlers
adapter.RowUpdating -= new SqlRowUpdatingEventHandler( OnRowUpdating );
adapter.RowUpdated -= new SqlRowUpdatedEventHandler( OnRowUpdated );
return 0;
}
-
- private static void PrintEventArgs(SqlRowUpdatingEventArgs args)
+
+ private static void PrintEventArgs(SqlRowUpdatingEventArgs args)
{
Console.WriteLine("OnRowUpdating");
Console.WriteLine(" event args: ("+
- " command=" + args.Command +
- " commandType=" + args.StatementType +
+ " command=" + args.Command +
+ " commandType=" + args.StatementType +
" status=" + args.Status + ")");
}
-
- private static void PrintEventArgs(SqlRowUpdatedEventArgs args)
+
+ private static void PrintEventArgs(SqlRowUpdatedEventArgs args)
{
Console.WriteLine("OnRowUpdated");
Console.WriteLine( " event args: ("+
" command=" + args.Command +
- " commandType=" + args.StatementType +
- " recordsAffected=" + args.RecordsAffected +
+ " commandType=" + args.StatementType +
+ " recordsAffected=" + args.RecordsAffected +
" status=" + args.Status + ")");
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter Example/CS/source.cs
index b8ddc44ca4f..b07f7e3c598 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter Example/CS/source.cs
@@ -26,21 +26,21 @@ public static SqlDataAdapter CreateSqlDataAdapter(SqlConnection connection)
"DELETE FROM Customers WHERE CustomerID = @CustomerID", connection);
// Create the parameters.
- adapter.InsertCommand.Parameters.Add("@CustomerID",
+ adapter.InsertCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID");
- adapter.InsertCommand.Parameters.Add("@CompanyName",
+ adapter.InsertCommand.Parameters.Add("@CompanyName",
SqlDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@CustomerID",
+ adapter.UpdateCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID");
- adapter.UpdateCommand.Parameters.Add("@CompanyName",
+ adapter.UpdateCommand.Parameters.Add("@CompanyName",
SqlDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
- SqlDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
+ SqlDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
- adapter.DeleteCommand.Parameters.Add("@CustomerID",
- SqlDbType.Char, 5, "CustomerID").SourceVersion =
+ adapter.DeleteCommand.Parameters.Add("@CustomerID",
+ SqlDbType.Char, 5, "CustomerID").SourceVersion =
DataRowVersion.Original;
return adapter;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter1 Example/CS/source.cs
index 000d2f81803..22a6ba80acf 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter1 Example/CS/source.cs
@@ -27,19 +27,19 @@ public static SqlDataAdapter CreateSqlDataAdapter(SqlCommand selectCommand,
"DELETE FROM Customers WHERE CustomerID = @CustomerID", connection);
// Create the parameters.
- adapter.InsertCommand.Parameters.Add("@CustomerID",
+ adapter.InsertCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID");
- adapter.InsertCommand.Parameters.Add("@CompanyName",
+ adapter.InsertCommand.Parameters.Add("@CompanyName",
SqlDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@CustomerID",
+ adapter.UpdateCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID");
- adapter.UpdateCommand.Parameters.Add("@CompanyName",
+ adapter.UpdateCommand.Parameters.Add("@CompanyName",
SqlDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
+ adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
SqlDbType.Char, 5, "CustomerID").SourceVersion = DataRowVersion.Original;
- adapter.DeleteCommand.Parameters.Add("@CustomerID",
+ adapter.DeleteCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID").SourceVersion = DataRowVersion.Original;
return adapter;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter2 Example/CS/source.cs
index 6cebc024ad7..4078c9a05b7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter2 Example/CS/source.cs
@@ -29,19 +29,19 @@ public static SqlDataAdapter CreateSqlDataAdapter(string commandText,
"DELETE FROM Customers WHERE CustomerID = @CustomerID", connection);
// Create the parameters.
- adapter.InsertCommand.Parameters.Add("@CustomerID",
+ adapter.InsertCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID");
- adapter.InsertCommand.Parameters.Add("@CompanyName",
+ adapter.InsertCommand.Parameters.Add("@CompanyName",
SqlDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@CustomerID",
+ adapter.UpdateCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID");
- adapter.UpdateCommand.Parameters.Add("@CompanyName",
+ adapter.UpdateCommand.Parameters.Add("@CompanyName",
SqlDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
+ adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
SqlDbType.Char, 5, "CustomerID").SourceVersion = DataRowVersion.Original;
- adapter.DeleteCommand.Parameters.Add("@CustomerID",
+ adapter.DeleteCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID").SourceVersion = DataRowVersion.Original;
return adapter;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter3 Example/CS/source.cs
index a48207ab97d..871dd5a295c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataAdapter.SqlDataAdapter3 Example/CS/source.cs
@@ -28,19 +28,19 @@ public static SqlDataAdapter CreateSqlDataAdapter(string commandText,
"DELETE FROM Customers WHERE CustomerID = @CustomerID");
// Create the parameters.
- adapter.InsertCommand.Parameters.Add("@CustomerID",
+ adapter.InsertCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID");
- adapter.InsertCommand.Parameters.Add("@CompanyName",
+ adapter.InsertCommand.Parameters.Add("@CompanyName",
SqlDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@CustomerID",
+ adapter.UpdateCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID");
- adapter.UpdateCommand.Parameters.Add("@CompanyName",
+ adapter.UpdateCommand.Parameters.Add("@CompanyName",
SqlDbType.VarChar, 40, "CompanyName");
- adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
+ adapter.UpdateCommand.Parameters.Add("@oldCustomerID",
SqlDbType.Char, 5, "CustomerID").SourceVersion = DataRowVersion.Original;
- adapter.DeleteCommand.Parameters.Add("@CustomerID",
+ adapter.DeleteCommand.Parameters.Add("@CustomerID",
SqlDbType.Char, 5, "CustomerID").SourceVersion = DataRowVersion.Original;
return adapter;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlError Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlError Example/CS/source.cs
index d6a6d958fb5..d3e6da49627 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlError Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlError Example/CS/source.cs
@@ -15,7 +15,7 @@ static void Main()
public static void ShowSqlException(string connectionString)
{
string queryString = "EXECUTE NonExistantStoredProcedure";
-
+
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(queryString, connection);
@@ -44,7 +44,7 @@ private static void DisplaySqlErrors(SqlException exception)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlException Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlException Example/CS/source.cs
index 4cb37bb1f0e..67375ca4845 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlException Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlException Example/CS/source.cs
@@ -16,7 +16,7 @@ public static void ShowSqlException(string connectionString)
{
string queryString = "EXECUTE NonExistantStoredProcedure";
StringBuilder errorMessages = new StringBuilder();
-
+
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(queryString, connection);
@@ -43,7 +43,7 @@ public static void ShowSqlException(string connectionString)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlException.State Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlException.State Example/CS/source.cs
index 364602e4a2e..6ea01925803 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlException.State Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlException.State Example/CS/source.cs
@@ -17,7 +17,7 @@ public static void ShowSqlException(string connectionString)
{
string queryString = "EXECUTE NonExistantStoredProcedure";
StringBuilder errorMessages = new StringBuilder();
-
+
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(queryString, connection);
@@ -44,7 +44,7 @@ public static void ShowSqlException(string connectionString)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter Example/CS/source.cs
index 047cd9c7bc3..047631e12c4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Form1: Form
protected SqlDataAdapter categoriesAdapter;
//
-public void AddSqlParameters()
+public void AddSqlParameters()
{
// ...
// create categoriesDataSet and categoriesAdapter
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.Direction Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.Direction Example/CS/source.cs
index 011c99c7269..889eb396766 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.Direction Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.Direction Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateSqlParameter()
+ public void CreateSqlParameter()
{
SqlParameter parameter = new SqlParameter(
"@Description", SqlDbType.VarChar);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.IsNullable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.IsNullable Example/CS/source.cs
index 81e1b820b0b..ae05a0d4071 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.IsNullable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.IsNullable Example/CS/source.cs
@@ -8,7 +8,7 @@ static void Main()
{
}
//
- private static void AddSqlParameter(SqlCommand command,
+ private static void AddSqlParameter(SqlCommand command,
string paramValue)
{
SqlParameter parameter = new SqlParameter(
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SourceColumn Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SourceColumn Example/CS/source.cs
index 488c0b7aa34..0ea80325cd3 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SourceColumn Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SourceColumn Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateSqlParameter()
+ public void CreateSqlParameter()
{
SqlParameter parameter = new SqlParameter(
"@Description", SqlDbType.VarChar);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SourceVersion Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SourceVersion Example/CS/source.cs
index d94861a3438..215e2f138c6 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SourceVersion Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SourceVersion Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateSqlParameter()
+ public void CreateSqlParameter()
{
SqlParameter parameter = new SqlParameter(
"@Description", SqlDbType.VarChar);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter1 Example/CS/source.cs
index 50f8cad65cc..0cfc7def7f3 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter1 Example/CS/source.cs
@@ -10,9 +10,9 @@ static void Main()
//
private static void AddSqlParameter(SqlCommand command)
{
- SqlParameter parameter = new SqlParameter("@Description",
+ SqlParameter parameter = new SqlParameter("@Description",
SqlDbType.VarChar, 11, ParameterDirection.Input,
- true, 0, 0, "Description", DataRowVersion.Current,
+ true, 0, 0, "Description", DataRowVersion.Current,
"garden hose");
parameter.IsNullable = true;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter4 Example/CS/source.cs
index 217e8b6e8f3..57d6c058898 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter4 Example/CS/source.cs
@@ -8,10 +8,10 @@ static void Main()
{
}
//
- private static void AddSqlParameter(SqlCommand command,
+ private static void AddSqlParameter(SqlCommand command,
string paramValue)
{
- SqlParameter parameter = new SqlParameter("@Description",
+ SqlParameter parameter = new SqlParameter("@Description",
SqlDbType.VarChar, 88);
parameter.IsNullable = true;
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter5 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter5 Example/CS/source.cs
index 8dc3b6a2908..264afb455dd 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter5 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter5 Example/CS/source.cs
@@ -10,7 +10,7 @@ static void Main()
//
private static void AddSqlParameter(SqlCommand command)
{
- SqlParameter parameter = new SqlParameter("@Description",
+ SqlParameter parameter = new SqlParameter("@Description",
SqlDbType.VarChar, 88, "Description");
parameter.IsNullable = true;
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter6 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter6 Example/CS/source.cs
index 8dc3b6a2908..264afb455dd 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter6 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.SqlParameter6 Example/CS/source.cs
@@ -10,7 +10,7 @@ static void Main()
//
private static void AddSqlParameter(SqlCommand command)
{
- SqlParameter parameter = new SqlParameter("@Description",
+ SqlParameter parameter = new SqlParameter("@Description",
SqlDbType.VarChar, 88, "Description");
parameter.IsNullable = true;
parameter.Direction = ParameterDirection.Output;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.Value Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.Value Example/CS/source.cs
index 7790772df03..d6f286b2103 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.Value Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameter.Value Example/CS/source.cs
@@ -11,7 +11,7 @@ public class Form1: Form
protected DataGrid dataGrid1;
//
- public void CreateSqlParameter()
+ public void CreateSqlParameter()
{
SqlParameter parameter = new SqlParameter(
"@Description", SqlDbType.VarChar);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add Example/CS/source.cs
index 9397db3f8d7..5dd1e7f4d16 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Sample
{
//
- public void AddSqlParameter(SqlCommand command)
+ public void AddSqlParameter(SqlCommand command)
{
command.Parameters.Add(new SqlParameter("Description", "Beverages"));
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add1 Example/CS/source.cs
index 48ec5d8f7bf..a3c29806965 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add1 Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Sample
{
//
- public void AddSqlParameter(SqlCommand command)
+ public void AddSqlParameter(SqlCommand command)
{
SqlParameter param = new SqlParameter(
"@Description", SqlDbType.NVarChar, 16);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add3 Example/CS/source.cs
index 2ff19aa4bb0..1ef913462d1 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add3 Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Sample
{
//
- public void AddSqlParameter(SqlCommand command)
+ public void AddSqlParameter(SqlCommand command)
{
SqlParameter param = command.Parameters.Add(
"@Description", SqlDbType.NVarChar);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add5 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add5 Example/CS/source.cs
index b645302082b..881291afd5e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add5 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Add5 Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Sample
{
//
- public void AddSqlParameter(SqlCommand cmd)
+ public void AddSqlParameter(SqlCommand cmd)
{
SqlParameter p1 = cmd.Parameters.Add("@Description", SqlDbType.NVarChar, 16, "Description");
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Parent Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Parent Example/CS/source.cs
index 4d0b15c2fb0..32f54550550 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Parent Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Parent Example/CS/source.cs
@@ -65,8 +65,8 @@ static private string CreateSqlParameters(int documentID)
//
static private string GetConnectionString()
{
- // To avoid storing the connectionection string in your code,
- // you can retrieve it from a configuration file, using the
+ // To avoid storing the connectionection string in your code,
+ // you can retrieve it from a configuration file, using the
// System.Configuration.ConfigurationSettings.AppSettings property
return "Data Source=(local);Initial Catalog=AdventureWorks;" +
"Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Remove Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Remove Example/CS/source.cs
index f37fa1809eb..9316aef7def 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Remove Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlParameterCollection.Remove Example/CS/source.cs
@@ -13,7 +13,7 @@ public class Form1: Form
protected SqlParameter param;
//
- public void SearchSqlParams()
+ public void SearchSqlParams()
{
// ...
// create SqlCommand command and SqlParameter param
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlRowUpdatingEventArgs Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlRowUpdatingEventArgs Example/CS/source.cs
index 56c0476d359..87e9b05d70c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlRowUpdatingEventArgs Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlRowUpdatingEventArgs Example/CS/source.cs
@@ -12,62 +12,62 @@ public class Form1: Form
//
// handler for RowUpdating event
- private static void OnRowUpdating(object sender, SqlRowUpdatingEventArgs e)
+ private static void OnRowUpdating(object sender, SqlRowUpdatingEventArgs e)
{
PrintEventArgs(e);
}
-
+
//Handler for RowUpdated event.
- private static void OnRowUpdated(object sender, SqlRowUpdatedEventArgs e)
+ private static void OnRowUpdated(object sender, SqlRowUpdatedEventArgs e)
{
PrintEventArgs(e);
}
-
- public static int Main()
+
+ public static int Main()
{
const string CONNECTION_STRING = "Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServer";
const string SELECT_ALL = "select * from Products";
-
+
//Create DataAdapter.
SqlDataAdapter rAdapter = new SqlDataAdapter(SELECT_ALL, CONNECTION_STRING);
-
+
//Create and fill DataSet (Select only first 5 rows.).
DataSet rDataSet = new DataSet();
rAdapter.Fill(rDataSet, 0, 5, "Table");
-
+
//Modify DataSet.
DataTable rTable = rDataSet.Tables["Table"];
rTable.Rows[0][1] = "new product";
-
+
//Add handlers.
rAdapter.RowUpdating += new SqlRowUpdatingEventHandler( OnRowUpdating );
rAdapter.RowUpdated += new SqlRowUpdatedEventHandler( OnRowUpdated );
-
- //Update--this operation fires two events (RowUpdating and RowUpdated) for each changed row.
+
+ //Update--this operation fires two events (RowUpdating and RowUpdated) for each changed row.
rAdapter.Update(rDataSet, "Table");
-
+
//Remove handlers.
rAdapter.RowUpdating -= new SqlRowUpdatingEventHandler( OnRowUpdating );
rAdapter.RowUpdated -= new SqlRowUpdatedEventHandler( OnRowUpdated );
return 0;
}
-
- private static void PrintEventArgs(SqlRowUpdatingEventArgs args)
+
+ private static void PrintEventArgs(SqlRowUpdatingEventArgs args)
{
Console.WriteLine("OnRowUpdating");
Console.WriteLine(" event args: ("+
- " command=" + args.Command +
- " commandType=" + args.StatementType +
+ " command=" + args.Command +
+ " commandType=" + args.StatementType +
" status=" + args.Status + ")");
}
-
- private static void PrintEventArgs(SqlRowUpdatedEventArgs args)
+
+ private static void PrintEventArgs(SqlRowUpdatedEventArgs args)
{
Console.WriteLine("OnRowUpdated");
Console.WriteLine(" event args: ("+
" command=" + args.Command +
- " commandType=" + args.StatementType +
- " recordsAffected=" + args.RecordsAffected +
+ " commandType=" + args.StatementType +
+ " recordsAffected=" + args.RecordsAffected +
" status=" + args.Status + ")");
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData StateChangeEventArgs Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData StateChangeEventArgs Example/CS/source.cs
index 522d2703ffc..f3c6c080e3a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData StateChangeEventArgs Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData StateChangeEventArgs Example/CS/source.cs
@@ -52,7 +52,7 @@ protected static void PrintEventArgs(StateChangeEventArgs args)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=Northwind;"
+ "Integrated Security=true";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData UniqueConstraint.UniqueConstraint2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData UniqueConstraint.UniqueConstraint2 Example/CS/source.cs
index 6ff8b05dc71..da45968c351 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData UniqueConstraint.UniqueConstraint2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData UniqueConstraint.UniqueConstraint2 Example/CS/source.cs
@@ -33,11 +33,11 @@ static private void MakeTableWithUniqueConstraint()
dataRow["Name"] = "John";
dataTable.Rows.Add(dataRow);
- // Display the constraint name.
+ // Display the constraint name.
Console.WriteLine(
dataTable.Constraints[0].ConstraintName);
- // Try to add an identical row,
+ // Try to add an identical row,
// which throws an exception.
try
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData VersionNotFoundException Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData VersionNotFoundException Example/CS/source.cs
index 889c6315bdb..3752ec037a7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData VersionNotFoundException Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData VersionNotFoundException Example/CS/source.cs
@@ -18,7 +18,7 @@ private void DemonstrateVersionNotFoundException()
DataColumn column = new DataColumn("NewColumn");
table.Columns.Add(column);
DataRow newRow;
-
+
for(int i = 0;i <10;i++)
{
newRow = table.NewRow();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DP DataView Samples/CS/Form1.Designer.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DP DataView Samples/CS/Form1.Designer.cs
index 943dac169ee..357585d930d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DP DataView Samples/CS/Form1.Designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DP DataView Samples/CS/Form1.Designer.cs
@@ -71,17 +71,17 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
this.SuspendLayout();
- //
+ //
// dataGridView1
- //
+ //
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Location = new System.Drawing.Point(13, 13);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(594, 150);
this.dataGridView1.TabIndex = 0;
- //
+ //
// button1
- //
+ //
this.button1.Location = new System.Drawing.Point(10, 310);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
@@ -89,9 +89,9 @@ private void InitializeComponent()
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
- //
+ //
// button2
- //
+ //
this.button2.Location = new System.Drawing.Point(112, 310);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
@@ -99,9 +99,9 @@ private void InitializeComponent()
this.button2.Text = "button2";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
- //
+ //
// button3
- //
+ //
this.button3.Location = new System.Drawing.Point(204, 310);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
@@ -109,18 +109,18 @@ private void InitializeComponent()
this.button3.Text = "button3";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
- //
+ //
// label1
- //
+ //
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 288);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(130, 13);
this.label1.TabIndex = 4;
this.label1.Text = "Create from simple queries";
- //
+ //
// button4
- //
+ //
this.button4.Location = new System.Drawing.Point(296, 310);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 23);
@@ -128,9 +128,9 @@ private void InitializeComponent()
this.button4.Text = "button4";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
- //
+ //
// button5
- //
+ //
this.button5.Location = new System.Drawing.Point(16, 368);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(75, 23);
@@ -138,18 +138,18 @@ private void InitializeComponent()
this.button5.Text = "button5";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
- //
+ //
// label2
- //
+ //
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 352);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(87, 13);
this.label2.TabIndex = 7;
this.label2.Text = "Create from table";
- //
+ //
// button6
- //
+ //
this.button6.Location = new System.Drawing.Point(16, 422);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(75, 23);
@@ -157,27 +157,27 @@ private void InitializeComponent()
this.button6.Text = "button6";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click);
- //
+ //
// label3
- //
+ //
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(13, 406);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(40, 13);
this.label3.TabIndex = 9;
this.label3.Text = "Sorting";
- //
+ //
// label4
- //
+ //
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(13, 461);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(43, 13);
this.label4.TabIndex = 10;
this.label4.Text = "Filtering";
- //
+ //
// button7
- //
+ //
this.button7.Location = new System.Drawing.Point(97, 422);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(75, 23);
@@ -185,9 +185,9 @@ private void InitializeComponent()
this.button7.Text = "button7";
this.button7.UseVisualStyleBackColor = true;
this.button7.Click += new System.EventHandler(this.button7_Click);
- //
+ //
// button8
- //
+ //
this.button8.Location = new System.Drawing.Point(178, 422);
this.button8.Name = "button8";
this.button8.Size = new System.Drawing.Size(75, 23);
@@ -195,9 +195,9 @@ private void InitializeComponent()
this.button8.Text = "button8";
this.button8.UseVisualStyleBackColor = true;
this.button8.Click += new System.EventHandler(this.button8_Click);
- //
+ //
// button9
- //
+ //
this.button9.Location = new System.Drawing.Point(259, 422);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(75, 23);
@@ -205,9 +205,9 @@ private void InitializeComponent()
this.button9.Text = "button9";
this.button9.UseVisualStyleBackColor = true;
this.button9.Click += new System.EventHandler(this.button9_Click);
- //
+ //
// button10
- //
+ //
this.button10.Location = new System.Drawing.Point(340, 422);
this.button10.Name = "button10";
this.button10.Size = new System.Drawing.Size(75, 23);
@@ -215,9 +215,9 @@ private void InitializeComponent()
this.button10.Text = "button10";
this.button10.UseVisualStyleBackColor = true;
this.button10.Click += new System.EventHandler(this.button10_Click);
- //
+ //
// button11
- //
+ //
this.button11.Location = new System.Drawing.Point(421, 422);
this.button11.Name = "button11";
this.button11.Size = new System.Drawing.Size(75, 23);
@@ -225,9 +225,9 @@ private void InitializeComponent()
this.button11.Text = "button11";
this.button11.UseVisualStyleBackColor = true;
this.button11.Click += new System.EventHandler(this.button11_Click);
- //
+ //
// button12
- //
+ //
this.button12.Location = new System.Drawing.Point(502, 422);
this.button12.Name = "button12";
this.button12.Size = new System.Drawing.Size(75, 23);
@@ -235,9 +235,9 @@ private void InitializeComponent()
this.button12.Text = "button12";
this.button12.UseVisualStyleBackColor = true;
this.button12.Click += new System.EventHandler(this.button12_Click);
- //
+ //
// button13
- //
+ //
this.button13.Location = new System.Drawing.Point(16, 490);
this.button13.Name = "button13";
this.button13.Size = new System.Drawing.Size(75, 23);
@@ -245,9 +245,9 @@ private void InitializeComponent()
this.button13.Text = "button13";
this.button13.UseVisualStyleBackColor = true;
this.button13.Click += new System.EventHandler(this.button13_Click);
- //
+ //
// button14
- //
+ //
this.button14.Location = new System.Drawing.Point(97, 490);
this.button14.Name = "button14";
this.button14.Size = new System.Drawing.Size(75, 23);
@@ -255,9 +255,9 @@ private void InitializeComponent()
this.button14.Text = "button14";
this.button14.UseVisualStyleBackColor = true;
this.button14.Click += new System.EventHandler(this.button14_Click);
- //
+ //
// button15
- //
+ //
this.button15.Location = new System.Drawing.Point(178, 490);
this.button15.Name = "button15";
this.button15.Size = new System.Drawing.Size(75, 23);
@@ -265,9 +265,9 @@ private void InitializeComponent()
this.button15.Text = "button15";
this.button15.UseVisualStyleBackColor = true;
this.button15.Click += new System.EventHandler(this.button15_Click);
- //
+ //
// button16
- //
+ //
this.button16.Location = new System.Drawing.Point(259, 490);
this.button16.Name = "button16";
this.button16.Size = new System.Drawing.Size(75, 23);
@@ -275,18 +275,18 @@ private void InitializeComponent()
this.button16.Text = "button16";
this.button16.UseVisualStyleBackColor = true;
this.button16.Click += new System.EventHandler(this.button16_Click);
- //
+ //
// label5
- //
+ //
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(16, 529);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(98, 13);
this.label5.TabIndex = 21;
this.label5.Text = "Filtering and sorting";
- //
+ //
// button17
- //
+ //
this.button17.Location = new System.Drawing.Point(341, 490);
this.button17.Name = "button17";
this.button17.Size = new System.Drawing.Size(75, 23);
@@ -294,9 +294,9 @@ private void InitializeComponent()
this.button17.Text = "button17";
this.button17.UseVisualStyleBackColor = true;
this.button17.Click += new System.EventHandler(this.button17_Click);
- //
+ //
// button18
- //
+ //
this.button18.Location = new System.Drawing.Point(423, 490);
this.button18.Name = "button18";
this.button18.Size = new System.Drawing.Size(75, 23);
@@ -304,9 +304,9 @@ private void InitializeComponent()
this.button18.Text = "button18";
this.button18.UseVisualStyleBackColor = true;
this.button18.Click += new System.EventHandler(this.button18_Click);
- //
+ //
// button19
- //
+ //
this.button19.Location = new System.Drawing.Point(19, 559);
this.button19.Name = "button19";
this.button19.Size = new System.Drawing.Size(75, 23);
@@ -314,9 +314,9 @@ private void InitializeComponent()
this.button19.Text = "button19";
this.button19.UseVisualStyleBackColor = true;
this.button19.Click += new System.EventHandler(this.button19_Click);
- //
+ //
// button20
- //
+ //
this.button20.Location = new System.Drawing.Point(101, 559);
this.button20.Name = "button20";
this.button20.Size = new System.Drawing.Size(75, 23);
@@ -324,9 +324,9 @@ private void InitializeComponent()
this.button20.Text = "button20";
this.button20.UseVisualStyleBackColor = true;
this.button20.Click += new System.EventHandler(this.button20_Click);
- //
+ //
// button21
- //
+ //
this.button21.Location = new System.Drawing.Point(313, 559);
this.button21.Name = "button21";
this.button21.Size = new System.Drawing.Size(75, 23);
@@ -334,18 +334,18 @@ private void InitializeComponent()
this.button21.Text = "button21";
this.button21.UseVisualStyleBackColor = true;
this.button21.Click += new System.EventHandler(this.button21_Click);
- //
+ //
// label6
- //
+ //
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(310, 543);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(27, 13);
this.label6.TabIndex = 27;
this.label6.Text = "Find";
- //
+ //
// button22
- //
+ //
this.button22.Location = new System.Drawing.Point(394, 559);
this.button22.Name = "button22";
this.button22.Size = new System.Drawing.Size(75, 23);
@@ -353,9 +353,9 @@ private void InitializeComponent()
this.button22.Text = "button22";
this.button22.UseVisualStyleBackColor = true;
this.button22.Click += new System.EventHandler(this.button22_Click);
- //
+ //
// button23
- //
+ //
this.button23.Location = new System.Drawing.Point(505, 490);
this.button23.Name = "button23";
this.button23.Size = new System.Drawing.Size(75, 23);
@@ -363,9 +363,9 @@ private void InitializeComponent()
this.button23.Text = "button23";
this.button23.UseVisualStyleBackColor = true;
this.button23.Click += new System.EventHandler(this.button23_Click);
- //
+ //
// button24
- //
+ //
this.button24.Location = new System.Drawing.Point(586, 490);
this.button24.Name = "button24";
this.button24.Size = new System.Drawing.Size(75, 23);
@@ -373,9 +373,9 @@ private void InitializeComponent()
this.button24.Text = "button24";
this.button24.UseVisualStyleBackColor = true;
this.button24.Click += new System.EventHandler(this.button24_Click);
- //
+ //
// button26
- //
+ //
this.button26.Location = new System.Drawing.Point(589, 422);
this.button26.Name = "button26";
this.button26.Size = new System.Drawing.Size(75, 23);
@@ -383,9 +383,9 @@ private void InitializeComponent()
this.button26.Text = "button26";
this.button26.UseVisualStyleBackColor = true;
this.button26.Click += new System.EventHandler(this.button26_Click);
- //
+ //
// button25
- //
+ //
this.button25.Location = new System.Drawing.Point(589, 391);
this.button25.Name = "button25";
this.button25.Size = new System.Drawing.Size(75, 23);
@@ -393,26 +393,26 @@ private void InitializeComponent()
this.button25.Text = "button25";
this.button25.UseVisualStyleBackColor = true;
this.button25.Click += new System.EventHandler(this.button25_Click);
- //
+ //
// dataGridView2
- //
+ //
this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView2.Location = new System.Drawing.Point(12, 178);
this.dataGridView2.Name = "dataGridView2";
this.dataGridView2.Size = new System.Drawing.Size(361, 80);
this.dataGridView2.TabIndex = 34;
- //
+ //
// label7
- //
+ //
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(502, 543);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(84, 13);
this.label7.TabIndex = 35;
this.label7.Text = "Query DataView";
- //
+ //
// button27
- //
+ //
this.button27.Location = new System.Drawing.Point(502, 559);
this.button27.Name = "button27";
this.button27.Size = new System.Drawing.Size(75, 23);
@@ -420,9 +420,9 @@ private void InitializeComponent()
this.button27.Text = "button27";
this.button27.UseVisualStyleBackColor = true;
this.button27.Click += new System.EventHandler(this.button27_Click);
- //
+ //
// button28
- //
+ //
this.button28.Location = new System.Drawing.Point(586, 559);
this.button28.Name = "button28";
this.button28.Size = new System.Drawing.Size(75, 23);
@@ -430,9 +430,9 @@ private void InitializeComponent()
this.button28.Text = "button28";
this.button28.UseVisualStyleBackColor = true;
this.button28.Click += new System.EventHandler(this.button28_Click);
- //
+ //
// Form1
- //
+ //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(679, 603);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DP DataView Samples/CS/Form1.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DP DataView Samples/CS/Form1.cs
index 4fc433caf4e..9e787c3e77d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DP DataView Samples/CS/Form1.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DP DataView Samples/CS/Form1.cs
@@ -33,8 +33,8 @@ private void Form1_Load(object sender, EventArgs e)
private void FillDataSet(DataSet ds)
{
- // Create a new adapter and give it a query to fetch sales order, contact,
- // address, and product information for sales in the year 2002. Point connection
+ // Create a new adapter and give it a query to fetch sales order, contact,
+ // address, and product information for sales in the year 2002. Point connection
// information to the configuration setting "AdventureWorks".
string connectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;"
+ "Integrated Security=true;";
@@ -200,7 +200,7 @@ static private string SoundEx(string word)
value = buffer.ToString();
}
// Return the value.
- return value;
+ return value;
}
//
@@ -216,7 +216,7 @@ orderby order.Field("TotalDue")
select order;
DataView view = query.AsDataView();
-
+
bindingSource1.DataSource = view;
//
}
@@ -246,7 +246,7 @@ private void button3_Click(object sender, EventArgs e)
DataTable contacts = dataSet.Tables["Contact"];
EnumerableRowCollection query = from contact in contacts.AsEnumerable()
- where contact.Field("LastName").StartsWith("S")
+ where contact.Field("LastName").StartsWith("S")
select contact;
DataView view = query.AsDataView();
@@ -272,7 +272,7 @@ private void button4_Click(object sender, EventArgs e)
private void button5_Click(object sender, EventArgs e)
{
-
+
//
DataTable orders = dataSet.Tables["SalesOrderDetail"];
@@ -342,7 +342,7 @@ orderby order.Field("TotalDue")
select order;
DataView view = query.AsDataView();
-
+
bindingSource1.DataSource = view;
//
@@ -383,7 +383,7 @@ private void button12_Click(object sender, EventArgs e)
DataTable orders = dataSet.Tables["SalesOrderHeader"];
EnumerableRowCollection query = from order in orders.AsEnumerable()
- orderby order.Field("TotalDue")
+ orderby order.Field("TotalDue")
select order;
DataView view = query.AsDataView();
@@ -449,7 +449,7 @@ private void button16_Click(object sender, EventArgs e)
DataTable orders = dataSet.Tables["SalesOrderDetail"];
EnumerableRowCollection query = from order in orders.AsEnumerable()
- where order.Field("OrderQty") > 2 && order.Field("OrderQty") < 6
+ where order.Field("OrderQty") > 2 && order.Field("OrderQty") < 6
select order;
DataView view = query.AsDataView();
@@ -471,7 +471,7 @@ where contact.Field("LastName") == "Hernandez"
bindingSource1.DataSource = view;
dataGridView1.AutoResizeColumns();
-
+
//
}
@@ -481,7 +481,7 @@ private void button18_Click(object sender, EventArgs e)
DataTable orders = dataSet.Tables["SalesOrderHeader"];
EnumerableRowCollection query = from order in orders.AsEnumerable()
- where order.Field("OrderDate") > new DateTime(2002, 6, 1)
+ where order.Field("OrderDate") > new DateTime(2002, 6, 1)
select order;
DataView view = query.AsDataView();
@@ -546,7 +546,7 @@ private void button22_Click(object sender, EventArgs e)
DataTable products = dataSet.Tables["Product"];
EnumerableRowCollection query = from product in products.AsEnumerable()
- orderby product.Field("ListPrice"), product.Field("Color")
+ orderby product.Field("ListPrice"), product.Field("Color")
select product;
DataView view = query.AsDataView();
@@ -555,7 +555,7 @@ orderby product.Field("ListPrice"), product.Field("Color")
object[] criteria = new object[] { "Red"};
- DataRowView[] foundRowsView = view.FindRows(criteria);
+ DataRowView[] foundRowsView = view.FindRows(criteria);
//
}
@@ -583,7 +583,7 @@ private void button24_Click(object sender, EventArgs e)
DataTable orders = dataSet.Tables["SalesOrderHeader"];
EnumerableRowCollection query = from order in orders.AsEnumerable()
- where order.Field("OrderDate") > new DateTime(2002, 11, 20)
+ where order.Field("OrderDate") > new DateTime(2002, 11, 20)
&& order.Field("TotalDue") < new Decimal(60.00)
select order;
@@ -630,7 +630,7 @@ orderby order.Field("OrderDate").Year
private void button27_Click(object sender, EventArgs e)
{
-
+
DataTable products = dataSet.Tables["Product"];
// Query for red colored products.
@@ -643,11 +643,11 @@ orderby product.Field("ListPrice")
bindingSource1.DataSource = boundView;
//
- // Create a table from the bound view representing a query of
+ // Create a table from the bound view representing a query of
// available products.
DataView view = (DataView)bindingSource1.DataSource;
- DataTable productsTable = (DataTable)view.Table;
-
+ DataTable productsTable = (DataTable)view.Table;
+
// Set RowStateFilter to display the current rows.
view.RowStateFilter = DataViewRowState.CurrentRows ;
@@ -658,7 +658,7 @@ orderby rowView.Row.Field("ListPrice")
select new { Name = rowView.Row.Field("Name"),
Color = rowView.Row.Field("Color"),
Price = rowView.Row.Field("ListPrice")};
-
+
// Bind the query results to another DataGridView.
dataGridView2.DataSource = productQuery.ToList();
//
@@ -692,7 +692,7 @@ orderby product.Field("ListPrice")
// Query for the modified and deleted rows.
IEnumerable modifiedDeletedQuery = from DataRowView rowView in view
select rowView;
-
+
dataGridView2.DataSource = modifiedDeletedQuery.ToList();
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DP LINQ to DataSet Examples/CS/Program.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DP LINQ to DataSet Examples/CS/Program.cs
index 6c535bb9d46..cc94d23d3ea 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DP LINQ to DataSet Examples/CS/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DP LINQ to DataSet Examples/CS/Program.cs
@@ -59,7 +59,7 @@ static void Main(string[] args)
/*** Grouping Operators ***/
//GroupBySimple2();
- //GroupBySimple3();
+ //GroupBySimple3();
//GroupByNested();
/*** Set Operators ***/
@@ -85,7 +85,7 @@ static void Main(string[] args)
//Range(); // Didn't use Range, couldn't get it to work.
/*** Quantifier Operators ***/
- //AnyGrouped_MQ();
+ //AnyGrouped_MQ();
//AllGrouped_MQ();
/*** Aggregate Operators ***/
@@ -93,17 +93,17 @@ static void Main(string[] args)
//Average_MQ();
//Average2_MQ();
//Count();
- //CountNested();
+ //CountNested();
//CountGrouped();
//LongCountSimple();
//SumProjection_MQ();
//SumGrouped_MQ();
//MinProjection_MQ();
//MinGrouped_MQ();
- //MinElements_MQ();
+ //MinElements_MQ();
//AverageProjection_MQ();
//AverageGrouped_MQ();
- //AverageElements_MQ();
+ //AverageElements_MQ();
//MaxProjection_MQ();
//MaxGrouped_MQ();
MaxElements_MQ();
@@ -122,7 +122,7 @@ static void Main(string[] args)
/*** DataRowComparer examples ***/
//CompareDifferentDataRows();
//CompareEqualDataRows();
- //CompareNullDataRows();
+ //CompareNullDataRows();
/*** CopyToDataTable examples ***/
//CopyToDataTable1();
@@ -134,7 +134,7 @@ static void Main(string[] args)
//OrderBy();
//OrderByDescending();
//Sum();
- //GroupBy();
+ //GroupBy();
Console.WriteLine("Hit Enter...");
Console.Read();
@@ -195,8 +195,8 @@ from product in products.AsEnumerable()
/*[Category("Projection Operators")]
[Title("Select - Anonymous Types ")]
- [Description("This example uses Select to project the Name, ProductNumber, and
- ListPrice properties to a sequence of anonymous types. The ListPrice
+ [Description("This example uses Select to project the Name, ProductNumber, and
+ ListPrice properties to a sequence of anonymous types. The ListPrice
property is also renamed to Price in the resulting type.")]*/
static void SelectAnonymousTypes_MQ()
{
@@ -517,7 +517,7 @@ where product.Field("Color") == "Red"
/*[Category("Restriction Operators")]
[Title("Where ")]
- [Description("This example returns all red colored products. This query does not used the generic Field
+ [Description("This example returns all red colored products. This query does not used the generic Field
method, but explicitly checks column values for null.")]*/
static void WhereIsNull()
{
@@ -1266,7 +1266,7 @@ where contact.Field("FirstName") == "Sandra"
DataTable contacts1 = query1.CopyToDataTable();
DataTable contacts2 = query2.CopyToDataTable();
- // Find the contacts that are in the first
+ // Find the contacts that are in the first
// table but not the second.
var contacts = contacts1.AsEnumerable().Except(contacts2.AsEnumerable(),
DataRowComparer.Default);
@@ -2275,10 +2275,10 @@ where contact.Field("ContactID") == order.Field("ContactID") &&
foreach (var result in query.Take(10))
{
- OnlineOrders.Rows.Add(new object[] {
- result.FirstName,
- result.LastName,
- result.OrderDate,
+ OnlineOrders.Rows.Add(new object[] {
+ result.FirstName,
+ result.LastName,
+ result.OrderDate,
result.TotalDue });
}
@@ -2341,7 +2341,7 @@ static void CopyToDataTable1()
DataTable orders = ds.Tables["SalesOrderHeader"];
- // Query the SalesOrderHeader table for orders placed
+ // Query the SalesOrderHeader table for orders placed
// after August 8, 2001.
IEnumerable query =
from order in orders.AsEnumerable()
@@ -2351,7 +2351,7 @@ from order in orders.AsEnumerable()
// Create a table from the query.
DataTable boundTable = query.CopyToDataTable();
- // Bind the table to a System.Windows.Forms.BindingSource object,
+ // Bind the table to a System.Windows.Forms.BindingSource object,
// which acts as a proxy for a System.Windows.Forms.DataGridView object.
bindingSource.DataSource = boundTable;
//
@@ -2621,8 +2621,8 @@ static void FillDataSet(DataSet ds)
//
try
{
- // Create a new adapter and give it a query to fetch sales order, contact,
- // address, and product information for sales in the year 2002. Point connection
+ // Create a new adapter and give it a query to fetch sales order, contact,
+ // address, and product information for sales in the year 2002. Point connection
// information to the configuration setting "AdventureWorks".
string connectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;"
+ "Integrated Security=true;";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks BulkCopy.Single/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks BulkCopy.Single/CS/source.cs
index dc6aef34f48..9f82f0f1128 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks BulkCopy.Single/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks BulkCopy.Single/CS/source.cs
@@ -31,17 +31,17 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Open the destination connection. In the real world you would
- // not use SqlBulkCopy to move data from one table to the other
+ // Open the destination connection. In the real world you would
+ // not use SqlBulkCopy to move data from one table to the other
// in the same database. This is for demonstration purposes only.
using (SqlConnection destinationConnection =
new SqlConnection(connectionString))
{
destinationConnection.Open();
- // Set up the bulk copy object.
+ // Set up the bulk copy object.
// Note that the column positions in the source
- // data reader match the column positions in
+ // data reader match the column positions in
// the destination table so there is no need to
// map columns.
using (SqlBulkCopy bulkCopy =
@@ -68,7 +68,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -81,8 +81,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks Data.AcceptRejectRule/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks Data.AcceptRejectRule/CS/source.cs
index 96fd426cc2d..d23d89ac56e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks Data.AcceptRejectRule/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks Data.AcceptRejectRule/CS/source.cs
@@ -6,7 +6,7 @@ public class Form1: Form
{
//
- private void CreateConstraint(DataSet dataSet,
+ private void CreateConstraint(DataSet dataSet,
string table1, string table2,string column1, string column2)
{
// Declare parent column and child column variables.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks Data.DataRowChangeEventHandler/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks Data.DataRowChangeEventHandler/CS/source.cs
index 7aefa3a13d7..f1e69b61d5d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks Data.DataRowChangeEventHandler/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks Data.DataRowChangeEventHandler/CS/source.cs
@@ -10,16 +10,16 @@ public class Form1: Form
//
private DataTable dataTable;
-
+
private void AddHandler(){
dataTable = new DataTable("dataTable");
dataTable.RowChanged +=
new System.Data.DataRowChangeEventHandler(dataTable_Changed);
}
-
+
private void dataTable_Changed(object sender,
- System.Data.DataRowChangeEventArgs e)
- {
+ System.Data.DataRowChangeEventArgs e)
+ {
Console.WriteLine("Row Changed", e.Action,
e.Row[dataGrid1.CurrentCell.ColumnNumber]);
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataRowView.RowVersion1/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataRowView.RowVersion1/CS/source.cs
index 25c2c418a62..3950b3cec1c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataRowView.RowVersion1/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataRowView.RowVersion1/CS/source.cs
@@ -39,9 +39,9 @@ private static void DemonstrateRowVersion()
row["Column"] = "World";
table.Rows.Add(row);
- // Set the RowStateFilter to display only added
+ // Set the RowStateFilter to display only added
// and modified rows.
- view.RowStateFilter = DataViewRowState.Added |
+ view.RowStateFilter = DataViewRowState.Added |
DataViewRowState.ModifiedCurrent;
// Print those rows. Output includes "Hello" and "World".
@@ -80,7 +80,7 @@ private static void PrintView(DataView view, string label)
for (int i = 0; i < view.Count; i++)
{
Console.WriteLine(view[i]["Column"]);
- Console.WriteLine("DataViewRow.RowVersion: {0}",
+ Console.WriteLine("DataViewRow.RowVersion: {0}",
view[i].RowVersion);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.CreateDataReader/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.CreateDataReader/CS/source.cs
index 6f042bd2a94..afa779ddf42 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.CreateDataReader/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.CreateDataReader/CS/source.cs
@@ -33,13 +33,13 @@ private static void TestCreateDataReader(DataSet dataSet)
// allowing access to all the DataSet's data.
// Even though the dataset contains three DataTables,
// this code will only display the contents of two of them,
- // because the code has limited the results to the
+ // because the code has limited the results to the
// DataTables stored in the tables array. Because this
- // parameter is declared using the ParamArray keyword,
- // you could also include a list of DataTable instances
- // individually, as opposed to supplying an array of
+ // parameter is declared using the ParamArray keyword,
+ // you could also include a list of DataTable instances
+ // individually, as opposed to supplying an array of
// DataTables, as in this example:
- using (DataTableReader reader =
+ using (DataTableReader reader =
dataSet.CreateDataReader(productTable, emptyTable))
{
do
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.DataTableReaderTables/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.DataTableReaderTables/CS/source.cs
index bb69645943a..caa5eb98795 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.DataTableReaderTables/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.DataTableReaderTables/CS/source.cs
@@ -33,13 +33,13 @@ private static void TestCreateDataReader(DataSet dataSet)
// allowing access to all the DataSet's data.
// Even though the dataset contains three DataTables,
// this code will only display the contents of two of them,
- // because the code has limited the results to the
+ // because the code has limited the results to the
// DataTables stored in the tables array. Because this
- // parameter is declared using the ParamArray keyword,
- // you could also include a list of DataTable instances
- // individually, as opposed to supplying an array of
+ // parameter is declared using the ParamArray keyword,
+ // you could also include a list of DataTable instances
+ // individually, as opposed to supplying an array of
// DataTables, as in this example:
- using (DataTableReader reader =
+ using (DataTableReader reader =
dataSet.CreateDataReader(productTable, emptyTable))
{
do
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.Load/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.Load/CS/source.cs
index f06b494bd25..c1a836a57bf 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.Load/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.Load/CS/source.cs
@@ -19,7 +19,7 @@ static void Main()
DataTable table = GetIntegerTable();
dataSet.Tables.Add(table);
DataTableReader reader = new DataTableReader(GetStringTable());
- dataSet.Load(reader, LoadOption.OverwriteChanges,
+ dataSet.Load(reader, LoadOption.OverwriteChanges,
FillErrorHandler, table);
Console.WriteLine("Press any key to continue.");
@@ -69,14 +69,14 @@ static void FillErrorHandler(object sender, FillErrorEventArgs e)
// went wrong.
if (e.Errors.GetType() == typeof(System.FormatException))
{
- Console.WriteLine("Error when attempting to update the value: {0}",
+ Console.WriteLine("Error when attempting to update the value: {0}",
e.Values[0]);
}
// Setting e.Continue to True tells the Load
// method to continue trying. Setting it to False
- // indicates that an error has occurred, and the
- // Load method raises the exception that got
+ // indicates that an error has occurred, and the
+ // Load method raises the exception that got
// you here.
e.Continue = true;
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.LoadString/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.LoadString/CS/source.cs
index a61d692af36..576ec9a9a6f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.LoadString/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.LoadString/CS/source.cs
@@ -12,7 +12,7 @@ static void Main()
DataTableReader reader = GetReader();
- // The tables listed as parameters for the Load method
+ // The tables listed as parameters for the Load method
// should be in the same order as the tables within the IDataReader.
dataSet.Load(reader, LoadOption.Upsert, "Customers", "Products");
foreach (DataTable table in dataSet.Tables)
@@ -34,7 +34,7 @@ static void Main()
// list of table names in the parameters. If you specify
// a new table name here, the Load method will create
// a corresponding new table.
- dataSet.Load(reader, LoadOption.Upsert,
+ dataSet.Load(reader, LoadOption.Upsert,
"NewCustomers", "Products");
foreach (DataTable table in dataSet.Tables)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.LoadTables/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.LoadTables/CS/source.cs
index de1e4715006..1ebcd4cae17 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.LoadTables/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataSet.LoadTables/CS/source.cs
@@ -19,7 +19,7 @@ static void Main()
dataSet.Tables.Add(customerTable);
dataSet.Tables.Add(productTable);
- // Load the data into the existing DataSet.
+ // Load the data into the existing DataSet.
DataTableReader reader = GetReader();
dataSet.Load(reader, LoadOption.OverwriteChanges,
customerTable, productTable);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.CreateDataReader/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.CreateDataReader/CS/source.cs
index 1b16a62932a..478ea068bc6 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.CreateDataReader/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.CreateDataReader/CS/source.cs
@@ -10,7 +10,7 @@ static void Main()
Console.WriteLine("Press any key to continue.");
Console.ReadKey();
}
-
+
private static void TestCreateDataReader(DataTable dt)
{
// Given a DataTable, retrieve a DataTableReader
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.Merge/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.Merge/CS/source.cs
index 4221f846d13..a1b221d14ef 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.Merge/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.Merge/CS/source.cs
@@ -24,7 +24,7 @@ private static void DemonstrateMergeTable()
table1.PrimaryKey = new DataColumn[] { column1 };
// Add RowChanged event handler for the table.
- table1.RowChanged +=
+ table1.RowChanged +=
new System.Data.DataRowChangeEventHandler(Row_Changed);
// Add some rows.
@@ -44,7 +44,7 @@ private static void DemonstrateMergeTable()
// Create a second DataTable identical to the first.
DataTable table2 = table1.Clone();
- // Add three rows. Note that the id column can't be the
+ // Add three rows. Note that the id column can't be the
// same as existing rows in the original table.
row = table2.NewRow();
row["id"] = 14;
@@ -67,10 +67,10 @@ private static void DemonstrateMergeTable()
PrintValues(table1, "Merged With table1");
}
- private static void Row_Changed(object sender,
+ private static void Row_Changed(object sender,
DataRowChangeEventArgs e)
{
- Console.WriteLine("Row changed {0}\t{1}",
+ Console.WriteLine("Row changed {0}\t{1}",
e.Action, e.Row.ItemArray[0]);
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.MergeMissingSchemaAction/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.MergeMissingSchemaAction/CS/source.cs
index 89fb1a1cba4..e8ab2561320 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.MergeMissingSchemaAction/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.MergeMissingSchemaAction/CS/source.cs
@@ -24,7 +24,7 @@ private static void DemonstrateMergeTable()
itemsTable.PrimaryKey = new DataColumn[] { idColumn };
// Add RowChanged event handler for the table.
- itemsTable.RowChanged +=
+ itemsTable.RowChanged +=
new System.Data.DataRowChangeEventHandler(Row_Changed);
// Add ten rows.
@@ -44,11 +44,11 @@ private static void DemonstrateMergeTable()
// Create a second DataTable identical to the first.
DataTable itemsClone = itemsTable.Clone();
- // Add column to the second column, so that the
+ // Add column to the second column, so that the
// schemas no longer match.
itemsClone.Columns.Add("newColumn", typeof(System.String));
- // Add three rows. Note that the id column can't be the
+ // Add three rows. Note that the id column can't be the
// same as existing rows in the original table.
row = itemsClone.NewRow();
row["id"] = 14;
@@ -74,10 +74,10 @@ private static void DemonstrateMergeTable()
PrintValues(itemsTable, "Merged With itemsTable, schema added");
}
- private static void Row_Changed(object sender,
+ private static void Row_Changed(object sender,
DataRowChangeEventArgs e)
{
- Console.WriteLine("Row changed {0}\t{1}",
+ Console.WriteLine("Row changed {0}\t{1}",
e.Action, e.Row.ItemArray[0]);
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.MergePreserveChanges/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.MergePreserveChanges/CS/source.cs
index b88ce15e552..2304ec85a16 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.MergePreserveChanges/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.MergePreserveChanges/CS/source.cs
@@ -26,8 +26,8 @@ private static void DemonstrateMergeTable()
// 2. Create a copy of table1, and modify its data (modifiedTable).
// 3. Modify data in table1.
// 4. Make a copy of table1 (table1Copy).
- // 5. Merge the data from modifiedTable into table1 and table1Copy,
- // showing the difference between setting the preserveChanges
+ // 5. Merge the data from modifiedTable into table1 and table1Copy,
+ // showing the difference between setting the preserveChanges
// parameter to true and false.
// Create a new DataTable.
@@ -57,12 +57,12 @@ private static void DemonstrateMergeTable()
table1.AcceptChanges();
PrintValues(table1, "Original values");
- // Using the same schema as the original table,
+ // Using the same schema as the original table,
// modify the data for later merge.
DataTable modifiedTable = table1.Copy();
foreach (DataRow rowModified in modifiedTable.Rows)
{
- rowModified["item"] = rowModified["item"].ToString()
+ rowModified["item"] = rowModified["item"].ToString()
+ " modified";
}
modifiedTable.AcceptChanges();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlIOStream/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlIOStream/CS/source.cs
index 4419539ec1f..a712fe82547 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlIOStream/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlIOStream/CS/source.cs
@@ -59,7 +59,7 @@ private static void PrintSchema(DataTable table, string label)
Console.WriteLine(label);
foreach (DataColumn column in table.Columns)
{
- Console.WriteLine("\t{0}: {1}", column.ColumnName,
+ Console.WriteLine("\t{0}: {1}", column.ColumnName,
column.DataType.Name);
}
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchema/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchema/CS/source.cs
index 7f0ea11efe6..f007d81107d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchema/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchema/CS/source.cs
@@ -25,7 +25,7 @@ private static void DemonstrateReadWriteXMLSchemaWithReader()
xmlStream.Position = 0;
DataTable newTable = new DataTable();
- System.IO.StreamReader reader =
+ System.IO.StreamReader reader =
new System.IO.StreamReader(xmlStream);
newTable.ReadXmlSchema(reader);
@@ -63,7 +63,7 @@ private static void PrintSchema(DataTable table, string label)
Console.WriteLine(label);
foreach (DataColumn column in table.Columns)
{
- Console.WriteLine("\t{0}: {1}",
+ Console.WriteLine("\t{0}: {1}",
column.ColumnName, column.DataType.Name);
}
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchemaReader/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchemaReader/CS/source.cs
index cb53408a3a0..eadc98f4b4d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchemaReader/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchemaReader/CS/source.cs
@@ -16,7 +16,7 @@ private static void DemonstrateReadWriteXMLSchemaWithReader()
PrintSchema(table, "Original table");
// Write the schema to XML in a memory stream.
- System.IO.MemoryStream xmlStream =
+ System.IO.MemoryStream xmlStream =
new System.IO.MemoryStream();
table.WriteXmlSchema(xmlStream);
@@ -24,7 +24,7 @@ private static void DemonstrateReadWriteXMLSchemaWithReader()
xmlStream.Position = 0;
DataTable newTable = new DataTable();
- System.Xml.XmlTextReader reader =
+ System.Xml.XmlTextReader reader =
new System.Xml.XmlTextReader(xmlStream);
newTable.ReadXmlSchema(reader);
@@ -62,7 +62,7 @@ private static void PrintSchema(DataTable table, string label)
Console.WriteLine(label);
foreach (DataColumn column in table.Columns)
{
- Console.WriteLine("\t{0}: {1}", column.ColumnName,
+ Console.WriteLine("\t{0}: {1}", column.ColumnName,
column.DataType.Name);
}
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchemaString/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchemaString/CS/source.cs
index d55450e1886..6cf34834e46 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchemaString/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlSchemaString/CS/source.cs
@@ -58,7 +58,7 @@ private static void PrintSchema(DataTable table, string label)
Console.WriteLine(label);
foreach (DataColumn column in table.Columns)
{
- Console.WriteLine("\t{0}: {1}", column.ColumnName,
+ Console.WriteLine("\t{0}: {1}", column.ColumnName,
column.DataType.Name);
}
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlText/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlText/CS/source.cs
index 426155efe77..cca70bb6878 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlText/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlText/CS/source.cs
@@ -22,7 +22,7 @@ private static void DemonstrateReadWriteXMLDocumentWithReader()
// Rewind the memory stream.
xmlStream.Position = 0;
- System.IO.StreamReader reader =
+ System.IO.StreamReader reader =
new System.IO.StreamReader(xmlStream);
DataTable newTable = new DataTable();
newTable.ReadXml(reader);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlXmlReader/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlXmlReader/CS/source.cs
index 50b95453979..df7fb2c5d9d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlXmlReader/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.ReadXmlXmlReader/CS/source.cs
@@ -22,7 +22,7 @@ private static void DemonstrateReadWriteXMLDocumentWithReader()
// Rewind the memory stream.
xmlStream.Position = 0;
- System.Xml.XmlTextReader reader =
+ System.Xml.XmlTextReader reader =
new System.Xml.XmlTextReader(xmlStream);
DataTable newTable = new DataTable();
newTable.ReadXml(reader);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXml/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXml/CS/source.cs
index 3ab2a418698..14076995235 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXml/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXml/CS/source.cs
@@ -69,7 +69,7 @@ private static DataTable GetOrders()
return table;
}
- private static void PrintOutput(System.IO.TextWriter stream,
+ private static void PrintOutput(System.IO.TextWriter stream,
string caption)
{
Console.WriteLine("==============================");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXmlIO/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXmlIO/CS/source.cs
index 4407f6602b2..3b0387b8034 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXmlIO/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXmlIO/CS/source.cs
@@ -73,7 +73,7 @@ private static DataTable GetOrders()
return table;
}
- private static void PrintOutput(System.IO.TextWriter writer,
+ private static void PrintOutput(System.IO.TextWriter writer,
string caption)
{
Console.WriteLine("==============================");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXmlSchemaOverload/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXmlSchemaOverload/CS/source.cs
index 4335620f077..7401fdbb33f 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXmlSchemaOverload/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTable.WriteXmlSchemaOverload/CS/source.cs
@@ -73,7 +73,7 @@ private static DataTable GetOrders()
return table;
}
- private static void PrintOutput(System.IO.TextWriter writer,
+ private static void PrintOutput(System.IO.TextWriter writer,
string caption)
{
Console.WriteLine("==============================");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.ErrorEventHandler/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.ErrorEventHandler/CS/source.cs
index 05a7dde1f3f..7b2e679b232 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.ErrorEventHandler/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.ErrorEventHandler/CS/source.cs
@@ -66,14 +66,14 @@ static void FillErrorHandler(object sender, FillErrorEventArgs e)
// went wrong.
if (e.Errors.GetType() == typeof(System.FormatException))
{
- Console.WriteLine("Error when attempting to update the value: {0}",
+ Console.WriteLine("Error when attempting to update the value: {0}",
e.Values[0]);
}
// Setting e.Continue to True tells the Load
// method to continue trying. Setting it to False
- // indicates that an error has occurred, and the
- // Load method raises the exception that got
+ // indicates that an error has occurred, and the
+ // Load method raises the exception that got
// you here.
e.Continue = true;
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.IDataReader/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.IDataReader/CS/source.cs
index 8e050de1e65..1c1beeb9f1b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.IDataReader/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.IDataReader/CS/source.cs
@@ -6,11 +6,11 @@ class Program
//
static void Main()
{
- // This example examines a number of scenarios involving the
+ // This example examines a number of scenarios involving the
// DataTable.Load method.
Console.WriteLine("Load a DataTable and infer its schema:");
- // The table has no schema. The Load method will infer the
+ // The table has no schema. The Load method will infer the
// schema from the IDataReader:
DataTable table = new DataTable();
@@ -27,17 +27,17 @@ static void Main()
"Load a DataTable from an incompatible IDataReader:");
// Create a table with a single integer column. Attempt
- // to load data from a reader with a schema that is
+ // to load data from a reader with a schema that is
// incompatible. Note the exception, determined
// by the particular incompatibility:
table = GetIntegerTable();
reader = new DataTableReader(GetStringTable());
- try
+ try
{
table.Load(reader);
- }
- catch (Exception ex)
- {
+ }
+ catch (Exception ex)
+ {
Console.WriteLine(ex.GetType().Name + ":" + ex.Message);
}
@@ -56,14 +56,14 @@ static void Main()
Console.WriteLine(
"Load a DataTable with an IDataReader that has missing columns:");
- // Note that loading a reader with missing columns causes
+ // Note that loading a reader with missing columns causes
// the columns to be filled with null data, if possible:
table = GetCustomers();
reader = new DataTableReader(GetIntegerTable());
table.Load(reader);
PrintColumns(table);
- // Demonstrate the various possibilites when loading data
+ // Demonstrate the various possibilites when loading data
// into a DataTable that already contains data.
Console.WriteLine(" ============================= ");
Console.WriteLine("Demonstrate data considerations:");
@@ -78,8 +78,8 @@ static void Main()
Console.WriteLine("Data in IDataReader to be loaded:");
DisplayRowState(GetChangedCustomers());
- // Load data into a DataTable, retrieve a DataTableReader
- // containing different data, and call the Load method.
+ // Load data into a DataTable, retrieve a DataTableReader
+ // containing different data, and call the Load method.
Console.WriteLine(" ============================= ");
Console.WriteLine("table.Load(reader)");
Console.WriteLine(" ============================= ");
@@ -114,7 +114,7 @@ private static void DisplayRowState(DataTable table)
{
original = table.Rows[i]["Name", DataRowVersion.Original];
}
- Console.WriteLine("{0}: {1}, {2} ({3})", i,
+ Console.WriteLine("{0}: {1}, {2} ({3})", i,
current, original, rowState);
}
}
@@ -125,7 +125,7 @@ private static DataTable GetChangedCustomers()
DataTable table = new DataTable();
// Create two columns, ID and Name.
- DataColumn idColumn = table.Columns.Add("ID",
+ DataColumn idColumn = table.Columns.Add("ID",
typeof(int));
table.Columns.Add("Name", typeof(string));
@@ -149,7 +149,7 @@ private static DataTable GetCustomers()
DataTable table = new DataTable();
// Create two columns, ID and Name.
- DataColumn idColumn = table.Columns.Add("ID",
+ DataColumn idColumn = table.Columns.Add("ID",
typeof(int));
table.Columns.Add("Name", typeof(string));
@@ -171,7 +171,7 @@ private static DataTable GetIntegerTable()
DataTable table = new DataTable();
// Create two columns, ID and Name.
- DataColumn idColumn = table.Columns.Add("ID",
+ DataColumn idColumn = table.Columns.Add("ID",
typeof(int));
// Set the ID column as the primary key column.
@@ -192,7 +192,7 @@ private static DataTable GetStringTable()
DataTable table = new DataTable();
// Create two columns, ID and Name.
- DataColumn idColumn = table.Columns.Add("ID",
+ DataColumn idColumn = table.Columns.Add("ID",
typeof(string));
// Set the ID column as the primary key column.
@@ -221,7 +221,7 @@ private static void PrintColumns(DataTable table)
private static DataTable SetupModifiedRows()
{
- // Fill a DataTable with customer info, and
+ // Fill a DataTable with customer info, and
// then modify, delete, and add rows.
DataTable table = GetCustomers();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.LoadOption/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.LoadOption/CS/source.cs
index 15cac087dff..49ab750d1ec 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.LoadOption/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad.LoadOption/CS/source.cs
@@ -6,11 +6,11 @@ class Program
//
static void Main()
{
- // This example examines a number of scenarios involving the
+ // This example examines a number of scenarios involving the
// DataTable.Load method.
Console.WriteLine("Load a DataTable and infer its schema:");
- // The table has no schema. The Load method will infer the
+ // The table has no schema. The Load method will infer the
// schema from the IDataReader:
DataTable table = new DataTable();
@@ -27,7 +27,7 @@ static void Main()
"Load a DataTable from an incompatible IDataReader:");
// Create a table with a single integer column. Attempt
- // to load data from a reader with a schema that is
+ // to load data from a reader with a schema that is
// incompatible. Note the exception, determined
// by the particular incompatibility:
table = GetIntegerTable();
@@ -56,7 +56,7 @@ static void Main()
Console.WriteLine(
"Load a DataTable with an IDataReader that has missing columns:");
- // Note that loading a reader with missing columns causes
+ // Note that loading a reader with missing columns causes
// the columns to be filled with null data, if possible:
table = GetCustomers();
reader = new DataTableReader(GetIntegerTable());
@@ -107,7 +107,7 @@ private static void DisplayRowState(DataTable table)
{
original = table.Rows[i]["Name", DataRowVersion.Original];
}
- Console.WriteLine("{0}: {1}, {2} ({3})", i,
+ Console.WriteLine("{0}: {1}, {2} ({3})", i,
current, original, rowState);
}
}
@@ -204,7 +204,7 @@ private static void PerformDemo(LoadOption optionForLoad)
DataTable table = SetupModifiedRows();
DataTableReader reader = new DataTableReader(GetChangedCustomers());
table.RowChanging +=new DataRowChangeEventHandler(HandleRowChanging);
-
+
table.Load(reader, optionForLoad);
Console.WriteLine();
DisplayRowState(table);
@@ -225,7 +225,7 @@ private static void PrintColumns(DataTable table)
private static DataTable SetupModifiedRows()
{
- // Fill a DataTable with customer info, and
+ // Fill a DataTable with customer info, and
// then modify, delete, and add rows.
DataTable table = GetCustomers();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad/CS/source.cs
index 1af9164b8f4..d987ca8b70e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableLoad/CS/source.cs
@@ -6,11 +6,11 @@ class Program
//
static void Main()
{
- // This example examines a number of scenarios involving the
+ // This example examines a number of scenarios involving the
// DataTable.Load method.
Console.WriteLine("Load a DataTable and infer its schema:");
- // The table has no schema. The Load method will infer the
+ // The table has no schema. The Load method will infer the
// schema from the IDataReader:
DataTable table = new DataTable();
@@ -26,7 +26,7 @@ static void Main()
Console.WriteLine("Load a DataTable from an incompatible IDataReader:");
// Create a table with a single integer column. Attempt
- // to load data from a reader with a schema that is
+ // to load data from a reader with a schema that is
// incompatible. Note the exception, determined
// by the particular incompatibility:
table = GetIntegerTable();
@@ -55,7 +55,7 @@ static void Main()
Console.WriteLine(
"Load a DataTable with an IDataReader that has missing columns:");
- // Note that loading a reader with missing columns causes
+ // Note that loading a reader with missing columns causes
// the columns to be filled with null data, if possible:
table = GetCustomers();
reader = new DataTableReader(GetIntegerTable());
@@ -106,7 +106,7 @@ private static void DisplayRowState(DataTable table)
{
original = table.Rows[i]["Name", DataRowVersion.Original];
}
- Console.WriteLine("{0}: {1}, {2} ({3})", i, current,
+ Console.WriteLine("{0}: {1}, {2} ({3})", i, current,
original, rowState);
}
}
@@ -203,7 +203,7 @@ private static void PerformDemo(LoadOption optionForLoad)
DataTable table = SetupModifiedRows();
DataTableReader reader = new DataTableReader(GetChangedCustomers());
table.RowChanging +=new DataRowChangeEventHandler(HandleRowChanging);
-
+
table.Load(reader, optionForLoad);
Console.WriteLine();
DisplayRowState(table);
@@ -224,7 +224,7 @@ private static void PrintColumns(DataTable table)
private static DataTable SetupModifiedRows()
{
- // Fill a DataTable with customer info, and
+ // Fill a DataTable with customer info, and
// then modify, delete, and add rows.
DataTable table = GetCustomers();
@@ -247,7 +247,7 @@ private static DataTable SetupModifiedRows()
static void HandleRowChanging(object sender, DataRowChangeEventArgs e)
{
Console.WriteLine(
- "RowChanging event: ID = {0}, action = {1}", e.Row["ID"],
+ "RowChanging event: ID = {0}, action = {1}", e.Row["ID"],
e.Action);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableMergeOverload/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableMergeOverload/CS/source.cs
index 17cbc65ea76..590034b3e09 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableMergeOverload/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableMergeOverload/CS/source.cs
@@ -24,7 +24,7 @@ private static void DemonstrateMergeTable()
table1.PrimaryKey = new DataColumn[] { idColumn };
// Add RowChanged event handler for the table.
- table1.RowChanged += new
+ table1.RowChanged += new
System.Data.DataRowChangeEventHandler(Row_Changed);
// Add ten rows.
@@ -44,11 +44,11 @@ private static void DemonstrateMergeTable()
// Create a second DataTable identical to the first.
DataTable table2 = table1.Clone();
- // Add column to the second column, so that the
+ // Add column to the second column, so that the
// schemas no longer match.
table2.Columns.Add("newColumn", typeof(System.String));
- // Add three rows. Note that the id column can't be the
+ // Add three rows. Note that the id column can't be the
// same as existing rows in the original table.
row = table2.NewRow();
row["id"] = 14;
@@ -74,10 +74,10 @@ private static void DemonstrateMergeTable()
PrintValues(table1, "Merged With table1, schema added");
}
- private static void Row_Changed(object sender,
+ private static void Row_Changed(object sender,
DataRowChangeEventArgs e)
{
- Console.WriteLine("Row changed {0}\t{1}", e.Action,
+ Console.WriteLine("Row changed {0}\t{1}", e.Action,
e.Row.ItemArray[0]);
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetBytes/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetBytes/CS/source.cs
index adaf414243b..fe12b4eafab 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetBytes/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetBytes/CS/source.cs
@@ -16,15 +16,15 @@ static void Main(string[] args)
static private void TestGetBytes()
{
- // Set up the data adapter, using information from
+ // Set up the data adapter, using information from
// the AdventureWorks sample database.
- SqlDataAdapter photoAdapter = SetupDataAdapter(
+ SqlDataAdapter photoAdapter = SetupDataAdapter(
"SELECT ThumbnailPhotoFileName, ThumbNailPhoto " +
"FROM Production.ProductPhoto");
// Fill the DataTable.
DataTable photoDataTable = new DataTable();
photoAdapter.Fill(photoDataTable);
-
+
using (DataTableReader reader = new DataTableReader(photoDataTable))
{
while (reader.Read())
@@ -49,9 +49,9 @@ static private void TestGetBytes()
// read the bytes from the DataTableReader.
Byte[] buffer = new Byte[len];
reader.GetBytes(1, 0, buffer, 0, (int)len);
- // Create a new Bitmap object, passing the array
+ // Create a new Bitmap object, passing the array
// of bytes to the constructor of a MemoryStream.
- using (Bitmap productImage = new
+ using (Bitmap productImage = new
Bitmap(new MemoryStream(buffer)))
{
String fileName = "C:\\" + productName;
@@ -74,9 +74,9 @@ static private void TestGetBytes()
static private SqlDataAdapter SetupDataAdapter(String sqlString)
{
// Assuming all the default settings, create a SqlDataAdapter
- // working with the AdventureWorks sample database that's
+ // working with the AdventureWorks sample database that's
// available with SQL Server.
- String connectionString =
+ String connectionString =
"Data Source=(local);Initial Catalog=AdventureWorks;" +
"Integrated Security=true";
return new SqlDataAdapter(sqlString, connectionString);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetChars/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetChars/CS/source.cs
index c3af40f7fca..d7f53516237 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetChars/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetChars/CS/source.cs
@@ -38,7 +38,7 @@ private static void TestGetChars(DataTableReader reader, int bufferSize)
// First, verify that the FileName column isn't null.
if (!reader.IsDBNull(FILENAME_COLUMN))
{
- // Get the file name, and create a file with
+ // Get the file name, and create a file with
// the supplied name.
fileName = reader.GetString(FILENAME_COLUMN);
// Start at the beginning.
@@ -51,7 +51,7 @@ private static void TestGetChars(DataTableReader reader, int bufferSize)
{
// Loop through all the characters in the input field,
// incrementing the offset for the next time. If this
- // pass through the loop reads characters, write them to
+ // pass through the loop reads characters, write them to
// the output stream.
do
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetDataTypeName/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetDataTypeName/CS/source.cs
index 5013c146c09..0dfac3de894 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetDataTypeName/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetDataTypeName/CS/source.cs
@@ -16,7 +16,7 @@ private static void TestGetTypeName()
{
for (int i = 0; i < reader.FieldCount; i++)
{
- Console.WriteLine("{0}: {1}", reader.GetName(i),
+ Console.WriteLine("{0}: {1}", reader.GetName(i),
reader.GetDataTypeName(i));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetEnumerator/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetEnumerator/CS/source.cs
index fcd9db7e33c..60d99351f67 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetEnumerator/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetEnumerator/CS/source.cs
@@ -31,7 +31,7 @@ public static void Main()
// is able to survive row deletion.
bool isRowDeleted = false;
while (enumerator.MoveNext())
- {
+ {
DbDataRecord dataRecord = (DbDataRecord)enumerator.Current;
// While the enumerator is active, delete a row.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetFieldType/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetFieldType/CS/source.cs
index 1699aa69230..8b27781945e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetFieldType/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetFieldType/CS/source.cs
@@ -11,7 +11,7 @@ private void TestGetFieldType(DataTableReader reader)
{
for (int i = 0; i < reader.FieldCount; i++)
{
- Console.WriteLine(reader.GetName(i) + ":" +
+ Console.WriteLine(reader.GetName(i) + ":" +
reader.GetFieldType(i).FullName);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetName/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetName/CS/source.cs
index cc270567a00..c6f2bce30e8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetName/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetName/CS/source.cs
@@ -10,7 +10,7 @@ static void Main()
private static void DisplayColumnNames(DataTableReader reader)
{
// Given a DataTableReader, display column names.
- for (int i = 0; i < reader.FieldCount; i++)
+ for (int i = 0; i < reader.FieldCount; i++)
{
Console.WriteLine("{0}: {1}", i, reader.GetName(i));
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetOrdinal/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetOrdinal/CS/source.cs
index 4fe8bb5c360..151e172b3ef 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetOrdinal/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetOrdinal/CS/source.cs
@@ -14,7 +14,7 @@ private static object GetValueByName(
// if you're going to retrieve information from a column
// in a loop, it would be better to retrieve the column
// ordinal once, store the value, and use the methods
- // of the DataTableReader class directly.
+ // of the DataTableReader class directly.
object columnValue;
try
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetSchemaTable/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetSchemaTable/CS/source.cs
index 8d69d620086..d056a5988dc 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetSchemaTable/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetSchemaTable/CS/source.cs
@@ -12,18 +12,18 @@ static void Main(string[] args)
//
private static void TestGetSchemaTable()
{
- // Set up the data adapter, using information from
+ // Set up the data adapter, using information from
// the AdventureWorks sample database.
- // Modify the SQL expression to retrieve
+ // Modify the SQL expression to retrieve
// data from a different table.
- SqlDataAdapter adapter =
+ SqlDataAdapter adapter =
SetupDataAdapter("SELECT * FROM Sales.Customer");
// Fill the DataTable, retrieving all the schema information.
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
DataTable table = new DataTable();
adapter.Fill(table);
-
+
// Create the DataTableReader, and close it when done.
using (DataTableReader reader = new DataTableReader(table))
{
@@ -48,24 +48,24 @@ private static void DisplaySchemaTableInfo(
DataRow row = schemaTable.Rows[ordinal];
foreach (DataColumn col in schemaTable.Columns)
{
- Console.WriteLine("{0}: {1}",
+ Console.WriteLine("{0}: {1}",
col.ColumnName, row[col.Ordinal]);
}
}
catch (IndexOutOfRangeException ex)
{
- Console.WriteLine("{0} is an invalid column number.",
+ Console.WriteLine("{0} is an invalid column number.",
ordinal);
}
}
private static SqlDataAdapter SetupDataAdapter(String sqlString)
{
- // Assuming all the default settings, create a
+ // Assuming all the default settings, create a
// SqlDataAdapter working with the AdventureWorks
- // sample database that's available with
+ // sample database that's available with
// SQL Server.
- String connectionString =
+ String connectionString =
"Data source=(local);initial catalog=AdventureWorks;" +
"Integrated Security=True";
return new SqlDataAdapter(sqlString, connectionString);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValue/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValue/CS/source.cs
index 1159d74a7df..b3e5a3ad126 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValue/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValue/CS/source.cs
@@ -9,7 +9,7 @@ static void Main()
//
private static void GetAllValues(DataTableReader reader)
{
- // Given a DataTableReader, retrieve the value of
+ // Given a DataTableReader, retrieve the value of
// each column, and display the name, value, and type.
// Make sure you have called reader.Read at least once before
// calling this procedure.
@@ -26,7 +26,7 @@ private static void GetAllValues(DataTableReader reader)
{
value = reader.GetValue(i);
}
- Console.WriteLine("{0}: {1} ({2})", reader.GetName(i),
+ Console.WriteLine("{0}: {1} ({2})", reader.GetName(i),
value, reader.GetFieldType(i).Name);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValueObject/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValueObject/CS/source.cs
index 2e6de2443c1..e4958216277 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValueObject/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValueObject/CS/source.cs
@@ -24,9 +24,9 @@ private static void TestGetValues(DataTableReader reader)
Console.WriteLine();
- // Now repeat, using an array that may contain a different
+ // Now repeat, using an array that may contain a different
// number of columns than the original data. This should work correctly,
- // whether the size of the array is larger or smaller than
+ // whether the size of the array is larger or smaller than
// the number of columns.
// Attempt to retrieve three columns of data.
@@ -56,9 +56,9 @@ private static void TestGetValues(SqlDataReader reader)
Console.WriteLine();
- // Now repeat, using an array that may contain a different
+ // Now repeat, using an array that may contain a different
// number of columns than the original data. This should work correctly,
- // whether the size of the array is larger or smaller than
+ // whether the size of the array is larger or smaller than
// the number of columns.
// Attempt to retrieve three columns of data.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.HasRows/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.HasRows/CS/source.cs
index 8aa91378dd8..379039014b3 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.HasRows/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.HasRows/CS/source.cs
@@ -67,7 +67,7 @@ private static DataTable GetProducts()
// Create two columns, ID and Name.
DataColumn idColumn = table.Columns.Add("ID", typeof(int));
table.Columns.Add("Name", typeof(string ));
-
+
// Set the ID column as the primary key column.
table.PrimaryKey = new DataColumn[] { idColumn };
return table;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.ItemName/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.ItemName/CS/source.cs
index 6937960b474..7dbd3250a3b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.ItemName/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.ItemName/CS/source.cs
@@ -14,7 +14,7 @@ private static object GetValueByName(
// if you're going to retrieve information from a column
// in a loop, it would be better to retrieve the column
// ordinal once, store the value, and use the methods
- // of the DataTableReader class directly.
+ // of the DataTableReader class directly.
// Use this string-based indexer sparingly.
object columnValue = null;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.NextResult/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.NextResult/CS/source.cs
index 489bb4cea2d..d401acf39b6 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.NextResult/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.NextResult/CS/source.cs
@@ -36,11 +36,11 @@ private static DataTable GetCustomers()
// Create sample Customers table, in order
// to demonstrate the behavior of the DataTableReader.
DataTable table = new DataTable();
-
+
// Create two columns, ID and Name.
DataColumn idColumn = table.Columns.Add("ID", typeof(int));
table.Columns.Add("Name", typeof(string ));
-
+
// Set the ID column as the primary key column.
table.PrimaryKey = new DataColumn[] { idColumn };
@@ -56,11 +56,11 @@ private static DataTable GetProducts()
// Create sample Products table, in order
// to demonstrate the behavior of the DataTableReader.
DataTable table = new DataTable();
-
+
// Create two columns, ID and Name.
DataColumn idColumn = table.Columns.Add("ID", typeof(int));
table.Columns.Add("Name", typeof(string ));
-
+
// Set the ID column as the primary key column.
table.PrimaryKey = new DataColumn[] { idColumn };
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.ctor/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.ctor/CS/source.cs
index 489bb4cea2d..d401acf39b6 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.ctor/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.ctor/CS/source.cs
@@ -36,11 +36,11 @@ private static DataTable GetCustomers()
// Create sample Customers table, in order
// to demonstrate the behavior of the DataTableReader.
DataTable table = new DataTable();
-
+
// Create two columns, ID and Name.
DataColumn idColumn = table.Columns.Add("ID", typeof(int));
table.Columns.Add("Name", typeof(string ));
-
+
// Set the ID column as the primary key column.
table.PrimaryKey = new DataColumn[] { idColumn };
@@ -56,11 +56,11 @@ private static DataTable GetProducts()
// Create sample Products table, in order
// to demonstrate the behavior of the DataTableReader.
DataTable table = new DataTable();
-
+
// Create two columns, ID and Name.
DataColumn idColumn = table.Columns.Add("ID", typeof(int));
table.Columns.Add("Name", typeof(string ));
-
+
// Set the ID column as the primary key column.
table.PrimaryKey = new DataColumn[] { idColumn };
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataView.ToTableUniqueValuesName/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataView.ToTableUniqueValuesName/CS/source.cs
index e284488a9cd..dffae8ea4f7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataView.ToTableUniqueValuesName/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataView.ToTableUniqueValuesName/CS/source.cs
@@ -61,7 +61,7 @@ private static void DemonstrateDataView()
view.Sort = "Category";
PrintTableOrView(view, "Current Values in View");
- DataTable newTable = view.ToTable("UniqueData", true,
+ DataTable newTable = view.ToTable("UniqueData", true,
"Category", "QuantityInStock");
PrintTableOrView(newTable, "Table created from sorted DataView");
Console.WriteLine("New table name: " + newTable.TableName);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Add/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Add/CS/source.cs
index f8909707301..3958a644f4a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Add/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Add/CS/source.cs
@@ -22,7 +22,7 @@ static void Main()
// Overwrite the existing "User ID" value.
builder.Add("User ID", "NewUserName");
- // The following code would trigger
+ // The following code would trigger
// an ArgumentNullException:
// builder.Add(null, "Some Value");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.ConnectionString/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.ConnectionString/CS/source.cs
index 7618e5f48f0..85486860437 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.ConnectionString/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.ConnectionString/CS/source.cs
@@ -33,12 +33,12 @@ static void Main()
builder.ConnectionString =
"Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI";
- // The DbConnectionStringBuilder class has parsed the contents,
+ // The DbConnectionStringBuilder class has parsed the contents,
// so you can work with any individual key/value pair.
builder["Data Source"] = ".";
Console.WriteLine(builder.ConnectionString);
Console.WriteLine();
- // Because the DbConnectionStringBuilder class doesn't
+ // Because the DbConnectionStringBuilder class doesn't
// validate its key/value pairs, you can use this class
// to store any semicolon-delimited list. The following
// snippet places an arbitrary string into the ConnectionString
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.EquivalentTo/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.EquivalentTo/CS/source.cs
index 8b1580d7093..bac5349ca63 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.EquivalentTo/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.EquivalentTo/CS/source.cs
@@ -28,12 +28,12 @@ static void Main()
Console.WriteLine("builder3 = " + builder3.ConnectionString);
// builder1 and builder2 contain the same
- // keys and values, in different order, and the
+ // keys and values, in different order, and the
// keys are not consistently cased. They are equivalent.
Console.WriteLine("builder1.EquivalentTo(builder2) = " +
builder1.EquivalentTo(builder2).ToString());
- // builder2 and builder3 contain the same key/value pairs in the
+ // builder2 and builder3 contain the same key/value pairs in the
// the same order, but the value casing is different, so they're
// not equivalent.
Console.WriteLine("builder2.EquivalentTo(builder3) = " +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Item/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Item/CS/source.cs
index c4cfb5ad704..3c960bafd08 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Item/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Item/CS/source.cs
@@ -11,12 +11,12 @@ static void Main()
DbConnectionStringBuilder();
builder["Data Source"] = "(local)";
- // Note that Item is the indexer, so
+ // Note that Item is the indexer, so
// you do not include it in the reference.
builder["integrated security"] = true;
builder["Initial Catalog"] = "AdventureWorks";
- // Overwrite the existing value for the Data Source key,
+ // Overwrite the existing value for the Data Source key,
// because it already exists within the collection.
builder["Data Source"] = ".";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Keys/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Keys/CS/source.cs
index c1e86d24f4f..a8a663c7230 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Keys/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Keys/CS/source.cs
@@ -29,7 +29,7 @@ static void Main()
Console.WriteLine();
Console.WriteLine("Keys after adding TimeOut:");
- // Because the Keys property is dynamically updated,
+ // Because the Keys property is dynamically updated,
// the following loop includes the Timeout key.
foreach (string key in keys)
Console.WriteLine("{0}={1}", key, builder[key]);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Remove/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Remove/CS/source.cs
index 47855365d21..c57957a1b79 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Remove/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.Remove/CS/source.cs
@@ -10,7 +10,7 @@ static void Main()
DbConnectionStringBuilder builder = new
DbConnectionStringBuilder();
builder.ConnectionString =
- @"Provider=Microsoft.Jet.OLEDB.4.0;Data
+ @"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Demo.mdb;" +
"Jet OLEDB:System Database=system.mdw;";
@@ -20,8 +20,8 @@ static void Main()
// Try to remove a nonexistent item.
TryRemove(builder, "User ID");
- // Try to remove an existing item,
- // demonstrating that the search isn't
+ // Try to remove an existing item,
+ // demonstrating that the search isn't
// case sensitive.
TryRemove(builder, "DATA SOURCE");
Console.ReadLine();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.TryGetValue/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.TryGetValue/CS/source.cs
index 1a5c8cd6810..694aa7fc0a9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.TryGetValue/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder.TryGetValue/CS/source.cs
@@ -8,7 +8,7 @@ class Program
static void Main()
{
DbConnectionStringBuilder builder = new DbConnectionStringBuilder();
- builder.ConnectionString =
+ builder.ConnectionString =
"Provider=sqloledb;Data Source=192.168.168.1,1433;" +
"Network Library=DBMSSOCN;Initial Catalog=pubs;" +
"Integrated Security=SSPI;";
@@ -29,10 +29,10 @@ private static void DisplayValue(
object value = null;
// Although TryGetValue handles missing keys,
- // it doesn't handle passing in a null
+ // it doesn't handle passing in a null
// key. This example traps for that particular error, but
// bubbles any other unknown exceptions back out to the
- // caller.
+ // caller.
try
{
if (builder.TryGetValue(key, out value))
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder/CS/source.cs
index dda2e86e46a..91530473911 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DbConnectionStringBuilder/CS/source.cs
@@ -21,18 +21,18 @@ static void Main()
// Set up row-level locking.
builder.Add("Jet OLEDB:Database Locking Mode", 1);
- // The DbConnectionStringBuilder class
- // is database agnostic, so it's possible to
- // build any type of connection string using
+ // The DbConnectionStringBuilder class
+ // is database agnostic, so it's possible to
+ // build any type of connection string using
// this class.
- // The ConnectionString property may have been
+ // The ConnectionString property may have been
// formatted by the DbConnectionStringBuilder class.
OleDbConnection oledbConnect = new
OleDbConnection(builder.ConnectionString);
Console.WriteLine(oledbConnect.ConnectionString);
- // Use the same DbConnectionStringBuilder to create
+ // Use the same DbConnectionStringBuilder to create
// a SqlConnection object.
builder.Clear();
builder.Add("integrated security", true);
@@ -43,7 +43,7 @@ static void Main()
SqlConnection(builder.ConnectionString);
Console.WriteLine(sqlConnect.ConnectionString);
- // Pass the DbConnectionStringBuilder an existing
+ // Pass the DbConnectionStringBuilder an existing
// connection string, and you can retrieve and
// modify any of the elements.
builder.ConnectionString = "server=(local);user id=*******;" +
@@ -55,7 +55,7 @@ static void Main()
// throw an exception.
builder.Remove("BadItem");
- // Setting the indexer adds the value if
+ // Setting the indexer adds the value if
// necessary.
builder["Integrated Security"] = true;
builder.Remove("password");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks IBinarySerialize Samples/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks IBinarySerialize Samples/CS/source.cs
index 4b8ae327c5e..254da5066d5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks IBinarySerialize Samples/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks IBinarySerialize Samples/CS/source.cs
@@ -32,7 +32,7 @@ static void Main(string [] args)
Console.WriteLine("String value: " + temp.StringValue);
Console.WriteLine("Double value: " + temp.DoubleValue);
-
+
r.Close();
fs.Close();
}
@@ -83,10 +83,10 @@ public void Read(System.IO.BinaryReader r)
// Bytes 0 - 19: string text, padded to the right with null characters
// Bytes 20+: Double value
public void Write(System.IO.BinaryWriter w)
-{
+{
int maxStringSize = 20;
string stringValue = "The value of PI: ";
- string paddedString;
+ string paddedString;
double value = 3.14159;
// Pad the string from the right with null characters.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.Item/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.Item/CS/source.cs
index b4028727751..430ed92699b 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.Item/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.Item/CS/source.cs
@@ -7,14 +7,14 @@ class Program
{
static void Main()
{
- OdbcConnectionStringBuilder builder =
+ OdbcConnectionStringBuilder builder =
new OdbcConnectionStringBuilder();
// Set up a connection string for a text file.
builder["Driver"] = "Microsoft Text Driver (*.txt; *.csv)";
builder["dbq"] = "C:\\TextFilesFolder";
builder["Extension"] = "asc,csv,tab,txt";
- // Overwrite the existing value for the dbq value,
+ // Overwrite the existing value for the dbq value,
// because it already exists within the collection.
builder["dbq"] = "D:\\";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.Remove/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.Remove/CS/source.cs
index 587aa1c0640..e70c0ea1e17 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.Remove/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.Remove/CS/source.cs
@@ -21,8 +21,8 @@ static void Main()
// Try to remove a nonexistent item.
TryRemove(builder, "User ID");
- // Try to remove an existing item,
- // demonstrating that the search is not
+ // Try to remove an existing item,
+ // demonstrating that the search is not
// case sensitive.
TryRemove(builder, "DATABASE");
@@ -30,7 +30,7 @@ static void Main()
Console.ReadLine();
}
- static void TryRemove(OdbcConnectionStringBuilder builder,
+ static void TryRemove(OdbcConnectionStringBuilder builder,
string itemToRemove)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.TryGetValue/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.TryGetValue/CS/source.cs
index 49ce9b9eaf6..b7b6bd9a96c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.TryGetValue/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder.TryGetValue/CS/source.cs
@@ -7,7 +7,7 @@ class Program
{
static void Main()
{
- OdbcConnectionStringBuilder builder =
+ OdbcConnectionStringBuilder builder =
new OdbcConnectionStringBuilder();
builder.ConnectionString = GetConnectionString();
@@ -30,8 +30,8 @@ static void Main()
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file using the
- // System.Configuration.ConfigurationSettings.AppSettings property.
+ // you can retrieve it from a configuration file using the
+ // System.Configuration.ConfigurationSettings.AppSettings property.
return "Driver={SQL Server};Server=(local);" +
"Database=AdventureWorks;Trusted_Connection=yes;";
}
@@ -44,7 +44,7 @@ private static void DisplayValue(OdbcConnectionStringBuilder builder, string key
// it does not handle passing in a null (Nothing in Visual Basic)
// key. This example traps for that particular error, but
// throws any other unknown exceptions back out to the
- // caller.
+ // caller.
try
{
if (builder.TryGetValue(key, out value))
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder/CS/source.cs
index 7688d29d663..1627fe3935d 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OdbcConnectionStringBuilder/CS/source.cs
@@ -7,7 +7,7 @@ class Program
{
static void Main()
{
- OdbcConnectionStringBuilder builder =
+ OdbcConnectionStringBuilder builder =
new OdbcConnectionStringBuilder();
builder.Driver = "Microsoft Access Driver (*.mdb)";
@@ -24,7 +24,7 @@ static void Main()
// default values.
builder.Clear();
- // Pass the OdbcConnectionStringBuilder an existing
+ // Pass the OdbcConnectionStringBuilder an existing
// connection string, and you can retrieve and
// modify any of the elements.
builder.ConnectionString =
@@ -32,7 +32,7 @@ static void Main()
"hostname=SampleServerName;port=SamplePortNum;" +
"protocol=TCPIP;uid=Admin;pwd=pass!word1";
- Console.WriteLine("protocol = "
+ Console.WriteLine("protocol = "
+ builder["protocol"].ToString());
Console.WriteLine();
@@ -40,7 +40,7 @@ static void Main()
builder["uid"] = "NewUser";
builder["pwd"] = "Pass@word2";
- // Call the Remove method to remove items from
+ // Call the Remove method to remove items from
// the collection of key/value pairs.
builder.Remove("port");
@@ -50,7 +50,7 @@ static void Main()
Console.WriteLine(builder.ConnectionString);
Console.WriteLine();
- // Setting the indexer adds the associated value, if
+ // Setting the indexer adds the associated value, if
// necessary.
builder["NewKey"] = "newValue";
Console.WriteLine(builder.ConnectionString);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Clear/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Clear/CS/source.cs
index 3c83cfeac98..baf8342abd6 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Clear/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Clear/CS/source.cs
@@ -20,7 +20,7 @@ static void Main()
// set up row-level locking.
builder.Add("Jet OLEDB:Database Locking Mode", 1);
- // Dump the contents of the "filled-in"
+ // Dump the contents of the "filled-in"
// OleDbConnectionStringBuilder
// to the console window.
DumpBuilderContents(builder);
@@ -29,7 +29,7 @@ static void Main()
// default values.
builder.Clear();
- // Dump the contents of the newly emptied
+ // Dump the contents of the newly emptied
// OleDbConnectionStringBuilder
// to the console window.
DumpBuilderContents(builder);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Item/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Item/CS/source.cs
index 74ddd4fb089..e0353e1cbae 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Item/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Item/CS/source.cs
@@ -22,7 +22,7 @@ static void Main()
Console.WriteLine(builder["Jet OLEDB:System database"]);
Console.WriteLine(builder["Jet OLEDB:Encrypt Database"]);
- // You can set or retrieve any of the "default" values for the
+ // You can set or retrieve any of the "default" values for the
// provider, even if you didn't set their values.
Console.WriteLine(builder["Jet OLEDB:Database Locking Mode"]);
Console.WriteLine(builder["Jet OLEDB:Global Partial Bulk Ops"]);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.OleDbServices/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.OleDbServices/CS/source.cs
index 2b874be7c1e..454e807533c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.OleDbServices/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.OleDbServices/CS/source.cs
@@ -5,8 +5,8 @@
class Program
{
- // These constants correspond to values in the
- // OLE DB SDK. You can use these values to
+ // These constants correspond to values in the
+ // OLE DB SDK. You can use these values to
// turn features on and off.
private const int DBPROPVAL_OS_AGR_AFTERSESSION = 8;
private const int DBPROPVAL_OS_AGR_RESOURCEPOOLING = 1;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Remove/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Remove/CS/source.cs
index aabae3d8419..b9a65443733 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Remove/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.Remove/CS/source.cs
@@ -21,8 +21,8 @@ static void Main()
// Try to remove a nonexistent item.
TryRemove(builder, "User ID");
- // try to remove an existing item,
- // demonstrating that the search isn't
+ // try to remove an existing item,
+ // demonstrating that the search isn't
// case sensitive.
TryRemove(builder, "DATA SOURCE");
@@ -30,7 +30,7 @@ static void Main()
Console.ReadLine();
}
- static void TryRemove(OleDbConnectionStringBuilder builder,
+ static void TryRemove(OleDbConnectionStringBuilder builder,
string itemToRemove)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.TryGetValue/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.TryGetValue/CS/source.cs
index 03aabd99a18..1585ca5f2f9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.TryGetValue/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder.TryGetValue/CS/source.cs
@@ -12,7 +12,7 @@ static void Main()
builder.ConnectionString = GetConnectionString();
// Call TryGetValue method for multiple
- // key names.
+ // key names.
DisplayValue(builder, "Data Source");
DisplayValue(builder, "Extended Properties");
// How about implicitly added key/value pairs?
@@ -34,7 +34,7 @@ static private void DisplayValue(OleDbConnectionStringBuilder builder, string ke
// it does not handle passing in a null (Nothing in Visual Basic)
// key. This example traps for that particular error, but
// throws any other unknown exceptions back out to the
- // caller.
+ // caller.
try
{
if (builder.TryGetValue(key, out value))
@@ -55,8 +55,8 @@ static private void DisplayValue(OleDbConnectionStringBuilder builder, string ke
static private string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file using the
- // System.Configuration.ConfigurationSettings.AppSettings property.
+ // you can retrieve it from a configuration file using the
+ // System.Configuration.ConfigurationSettings.AppSettings property.
return "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=C:\\ExcelDemo.xls;" +
"Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\"";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder/CS/source.cs
index 07c9fe0c126..2b123223dc5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OleDbConnectionStringBuilder/CS/source.cs
@@ -26,7 +26,7 @@ static void Main(string[] args)
// default values.
builder.Clear();
- // Pass the OleDbConnectionStringBuilder an existing
+ // Pass the OleDbConnectionStringBuilder an existing
// connection string, and you can retrieve and
// modify any of the elements.
builder.ConnectionString =
@@ -41,7 +41,7 @@ static void Main(string[] args)
builder["Package Collection"] = "NewPackage";
builder["Default Schema"] = "NewSchema";
- // Call the Remove method to remove items from
+ // Call the Remove method to remove items from
// the collection of key/value pairs.
builder.Remove("User ID");
@@ -51,7 +51,7 @@ static void Main(string[] args)
Console.WriteLine(builder.ConnectionString);
Console.WriteLine();
- // Setting the indexer adds the value, if
+ // Setting the indexer adds the value, if
// necessary.
builder["User ID"] = "SampleUser";
builder["Password"] = "SamplePassword";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.ContainsKey/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.ContainsKey/CS/source.cs
index 4ebd3c3142f..c3c23802147 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.ContainsKey/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.ContainsKey/CS/source.cs
@@ -16,9 +16,9 @@ static void Main()
// Keys you have provided return true.
Console.WriteLine(builder.ContainsKey("Integrated Security"));
- // Comparison is case insensitive, and synonyms for the
+ // Comparison is case insensitive, and synonyms for the
// keywords are translated to well-known names.
- // The following returns true because "PWD" is a
+ // The following returns true because "PWD" is a
// synonym for "Password", a valid key.
Console.WriteLine(builder.ContainsKey("PWD"));
@@ -35,7 +35,7 @@ static void Main()
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // you can retrieve it from a configuration file.
return "Server=OracleDemo;Integrated Security=True";
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Ctor/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Ctor/CS/source.cs
index 0fbd2815161..d8e41e86cf9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Ctor/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Ctor/CS/source.cs
@@ -13,7 +13,7 @@ static void Main()
{
string connectString = "Server=OracleDemo;UID=Mary;Pwd=*****";
Console.WriteLine("Original: " + connectString);
- OracleConnectionStringBuilder builder =
+ OracleConnectionStringBuilder builder =
new OracleConnectionStringBuilder(connectString);
Console.WriteLine("Modified: " + builder.ConnectionString);
foreach (string key in builder.Keys)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.DataSource/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.DataSource/CS/source.cs
index 2bf3e8197fc..be771732319 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.DataSource/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.DataSource/CS/source.cs
@@ -9,12 +9,12 @@ class Program
{
static void Main()
{
- OracleConnectionStringBuilder builder =
+ OracleConnectionStringBuilder builder =
new OracleConnectionStringBuilder(
"Server=OracleDemo;Integrated Security=True");
- // Display the connection string, which should now
- // contains the "Data Source" key, as opposed to the
+ // Display the connection string, which should now
+ // contains the "Data Source" key, as opposed to the
// supplied "Server".
Console.WriteLine(builder.ConnectionString);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.IntegratedSecurity/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.IntegratedSecurity/CS/source.cs
index a535aaef702..2ef08b332e0 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.IntegratedSecurity/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.IntegratedSecurity/CS/source.cs
@@ -20,7 +20,7 @@ static void Main()
// Use the Remove method
// in order to reset the user ID and password back to their
- // default (empty string) values. Simply setting the
+ // default (empty string) values. Simply setting the
// associated property values to an empty string will not
// remove them from the connection string; you must
// call the Remove method.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Item/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Item/CS/source.cs
index 619b44ebf58..d5b11f46b8c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Item/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Item/CS/source.cs
@@ -9,7 +9,7 @@ class Program
{
static void Main()
{
- OracleConnectionStringBuilder builder =
+ OracleConnectionStringBuilder builder =
new OracleConnectionStringBuilder();
builder["Data Source"] = "localhost";
builder["integrated security"] = true;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Keys/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Keys/CS/source.cs
index 49100b95e15..20a82eca4e4 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Keys/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Keys/CS/source.cs
@@ -14,7 +14,7 @@ static void Main()
builder.DataSource = "OracleSample";
builder.IntegratedSecurity = true;
- // Loop through the collection of keys, displaying
+ // Loop through the collection of keys, displaying
// the key and value for each item.
foreach (string key in builder.Keys)
Console.WriteLine("{0}={1}", key, builder[key]);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Remove/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Remove/CS/source.cs
index cc032bce6f1..b80b69ce483 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Remove/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Remove/CS/source.cs
@@ -19,7 +19,7 @@ static void Main()
// Use the Remove method
// in order to reset the user ID and password back to their
- // default (empty string) values.
+ // default (empty string) values.
builder.Remove("User ID");
builder.Remove("Password");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.TryGetValue/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.TryGetValue/CS/source.cs
index b764ff33b01..12d5da85b30 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.TryGetValue/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.TryGetValue/CS/source.cs
@@ -32,7 +32,7 @@ private static void DisplayValue(OracleConnectionStringBuilder builder, string k
// it does not handle passing in a null
// key. This example traps for that particular error, but
// passes any other unknown exceptions back out to the
- // caller.
+ // caller.
try
{
if (builder.TryGetValue(key, out value))
@@ -53,7 +53,7 @@ private static void DisplayValue(OracleConnectionStringBuilder builder, string k
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // you can retrieve it from a configuration file.
return "Server=OracleDemo;Integrated Security=True";
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Values/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Values/CS/source.cs
index 4a278b3eddc..7116a678a92 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Values/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder.Values/CS/source.cs
@@ -23,7 +23,7 @@ static void Main()
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // you can retrieve it from a configuration file.
return "Data Source=OracleSample;Integrated Security=true;" +
"Persist Security Info=True; Max Pool Size=100; Min Pool Size=1";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder/CS/source.cs
index 34c6d928e15..a52ba160005 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks OracleConnectionStringBuilder/CS/source.cs
@@ -14,12 +14,12 @@ static void Main()
OracleConnectionStringBuilder builder =
new OracleConnectionStringBuilder(GetConnectionString());
- // Note that the input connection string used the
+ // Note that the input connection string used the
// Server key, but the new connection string uses
// the well-known Data Source key instead.
Console.WriteLine(builder.ConnectionString);
- // Pass the OracleConnectionStringBuilder an existing
+ // Pass the OracleConnectionStringBuilder an existing
// connection string, and you can retrieve and
// modify any of the elements.
builder.ConnectionString = "server=OracleDemo;user id=maryc;" +
@@ -31,7 +31,7 @@ static void Main()
builder.Password = "newPassword";
builder.PersistSecurityInfo = true;
- // You can refer to connection keys using strings,
+ // You can refer to connection keys using strings,
// as well. When you use this technique (the default
// Item property in Visual Basic, or the indexer in C#),
// you can specify any synonym for the connection string key
@@ -48,7 +48,7 @@ static void Main()
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // you can retrieve it from a configuration file.
return "Server=OracleDemo;Integrated Security=true";
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.BatchSize/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.BatchSize/CS/source.cs
index 65fa42324e3..3e66c9e5ad8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.BatchSize/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.BatchSize/CS/source.cs
@@ -31,7 +31,7 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Create the SqlBulkCopy object using a connection string.
+ // Create the SqlBulkCopy object using a connection string.
// In the real world you would not use SqlBulkCopy to move
// data from one table to the other in the same database.
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connectionString))
@@ -59,7 +59,7 @@ static void Main()
reader.Close();
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -72,8 +72,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMapping/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMapping/CS/source.cs
index 061631da6ae..b94f4bc22f9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMapping/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMapping/CS/source.cs
@@ -69,7 +69,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -81,8 +81,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingColNameIndex/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingColNameIndex/CS/source.cs
index c653907bc0b..b17bcbc360c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingColNameIndex/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingColNameIndex/CS/source.cs
@@ -31,14 +31,14 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Set up the bulk copy object.
+ // Set up the bulk copy object.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(connectionString))
{
bulkCopy.DestinationTableName =
"dbo.BulkCopyDemoDifferentColumns";
- // The column order in the source doesn't match the order
+ // The column order in the source doesn't match the order
// in the destination, so ColumnMappings must be defined.
bulkCopy.ColumnMappings.Add("ProductID", 0);
bulkCopy.ColumnMappings.Add("ProductNumber", 1);
@@ -62,7 +62,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -74,8 +74,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingCollection/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingCollection/CS/source.cs
index c9831c0070b..346d93389b3 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingCollection/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingCollection/CS/source.cs
@@ -31,14 +31,14 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Set up the bulk copy object.
+ // Set up the bulk copy object.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(connectionString))
{
bulkCopy.DestinationTableName =
"dbo.BulkCopyDemoDifferentColumns";
- // The column order in the source doesn't match the order
+ // The column order in the source doesn't match the order
// in the destination, so ColumnMappings must be defined.
bulkCopy.ColumnMappings.Add("ProductID", "ProdID");
bulkCopy.ColumnMappings.Add("Name", "ProdName");
@@ -62,7 +62,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -74,8 +74,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingCollectionOrdinal/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingCollectionOrdinal/CS/source.cs
index 349e6e647d6..a994fb117f9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingCollectionOrdinal/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingCollectionOrdinal/CS/source.cs
@@ -31,14 +31,14 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Set up the bulk copy object.
+ // Set up the bulk copy object.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(connectionString))
{
bulkCopy.DestinationTableName =
"dbo.BulkCopyDemoDifferentColumns";
- // The column order in the source doesn't match the order
+ // The column order in the source doesn't match the order
// in the destination, so ColumnMappings must be defined.
bulkCopy.ColumnMappings.Add(0, 0);
bulkCopy.ColumnMappings.Add(1, 2);
@@ -62,7 +62,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -74,8 +74,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingDestinationColumn/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingDestinationColumn/CS/source.cs
index c793767f3fa..343e460c8b5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingDestinationColumn/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingDestinationColumn/CS/source.cs
@@ -72,7 +72,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -84,8 +84,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingDestinationOrdinal/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingDestinationOrdinal/CS/source.cs
index aed38ffcaab..5992783a91c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingDestinationOrdinal/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingDestinationOrdinal/CS/source.cs
@@ -72,7 +72,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -84,8 +84,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingIndexColName/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingIndexColName/CS/source.cs
index d4715c004cb..5c6eb2c953c 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingIndexColName/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingIndexColName/CS/source.cs
@@ -31,14 +31,14 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Set up the bulk copy object.
+ // Set up the bulk copy object.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(connectionString))
{
bulkCopy.DestinationTableName =
"dbo.BulkCopyDemoDifferentColumns";
- // The column order in the source doesn't match the order
+ // The column order in the source doesn't match the order
// in the destination, so ColumnMappings must be defined.
bulkCopy.ColumnMappings.Add(0, "ProdID");
bulkCopy.ColumnMappings.Add(1, "ProdName");
@@ -62,7 +62,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -74,8 +74,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingNameOrdinal/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingNameOrdinal/CS/source.cs
index 9bc7afcb5f4..60134a31f3a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingNameOrdinal/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingNameOrdinal/CS/source.cs
@@ -69,7 +69,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -81,8 +81,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdersDetails/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdersDetails/CS/source.cs
index 95fd7a21aea..18c9e664967 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdersDetails/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdersDetails/CS/source.cs
@@ -14,7 +14,7 @@ static void Main()
{
connection.Open();
- // Empty the destination tables.
+ // Empty the destination tables.
SqlCommand deleteHeader = new SqlCommand(
"DELETE FROM dbo.BulkCopyDemoOrderHeader;",
connection);
@@ -25,7 +25,7 @@ static void Main()
deleteDetail.ExecuteNonQuery();
// Perform an initial count on the destination
- // table with matching columns.
+ // table with matching columns.
SqlCommand countRowHeader = new SqlCommand(
"SELECT COUNT(*) FROM dbo.BulkCopyDemoOrderHeader;",
connection);
@@ -36,7 +36,7 @@ static void Main()
countStartHeader);
// Perform an initial count on the destination
- // table with different column positions.
+ // table with different column positions.
SqlCommand countRowDetail = new SqlCommand(
"SELECT COUNT(*) FROM dbo.BulkCopyDemoOrderDetail;",
connection);
@@ -49,10 +49,10 @@ static void Main()
// Get data from the source table as a SqlDataReader.
// The Sales.SalesOrderHeader and Sales.SalesOrderDetail
// tables are quite large and could easily cause a timeout
- // if all data from the tables is added to the destination.
- // To keep the example simple and quick, a parameter is
- // used to select only orders for a particular account
- // as the source for the bulk insert.
+ // if all data from the tables is added to the destination.
+ // To keep the example simple and quick, a parameter is
+ // used to select only orders for a particular account
+ // as the source for the bulk insert.
SqlCommand headerData = new SqlCommand(
"SELECT [SalesOrderID], [OrderDate], " +
"[AccountNumber] FROM [Sales].[SalesOrderHeader] " +
@@ -85,7 +85,7 @@ static void Main()
sourceDetailData.Parameters.Add(accountDetail);
SqlDataReader readerDetail = sourceDetailData.ExecuteReader();
- // Create the SqlBulkCopy object.
+ // Create the SqlBulkCopy object.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(connectionString))
{
@@ -112,7 +112,7 @@ static void Main()
readerHeader.Close();
}
- // Set up the order details destination.
+ // Set up the order details destination.
bulkCopy.DestinationTableName ="dbo.BulkCopyDemoOrderDetail";
// Clear the ColumnMappingCollection.
@@ -141,7 +141,7 @@ static void Main()
}
// Perform a final count on the destination
- // tables to see how many rows were added.
+ // tables to see how many rows were added.
long countEndHeader = System.Convert.ToInt32(
countRowHeader.ExecuteScalar());
Console.WriteLine("{0} rows were added to the Header table.",
@@ -157,8 +157,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdinal/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdinal/CS/source.cs
index c50847dc9ee..ba258347f18 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdinal/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdinal/CS/source.cs
@@ -69,7 +69,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -81,8 +81,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdinalName/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdinalName/CS/source.cs
index 03f139b871d..9835e191067 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdinalName/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingOrdinalName/CS/source.cs
@@ -69,7 +69,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -81,8 +81,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingRemove/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingRemove/CS/source.cs
index 59bebadd2f8..95450154c74 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingRemove/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingRemove/CS/source.cs
@@ -14,7 +14,7 @@ static void Main()
{
connection.Open();
- // Empty the destination tables.
+ // Empty the destination tables.
SqlCommand deleteHeader = new SqlCommand(
"DELETE FROM dbo.BulkCopyDemoOrderHeader;",
connection);
@@ -25,7 +25,7 @@ static void Main()
deleteDetail.ExecuteNonQuery();
// Perform an initial count on the destination
- // table with matching columns.
+ // table with matching columns.
SqlCommand countRowHeader = new SqlCommand(
"SELECT COUNT(*) FROM dbo.BulkCopyDemoOrderHeader;",
connection);
@@ -36,7 +36,7 @@ static void Main()
countStartHeader);
// Perform an initial count on the destination
- // table with different column positions.
+ // table with different column positions.
SqlCommand countRowDetail = new SqlCommand(
"SELECT COUNT(*) FROM dbo.BulkCopyDemoOrderDetail;",
connection);
@@ -49,10 +49,10 @@ static void Main()
// Get data from the source table as a SqlDataReader.
// The Sales.SalesOrderHeader and Sales.SalesOrderDetail
// tables are quite large and could easily cause a timeout
- // if all data from the tables is added to the destination.
- // To keep the example simple and quick, a parameter is
- // used to select only orders for a particular account
- // as the source for the bulk insert.
+ // if all data from the tables is added to the destination.
+ // To keep the example simple and quick, a parameter is
+ // used to select only orders for a particular account
+ // as the source for the bulk insert.
SqlCommand headerData = new SqlCommand(
"SELECT [SalesOrderID], [OrderDate], " +
"[AccountNumber] FROM [Sales].[SalesOrderHeader] " +
@@ -85,7 +85,7 @@ static void Main()
sourceDetailData.Parameters.Add(accountDetail);
SqlDataReader readerDetail = sourceDetailData.ExecuteReader();
- // Create the SqlBulkCopy object.
+ // Create the SqlBulkCopy object.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(connectionString))
{
@@ -117,7 +117,7 @@ static void Main()
readerHeader.Close();
}
- // Set up the order details destination.
+ // Set up the order details destination.
bulkCopy.DestinationTableName ="dbo.BulkCopyDemoOrderDetail";
// Rather than clearing mappings that are not necessary
@@ -149,7 +149,7 @@ static void Main()
}
// Perform a final count on the destination
- // tables to see how many rows were added.
+ // tables to see how many rows were added.
long countEndHeader = System.Convert.ToInt32(
countRowHeader.ExecuteScalar());
Console.WriteLine("{0} rows were added to the Header table.",
@@ -165,8 +165,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingRemoveAt/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingRemoveAt/CS/source.cs
index 9d1bd44ec4c..ab5bada8474 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingRemoveAt/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ColumnMappingRemoveAt/CS/source.cs
@@ -14,7 +14,7 @@ static void Main()
{
connection.Open();
- // Empty the destination tables.
+ // Empty the destination tables.
SqlCommand deleteHeader = new SqlCommand(
"DELETE FROM dbo.BulkCopyDemoOrderHeader;",
connection);
@@ -25,7 +25,7 @@ static void Main()
deleteDetail.ExecuteNonQuery();
// Perform an initial count on the destination
- // table with matching columns.
+ // table with matching columns.
SqlCommand countRowHeader = new SqlCommand(
"SELECT COUNT(*) FROM dbo.BulkCopyDemoOrderHeader;",
connection);
@@ -36,7 +36,7 @@ static void Main()
countStartHeader);
// Perform an initial count on the destination
- // table with different column positions.
+ // table with different column positions.
SqlCommand countRowDetail = new SqlCommand(
"SELECT COUNT(*) FROM dbo.BulkCopyDemoOrderDetail;",
connection);
@@ -49,10 +49,10 @@ static void Main()
// Get data from the source table as a SqlDataReader.
// The Sales.SalesOrderHeader and Sales.SalesOrderDetail
// tables are quite large and could easily cause a timeout
- // if all data from the tables is added to the destination.
- // To keep the example simple and quick, a parameter is
- // used to select only orders for a particular account
- // as the source for the bulk insert.
+ // if all data from the tables is added to the destination.
+ // To keep the example simple and quick, a parameter is
+ // used to select only orders for a particular account
+ // as the source for the bulk insert.
SqlCommand headerData = new SqlCommand(
"SELECT [SalesOrderID], [OrderDate], " +
"[AccountNumber] FROM [Sales].[SalesOrderHeader] " +
@@ -85,7 +85,7 @@ static void Main()
sourceDetailData.Parameters.Add(accountDetail);
SqlDataReader readerDetail = sourceDetailData.ExecuteReader();
- // Create the SqlBulkCopy object.
+ // Create the SqlBulkCopy object.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(connectionString))
{
@@ -112,7 +112,7 @@ static void Main()
readerHeader.Close();
}
- // Set up the order details destination.
+ // Set up the order details destination.
bulkCopy.DestinationTableName ="dbo.BulkCopyDemoOrderDetail";
// Rather than clearing mappings that are not necessary
@@ -144,7 +144,7 @@ static void Main()
}
// Perform a final count on the destination
- // tables to see how many rows were added.
+ // tables to see how many rows were added.
long countEndHeader = System.Convert.ToInt32(
countRowHeader.ExecuteScalar());
Console.WriteLine("{0} rows were added to the Header table.",
@@ -160,8 +160,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ConnectionString/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ConnectionString/CS/source.cs
index cd950e6fb90..ece6f7c7395 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ConnectionString/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.ConnectionString/CS/source.cs
@@ -31,7 +31,7 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Set up the bulk copy object using a connection string.
+ // Set up the bulk copy object using a connection string.
// In the real world you would not use SqlBulkCopy to move
// data from one table to the other in the same database.
using (SqlBulkCopy bulkCopy =
@@ -58,7 +58,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -70,8 +70,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.DataRowState/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.DataRowState/CS/source.cs
index ef45a4f3f72..30b21037034 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.DataRowState/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.DataRowState/CS/source.cs
@@ -23,22 +23,22 @@ static void Main()
commandRowCount.ExecuteScalar());
Console.WriteLine("Starting row count = {0}", countStart);
- // Create a table with some rows.
+ // Create a table with some rows.
DataTable newProducts = MakeTable();
-
+
// Make a change to one of the rows in the DataTable.
DataRow row = newProducts.Rows[0];
row.BeginEdit();
row["Name"] = "AAA";
row.EndEdit();
- // Create the SqlBulkCopy object.
- // Note that the column positions in the source DataTable
- // match the column positions in the destination table so
- // there is no need to map columns.
+ // Create the SqlBulkCopy object.
+ // Note that the column positions in the source DataTable
+ // match the column positions in the destination table so
+ // there is no need to map columns.
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connection))
{
- bulkCopy.DestinationTableName =
+ bulkCopy.DestinationTableName =
"dbo.BulkCopyDemoMatchingColumns";
try
@@ -52,7 +52,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -64,11 +64,11 @@ static void Main()
}
private static DataTable MakeTable()
- // Create a new DataTable named NewProducts.
+ // Create a new DataTable named NewProducts.
{
DataTable newProducts = new DataTable("NewProducts");
- // Add three column objects to the table.
+ // Add three column objects to the table.
DataColumn productID = new DataColumn();
productID.DataType = System.Type.GetType("System.Int32");
productID.ColumnName = "ProductID";
@@ -90,7 +90,7 @@ private static DataTable MakeTable()
keys[0] = productID;
newProducts.PrimaryKey = keys;
- // Add some new rows to the collection.
+ // Add some new rows to the collection.
DataRow row = newProducts.NewRow();
row["Name"] = "CC-101-WH";
row["ProductNumber"] = "Cyclocomputer - White";
@@ -107,12 +107,12 @@ private static DataTable MakeTable()
newProducts.Rows.Add(row);
newProducts.AcceptChanges();
- // Return the new DataTable.
+ // Return the new DataTable.
return newProducts;
}
private static string GetConnectionString()
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.DataTable/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.DataTable/CS/source.cs
index a26d6815336..cf321f70e64 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.DataTable/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.DataTable/CS/source.cs
@@ -23,16 +23,16 @@ static void Main()
commandRowCount.ExecuteScalar());
Console.WriteLine("Starting row count = {0}", countStart);
- // Create a table with some rows.
+ // Create a table with some rows.
DataTable newProducts = MakeTable();
-
- // Create the SqlBulkCopy object.
- // Note that the column positions in the source DataTable
- // match the column positions in the destination table so
- // there is no need to map columns.
+
+ // Create the SqlBulkCopy object.
+ // Note that the column positions in the source DataTable
+ // match the column positions in the destination table so
+ // there is no need to map columns.
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connection))
{
- bulkCopy.DestinationTableName =
+ bulkCopy.DestinationTableName =
"dbo.BulkCopyDemoMatchingColumns";
try
@@ -46,7 +46,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -58,11 +58,11 @@ static void Main()
}
private static DataTable MakeTable()
- // Create a new DataTable named NewProducts.
+ // Create a new DataTable named NewProducts.
{
DataTable newProducts = new DataTable("NewProducts");
- // Add three column objects to the table.
+ // Add three column objects to the table.
DataColumn productID = new DataColumn();
productID.DataType = System.Type.GetType("System.Int32");
productID.ColumnName = "ProductID";
@@ -84,7 +84,7 @@ private static DataTable MakeTable()
keys[0] = productID;
newProducts.PrimaryKey = keys;
- // Add some new rows to the collection.
+ // Add some new rows to the collection.
DataRow row = newProducts.NewRow();
row["Name"] = "CC-101-WH";
row["ProductNumber"] = "Cyclocomputer - White";
@@ -101,12 +101,12 @@ private static DataTable MakeTable()
newProducts.Rows.Add(row);
newProducts.AcceptChanges();
- // Return the new DataTable.
+ // Return the new DataTable.
return newProducts;
}
private static string GetConnectionString()
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.KeepIdentity/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.KeepIdentity/CS/source.cs
index cce4b848b2c..c2aa680db3a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.KeepIdentity/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.KeepIdentity/CS/source.cs
@@ -31,8 +31,8 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Create the SqlBulkCopy object using a connection string
- // and the KeepIdentity option.
+ // Create the SqlBulkCopy object using a connection string
+ // and the KeepIdentity option.
// In the real world you would not use SqlBulkCopy to move
// data from one table to the other in the same database.
using (SqlBulkCopy bulkCopy =
@@ -59,7 +59,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -71,8 +71,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.NotifyAfter/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.NotifyAfter/CS/source.cs
index d119d3f3e30..b052de73196 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.NotifyAfter/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.NotifyAfter/CS/source.cs
@@ -32,7 +32,7 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Create the SqlBulkCopy object using a connection string.
+ // Create the SqlBulkCopy object using a connection string.
// In the real world you would not use SqlBulkCopy to move
// data from one table to the other in the same database.
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connectionString))
@@ -63,7 +63,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -80,8 +80,8 @@ private static void OnSqlRowsCopied(
Console.WriteLine("Copied {0} so far...", e.RowsCopied);
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.OrdersDetails/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.OrdersDetails/CS/source.cs
index b8bec52cc9e..42fa94412de 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.OrdersDetails/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.OrdersDetails/CS/source.cs
@@ -14,7 +14,7 @@ static void Main()
{
connection.Open();
- // Empty the destination tables.
+ // Empty the destination tables.
SqlCommand deleteHeader = new SqlCommand(
"DELETE FROM dbo.BulkCopyDemoOrderHeader;",
connection);
@@ -25,7 +25,7 @@ static void Main()
deleteDetail.ExecuteNonQuery();
// Perform an initial count on the destination
- // table with matching columns.
+ // table with matching columns.
SqlCommand countRowHeader = new SqlCommand(
"SELECT COUNT(*) FROM dbo.BulkCopyDemoOrderHeader;",
connection);
@@ -36,7 +36,7 @@ static void Main()
countStartHeader);
// Perform an initial count on the destination
- // table with different column positions.
+ // table with different column positions.
SqlCommand countRowDetail = new SqlCommand(
"SELECT COUNT(*) FROM dbo.BulkCopyDemoOrderDetail;",
connection);
@@ -49,10 +49,10 @@ static void Main()
// Get data from the source table as a SqlDataReader.
// The Sales.SalesOrderHeader and Sales.SalesOrderDetail
// tables are quite large and could easily cause a timeout
- // if all data from the tables is added to the destination.
- // To keep the example simple and quick, a parameter is
- // used to select only orders for a particular account
- // as the source for the bulk insert.
+ // if all data from the tables is added to the destination.
+ // To keep the example simple and quick, a parameter is
+ // used to select only orders for a particular account
+ // as the source for the bulk insert.
SqlCommand headerData = new SqlCommand(
"SELECT [SalesOrderID], [OrderDate], " +
"[AccountNumber] FROM [Sales].[SalesOrderHeader] " +
@@ -85,7 +85,7 @@ static void Main()
sourceDetailData.Parameters.Add(accountDetail);
SqlDataReader readerDetail = sourceDetailData.ExecuteReader();
- // Create the SqlBulkCopy object.
+ // Create the SqlBulkCopy object.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(connectionString))
{
@@ -106,8 +106,8 @@ static void Main()
readerHeader.Close();
}
- // Set up a different destination and
- // map columns.
+ // Set up a different destination and
+ // map columns.
bulkCopy.DestinationTableName =
"dbo.BulkCopyDemoOrderDetail";
@@ -127,7 +127,7 @@ static void Main()
}
// Perform a final count on the destination
- // tables to see how many rows were added.
+ // tables to see how many rows were added.
long countEndHeader = System.Convert.ToInt32(
countRowHeader.ExecuteScalar());
Console.WriteLine("{0} rows were added to the Header table.",
@@ -143,8 +143,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.RowArray/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.RowArray/CS/source.cs
index 81150f915fb..fd713224be8 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.RowArray/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.RowArray/CS/source.cs
@@ -23,17 +23,17 @@ static void Main()
commandRowCount.ExecuteScalar());
Console.WriteLine("Starting row count = {0}", countStart);
- // Create a table with some rows.
+ // Create a table with some rows.
DataTable newProducts = MakeTable();
- // Get a reference to a single row in the table.
+ // Get a reference to a single row in the table.
DataRow[] rowArray = newProducts.Select(
"Name='CC-101-BK'");
- // Create the SqlBulkCopy object.
- // Note that the column positions in the source DataTable
- // match the column positions in the destination table so
- // there is no need to map columns.
+ // Create the SqlBulkCopy object.
+ // Note that the column positions in the source DataTable
+ // match the column positions in the destination table so
+ // there is no need to map columns.
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connection))
{
bulkCopy.DestinationTableName =
@@ -50,7 +50,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -62,11 +62,11 @@ static void Main()
}
private static DataTable MakeTable()
- // Create a new DataTable named NewProducts.
+ // Create a new DataTable named NewProducts.
{
DataTable newProducts = new DataTable("NewProducts");
- // Add three column objects to the table.
+ // Add three column objects to the table.
DataColumn productID = new DataColumn();
productID.DataType = System.Type.GetType("System.Int32");
productID.ColumnName = "ProductID";
@@ -88,7 +88,7 @@ private static DataTable MakeTable()
keys[0] = productID;
newProducts.PrimaryKey = keys;
- // Add some new rows to the collection.
+ // Add some new rows to the collection.
DataRow row = newProducts.NewRow();
row["Name"] = "CC-101-WH";
row["ProductNumber"] = "Cyclocomputer - White";
@@ -105,12 +105,12 @@ private static DataTable MakeTable()
newProducts.Rows.Add(row);
newProducts.AcceptChanges();
- // Return the new DataTable.
+ // Return the new DataTable.
return newProducts;
}
private static string GetConnectionString()
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.Single/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.Single/CS/source.cs
index dc6aef34f48..9f82f0f1128 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.Single/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.Single/CS/source.cs
@@ -31,17 +31,17 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Open the destination connection. In the real world you would
- // not use SqlBulkCopy to move data from one table to the other
+ // Open the destination connection. In the real world you would
+ // not use SqlBulkCopy to move data from one table to the other
// in the same database. This is for demonstration purposes only.
using (SqlConnection destinationConnection =
new SqlConnection(connectionString))
{
destinationConnection.Open();
- // Set up the bulk copy object.
+ // Set up the bulk copy object.
// Note that the column positions in the source
- // data reader match the column positions in
+ // data reader match the column positions in
// the destination table so there is no need to
// map columns.
using (SqlBulkCopy bulkCopy =
@@ -68,7 +68,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -81,8 +81,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.Timeout/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.Timeout/CS/source.cs
index 40226583b8d..45ea53109d9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.Timeout/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlBulkCopy.Timeout/CS/source.cs
@@ -32,7 +32,7 @@ static void Main()
SqlDataReader reader =
commandSourceData.ExecuteReader();
- // Create the SqlBulkCopy object using a connection string.
+ // Create the SqlBulkCopy object using a connection string.
// In the real world you would not use SqlBulkCopy to move
// data from one table to the other in the same database.
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connectionString))
@@ -61,7 +61,7 @@ static void Main()
}
}
- // Perform a final count on the destination
+ // Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(
commandRowCount.ExecuteScalar());
@@ -73,8 +73,8 @@ static void Main()
}
private static string GetConnectionString()
- // To avoid storing the sourceConnection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the sourceConnection string in your code,
+ // you can retrieve it from a configuration file.
{
return "Data Source=(local); " +
" Integrated Security=true;" +
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.AcceptChangesDuringUpdate/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.AcceptChangesDuringUpdate/CS/source.cs
index 157e660b1ac..d58368f7fd7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.AcceptChangesDuringUpdate/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.AcceptChangesDuringUpdate/CS/source.cs
@@ -38,7 +38,7 @@ private static void MergeIdentityColumns(string connectionString)
"CompanyName"));
adapter.InsertCommand.UpdatedRowSource = UpdateRowSource.Both;
- // MissingSchemaAction adds any missing schema to
+ // MissingSchemaAction adds any missing schema to
// the DataTable, including auto increment columns
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
@@ -46,7 +46,7 @@ private static void MergeIdentityColumns(string connectionString)
DataTable shipper = new DataTable();
adapter.Fill(shipper);
- // Add a new shipper row.
+ // Add a new shipper row.
DataRow newRow = shipper.NewRow();
newRow["CompanyName"] = "New Shipper";
shipper.Rows.Add(newRow);
@@ -85,7 +85,7 @@ private static void MergeIdentityColumns(string connectionString)
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=Northwind;"
+ "Integrated Security=true";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClientFactory.DataSourceEnumerator/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClientFactory.DataSourceEnumerator/CS/source.cs
index 7606c5474d6..ed1472420d5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClientFactory.DataSourceEnumerator/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClientFactory.DataSourceEnumerator/CS/source.cs
@@ -18,9 +18,9 @@ static void Main()
private static void ListServers(DbProviderFactory factory)
{
// This procedure is provider-agnostic, and can list
- // instances of any provider's servers. Of course,
+ // instances of any provider's servers. Of course,
// not all providers can create a data source enumerator,
- // so it's best to check the CanCreateDataSourceEnumerator
+ // so it's best to check the CanCreateDataSourceEnumerator
// property before attempting to list the data sources.
if (factory.CanCreateDataSourceEnumerator)
{
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQuery/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQuery/CS/source.cs
index 7e7f1c2e915..a0e46a00e08 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQuery/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQuery/CS/source.cs
@@ -7,16 +7,16 @@ class Class1
{
static void Main()
{
- // This is a simple example that demonstrates the usage of the
+ // This is a simple example that demonstrates the usage of the
// BeginExecuteNonQuery functionality.
- // The WAITFOR statement simply adds enough time to prove the
+ // The WAITFOR statement simply adds enough time to prove the
// asynchronous nature of the command.
-
- string commandText =
- "UPDATE Production.Product SET ReorderPoint = ReorderPoint + 1 " +
- "WHERE ReorderPoint Is Not Null;" +
- "WAITFOR DELAY '0:0:3';" +
- "UPDATE Production.Product SET ReorderPoint = ReorderPoint - 1 " +
+
+ string commandText =
+ "UPDATE Production.Product SET ReorderPoint = ReorderPoint + 1 " +
+ "WHERE ReorderPoint Is Not Null;" +
+ "WAITFOR DELAY '0:0:3';" +
+ "UPDATE Production.Product SET ReorderPoint = ReorderPoint - 1 " +
"WHERE ReorderPoint Is Not Null";
RunCommandAsynchronously(commandText, GetConnectionString());
@@ -30,9 +30,9 @@ private static void RunCommandAsynchronously(
{
// Given command text and connection string, asynchronously execute
// the specified command against the connection. For this example,
- // the code displays an indicator as it is working, verifying the
- // asynchronous behavior.
- using (SqlConnection connection =
+ // the code displays an indicator as it is working, verifying the
+ // asynchronous behavior.
+ using (SqlConnection connection =
new SqlConnection(connectionString))
{
try
@@ -46,11 +46,11 @@ private static void RunCommandAsynchronously(
{
Console.WriteLine("Waiting ({0})", count++);
// Wait for 1/10 second, so the counter
- // does not consume all available resources
+ // does not consume all available resources
// on the main thread.
System.Threading.Thread.Sleep(100);
}
- Console.WriteLine("Command complete. Affected {0} rows.",
+ Console.WriteLine("Command complete. Affected {0} rows.",
command.EndExecuteNonQuery(result));
}
catch (SqlException ex)
@@ -72,14 +72,14 @@ private static void RunCommandAsynchronously(
private static string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
// If you have not included "Asynchronous Processing=true" in the
// connection string, the command is not able
// to execute asynchronously.
return "Data Source=(local);Integrated Security=SSPI;" +
"Initial Catalog=AdventureWorks; Asynchronous Processing=true";
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQueryForm/CS/Form1.Designer.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQueryForm/CS/Form1.Designer.cs
index afdccafa268..73db401049a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQueryForm/CS/Form1.Designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQueryForm/CS/Form1.Designer.cs
@@ -33,35 +33,35 @@ private void InitializeComponent()
this.dataGridView1 = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
- //
+ //
// button1
- //
+ //
this.button1.Location = new System.Drawing.Point(47, 238);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
- //
+ //
// label1
- //
+ //
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(44, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
- //
+ //
// dataGridView1
- //
+ //
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Location = new System.Drawing.Point(40, 65);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(240, 150);
this.dataGridView1.TabIndex = 2;
- //
+ //
// Form1
- //
+ //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQueryForm/CS/Form1.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQueryForm/CS/Form1.cs
index b54b2fb0caa..451a6db6781 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQueryForm/CS/Form1.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteNonQueryForm/CS/Form1.cs
@@ -17,8 +17,8 @@ public Form1()
InitializeComponent();
}
- // Hook up the form's Load event handler (you can double-click on
- // the form's design surface in Visual Studio), and then add
+ // Hook up the form's Load event handler (you can double-click on
+ // the form's design surface in Visual Studio), and then add
// this code to the form's class:
private void Form1_Load(object sender, EventArgs e)
{
@@ -30,23 +30,23 @@ private void Form1_Load(object sender, EventArgs e)
// You need this delegate in order to display text from a thread
// other than the form's thread. See the HandleCallback
// procedure for more information.
- // This same delegate matches both the DisplayStatus
+ // This same delegate matches both the DisplayStatus
// and DisplayResults methods.
private delegate void DisplayInfoDelegate(string Text);
// This flag ensures that the user does not attempt
- // to restart the command or close the form while the
+ // to restart the command or close the form while the
// asynchronous command is executing.
private bool isExecuting;
- // This example maintains the connection object
+ // This example maintains the connection object
// externally, so that it is available for closing.
private SqlConnection connection;
private static string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
// If you have not included "Asynchronous Processing=true" in the
// connection string, the command is not able
@@ -93,7 +93,7 @@ private void button1_Click(object sender, System.EventArgs e)
DisplayResults("");
DisplayStatus("Connecting...");
connection = new SqlConnection(GetConnectionString());
- // To emulate a long-running query, wait for
+ // To emulate a long-running query, wait for
// a few seconds before working with the data.
// This command does not do much, but that's the point--
// it does not change your data, in the long run.
@@ -109,8 +109,8 @@ private void button1_Click(object sender, System.EventArgs e)
DisplayStatus("Executing...");
isExecuting = true;
- // Although it is not required that you pass the
- // SqlCommand object as the second parameter in the
+ // Although it is not required that you pass the
+ // SqlCommand object as the second parameter in the
// BeginExecuteNonQuery call, doing so makes it easier
// to call EndExecuteNonQuery in the callback procedure.
AsyncCallback callback = new AsyncCallback(HandleCallback);
@@ -147,31 +147,31 @@ private void HandleCallback(IAsyncResult result)
// You may not interact with the form and its contents
// from a different thread, and this callback procedure
// is all but guaranteed to be running from a different thread
- // than the form. Therefore you cannot simply call code that
+ // than the form. Therefore you cannot simply call code that
// displays the results, like this:
// DisplayResults(rowText)
// Instead, you must call the procedure from the form's thread.
// One simple way to accomplish this is to call the Invoke
// method of the form, which calls the delegate you supply
- // from the form's thread.
+ // from the form's thread.
DisplayInfoDelegate del = new DisplayInfoDelegate(DisplayResults);
this.Invoke(del, rowText);
}
catch (Exception ex)
{
- // Because you are now running code in a separate thread,
+ // Because you are now running code in a separate thread,
// if you do not handle the exception here, none of your other
- // code catches the exception. Because none of
+ // code catches the exception. Because none of
// your code is on the call stack in this thread, there is nothing
- // higher up the stack to catch the exception if you do not
- // handle it here. You can either log the exception or
- // invoke a delegate (as in the non-error case in this
+ // higher up the stack to catch the exception if you do not
+ // handle it here. You can either log the exception or
+ // invoke a delegate (as in the non-error case in this
// example) to display the error on the form. In no case
// can you simply display the error without executing a delegate
- // as in the try block here.
+ // as in the try block here.
- // You can create the delegate instance as you
+ // You can create the delegate instance as you
// invoke it, like this:
this.Invoke(new DisplayInfoDelegate(DisplayStatus),
String.Format("Ready(last error: {0}", ex.Message));
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReader/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReader/CS/source.cs
index 76682b042a2..d353f522644 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReader/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReader/CS/source.cs
@@ -7,9 +7,9 @@ class Class1
{
static void Main()
{
- // This is a simple example that demonstrates the usage of the
+ // This is a simple example that demonstrates the usage of the
// BeginExecuteReader functionality
- // The WAITFOR statement simply adds enough time to prove the
+ // The WAITFOR statement simply adds enough time to prove the
// asynchronous nature of the command.
string commandText =
"WAITFOR DELAY '00:00:03';" +
@@ -27,8 +27,8 @@ private static void RunCommandAsynchronously(
{
// Given command text and connection string, asynchronously execute
// the specified command against the connection. For this example,
- // the code displays an indicator as it is working, verifying the
- // asynchronous behavior.
+ // the code displays an indicator as it is working, verifying the
+ // asynchronous behavior.
using (SqlConnection connection = new SqlConnection(connectionString))
{
try
@@ -39,8 +39,8 @@ private static void RunCommandAsynchronously(
IAsyncResult result = command.BeginExecuteReader();
// Although it is not necessary, the following code
- // displays a counter in the console window, indicating that
- // the main thread is not blocked while awaiting the command
+ // displays a counter in the console window, indicating that
+ // the main thread is not blocked while awaiting the command
// results.
int count = 0;
while (!result.IsCompleted)
@@ -48,7 +48,7 @@ private static void RunCommandAsynchronously(
count += 1;
Console.WriteLine("Waiting ({0})", count);
// Wait for 1/10 second, so the counter
- // does not consume all available resources
+ // does not consume all available resources
// on the main thread.
System.Threading.Thread.Sleep(100);
}
@@ -80,7 +80,7 @@ private static void DisplayResults(SqlDataReader reader)
// Display the data within the reader.
while (reader.Read())
{
- // Display all the columns.
+ // Display all the columns.
for (int i = 0; i < reader.FieldCount; i++)
Console.Write("{0} ", reader.GetValue(i));
Console.WriteLine();
@@ -89,8 +89,8 @@ private static void DisplayResults(SqlDataReader reader)
private static string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
// If you have not included "Asynchronous Processing=true" in the
// connection string, the command is not able
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsync/CS/Form1.Designer.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsync/CS/Form1.Designer.cs
index afdccafa268..73db401049a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsync/CS/Form1.Designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsync/CS/Form1.Designer.cs
@@ -33,35 +33,35 @@ private void InitializeComponent()
this.dataGridView1 = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
- //
+ //
// button1
- //
+ //
this.button1.Location = new System.Drawing.Point(47, 238);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
- //
+ //
// label1
- //
+ //
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(44, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
- //
+ //
// dataGridView1
- //
+ //
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Location = new System.Drawing.Point(40, 65);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(240, 150);
this.dataGridView1.TabIndex = 2;
- //
+ //
// Form1
- //
+ //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsync/CS/Form1.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsync/CS/Form1.cs
index 8e646051685..fc692bde195 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsync/CS/Form1.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsync/CS/Form1.cs
@@ -17,8 +17,8 @@ public Form1()
InitializeComponent();
}
- // Hook up the form's Load event handler (you can double-click on
- // the form's design surface in Visual Studio), and then add
+ // Hook up the form's Load event handler (you can double-click on
+ // the form's design surface in Visual Studio), and then add
// this code to the form's class:
// You need this delegate in order to fill the grid from
@@ -30,13 +30,13 @@ public Form1()
private delegate void DisplayStatusDelegate(string Text);
// This flag ensures that the user does not attempt
- // to restart the command or close the form while the
+ // to restart the command or close the form while the
// asynchronous command is executing.
private bool isExecuting = false;
// Because the overloaded version of BeginExecuteReader
// demonstrated here does not allow you to have the connection
- // closed automatically, this example maintains the
+ // closed automatically, this example maintains the
// connection object externally, so that it is available for closing.
private SqlConnection connection = null;
@@ -88,32 +88,32 @@ private void HandleCallback(IAsyncResult result)
// You may not interact with the form and its contents
// from a different thread, and this callback procedure
// is all but guaranteed to be running from a different thread
- // than the form. Therefore you cannot simply call code that
+ // than the form. Therefore you cannot simply call code that
// fills the grid, like this:
// FillGrid(reader);
// Instead, you must call the procedure from the form's thread.
// One simple way to accomplish this is to call the Invoke
// method of the form, which calls the delegate you supply
- // from the form's thread.
+ // from the form's thread.
FillGridDelegate del = new FillGridDelegate(FillGrid);
this.Invoke(del, reader);
- // Do not close the reader here, because it is being used in
+ // Do not close the reader here, because it is being used in
// a separate thread. Instead, have the procedure you have
// called close the reader once it is done with it.
}
catch (Exception ex)
{
- // Because you are now running code in a separate thread,
+ // Because you are now running code in a separate thread,
// if you do not handle the exception here, none of your other
- // code catches the exception. Because there is none of
+ // code catches the exception. Because there is none of
// your code on the call stack in this thread, there is nothing
- // higher up the stack to catch the exception if you do not
- // handle it here. You can either log the exception or
- // invoke a delegate (as in the non-error case in this
+ // higher up the stack to catch the exception if you do not
+ // handle it here. You can either log the exception or
+ // invoke a delegate (as in the non-error case in this
// example) to display the error on the form. In no case
// can you simply display the error without executing a delegate
- // as in the try block here.
- // You can create the delegate instance as you
+ // as in the try block here.
+ // You can create the delegate instance as you
// invoke it, like this:
this.Invoke(new DisplayStatusDelegate(DisplayStatus),
"Error: " + ex.Message);
@@ -126,8 +126,8 @@ private void HandleCallback(IAsyncResult result)
private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
// If you do not include the Asynchronous Processing=true name/value pair,
// you wo not be able to execute the command asynchronously.
@@ -150,7 +150,7 @@ private void button1_Click(object sender, System.EventArgs e)
{
DisplayStatus("Connecting...");
connection = new SqlConnection(GetConnectionString());
- // To emulate a long-running query, wait for
+ // To emulate a long-running query, wait for
// a few seconds before retrieving the real data.
command = new SqlCommand("WAITFOR DELAY '0:0:5';" +
"SELECT ProductID, Name, ListPrice, Weight FROM Production.Product",
@@ -159,8 +159,8 @@ private void button1_Click(object sender, System.EventArgs e)
DisplayStatus("Executing...");
isExecuting = true;
- // Although it is not required that you pass the
- // SqlCommand object as the second parameter in the
+ // Although it is not required that you pass the
+ // SqlCommand object as the second parameter in the
// BeginExecuteReader call, doing so makes it easier
// to call EndExecuteReader in the callback procedure.
AsyncCallback callback = new AsyncCallback(HandleCallback);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncBehavior/CS/Form1.Designer.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncBehavior/CS/Form1.Designer.cs
index afdccafa268..73db401049a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncBehavior/CS/Form1.Designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncBehavior/CS/Form1.Designer.cs
@@ -33,35 +33,35 @@ private void InitializeComponent()
this.dataGridView1 = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
- //
+ //
// button1
- //
+ //
this.button1.Location = new System.Drawing.Point(47, 238);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
- //
+ //
// label1
- //
+ //
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(44, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
- //
+ //
// dataGridView1
- //
+ //
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Location = new System.Drawing.Point(40, 65);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(240, 150);
this.dataGridView1.TabIndex = 2;
- //
+ //
// Form1
- //
+ //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncBehavior/CS/Form1.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncBehavior/CS/Form1.cs
index b30c140d879..b3f84fb805e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncBehavior/CS/Form1.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncBehavior/CS/Form1.cs
@@ -16,8 +16,8 @@ public Form1()
{
InitializeComponent();
}
- // Hook up the form's Load event handler (you can double-click on
- // the form's design surface in Visual Studio), and then add
+ // Hook up the form's Load event handler (you can double-click on
+ // the form's design surface in Visual Studio), and then add
// this code to the form's class:
// You need this delegate in order to fill the grid from
// a thread other than the form's thread. See the HandleCallback
@@ -28,7 +28,7 @@ public Form1()
private delegate void DisplayStatusDelegate(string Text);
// This flag ensures that the user does not attempt
- // to restart the command or close the form while the
+ // to restart the command or close the form while the
// asynchronous command is executing.
private bool isExecuting;
@@ -57,7 +57,7 @@ private void FillGrid(SqlDataReader reader)
finally
{
// Closing the reader also closes the connection,
- // because this reader was created using the
+ // because this reader was created using the
// CommandBehavior.CloseConnection value.
if (reader != null)
{
@@ -78,32 +78,32 @@ private void HandleCallback(IAsyncResult result)
// You may not interact with the form and its contents
// from a different thread, and this callback procedure
// is all but guaranteed to be running from a different thread
- // than the form. Therefore you cannot simply call code that
+ // than the form. Therefore you cannot simply call code that
// fills the grid, like this:
// FillGrid(reader);
// Instead, you must call the procedure from the form's thread.
// One simple way to accomplish this is to call the Invoke
// method of the form, which calls the delegate you supply
- // from the form's thread.
+ // from the form's thread.
FillGridDelegate del = new FillGridDelegate(FillGrid);
this.Invoke(del, reader);
- // Do not close the reader here, because it is being used in
+ // Do not close the reader here, because it is being used in
// a separate thread. Instead, have the procedure you have
// called close the reader once it is done with it.
}
catch (Exception ex)
{
- // Because you are now running code in a separate thread,
+ // Because you are now running code in a separate thread,
// if you do not handle the exception here, none of your other
- // code catches the exception. Because there is none of
+ // code catches the exception. Because there is none of
// your code on the call stack in this thread, there is nothing
- // higher up the stack to catch the exception if you do not
- // handle it here. You can either log the exception or
- // invoke a delegate (as in the non-error case in this
+ // higher up the stack to catch the exception if you do not
+ // handle it here. You can either log the exception or
+ // invoke a delegate (as in the non-error case in this
// example) to display the error on the form. In no case
// can you simply display the error without executing a delegate
- // as in the try block here.
- // You can create the delegate instance as you
+ // as in the try block here.
+ // You can create the delegate instance as you
// invoke it, like this:
this.Invoke(new DisplayStatusDelegate(DisplayStatus), "Error: " +
ex.Message);
@@ -116,8 +116,8 @@ private void HandleCallback(IAsyncResult result)
private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
// If you do not include the Asynchronous Processing=true name/value pair,
// you wo not be able to execute the command asynchronously.
@@ -141,7 +141,7 @@ private void button1_Click(object sender, System.EventArgs e)
{
DisplayStatus("Connecting...");
connection = new SqlConnection(GetConnectionString());
- // To emulate a long-running query, wait for
+ // To emulate a long-running query, wait for
// a few seconds before retrieving the real data.
command = new SqlCommand("WAITFOR DELAY '0:0:5';" +
"SELECT ProductID, Name, ListPrice, Weight FROM Production.Product",
@@ -150,8 +150,8 @@ private void button1_Click(object sender, System.EventArgs e)
DisplayStatus("Executing...");
isExecuting = true;
- // Although it is not required that you pass the
- // SqlCommand object as the second parameter in the
+ // Although it is not required that you pass the
+ // SqlCommand object as the second parameter in the
// BeginExecuteReader call, doing so makes it easier
// to call EndExecuteReader in the callback procedure.
AsyncCallback callback = new AsyncCallback(HandleCallback);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncSimple/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncSimple/CS/source.cs
index 42045b152e5..fa9ce52491e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncSimple/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteReaderAsyncSimple/CS/source.cs
@@ -7,7 +7,7 @@ class Class1
static void Main()
{
// This example is not terribly useful, but it proves a point.
- // The WAITFOR statement simply adds enough time to prove the
+ // The WAITFOR statement simply adds enough time to prove the
// asynchronous nature of the command.
string commandText = "WAITFOR DELAY '00:00:03';" +
"SELECT ProductID, Name FROM Production.Product WHERE ListPrice < 100";
@@ -23,14 +23,14 @@ private static void RunCommandAsynchronously(
{
// Given command text and connection string, asynchronously execute
// the specified command against the connection. For this example,
- // the code displays an indicator as it is working, verifying the
- // asynchronous behavior.
+ // the code displays an indicator as it is working, verifying the
+ // asynchronous behavior.
try
{
// The code does not need to handle closing the connection explicitly--
// the use of the CommandBehavior.CloseConnection option takes care
- // of that for you.
+ // of that for you.
SqlConnection connection = new SqlConnection(connectionString);
SqlCommand command = new SqlCommand(commandText, connection);
@@ -39,15 +39,15 @@ private static void RunCommandAsynchronously(
CommandBehavior.CloseConnection);
// Although it is not necessary, the following code
- // displays a counter in the console window, indicating that
- // the main thread is not blocked while awaiting the command
+ // displays a counter in the console window, indicating that
+ // the main thread is not blocked while awaiting the command
// results.
int count = 0;
while (!result.IsCompleted)
{
Console.WriteLine("Waiting ({0})", count++);
// Wait for 1/10 second, so the counter
- // does not consume all available resources
+ // does not consume all available resources
// on the main thread.
System.Threading.Thread.Sleep(100);
}
@@ -78,7 +78,7 @@ private static void DisplayResults(SqlDataReader reader)
// Display the data within the reader.
while (reader.Read())
{
- // Display all the columns.
+ // Display all the columns.
for (int i = 0; i < reader.FieldCount; i++)
{
Console.Write("{0}\t", reader.GetValue(i));
@@ -89,8 +89,8 @@ private static void DisplayResults(SqlDataReader reader)
private static string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
// If you have not included "Asynchronous Processing=true" in the
// connection string, the command is not able
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReader/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReader/CS/source.cs
index 993df83756d..cec041a047e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReader/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReader/CS/source.cs
@@ -9,7 +9,7 @@ class Class1
static void Main()
{
// This example is not terribly effective, but it proves a point.
- // The WAITFOR statement simply adds enough time to prove the
+ // The WAITFOR statement simply adds enough time to prove the
// asynchronous nature of the command.
string commandText =
"WAITFOR DELAY '00:00:03';" +
@@ -28,8 +28,8 @@ private static void RunCommandAsynchronously(
{
// Given command text and connection string, asynchronously execute
// the specified command against the connection. For this example,
- // the code displays an indicator as it is working, verifying the
- // asynchronous behavior.
+ // the code displays an indicator as it is working, verifying the
+ // asynchronous behavior.
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(commandText, connection);
@@ -38,15 +38,15 @@ private static void RunCommandAsynchronously(
IAsyncResult result = command.BeginExecuteXmlReader();
// Although it is not necessary, the following procedure
- // displays a counter in the console window, indicating that
- // the main thread is not blocked while awaiting the command
+ // displays a counter in the console window, indicating that
+ // the main thread is not blocked while awaiting the command
// results.
int count = 0;
while (!result.IsCompleted)
{
Console.WriteLine("Waiting ({0})", count++);
// Wait for 1/10 second, so the counter
- // does not consume all available resources
+ // does not consume all available resources
// on the main thread.
System.Threading.Thread.Sleep(100);
}
@@ -72,8 +72,8 @@ private static void DisplayProductInfo(XmlReader reader)
private static string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
// If you have not included "Asynchronous Processing=true" in the
// connection string, the command is not able
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReaderAsync/CS/Form1.Designer.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReaderAsync/CS/Form1.Designer.cs
index 4243a746ddf..4ac7e5dfcec 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReaderAsync/CS/Form1.Designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReaderAsync/CS/Form1.Designer.cs
@@ -32,35 +32,35 @@ private void InitializeComponent()
this.label1 = new System.Windows.Forms.Label();
this.listBox1 = new System.Windows.Forms.ListBox();
this.SuspendLayout();
- //
+ //
// button1
- //
+ //
this.button1.Location = new System.Drawing.Point(47, 238);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
- //
+ //
// label1
- //
+ //
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(44, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
- //
+ //
// listBox1
- //
+ //
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(47, 83);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(233, 95);
this.listBox1.TabIndex = 2;
- //
+ //
// Form1
- //
+ //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReaderAsync/CS/Form1.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReaderAsync/CS/Form1.cs
index fec9a3b48ff..2536a142fe0 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReaderAsync/CS/Form1.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.BeginExecuteXmlReaderAsync/CS/Form1.cs
@@ -13,7 +13,7 @@ namespace Microsoft.AdoDotNet.CodeSamples
{
public partial class Form1 : Form
{
- // Hook up the form's Load event handler and then add
+ // Hook up the form's Load event handler and then add
// this code to the form's class:
// You need these delegates in order to display text from a thread
// other than the form's thread. See the HandleCallback
@@ -23,7 +23,7 @@ public partial class Form1 : Form
private bool isExecuting;
- // This example maintains the connection object
+ // This example maintains the connection object
// externally, so that it is available for closing.
private SqlConnection connection;
@@ -34,8 +34,8 @@ public Form1()
private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
// If you do not include the Asynchronous Processing=true name/value pair,
// you wo not be able to execute the command asynchronously.
@@ -69,7 +69,7 @@ private void DisplayProductInfo(XmlReader reader)
DisplayStatus("Ready");
}
- private void Form1_FormClosing(object sender,
+ private void Form1_FormClosing(object sender,
System.Windows.Forms.FormClosingEventArgs e)
{
if (isExecuting)
@@ -84,7 +84,7 @@ private void button1_Click(object sender, System.EventArgs e)
{
if (isExecuting)
{
- MessageBox.Show(this,
+ MessageBox.Show(this,
"Already executing. Please wait until the current query " +
"has completed.");
}
@@ -97,7 +97,7 @@ private void button1_Click(object sender, System.EventArgs e)
DisplayStatus("Connecting...");
connection = new SqlConnection(GetConnectionString());
- // To emulate a long-running query, wait for
+ // To emulate a long-running query, wait for
// a few seconds before working with the data.
string commandText =
"WAITFOR DELAY '00:00:03';" +
@@ -110,8 +110,8 @@ private void button1_Click(object sender, System.EventArgs e)
DisplayStatus("Executing...");
isExecuting = true;
- // Although it is not required that you pass the
- // SqlCommand object as the second parameter in the
+ // Although it is not required that you pass the
+ // SqlCommand object as the second parameter in the
// BeginExecuteXmlReader call, doing so makes it easier
// to call EndExecuteXmlReader in the callback procedure.
AsyncCallback callback = new AsyncCallback(HandleCallback);
@@ -142,29 +142,29 @@ private void HandleCallback(IAsyncResult result)
// You may not interact with the form and its contents
// from a different thread, and this callback procedure
// is all but guaranteed to be running from a different thread
- // than the form.
+ // than the form.
// Instead, you must call the procedure from the form's thread.
// One simple way to accomplish this is to call the Invoke
// method of the form, which calls the delegate you supply
- // from the form's thread.
+ // from the form's thread.
DisplayReaderDelegate del = new DisplayReaderDelegate(DisplayProductInfo);
this.Invoke(del, reader);
}
catch (Exception ex)
{
- // Because you are now running code in a separate thread,
+ // Because you are now running code in a separate thread,
// if you do not handle the exception here, none of your other
- // code catches the exception. Because none of
+ // code catches the exception. Because none of
// your code is on the call stack in this thread, there is nothing
- // higher up the stack to catch the exception if you do not
- // handle it here. You can either log the exception or
- // invoke a delegate (as in the non-error case in this
+ // higher up the stack to catch the exception if you do not
+ // handle it here. You can either log the exception or
+ // invoke a delegate (as in the non-error case in this
// example) to display the error on the form. In no case
// can you simply display the error without executing a delegate
- // as in the try block here.
+ // as in the try block here.
- // You can create the delegate instance as you
+ // You can create the delegate instance as you
// invoke it, like this:
this.Invoke(new DisplayInfoDelegate(DisplayStatus),
String.Format("Ready(last error: {0}", ex.Message));
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.ExecuteScalar/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.ExecuteScalar/CS/source.cs
index d9f1a5597f4..7b1611482ef 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.ExecuteScalar/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlCommand.ExecuteScalar/CS/source.cs
@@ -37,7 +37,7 @@ static public int AddProductCategory(string newName, string connString)
//
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=true";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnection.ChangePassword/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnection.ChangePassword/CS/source.cs
index ba9281f1fba..5c131c3851a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnection.ChangePassword/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnection.ChangePassword/CS/source.cs
@@ -29,11 +29,11 @@ private static void DemonstrateChangePassword()
{
for (int i = 0; i <= 1; i++)
{
- // Run this loop at most two times. If the first attempt fails,
+ // Run this loop at most two times. If the first attempt fails,
// the code checks the Number property of the SqlException object.
- // If that contains the special values 18487 or 18488, the code
- // attempts to set the user's password to a new value.
- // Assuming this succeeds, the second pass through
+ // If that contains the special values 18487 or 18488, the code
+ // attempts to set the user's password to a new value.
+ // Assuming this succeeds, the second pass through
// successfully opens the connection.
// If not, the exception handler catches the exception.
try
@@ -48,9 +48,9 @@ private static void DemonstrateChangePassword()
{
if (i == 0 && ((ex.Number == 18487) || (ex.Number == 18488)))
{
- // You must reset the password.
+ // You must reset the password.
connectionString =
- ModifyConnectionString(connectionString,
+ ModifyConnectionString(connectionString,
GetNewPassword());
}
else
@@ -72,7 +72,7 @@ private static string ModifyConnectionString(
{
// Use the SqlConnectionStringBuilder class to modify the
- // password portion of the connection string.
+ // password portion of the connection string.
SqlConnectionStringBuilder builder =
new SqlConnectionStringBuilder(connectionString);
builder.Password = NewPassword;
@@ -95,7 +95,7 @@ private static string GetConnectionString()
// application, you might want to retrieve this setting
// from a config file, or from some other source.
- // In a production application, you would want to
+ // In a production application, you would want to
// display a modal form that could gather user and password
// information.
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.ApplicationName/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.ApplicationName/CS/source.cs
index 3e250dc37f1..23cf7d813b2 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.ApplicationName/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.ApplicationName/CS/source.cs
@@ -9,9 +9,9 @@ static void Main()
{
try
{
- string connectString = "Server=(local);Initial Catalog=AdventureWorks;" +
+ string connectString = "Server=(local);Initial Catalog=AdventureWorks;" +
"Integrated Security=true";
- SqlConnectionStringBuilder builder =
+ SqlConnectionStringBuilder builder =
new SqlConnectionStringBuilder(connectString);
Console.WriteLine("Original: " + builder.ConnectionString);
Console.WriteLine("ApplicationName={0}",
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Async/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Async/CS/source.cs
index e53aaf49315..3fec1b523e3 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Async/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Async/CS/source.cs
@@ -8,7 +8,7 @@ class Program
{
static void Main()
{
- // Create a SqlConnectionStringBuilder instance,
+ // Create a SqlConnectionStringBuilder instance,
// and ensure that it is set up for asynchronous processing.
SqlConnectionStringBuilder builder =
new SqlConnectionStringBuilder(GetConnectionString());
@@ -33,18 +33,18 @@ static void Main()
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // you can retrieve it from a configuration file.
return "Data Source=(local);Integrated Security=SSPI;" +
"Initial Catalog=AdventureWorks";
}
- private static void RunCommandAsynchronously(string commandText,
+ private static void RunCommandAsynchronously(string commandText,
string connectionString)
{
// Given command text and connection string, asynchronously execute
// the specified command against the connection. For this example,
- // the code displays an indicator as it's working, verifying the
- // asynchronous behavior.
+ // the code displays an indicator as it's working, verifying the
+ // asynchronous behavior.
using (SqlConnection connection = new SqlConnection(connectionString))
{
try
@@ -57,7 +57,7 @@ private static void RunCommandAsynchronously(string commandText,
{
Console.WriteLine("Waiting {0}.", count);
// Wait for 1/10 second, so the counter
- // doesn't consume all available resources
+ // doesn't consume all available resources
// on the main thread.
Thread.Sleep(100);
count += 1;
@@ -68,7 +68,7 @@ private static void RunCommandAsynchronously(string commandText,
catch (SqlException ex)
{
Console.WriteLine(
- "Error {0}: System.Data.SqlClient.SqlConnectionStringBuilder",
+ "Error {0}: System.Data.SqlClient.SqlConnectionStringBuilder",
ex.Number, ex.Message);
}
catch (InvalidOperationException ex)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.ContainsKey/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.ContainsKey/CS/source.cs
index c505bddc63b..f2360245a26 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.ContainsKey/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.ContainsKey/CS/source.cs
@@ -32,7 +32,7 @@ static void Main()
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // you can retrieve it from a configuration file.
return "Server=(local);Integrated Security=SSPI;" +
"Initial Catalog=AdventureWorks";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.DataSource/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.DataSource/CS/source.cs
index ff4c33ca9bb..62776cf028e 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.DataSource/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.DataSource/CS/source.cs
@@ -11,8 +11,8 @@ static void Main()
"Network Address=(local);Integrated Security=SSPI;" +
"Initial Catalog=AdventureWorks");
- // Display the connection string, which should now
- // contain the "Data Source" key, as opposed to the
+ // Display the connection string, which should now
+ // contain the "Data Source" key, as opposed to the
// supplied "Network Address".
Console.WriteLine(builder.ConnectionString);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.InitialCatalog/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.InitialCatalog/CS/source.cs
index 0a6b4adcf97..71f974a7ede 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.InitialCatalog/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.InitialCatalog/CS/source.cs
@@ -12,7 +12,7 @@ static void Main()
string connectString = "Data Source=(local);" +
"Integrated Security=true";
- SqlConnectionStringBuilder builder =
+ SqlConnectionStringBuilder builder =
new SqlConnectionStringBuilder(connectString);
Console.WriteLine("Original: " + builder.ConnectionString);
@@ -23,11 +23,11 @@ static void Main()
// setting the value in this way results in the same
// connection string:
builder["Database"] = "AdventureWorks";
- Console.WriteLine("builder.InitialCatalog = "
+ Console.WriteLine("builder.InitialCatalog = "
+ builder.InitialCatalog);
Console.WriteLine("Modified: " + builder.ConnectionString);
- using (SqlConnection connection =
+ using (SqlConnection connection =
new SqlConnection(builder.ConnectionString))
{
connection.Open();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.IntegratedSecurity/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.IntegratedSecurity/CS/source.cs
index 15649680439..b2160924759 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.IntegratedSecurity/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.IntegratedSecurity/CS/source.cs
@@ -13,13 +13,13 @@ static void Main()
"Data Source=(local);User ID=ab;Password=MyPassword;" +
"Initial Catalog=AdventureWorks";
- SqlConnectionStringBuilder builder =
+ SqlConnectionStringBuilder builder =
new SqlConnectionStringBuilder(connectString);
Console.WriteLine("Original: " + builder.ConnectionString);
// Use the Remove method
// in order to reset the user ID and password back to their
- // default (empty string) values. Simply setting the
+ // default (empty string) values. Simply setting the
// associated property values to an empty string won't
// remove them from the connection string; you must
// call the Remove method.
@@ -31,7 +31,7 @@ static void Main()
Console.WriteLine("Modified: " + builder.ConnectionString);
- using (SqlConnection connection =
+ using (SqlConnection connection =
new SqlConnection(builder.ConnectionString))
{
connection.Open();
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Item/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Item/CS/source.cs
index 7e07030367b..fc5de1b30a9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Item/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Item/CS/source.cs
@@ -7,7 +7,7 @@ class Program
{
static void Main()
{
- SqlConnectionStringBuilder builder =
+ SqlConnectionStringBuilder builder =
new SqlConnectionStringBuilder();
builder["Data Source"] = "(local)";
builder["Integrated Security"] = true;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Keys/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Keys/CS/source.cs
index 37c8bba7932..d96b6106f10 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Keys/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Keys/CS/source.cs
@@ -13,7 +13,7 @@ static void Main()
builder.IntegratedSecurity = true;
builder.InitialCatalog = "AdventureWorks";
- // Loop through the collection of keys, displaying
+ // Loop through the collection of keys, displaying
// the key and value for each item:
foreach (string key in builder.Keys)
Console.WriteLine("{0}={1}", key, builder[key]);
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.MARS/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.MARS/CS/source.cs
index ae70f0a4efd..3d3fd5c68b7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.MARS/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.MARS/CS/source.cs
@@ -14,7 +14,7 @@ static void Main()
// The connection does not allow multiple active result sets
// by default, so this line of code explicitly
- // enables this feature. Note that this feature is
+ // enables this feature. Note that this feature is
// only available when programming against SQL Server 2005
// or later.
builder.MultipleActiveResultSets = true;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Password/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Password/CS/source.cs
index 6b073b873aa..63145841ab7 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Password/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Password/CS/source.cs
@@ -9,10 +9,10 @@ static void Main()
{
try
{
- string connectString =
+ string connectString =
"Server=(local);Database=AdventureWorks;UID=ab;Pwd= a!Pass@@";
Console.WriteLine("Original: " + connectString);
- SqlConnectionStringBuilder builder =
+ SqlConnectionStringBuilder builder =
new SqlConnectionStringBuilder(connectString);
Console.WriteLine("Modified: " + builder.ConnectionString);
foreach (string key in builder.Keys)
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/source.cs
index 88d7f89962d..780b2a4e1c9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Remove/CS/source.cs
@@ -18,7 +18,7 @@ static void Main()
// Use the Remove method
// in order to reset the user ID and password back to their
- // default (empty string) values.
+ // default (empty string) values.
builder.Remove("User ID");
builder.Remove("Password");
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.TryGetValue/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.TryGetValue/CS/source.cs
index 375e3858b3e..bedc06327b5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.TryGetValue/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.TryGetValue/CS/source.cs
@@ -34,7 +34,7 @@ private static void DisplayValue(
// it doesn't handle passing in a null
// key. This example traps for that particular error, but
// passes any other unknown exceptions back out to the
- // caller.
+ // caller.
try
{
if (builder.TryGetValue(key, out value))
@@ -55,7 +55,7 @@ private static void DisplayValue(
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // you can retrieve it from a configuration file.
return "Server=(local);Integrated Security=SSPI;" +
"Initial Catalog=AdventureWorks";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Values/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Values/CS/source.cs
index 5564bf9f107..85f515c3806 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Values/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder.Values/CS/source.cs
@@ -7,7 +7,7 @@ class Program
{
static void Main()
{
- SqlConnectionStringBuilder builder =
+ SqlConnectionStringBuilder builder =
new SqlConnectionStringBuilder(GetConnectionString());
// Loop through each of the values, displaying the contents.
@@ -21,7 +21,7 @@ static void Main()
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // you can retrieve it from a configuration file.
return "Data Source=(local);Integrated Security=SSPI;" +
"Initial Catalog=AdventureWorks; Asynchronous Processing=true";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/source.cs
index eac84258569..23584c49366 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlConnectionStringBuilder/CS/source.cs
@@ -14,12 +14,12 @@ static void Main()
SqlConnectionStringBuilder builder =
new SqlConnectionStringBuilder(GetConnectionString());
- // The input connection string used the
+ // The input connection string used the
// Server key, but the new connection string uses
// the well-known Data Source key instead.
Console.WriteLine(builder.ConnectionString);
- // Pass the SqlConnectionStringBuilder an existing
+ // Pass the SqlConnectionStringBuilder an existing
// connection string, and you can retrieve and
// modify any of the elements.
builder.ConnectionString = "server=(local);user id=ab;" +
@@ -31,7 +31,7 @@ static void Main()
builder.Password = "new@1Password";
builder.AsynchronousProcessing = true;
- // You can refer to connection keys using strings,
+ // You can refer to connection keys using strings,
// as well. When you use this technique (the default
// Item property in Visual Basic, or the indexer in C#),
// you can specify any synonym for the connection string key
@@ -48,7 +48,7 @@ static void Main()
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // you can retrieve it from a configuration file.
return "Server=(local);Integrated Security=SSPI;" +
"Initial Catalog=AdventureWorks";
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlDataRecord Samples/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlDataRecord Samples/CS/source.cs
index 1a2aaa89c8d..641c9f6d712 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlDataRecord Samples/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlDataRecord Samples/CS/source.cs
@@ -23,12 +23,12 @@ public static void CreateNewRecord()
{
// Variables.
- SqlDataRecord record;
-
- // Create a new record with the column metadata. The constructor is
- // able to accept a variable number of parameters.
- record = new SqlDataRecord(new SqlMetaData[] { new SqlMetaData("Column1", SqlDbType.NVarChar, 12),
- new SqlMetaData("Column2", SqlDbType.Int),
+ SqlDataRecord record;
+
+ // Create a new record with the column metadata. The constructor is
+ // able to accept a variable number of parameters.
+ record = new SqlDataRecord(new SqlMetaData[] { new SqlMetaData("Column1", SqlDbType.NVarChar, 12),
+ new SqlMetaData("Column2", SqlDbType.Int),
new SqlMetaData("Column3", SqlDbType.DateTime) });
// Set the record fields.
@@ -55,8 +55,8 @@ public static void CreateNewRecord1()
column1Info = new SqlMetaData("Column1", SqlDbType.NVarChar, 12);
column2Info = new SqlMetaData("Column2", SqlDbType.Int);
-// Create a new record with the column metadata.
-record = new SqlDataRecord(new SqlMetaData[] { column1Info,
+// Create a new record with the column metadata.
+record = new SqlDataRecord(new SqlMetaData[] { column1Info,
column2Info });
//
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlMetaData Samples/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlMetaData Samples/CS/source.cs
index 9d71c8dee1f..7ba5be5af28 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlMetaData Samples/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlMetaData Samples/CS/source.cs
@@ -24,10 +24,10 @@ public static void CreateNewRecord()
column1Info = new SqlMetaData("Column1", SqlDbType.NVarChar, 12);
column2Info = new SqlMetaData("Column2", SqlDbType.Int);
column3Info = new SqlMetaData("Column3", SqlDbType.DateTime);
-
- // Create a new record with the column metadata.
- record = new SqlDataRecord(new SqlMetaData[] { column1Info,
- column2Info,
+
+ // Create a new record with the column metadata.
+ record = new SqlDataRecord(new SqlMetaData[] { column1Info,
+ column2Info,
column3Info });
// Set the record fields.
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlMethodAttribute Sample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlMethodAttribute Sample/CS/source.cs
index c1feebf0041..4821d16baa9 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlMethodAttribute Sample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlMethodAttribute Sample/CS/source.cs
@@ -6,7 +6,7 @@
[Serializable]
[Microsoft.SqlServer.Server.SqlUserDefinedType(Format.Native,
- IsByteOrdered=true,
+ IsByteOrdered=true,
Name="Point",ValidationMethodName = "ValidatePoint")]
public struct Point : INullable
{
@@ -65,7 +65,7 @@ public override string ToString()
[SqlMethod(OnNullCall = false)]
public static Point Parse(SqlString s)
{
- // With OnNullCall=false, this check is unnecessary if
+ // With OnNullCall=false, this check is unnecessary if
// Point only called from SQL.
if (s.IsNull)
return Null;
@@ -78,7 +78,7 @@ public static Point Parse(SqlString s)
// Call ValidatePoint to enforce validation
// for string conversions.
- if (!pt.ValidatePoint())
+ if (!pt.ValidatePoint())
throw new ArgumentException("Invalid XY coordinate values.");
return pt;
}
@@ -91,7 +91,7 @@ public Int32 X
return this._x;
}
// Call ValidatePoint to ensure valid range of Point values.
- set
+ set
{
Int32 temp = _x;
_x = value;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlParameterCollection.AddWithValue/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlParameterCollection.AddWithValue/CS/source.cs
index 67cc48a61f9..a06a5843529 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlParameterCollection.AddWithValue/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlParameterCollection.AddWithValue/CS/source.cs
@@ -16,8 +16,8 @@ static void Main()
private static void UpdateDemographics(Int32 customerID,
string demoXml, string connectionString)
{
- // Update the demographics for a store, which is stored
- // in an xml column.
+ // Update the demographics for a store, which is stored
+ // in an xml column.
string commandText = "UPDATE Sales.Store SET Demographics = @demographics "
+ "WHERE CustomerID = @ID;";
@@ -46,7 +46,7 @@ private static void UpdateDemographics(Int32 customerID,
//
static private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
+ // To avoid storing the connection string in your code,
// you can retrieve it from a configuration file.
return "Data Source=(local);Initial Catalog=AdventureWorks;"
+ "Integrated Security=SSPI";
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTriggerAttribute Sample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTriggerAttribute Sample/CS/source.cs
index 6abeea1045a..520190db461 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTriggerAttribute Sample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTriggerAttribute Sample/CS/source.cs
@@ -16,13 +16,13 @@ public static void SalesAudit()
{
// Get the trigger context.
SqlTriggerContext triggContext = SqlContext.TriggerContext;
-
+
switch (triggContext.TriggerAction)
{
case TriggerAction.Insert:
// Do something in response to the INSERT.
-
+
break;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTriggerContext Sample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTriggerContext Sample/CS/source.cs
index e84b164bfc8..be6d10c3cd1 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTriggerContext Sample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTriggerContext Sample/CS/source.cs
@@ -20,7 +20,7 @@ public static void UsersAudit()
SqlCommand command;
SqlTriggerContext triggContext = SqlContext.TriggerContext;
SqlDataReader reader;
-
+
switch (triggContext.TriggerAction)
{
case TriggerAction.Insert:
@@ -30,7 +30,7 @@ public static void UsersAudit()
= new SqlConnection(@"context connection=true"))
{
connection.Open();
-
+
// Get the inserted row.
command = new SqlCommand(@"SELECT * FROM INSERTED;",
connection);
@@ -43,15 +43,15 @@ public static void UsersAudit()
reader.Close();
// Insert the user name and real name into the auditing table.
- command = new SqlCommand(@"INSERT [dbo].[UserNameAudit] (userName, realName) "
+ command = new SqlCommand(@"INSERT [dbo].[UserNameAudit] (userName, realName) "
+ @"VALUES (@userName, @realName);", connection);
command.Parameters.Add(new SqlParameter("@userName", userName));
command.Parameters.Add(new SqlParameter("@realName", realName));
-
- command.ExecuteNonQuery();
+
+ command.ExecuteNonQuery();
}
-
+
break;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTypes.IsNull/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTypes.IsNull/CS/source.cs
index 1fde8eab03f..c7452c78db5 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTypes.IsNull/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlTypes.IsNull/CS/source.cs
@@ -42,7 +42,7 @@ static private void WorkWithSqlNulls()
// Iterate through the DataTable and display the values.
foreach (DataRow row in table.Rows)
{
- // Assign values to variables. Note that you
+ // Assign values to variables. Note that you
// do not have to test for null values.
idValue = (SqlInt32)row["ID"];
descriptionValue = (SqlString)row["Description"];
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlUserDefinedAggregateAttribute Sample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlUserDefinedAggregateAttribute Sample/CS/source.cs
index 0973f6c7a15..ce3ba7ae642 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlUserDefinedAggregateAttribute Sample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlUserDefinedAggregateAttribute Sample/CS/source.cs
@@ -8,7 +8,7 @@
[Serializable]
[Microsoft.SqlServer.Server.SqlUserDefinedAggregate(
- Microsoft.SqlServer.Server.Format.UserDefined,
+ Microsoft.SqlServer.Server.Format.UserDefined,
IsInvariantToNulls = true,
IsInvariantToDuplicates = false,
IsInvariantToOrder = false,
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlUserDefinedTypeAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlUserDefinedTypeAttribute Example/CS/source.cs
index 01a0dbebc78..0c4faff9984 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlUserDefinedTypeAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlUserDefinedTypeAttribute Example/CS/source.cs
@@ -7,7 +7,7 @@
//
[Serializable]
[Microsoft.SqlServer.Server.SqlUserDefinedType(Format.Native,
- IsByteOrdered=true,
+ IsByteOrdered=true,
Name="Point",ValidationMethodName = "ValidatePoint")]
public struct Point : INullable
{
@@ -57,7 +57,7 @@ public override string ToString()
[SqlMethod(OnNullCall = false)]
public static Point Parse(SqlString s)
{
- // With OnNullCall=false, this check is unnecessary if
+ // With OnNullCall=false, this check is unnecessary if
// Point only called from SQL.
if (s.IsNull)
return Null;
@@ -70,7 +70,7 @@ public static Point Parse(SqlString s)
// Call ValidatePoint to enforce validation
// for string conversions.
- if (!pt.ValidatePoint())
+ if (!pt.ValidatePoint())
throw new ArgumentException("Invalid XY coordinate values.");
return pt;
}
@@ -83,7 +83,7 @@ public Int32 X
return this._x;
}
// Call ValidatePoint to ensure valid range of Point values.
- set
+ set
{
Int32 temp = _x;
_x = value;
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/classic webdata datatable example2/cs/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/classic webdata datatable example2/cs/source.cs
index ec449653621..8227fb5fa8a 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/classic webdata datatable example2/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/classic webdata datatable example2/cs/source.cs
@@ -141,7 +141,7 @@ private static void ShowTable(DataTable table) {
else if (col.DataType.Equals(typeof(Decimal)))
Console.Write("{0,-14:C}", row[col]);
else
- Console.Write("{0,-14}", row[col]);
+ Console.Write("{0,-14}", row[col]);
}
Console.WriteLine();
}
diff --git a/samples/snippets/csharp/VS_Snippets_ADO.NET/system_data_isolationlevel/cs/source.cs b/samples/snippets/csharp/VS_Snippets_ADO.NET/system_data_isolationlevel/cs/source.cs
index 1e715d875e4..110699d02c1 100644
--- a/samples/snippets/csharp/VS_Snippets_ADO.NET/system_data_isolationlevel/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_ADO.NET/system_data_isolationlevel/cs/source.cs
@@ -15,7 +15,7 @@ public static void DirtyReadFirstThread(String connStrig, IsolationLevel level)
Console.WriteLine("Begin the DirtyReadFirstThread.....");
using (SqlConnection conn = new SqlConnection(connStrig)) {
- String cmdText = @"Use DbDataIsolationLevel;
+ String cmdText = @"Use DbDataIsolationLevel;
Update dbo.Products set Quantity=Quantity+100 where ProductId=1;
WaitFor Delay '00:00:06';";
@@ -42,7 +42,7 @@ public static void DirtyReadSecondThread(String connStrig, IsolationLevel level)
using (SqlConnection conn = new SqlConnection(connStrig)) {
String cmdText = @"Use DbDataIsolationLevel;
- WaitFor Delay '00:00:03';
+ WaitFor Delay '00:00:03';
Declare @qty int;
select @qty=Quantity from dbo.Products where ProductId=1;
@@ -69,7 +69,7 @@ public static void NonrepeatableReadFirstThread(String connStrig, IsolationLevel
Console.WriteLine("Begin the NonrepeatableReadFirstThread.....");
using (SqlConnection conn = new SqlConnection(connStrig)) {
- String cmdText = @"Use DbDataIsolationLevel;
+ String cmdText = @"Use DbDataIsolationLevel;
Select ProductId,ProductName,Quantity,Price
from dbo.Products
@@ -110,7 +110,7 @@ public static void NonrepeatableReadSecondThread(String connStrig, IsolationLeve
using (SqlConnection conn = new SqlConnection(connStrig)) {
String cmdText = @"Use DbDataIsolationLevel;
- WaitFor Delay '00:00:03';
+ WaitFor Delay '00:00:03';
Update dbo.Products set Quantity=Quantity+100 where ProductId=1;";
@@ -134,7 +134,7 @@ public static void PhantomReadFirstThread(String connStrig, IsolationLevel level
Console.WriteLine("Begin the PhantomReadFirstThread.....");
using (SqlConnection conn = new SqlConnection(connStrig)) {
- String cmdText = @"Use DbDataIsolationLevel;
+ String cmdText = @"Use DbDataIsolationLevel;
Select ProductId,ProductName,Quantity,Price
from dbo.Products
@@ -174,9 +174,9 @@ public static void PhantomReadSecondThread(String connStrig, IsolationLevel leve
using (SqlConnection conn = new SqlConnection(connStrig)) {
String cmdText = @"Use DbDataIsolationLevel;
- WaitFor Delay '00:00:03';
+ WaitFor Delay '00:00:03';
- INSERT [dbo].[Products] ([ProductName], [Quantity], [Price])
+ INSERT [dbo].[Products] ([ProductName], [Quantity], [Price])
VALUES (N'White Bike', 843, 1349.00)";
conn.Open();
@@ -261,7 +261,7 @@ public static void ExchangeValuesSecondThread(String connStrig, IsolationLevel l
using (SqlConnection conn = new SqlConnection(connStrig)) {
String cmdText = @"Use DbDataIsolationLevel;
- WaitFor Delay '00:00:03';
+ WaitFor Delay '00:00:03';
Declare @price money;
select @price=Price from dbo.Products where ProductId=1;
@@ -304,7 +304,7 @@ public static void DemonstrateBetweenSnapshotAndSerializable(String connString)
public static void DisplayData(String connString) {
using (SqlConnection conn = new SqlConnection(connString)) {
- String cmdText = @"Use DbDataIsolationLevel;
+ String cmdText = @"Use DbDataIsolationLevel;
Select ProductId,ProductName,Quantity,Price
from dbo.Products";
diff --git a/samples/snippets/csharp/VS_Snippets_Atlas/LocalizingClientResourcesWalkthrough/cs/AssemblyInfo.cs b/samples/snippets/csharp/VS_Snippets_Atlas/LocalizingClientResourcesWalkthrough/cs/AssemblyInfo.cs
index ad442f83f16..2cf4759e206 100644
--- a/samples/snippets/csharp/VS_Snippets_Atlas/LocalizingClientResourcesWalkthrough/cs/AssemblyInfo.cs
+++ b/samples/snippets/csharp/VS_Snippets_Atlas/LocalizingClientResourcesWalkthrough/cs/AssemblyInfo.cs
@@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LocalizingScriptResources")]
@@ -14,8 +14,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -25,11 +25,11 @@
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Revision and Build Numbers
+// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/samples/snippets/csharp/VS_Snippets_Atlas/System.Web.UI.ScriptReference/CS/AssemblyInfo.cs b/samples/snippets/csharp/VS_Snippets_Atlas/System.Web.UI.ScriptReference/CS/AssemblyInfo.cs
index 20c805b3ba1..fa81016f35a 100644
--- a/samples/snippets/csharp/VS_Snippets_Atlas/System.Web.UI.ScriptReference/CS/AssemblyInfo.cs
+++ b/samples/snippets/csharp/VS_Snippets_Atlas/System.Web.UI.ScriptReference/CS/AssemblyInfo.cs
@@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SampleControl")]
@@ -14,8 +14,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -25,11 +25,11 @@
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Revision and Build Numbers
+// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/samples/snippets/csharp/VS_Snippets_Atlas/System.Web.UI.ScriptReference/CS/customcontrol.cs b/samples/snippets/csharp/VS_Snippets_Atlas/System.Web.UI.ScriptReference/CS/customcontrol.cs
index 48feb31001c..ff59fb600cc 100644
--- a/samples/snippets/csharp/VS_Snippets_Atlas/System.Web.UI.ScriptReference/CS/customcontrol.cs
+++ b/samples/snippets/csharp/VS_Snippets_Atlas/System.Web.UI.ScriptReference/CS/customcontrol.cs
@@ -59,7 +59,7 @@ protected override void OnPreRender(EventArgs e)
CultureInfo.InvariantCulture,
@"
Sys.Application.add_load(function(sender, args) {{
-var {0}_borderAnimation = new BorderAnimation('{1}');
+var {0}_borderAnimation = new BorderAnimation('{1}');
var panelElement = document.getElementById('{0}');
if (args.get_isPartialLoad()) {{
{0}_borderAnimation.animate(panelElement);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/client.cs
index 989eaed8626..fb05d30cfc4 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/client.cs
@@ -39,7 +39,7 @@ static Activity GetClientWorkflow()
OperationName = "Echo",
Content = new SendParametersContent()
{
- Parameters = { { "echoString", new InArgument("Hello, World") } }
+ Parameters = { { "echoString", new InArgument("Hello, World") } }
}
};
@@ -47,12 +47,12 @@ static Activity GetClientWorkflow()
{
Variables = { echoString },
Activities =
- {
+ {
new CorrelationScope
{
Body = new Sequence
{
- Activities =
+ Activities =
{
echoRequest,
new ReceiveReply
@@ -65,8 +65,8 @@ static Activity GetClientWorkflow()
}
}
}
- },
- new WriteLine { Text = new InArgument( (e) => "Received Text: " + echoString.Get(e) ) },
+ },
+ new WriteLine { Text = new InArgument( (e) => "Received Text: " + echoString.Get(e) ) },
}
};
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/receiveinstanceidcallback.cs b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/receiveinstanceidcallback.cs
index 7bda9b3589a..fc207ecc151 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/receiveinstanceidcallback.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/receiveinstanceidcallback.cs
@@ -15,7 +15,7 @@ class ReceiveInstanceIdCallback : IReceiveMessageCallback
public const string HeaderNS = "http://Microsoft.Samples.AccessingOperationContext";
public void OnReceiveMessage(System.ServiceModel.OperationContext operationContext, System.Activities.ExecutionProperties activityExecutionProperties)
- {
+ {
try
{
Guid instanceId = operationContext.IncomingMessageHeaders.GetHeader(HeaderName, HeaderNS);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/receiveinstanceidscope.cs b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/receiveinstanceidscope.cs
index 6fb040332d0..bfbb47ad33f 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/receiveinstanceidscope.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/receiveinstanceidscope.cs
@@ -42,9 +42,9 @@ protected override void CacheMetadata(NativeActivityMetadata metadata)
{
//call base.CacheMetadata to add the Activities and Variables to this activity's metadata
base.CacheMetadata(metadata);
- //add the private implementation variable: currentIndex
+ //add the private implementation variable: currentIndex
metadata.AddImplementationVariable(this.currentIndex);
- }
+ }
protected override void Execute(
NativeActivityContext context)
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/sendinstanceidscope.cs b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/sendinstanceidscope.cs
index d1ebcef12cd..925a978a1e2 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/sendinstanceidscope.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/sendinstanceidscope.cs
@@ -42,7 +42,7 @@ protected override void CacheMetadata(NativeActivityMetadata metadata)
{
//call base.CacheMetadata to add the Activities and Variables to this activity's metadata
base.CacheMetadata(metadata);
- //add the private implementation variable: currentIndex
+ //add the private implementation variable: currentIndex
metadata.AddImplementationVariable(this.currentIndex);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/service.cs b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/service.cs
index 2bcf15aa764..2c09acc3240 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/accessingoperationcontext/cs/service.cs
@@ -10,7 +10,7 @@
using System.Xml.Linq;
namespace Microsoft.Samples.AccessingOperationContext.Service
-{
+{
class Program
{
const string addr = "http://localhost:8080/Service";
@@ -59,7 +59,7 @@ static Activity GetServiceWorkflow()
Request = echoRequest,
Content = new SendParametersContent()
{
- Parameters = { { "result", new InArgument(echoString) } }
+ Parameters = { { "result", new InArgument(echoString) } }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/advancedwebprogramming/cs/service.cs b/samples/snippets/csharp/VS_Snippets_CFX/advancedwebprogramming/cs/service.cs
index 38909b628d6..79c16c8b9dd 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/advancedwebprogramming/cs/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/advancedwebprogramming/cs/service.cs
@@ -24,16 +24,16 @@ public Customer AddCustomer(Customer customer)
{
//
counter++;
-
+
UriTemplateMatch match = WebOperationContext.Current.IncomingRequest.UriTemplateMatch;
UriTemplate template = new UriTemplate("{id}");
customer.Uri = template.BindByPosition(match.BaseUri, counter.ToString());
customers[counter.ToString()] = customer;
-
+
WebOperationContext.Current.OutgoingResponse.SetStatusAsCreated(customer.Uri);
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs b/samples/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs
index 402f503e6b6..9506498d4fa 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs
@@ -12,8 +12,8 @@ namespace Microsoft.Samples.WorkflowModel
public sealed class FileWriter : AsyncCodeActivity
{
public FileWriter()
- : base()
- {
+ : base()
+ {
}
//
protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
@@ -33,7 +33,7 @@ protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, A
protected override void EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
{
FileStream file = (FileStream)context.UserState;
-
+
try
{
file.EndWrite(result);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/atomformatter/cs/snippets.cs b/samples/snippets/csharp/VS_Snippets_CFX/atomformatter/cs/snippets.cs
index 8b877bc1fc2..388df0687f7 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/atomformatter/cs/snippets.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/atomformatter/cs/snippets.cs
@@ -74,7 +74,7 @@ public static void Snippet3()
List items = new List();
items.Add(item);
feed.Items = items;
-
+
XmlWriter atomWriter = XmlWriter.Create("Atom.xml");
//
Atom10FeedFormatter atomFormatter = new Atom10FeedFormatter(feed);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/auditingsecurityevents/cs/auditingsecurityevents.cs b/samples/snippets/csharp/VS_Snippets_CFX/auditingsecurityevents/cs/auditingsecurityevents.cs
index 53b6b79a7a9..71fdfd3cede 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/auditingsecurityevents/cs/auditingsecurityevents.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/auditingsecurityevents/cs/auditingsecurityevents.cs
@@ -66,23 +66,23 @@ public static void Main()
Uri baseAddress = new Uri(ConfigurationManager.
AppSettings["baseAddress"]);
- // Create a ServiceHost for the CalculatorService type
+ // Create a ServiceHost for the CalculatorService type
// and provide the base address.
- using (ServiceHost serviceHost = new
+ using (ServiceHost serviceHost = new
ServiceHost(typeof(CalculatorService), baseAddress))
{
//
//
//
// Create a new auditing behavior and set the log location.
- ServiceSecurityAuditBehavior newAudit =
+ ServiceSecurityAuditBehavior newAudit =
new ServiceSecurityAuditBehavior();
- newAudit.AuditLogLocation =
+ newAudit.AuditLogLocation =
AuditLogLocation.Application;
//
- newAudit.MessageAuthenticationAuditLevel =
+ newAudit.MessageAuthenticationAuditLevel =
AuditLevel.SuccessOrFailure;
- newAudit.ServiceAuthorizationAuditLevel =
+ newAudit.ServiceAuthorizationAuditLevel =
AuditLevel.SuccessOrFailure;
//
newAudit.SuppressAuditFailure = false;
@@ -93,7 +93,7 @@ public static void Main()
Behaviors.Remove();
serviceHost.Description.Behaviors.Add(newAudit);
//
- // Open the ServiceHostBase to create listeners
+ // Open the ServiceHostBase to create listeners
// and start listening for messages.
serviceHost.Open();
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/basicwebprogramming/cs/snippets.cs b/samples/snippets/csharp/VS_Snippets_CFX/basicwebprogramming/cs/snippets.cs
index db0ceb9667c..d449d11b238 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/basicwebprogramming/cs/snippets.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/basicwebprogramming/cs/snippets.cs
@@ -100,7 +100,7 @@ public static void Snippet3()
try
{
host.Open();
-
+
// The endpoint name passed to the constructor must match an endpoint element
// in the application configuration file
WebChannelFactory cf = new WebChannelFactory("MyEndpoint");
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_bestpractices-concurrency/cs/reentrantandmultiple.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_bestpractices-concurrency/cs/reentrantandmultiple.cs
index de87c9bae7e..a0030565ef0 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_bestpractices-concurrency/cs/reentrantandmultiple.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_bestpractices-concurrency/cs/reentrantandmultiple.cs
@@ -51,7 +51,7 @@ public string GetWebPage(string address)
//
// With ConcurrencyMode.Reentrant, WCF makes sure that only one
// thread runs in your code at a time. However, when you call out on a
-// channel, the operation can get called again on another thread. Therefore
+// channel, the operation can get called again on another thread. Therefore
// you must confirm that state is consistent both before channel calls and
// before you return.
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant)]
@@ -74,7 +74,7 @@ public string GetWebPage(string address)
return this.cachedWebPage;
}
- // <-- Must guarantee that the cache is valid, because
+ // <-- Must guarantee that the cache is valid, because
// the operation can be called again before we return.
string webPage = slow.GetWebPage(address);
// <-- Can assume cache is valid.
@@ -92,7 +92,7 @@ public string GetWebPage(string address)
//
//
-// With ConcurrencyMode.Multiple, threads can call an operation at any time.
+// With ConcurrencyMode.Multiple, threads can call an operation at any time.
// It is your responsibility to guard your state with locks. If
// you always guarantee you leave state consistent when you leave
// the lock, you can assume it is valid when you enter the lock.
@@ -117,7 +117,7 @@ public string GetWebPage(string address)
if (this.cachedAddress == address)
{
return this.cachedWebPage;
- // <-- Must guarantee that cache is valid because
+ // <-- Must guarantee that cache is valid because
// the operation returns and releases the lock.
}
// <-- Must guarantee that cache is valid here because
@@ -130,7 +130,7 @@ public string GetWebPage(string address)
{
// <-- Can assume cache is valid.
- // <-- Cache is no longer valid because the operation
+ // <-- Cache is no longer valid because the operation
// changes one of the values.
this.cachedAddress = address;
this.cachedWebPage = webPage;
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_claim/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_claim/cs/source.cs
index 2c97df43380..a80fe17f787 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_claim/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_claim/cs/source.cs
@@ -24,7 +24,7 @@ public double Add(double a, double b)
//
//
- // Only a client authenticated with a valid certificate that has the
+ // Only a client authenticated with a valid certificate that has the
// specified subject name and thumbprint can call this method.
[PrincipalPermission(SecurityAction.Demand,
Name = "CN=ReplaceWithSubjectName; 123456712345677E8E230FDE624F841B1CE9D41E")]
@@ -48,13 +48,13 @@ public void WriteServiceSecurityContextData(string fileName)
sw.WriteLine();
//
// Write the claimsets in the authorization context. By default, there is only one claimset
- // provided by the system.
+ // provided by the system.
foreach (ClaimSet claimset in ServiceSecurityContext.Current.AuthorizationContext.ClaimSets)
{
foreach (Claim claim in claimset)
{
// Write out each claim type, claim value, and the right. There are two
- // possible values for the right: "identity" and "possessproperty".
+ // possible values for the right: "identity" and "possessproperty".
sw.WriteLine("Claim Type = {0}", claim.ClaimType);
sw.WriteLine("\t Resource = {0}", claim.Resource.ToString());
sw.WriteLine("\t Right = {0}", claim.Right);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_claimset/cs/service.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_claimset/cs/service.cs
index b302002eb02..a17decf5ed1 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_claimset/cs/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_claimset/cs/service.cs
@@ -73,9 +73,9 @@ public double Divide(double n1, double n2)
//
public class MyServiceAuthorizationManager : ServiceAuthorizationManager
{
-
+
protected override bool CheckAccessCore(OperationContext operationContext)
- {
+ {
// Extract the action URI from the OperationContext. Match this against the claims
// in the AuthorizationContext.
@@ -90,7 +90,7 @@ protected override bool CheckAccessCore(OperationContext operationContext)
{
//
// Iterate through claims of type "http://example.org/claims/allowedoperation".
- foreach (Claim c in cs.FindClaims("http://example.org/claims/allowedoperation",
+ foreach (Claim c in cs.FindClaims("http://example.org/claims/allowedoperation",
Rights.PossessProperty))
{
//
@@ -103,9 +103,9 @@ protected override bool CheckAccessCore(OperationContext operationContext)
}
}
}
-
+
// If this point is reached, return false to deny access.
- return false;
+ return false;
}
}
//
@@ -118,13 +118,13 @@ public MyAuthorizationPolicy()
id = Guid.NewGuid().ToString();
}
- //
+ //
public bool Evaluate(EvaluationContext evaluationContext, ref object state)
{
bool bRet = false;
CustomAuthState customstate = null;
- // If the state is null, then the method has not been called before, so
+ // If the state is null, then the method has not been called before, so
// set up a custom state.
if (state == null)
{
@@ -152,7 +152,7 @@ public bool Evaluate(EvaluationContext evaluationContext, ref object state)
foreach (string s in GetAllowedOpList(c.Resource.ToString()))
{
// Add claims to the list.
- claims.Add(new Claim("http://example.org/claims/allowedoperation",
+ claims.Add(new Claim("http://example.org/claims/allowedoperation",
s, Rights.PossessProperty));
Console.WriteLine("Claim added {0}", s);
}
@@ -174,7 +174,7 @@ public bool Evaluate(EvaluationContext evaluationContext, ref object state)
return bRet;
}
-
+
public ClaimSet Issuer
{
get { return ClaimSet.System; }
@@ -185,12 +185,12 @@ public string Id
get { return id; }
}
- // This method returns a collection of action strings that indicate the
+ // This method returns a collection of action strings that indicate the
// operations that the specified username is allowed to call.
private IEnumerable GetAllowedOpList(string username)
{
IList ret = new List();
-
+
if (username == "test1")
{
ret.Add ( "http://Microsoft.ServiceModel.Samples/ICalculator/Add");
@@ -215,16 +215,16 @@ public CustomAuthState()
bClaimsAdded = false;
}
- public bool ClaimsAdded { get { return bClaimsAdded; }
+ public bool ClaimsAdded { get { return bClaimsAdded; }
set { bClaimsAdded = value; } }
}
}
public class MyCustomUserNameValidator : UserNamePasswordValidator
{
- // This method validates users. It allows two users, test1 and test2
+ // This method validates users. It allows two users, test1 and test2
// with passwords 1tset and 2tset respectively.
- // This code is for illustration purposes only and
+ // This code is for illustration purposes only and
// MUST NOT be used in a production environment because it is NOT secure.
public override void Validate(string userName, string password)
{
@@ -239,13 +239,13 @@ public override void Validate(string userName, string password)
}
}
}
-
+
// Host the service within this EXE console application.
public static void Main()
{
// Get the base address from appsettings in configuration.
Uri baseAddress = new Uri(ConfigurationManager.AppSettings["baseAddress"]);
-
+
// Create a ServiceHost for the CalculatorService type and provide the base address.
using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress))
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs
index 6b5f2ddd1db..6051154a614 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_claimtypes/cs/service.cs
@@ -4,9 +4,9 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
-using System.IdentityModel.Claims;
-using System.IdentityModel.Policy;
-using System.IdentityModel.Tokens;
+using System.IdentityModel.Claims;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
using System.IdentityModel.Selectors;
using System.ServiceModel;
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_createsecuresession/cs/secureservice.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_createsecuresession/cs/secureservice.cs
index 7204306213b..c2814e2eff0 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_createsecuresession/cs/secureservice.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_createsecuresession/cs/secureservice.cs
@@ -30,7 +30,7 @@ private void Run()
MessageCredentialType.Windows;
//
- // Create the Type instances for later use and the URI for
+ // Create the Type instances for later use and the URI for
// the base address.
Type contractType = typeof(ICalculator);
Type serviceType = typeof(Calculator);
@@ -70,7 +70,7 @@ private void Run2()
// Create the custom binding.
CustomBinding myBinding = new CustomBinding(security, new HttpTransportBindingElement());
- // Create the Type instances for later use and the URI for
+ // Create the Type instances for later use and the URI for
// the base address.
Type contractType = typeof(ICalculator);
Type serviceType = typeof(Calculator);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_creatests/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_creatests/cs/source.cs
index a0945a3be0f..3b0288a24f1 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_creatests/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_creatests/cs/source.cs
@@ -122,11 +122,11 @@ private void Run()
//
itcc.LocalIssuerBinding = new WSHttpBinding("LocalIssuerBinding");
- //
+ //
//
SynchronousReceiveBehavior myEndpointBehavior = new SynchronousReceiveBehavior();
- //
+ //
itcc.LocalIssuerChannelBehaviors.Add(myEndpointBehavior);
//
//
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customauthmgr/cs/c_customauthmgr.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customauthmgr/cs/c_customauthmgr.cs
index 041c749cecc..92b08694ce5 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customauthmgr/cs/c_customauthmgr.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customauthmgr/cs/c_customauthmgr.cs
@@ -16,11 +16,11 @@ public class MyServiceAuthorizationManager : ServiceAuthorizationManager
//
//
protected override bool CheckAccessCore(OperationContext operationContext)
- {
+ {
// Extract the action URI from the OperationContext. Match this against the claims
// in the AuthorizationContext.
string action = operationContext.RequestContext.RequestMessage.Headers.Action;
-
+
// Iterate through the various claim sets in the AuthorizationContext.
foreach(ClaimSet cs in operationContext.ServiceSecurityContext.AuthorizationContext.ClaimSets)
{
@@ -36,9 +36,9 @@ protected override bool CheckAccessCore(OperationContext operationContext)
}
}
}
-
+
// If this point is reached, return false to deny access.
- return false;
+ return false;
}
//
}
@@ -72,7 +72,7 @@ public static void Main()
{
//
// Add a custom authorization manager to the service authorization behavior.
- serviceHost.Authorization.ServiceAuthorizationManager =
+ serviceHost.Authorization.ServiceAuthorizationManager =
new MyServiceAuthorizationManager();
//
// Open the ServiceHost to create listeners and start listening for messages.
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_custombinding/cs/c_custombinding.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_custombinding/cs/c_custombinding.cs
index 243f2a2f46e..9ee99526de0 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_custombinding/cs/c_custombinding.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_custombinding/cs/c_custombinding.cs
@@ -31,7 +31,7 @@ private CustomBindingCreator(){}
//
public static Binding CreateCustomBinding()
{
- // Create an empty BindingElementCollection to populate,
+ // Create an empty BindingElementCollection to populate,
// then create a custom binding from it.
BindingElementCollection outputBec = new BindingElementCollection();
@@ -39,7 +39,7 @@ public static Binding CreateCustomBinding()
//
//
// Create a SymmetricSecurityBindingElement.
- SymmetricSecurityBindingElement ssbe =
+ SymmetricSecurityBindingElement ssbe =
new SymmetricSecurityBindingElement();
//
@@ -53,7 +53,7 @@ public static Binding CreateCustomBinding()
// Use a Kerberos token as the protection token.
ssbe.ProtectionTokenParameters = new KerberosSecurityTokenParameters();
//
-
+
// Add the SymmetricSecurityBindingElement to the BindingElementCollection.
outputBec.Add ( ssbe );
outputBec.Add(new TextMessageEncodingBindingElement());
@@ -97,7 +97,7 @@ private MultipleTokensBinding() { }
public static Binding CreateCustomBinding(EndpointAddress issuerEndpointAddress1, Binding issuerBinding1, EndpointAddress issuerEndpointAddress2, Binding issuerBinding2)
{
//
- // Create an empty BindingElementCollection to populate,
+ // Create an empty BindingElementCollection to populate,
// then create a custom binding from it.
BindingElementCollection bec = new BindingElementCollection();
//
@@ -109,17 +109,17 @@ public static Binding CreateCustomBinding(EndpointAddress issuerEndpointAddress1
//
SupportingTokenParameters supportParams = new SupportingTokenParameters();
//
-
+
//
// Two supporting SAML tokens are being added.
supportParams.SignedEndorsing.Add(new IssuedSecurityTokenParameters("samlTokenType", issuerEndpointAddress1, issuerBinding1));
supportParams.SignedEndorsing.Add(new IssuedSecurityTokenParameters("samlTokenType", issuerEndpointAddress2, issuerBinding2));
//
-
+
//
((SymmetricSecurityBindingElement)sbe).OperationSupportingTokenParameters.Add("*", supportParams);
//
-
+
//
bec.Add(sbe);
bec.Add(new TextMessageEncodingBindingElement());
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_custombindingsauthmode/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_custombindingsauthmode/cs/source.cs
index 99ae58b67b3..d3bb9a82866 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_custombindingsauthmode/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_custombindingsauthmode/cs/source.cs
@@ -18,8 +18,8 @@ public sealed class CustomBindingCreator
private CustomBindingCreator() { }
//
- // These public methods create custom bindings based on the built-in
- // authentication modes that use the static methods of
+ // These public methods create custom bindings based on the built-in
+ // authentication modes that use the static methods of
// the System.ServiceModel.Channels.SecurityBindingElement class.
public static Binding CreateAnonymousForCertificateBinding()
{
@@ -228,19 +228,19 @@ public static Binding CreateCustomBinding()
//
//
- BindingElementCollection outputBindings =
+ BindingElementCollection outputBindings =
new BindingElementCollection();
//
-
+
//
b.DefaultAlgorithmSuite = SecurityAlgorithmSuite.Basic128;
- b.MessageProtectionOrder =
+ b.MessageProtectionOrder =
MessageProtectionOrder.SignBeforeEncrypt;
- b.ProtectionTokenParameters =
+ b.ProtectionTokenParameters =
new KerberosSecurityTokenParameters();
//
//
-
+
//
outputBindings.Add(b);
outputBindings.Add(new TextMessageEncodingBindingElement());
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customcertificatevalidator/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customcertificatevalidator/cs/source.cs
index 827446d4573..47335b4158e 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customcertificatevalidator/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customcertificatevalidator/cs/source.cs
@@ -11,7 +11,7 @@
[assembly: SecurityPermission(
SecurityAction.RequestMinimum, Execution = true)]
namespace Microsoft.ServiceModel.Samples
-{
+{
[ServiceContract(Namespace="http://Microsoft.ServiceModel.Samples")]
public interface ICalculator
{
@@ -35,9 +35,9 @@ static void Main()
using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService)))
{
//
- serviceHost.Credentials.ClientCertificate.Authentication.CertificateValidationMode =
+ serviceHost.Credentials.ClientCertificate.Authentication.CertificateValidationMode =
X509CertificateValidationMode.Custom;
- serviceHost.Credentials.ClientCertificate.Authentication.CustomCertificateValidator =
+ serviceHost.Credentials.ClientCertificate.Authentication.CustomCertificateValidator =
new MyX509CertificateValidator("CN=Contoso.com");
//
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customcredentials/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customcredentials/cs/source.cs
index 7be7a911db5..b388a882e0c 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customcredentials/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customcredentials/cs/source.cs
@@ -9,7 +9,7 @@
using System.ServiceModel.Configuration;
using System.Configuration;
-[assembly: SecurityPermission(SecurityAction.RequestMinimum,
+[assembly: SecurityPermission(SecurityAction.RequestMinimum,
Execution = true)]
namespace Microsoft.ServiceModel.Samples
{
@@ -61,7 +61,7 @@ protected override ClientCredentials CloneCore()
//
//
- internal class MyClientCredentialsSecurityTokenManager :
+ internal class MyClientCredentialsSecurityTokenManager :
ClientCredentialsSecurityTokenManager
{
MyClientCredentials credentials;
@@ -141,7 +141,7 @@ protected override ServiceCredentials CloneCore()
//
//
- internal class MyServiceCredentialsSecurityTokenManager :
+ internal class MyServiceCredentialsSecurityTokenManager :
ServiceCredentialsSecurityTokenManager
{
MyServiceCredentials credentials;
@@ -206,11 +206,11 @@ protected override ConfigurationPropertyCollection Properties
{
ConfigurationPropertyCollection properties = base.Properties;
properties.Add(new ConfigurationProperty(
- "creditCardNumber",
- typeof(System.String),
+ "creditCardNumber",
+ typeof(System.String),
string.Empty,
- null,
- new StringValidator(0, 32, null),
+ null,
+ new StringValidator(0, 32, null),
ConfigurationPropertyOptions.None));
this.properties = properties;
}
@@ -294,37 +294,37 @@ public string Echo(string value)
}
public partial class CalculatorClient : System.ServiceModel.ClientBase, ICalculator
{
-
+
public CalculatorClient()
{
}
-
- public CalculatorClient(string endpointConfigurationName) :
+
+ public CalculatorClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public CalculatorClient(string endpointConfigurationName, string remoteAddress) :
+
+ public CalculatorClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public CalculatorClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public CalculatorClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public CalculatorClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public CalculatorClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public double Add(double a, double b)
{
return base.Channel.Add(a, b);
}
}
-
+
[System.ServiceModel.ServiceContractAttribute(ConfigurationName = "ICalculator")]
public interface ICalculator
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customtoken/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customtoken/cs/source.cs
index 8b01ac3bb4a..6f8fb33fa63 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customtoken/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customtoken/cs/source.cs
@@ -95,29 +95,29 @@ public CreditCardToken(CreditCardInfo cardInfo, string id)
this.securityKeys = new ReadOnlyCollection(new List());
}
- public CreditCardInfo CardInfo
- {
- get { return this.cardInfo; }
+ public CreditCardInfo CardInfo
+ {
+ get { return this.cardInfo; }
}
- public override ReadOnlyCollection SecurityKeys
- {
- get { return this.securityKeys; }
+ public override ReadOnlyCollection SecurityKeys
+ {
+ get { return this.securityKeys; }
}
- public override DateTime ValidFrom
- {
- get { return this.effectiveTime; }
+ public override DateTime ValidFrom
+ {
+ get { return this.effectiveTime; }
}
- public override DateTime ValidTo
- {
- get { return this.cardInfo.ExpirationDate; }
+ public override DateTime ValidTo
+ {
+ get { return this.cardInfo.ExpirationDate; }
}
-
- public override string Id
- {
- get { return this.id; }
+
+ public override string Id
+ {
+ get { return this.id; }
}
}
//
@@ -146,24 +146,24 @@ protected override void InitializeSecurityTokenRequirement(SecurityTokenRequirem
}
// A credit card token has no cryptography, no windows identity, and supports only client authentication.
- protected override bool HasAsymmetricKey
- {
- get { return false; }
+ protected override bool HasAsymmetricKey
+ {
+ get { return false; }
}
-
- protected override bool SupportsClientAuthentication
- {
- get { return true; }
+
+ protected override bool SupportsClientAuthentication
+ {
+ get { return true; }
}
-
- protected override bool SupportsClientWindowsIdentity
- {
- get { return false; }
+
+ protected override bool SupportsClientWindowsIdentity
+ {
+ get { return false; }
}
-
- protected override bool SupportsServerAuthentication
- {
- get { return false; }
+
+ protected override bool SupportsServerAuthentication
+ {
+ get { return false; }
}
protected override SecurityKeyIdentifierClause CreateKeyIdentifierClause(SecurityToken token, SecurityTokenReferenceStyle referenceStyle)
@@ -246,13 +246,13 @@ protected override bool CanWriteTokenCore(SecurityToken token)
protected override void WriteTokenCore(XmlWriter writer, SecurityToken token)
{
- if (writer == null)
- {
- throw new ArgumentNullException("writer");
+ if (writer == null)
+ {
+ throw new ArgumentNullException("writer");
}
- if (token == null)
- {
- throw new ArgumentNullException("token");
+ if (token == null)
+ {
+ throw new ArgumentNullException("token");
}
CreditCardToken c = token as CreditCardToken;
@@ -437,7 +437,7 @@ public override SecurityTokenSerializer CreateSecurityTokenSerializer(SecurityTo
}
}
//
-
+
//
public class CreditCardServiceCredentialsSecurityTokenManager : ServiceCredentialsSecurityTokenManager
{
@@ -531,7 +531,7 @@ public override SecurityTokenManager CreateSecurityTokenManager()
}
}
//
-
+
//
public static class BindingHelper
{
@@ -540,7 +540,7 @@ public static Binding CreateCreditCardBinding()
HttpTransportBindingElement httpTransport = new HttpTransportBindingElement();
// The message security binding element is configured to require a credit card
- // token that is encrypted with the service's certificate.
+ // token that is encrypted with the service's certificate.
SymmetricSecurityBindingElement messageSecurity = new SymmetricSecurityBindingElement();
messageSecurity.EndpointSupportingTokenParameters.SignedEncrypted.Add(new CreditCardTokenParameters());
X509SecurityTokenParameters x509ProtectionParameters = new X509SecurityTokenParameters();
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customtokenauthenticator/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customtokenauthenticator/cs/source.cs
index 1d01a7c139c..d64be5a8fe0 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customtokenauthenticator/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customtokenauthenticator/cs/source.cs
@@ -20,17 +20,17 @@ internal class MySecurityTokenAuthenticator : SecurityTokenAuthenticator
{
protected override bool CanValidateTokenCore(SecurityToken token)
{
- // Check that the incoming token is a username token type that
+ // Check that the incoming token is a username token type that
// can be validated by this implementation.
return (token is UserNameSecurityToken);
}
- protected override ReadOnlyCollection
+ protected override ReadOnlyCollection
ValidateTokenCore(SecurityToken token)
{
UserNameSecurityToken userNameToken = token as UserNameSecurityToken;
- // Validate the information contained in the username token. For demonstration
+ // Validate the information contained in the username token. For demonstration
// purposes, this code just checks that the user name matches the password.
if (userNameToken.UserName != userNameToken.Password)
{
@@ -39,7 +39,7 @@ protected override ReadOnlyCollection
// Create just one Claim instance for the username token - the name of the user.
DefaultClaimSet userNameClaimSet = new DefaultClaimSet(
- ClaimSet.System,
+ ClaimSet.System,
new Claim(ClaimTypes.Name, userNameToken.UserName, Rights.PossessProperty));
List policies = new List(1);
policies.Add(new MyAuthorizationPolicy(userNameClaimSet));
@@ -49,7 +49,7 @@ protected override ReadOnlyCollection
//
//
- internal class MyServiceCredentialsSecurityTokenManager :
+ internal class MyServiceCredentialsSecurityTokenManager :
ServiceCredentialsSecurityTokenManager
{
ServiceCredentials credentials;
@@ -62,7 +62,7 @@ public MyServiceCredentialsSecurityTokenManager(ServiceCredentials credentials)
public override SecurityTokenAuthenticator CreateSecurityTokenAuthenticator
(SecurityTokenRequirement tokenRequirement, out SecurityTokenResolver outOfBandTokenResolver)
{
- // Return your implementation of the SecurityTokenProvider based on the
+ // Return your implementation of the SecurityTokenProvider based on the
// tokenRequirement argument.
SecurityTokenAuthenticator result;
if (tokenRequirement.TokenType == SecurityTokenTypes.UserName)
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/client.cs
index f844bcb0272..95a1f7d37c3 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/client.cs
@@ -17,7 +17,7 @@ static void Main(string[] args)
IFibonacci fibonacci = channelFactory.CreateChannel();
GenerateCSCodeForService(
- new EndpointAddress("http://localhost:8000/Fibonacci/mex/"),
+ new EndpointAddress("http://localhost:8000/Fibonacci/mex/"),
System.Environment.CurrentDirectory + "\\..\\..\\GeneratedContract.cs"
);
@@ -45,12 +45,12 @@ static void GenerateCSCodeForService(EndpointAddress metadataAddress, string out
MetadataExchangeClient mexClient = new MetadataExchangeClient(metadataAddress);
mexClient.ResolveMetadataReferences = true;
MetadataSet metaDocs = mexClient.GetMetadata();
-
+
WsdlImporter importer = new WsdlImporter(metaDocs);
ServiceContractGenerator generator = new ServiceContractGenerator();
//
- // Add our custom DCAnnotationSurrogate
+ // Add our custom DCAnnotationSurrogate
// to write XSD annotations into the comments.
object dataContractImporter;
XsdDataContractImporter xsdDCImporter;
@@ -72,14 +72,14 @@ static void GenerateCSCodeForService(EndpointAddress metadataAddress, string out
}
xsdDCImporter.Options.DataContractSurrogate = new DCAnnotationSurrogate();
- // Uncomment the following code if you are going to do your work programmatically rather than add
- // the WsdlDocumentationImporters through a configuration file.
+ // Uncomment the following code if you are going to do your work programmatically rather than add
+ // the WsdlDocumentationImporters through a configuration file.
/*
//
- // The following code inserts a custom WsdlImporter without removing the other
+ // The following code inserts a custom WsdlImporter without removing the other
// importers already in the collection.
System.Collections.Generic.IEnumerable exts = importer.WsdlImportExtensions;
- System.Collections.Generic.List newExts
+ System.Collections.Generic.List newExts
= new System.Collections.Generic.List();
foreach (IWsdlImportExtension ext in exts)
{
@@ -92,7 +92,7 @@ System.Collections.Generic.List newExts
//
*/
- System.Collections.ObjectModel.Collection contracts
+ System.Collections.ObjectModel.Collection contracts
= importer.ImportAllContracts();
importer.ImportAllEndpoints();
foreach (ContractDescription contract in contracts)
@@ -103,12 +103,12 @@ System.Collections.ObjectModel.Collection contracts
throw new Exception("There were errors during code compilation.");
// Write the code dom
- System.CodeDom.Compiler.CodeGeneratorOptions options
+ System.CodeDom.Compiler.CodeGeneratorOptions options
= new System.CodeDom.Compiler.CodeGeneratorOptions();
options.BracingStyle = "C";
- System.CodeDom.Compiler.CodeDomProvider codeDomProvider
+ System.CodeDom.Compiler.CodeDomProvider codeDomProvider
= System.CodeDom.Compiler.CodeDomProvider.CreateProvider("C#");
- System.CodeDom.Compiler.IndentedTextWriter textWriter
+ System.CodeDom.Compiler.IndentedTextWriter textWriter
= new System.CodeDom.Compiler.IndentedTextWriter(new System.IO.StreamWriter(outputFile));
codeDomProvider.GenerateCodeFromCompileUnit(
generator.TargetCompileUnit, textWriter, options
@@ -126,7 +126,7 @@ static void GenerateVBCodeForService(EndpointAddress metadataAddress, string out
WsdlImporter importer = new WsdlImporter(metaDocs);
ServiceContractGenerator generator = new ServiceContractGenerator();
- // Add our custom DCAnnotationSurrogate
+ // Add our custom DCAnnotationSurrogate
// to write XSD annotations into the comments.
object dataContractImporter;
XsdDataContractImporter xsdDCImporter;
@@ -148,14 +148,14 @@ static void GenerateVBCodeForService(EndpointAddress metadataAddress, string out
}
xsdDCImporter.Options.DataContractSurrogate = new DCAnnotationSurrogate();
- // Uncomment the following code if you are going to do your work programmatically rather than add
- // the WsdlDocumentationImporters through a configuration file.
+ // Uncomment the following code if you are going to do your work programmatically rather than add
+ // the WsdlDocumentationImporters through a configuration file.
/*
- // The following code inserts the custom WSDL programmatically
- // adding the custom WsdlImporter without removing the other
+ // The following code inserts the custom WSDL programmatically
+ // adding the custom WsdlImporter without removing the other
// importers already in the collection.
System.Collections.Generic.IEnumerable exts = importer.WsdlImportExtensions;
- System.Collections.Generic.List newExts
+ System.Collections.Generic.List newExts
= new System.Collections.Generic.List();
foreach (IWsdlImportExtension ext in exts)
{
@@ -174,7 +174,7 @@ System.Collections.Generic.List newExts
}
if (generator.Errors.Count != 0)
throw new Exception("There were errors during code compilation.");
-
+
// Write the code dom.
System.CodeDom.Compiler.CodeGeneratorOptions options = new System.CodeDom.Compiler.CodeGeneratorOptions();
options.BracingStyle = "C";
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/formatter.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/formatter.cs
index 6601035f286..f3aeb484021 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/formatter.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/formatter.cs
@@ -22,9 +22,9 @@ public static XmlElement CreateSummaryElement(XmlDocument owningDoc, string text
public static CodeCommentStatementCollection FormatComments(string text)
{
/*
- * Note that in Visual C# the XML comment format absorbs a
+ * Note that in Visual C# the XML comment format absorbs a
* documentation element with a line break in the middle. This sample
- * could take an XmlElement and create code comments in which
+ * could take an XmlElement and create code comments in which
* the element never had a line break in it.
*/
@@ -62,8 +62,8 @@ public static Collection WordWrap(string text, int columnWidth)
return lines;
}
- #endregion
-
+ #endregion
+
public static XmlElement CreateReturnsElement(XmlDocument owner, string p)
{
XmlElement returnsElement = owner.CreateElement("returns");
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/generatedcontract.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/generatedcontract.cs
index af0d8a10d0a..7ae7b0721a0 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/generatedcontract.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/generatedcontract.cs
@@ -11,32 +11,32 @@
/// From WsdlDocumentation:
-///
-/// This contract is a stateless contract that provides a mechanism for
-/// computing the nth Fibonacci term.
-///
+///
+/// This contract is a stateless contract that provides a mechanism for
+/// computing the nth Fibonacci term.
+///
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="IFibonacci")]
public interface IFibonacci
{
-
+
/// From WsdlDocumentation:
- ///
- /// The Compute operation returns the nth Fibonacci number. Because it
- /// uses dual recursion it's very inefficient and therefore useful to demonstrate
- /// caching.The nth Fibonacci number.The value to use when computing the Fibonacci number.
- ///
+ ///
+ /// The Compute operation returns the nth Fibonacci number. Because it
+ /// uses dual recursion it's very inefficient and therefore useful to demonstrate
+ /// caching.The nth Fibonacci number.The value to use when computing the Fibonacci number.
+ ///
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/IFibonacci/Compute", ReplyAction="http://microsoft.wcf.documentation/IFibonacci/ComputeResponse")]
int Compute(int num);
-
+
/// From WsdlDocumentation:
- ///
- /// The GetPerson operation tests custom WSDL documentation
- /// generation.The Person object to be returned.The value for the first parameter.The value for the second parameter.
- ///
+ ///
+ /// The GetPerson operation tests custom WSDL documentation
+ /// generation.The Person object to be returned.The value for the first parameter.The value for the second parameter.
+ ///
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/IFibonacci/GetPerson", ReplyAction="http://microsoft.wcf.documentation/IFibonacci/GetPersonResponse")]
Microsoft.WCF.Documentation.Person GetPerson(int FirstParameter, int SecondParameter);
}
@@ -50,36 +50,36 @@ public interface IFibonacciChannel : IFibonacci, System.ServiceModel.IClientChan
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class FibonacciClient : System.ServiceModel.ClientBase, IFibonacci
{
-
+
public FibonacciClient()
{
}
-
- public FibonacciClient(string endpointConfigurationName) :
+
+ public FibonacciClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public FibonacciClient(string endpointConfigurationName, string remoteAddress) :
+
+ public FibonacciClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public FibonacciClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public FibonacciClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public FibonacciClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public FibonacciClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public int Compute(int num)
{
return base.Channel.Compute(num);
}
-
+
public Microsoft.WCF.Documentation.Person GetPerson(int FirstParameter, int SecondParameter)
{
return base.Channel.GetPerson(FirstParameter, SecondParameter);
@@ -88,21 +88,21 @@ public Microsoft.WCF.Documentation.Person GetPerson(int FirstParameter, int Seco
namespace Microsoft.WCF.Documentation
{
using System.Runtime.Serialization;
-
-
+
+
/// From WsdlDocumentation:
- ///
- /// The string for the Person type.
- ///
+ ///
+ /// The string for the Person type.
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute()]
public partial class Person : object, System.Runtime.Serialization.IExtensibleDataObject
{
-
+
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
-
+
private string NameField;
-
+
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
@@ -114,11 +114,11 @@ public System.Runtime.Serialization.ExtensionDataObject ExtensionData
this.extensionDataField = value;
}
}
-
+
/// From WsdlDocumentation:
- ///
- /// The string for the Name data member.
- ///
+ ///
+ /// The string for the Name data member.
+ ///
[System.Runtime.Serialization.DataMemberAttribute()]
public string Name
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/hostapplication.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/hostapplication.cs
index 49c508c4a4f..eb4b7bea379 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/hostapplication.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/hostapplication.cs
@@ -28,7 +28,7 @@ private void Run()
foreach (OperationDescription op in ep.Contract.Operations)
{
if (op.Behaviors.Find() == null)
- {
+ {
DataContractSerializerOperationBehavior dcserBehave = new DataContractSerializerOperationBehavior(op);
dcserBehave.DataContractSurrogate = new DCAnnotationSurrogate();
op.Behaviors.Add(dcserBehave);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/ifibonacci.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/ifibonacci.cs
index 5d51150b729..c44923e4cd4 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/ifibonacci.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/ifibonacci.cs
@@ -26,9 +26,9 @@ int Compute(
[return: WsdlParameterDocumentation("The Person object to be returned.")]
Person GetPerson(
[WsdlParameterDocumentation("The value for the first parameter.")]
- int FirstParameter,
+ int FirstParameter,
[WsdlParameterDocumentation("The value for the second parameter.")]
- int SecondParameter
+ int SecondParameter
);
}
@@ -40,7 +40,7 @@ public class Person
public Person(string n)
{
- this.internalName = n;
+ this.internalName = n;
}
[DataMember]
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/newgeneratedcontract.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/newgeneratedcontract.cs
index 7ae31219c3d..f39a198edb3 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/newgeneratedcontract.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/newgeneratedcontract.cs
@@ -11,32 +11,32 @@
//
/// From WSDL Documentation:
-///
-/// This contract is a stateless contract that provides a mechanism for
-/// computing the nth Fibonacci term.
-///
+///
+/// This contract is a stateless contract that provides a mechanism for
+/// computing the nth Fibonacci term.
+///
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="IFibonacci")]
public interface IFibonacci
{
-
+
/// From WSDL Documentation:
- ///
- /// The Compute operation returns the nth Fibonacci number. Because it
- /// uses dual recursion it's very inefficient and therefore useful to demonstrate
- /// caching.The nth Fibonacci number.The value to use when computing the Fibonacci number.
- ///
+ ///
+ /// The Compute operation returns the nth Fibonacci number. Because it
+ /// uses dual recursion it's very inefficient and therefore useful to demonstrate
+ /// caching.The nth Fibonacci number.The value to use when computing the Fibonacci number.
+ ///
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/IFibonacci/Compute", ReplyAction="http://microsoft.wcf.documentation/IFibonacci/ComputeResponse")]
int Compute(int num);
-
+
/// From WSDL Documentation:
- ///
- /// The GetPerson operation tests custom WSDL documentation
- /// generation.The Person object to be returned.The value for the first parameter.The value for the second parameter.
- ///
+ ///
+ /// The GetPerson operation tests custom WSDL documentation
+ /// generation.The Person object to be returned.The value for the first parameter.The value for the second parameter.
+ ///
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/IFibonacci/GetPerson", ReplyAction="http://microsoft.wcf.documentation/IFibonacci/GetPersonResponse")]
Microsoft.WCF.Documentation.Person GetPerson(int FirstParameter, int SecondParameter);
}
@@ -51,36 +51,36 @@ public interface IFibonacciChannel : IFibonacci, System.ServiceModel.IClientChan
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class FibonacciClient : System.ServiceModel.ClientBase, IFibonacci
{
-
+
public FibonacciClient()
{
}
-
- public FibonacciClient(string endpointConfigurationName) :
+
+ public FibonacciClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public FibonacciClient(string endpointConfigurationName, string remoteAddress) :
+
+ public FibonacciClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public FibonacciClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public FibonacciClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public FibonacciClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public FibonacciClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public int Compute(int num)
{
return base.Channel.Compute(num);
}
-
+
public Microsoft.WCF.Documentation.Person GetPerson(int FirstParameter, int SecondParameter)
{
return base.Channel.GetPerson(FirstParameter, SecondParameter);
@@ -89,21 +89,21 @@ public Microsoft.WCF.Documentation.Person GetPerson(int FirstParameter, int Seco
namespace Microsoft.WCF.Documentation
{
using System.Runtime.Serialization;
-
-
+
+
/// From WSDL Documentation:
- ///
- /// The string for the Person type.
- ///
+ ///
+ /// The string for the Person type.
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute()]
public partial class Person : object, System.Runtime.Serialization.IExtensibleDataObject
{
-
+
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
-
+
private string NameField;
-
+
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
@@ -117,9 +117,9 @@ public System.Runtime.Serialization.ExtensionDataObject ExtensionData
}
//
/// From WSDL Documentation:
- ///
- /// The string for the Name data member.
- ///
+ ///
+ /// The string for the Name data member.
+ ///
[System.Runtime.Serialization.DataMemberAttribute()]
public string Name
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/operationcachinginvokerasyncresult.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/operationcachinginvokerasyncresult.cs
index df527ee29e5..370122df61b 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/operationcachinginvokerasyncresult.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/operationcachinginvokerasyncresult.cs
@@ -154,7 +154,7 @@ protected void Complete(bool completedSynchronously)
if (completedSynchronously)
{
- // If we completedSynchronously, then there's no chance that the
+ // If we completedSynchronously, then there's no chance that the
// manualResetEvent was created so we don't need to worry about a race
this.isCompleted = true;
if (this.manualResetEvent != null)
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/service.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/service.cs
index cae0c91a341..7ed0a1edea2 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/service.cs
@@ -18,7 +18,7 @@ public int Compute(int num)
public Person GetPerson(int a, int b)
{
- return new Person("Last name, first name");
+ return new Person("Last name, first name");
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/wsdldocumentationattribute.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/wsdldocumentationattribute.cs
index e42c780b733..167d7a99fd7 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/wsdldocumentationattribute.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/wsdldocumentationattribute.cs
@@ -31,7 +31,7 @@ public WsdlDocumentationAttribute(string text)
}
///
- /// This constructor takes an XmlElement if the sample
+ /// This constructor takes an XmlElement if the sample
/// were to be modified to import the documentation element
/// as XML. This sample does not use this constructor.
///
@@ -83,7 +83,7 @@ public void ExportContract(WsdlExporter exporter, WsdlContractConversionContext
{
// Inside this block it is the contract-level comment attribute.
// This.Text returns the string for the contract attribute.
- // Set the doc element; if this isn't done first, there is no XmlElement in the
+ // Set the doc element; if this isn't done first, there is no XmlElement in the
// DocumentElement property.
context.WsdlPortType.Documentation = string.Empty;
// Contract comments.
@@ -100,7 +100,7 @@ public void ExportContract(WsdlExporter exporter, WsdlContractConversionContext
string opComment = ((WsdlDocumentationAttribute)opAttrs[0]).Text;
// This.Text returns the string for the operation-level attributes.
- // Set the doc element; if this isn't done first, there is no XmlElement in the
+ // Set the doc element; if this isn't done first, there is no XmlElement in the
// DocumentElement property.
operation.Documentation = String.Empty;
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/wsdldocumentationimporter.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/wsdldocumentationimporter.cs
index ccc5bf4842e..9331578c79d 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/wsdldocumentationimporter.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_customwsdlextensions/cs/wsdldocumentationimporter.cs
@@ -9,20 +9,20 @@
namespace Microsoft.WCF.Documentation
{
- public class WsdlDocumentationImporter :
+ public class WsdlDocumentationImporter :
IContractBehavior,
IOperationBehavior,
- IWsdlImportExtension,
- IServiceContractGenerationExtension,
+ IWsdlImportExtension,
+ IServiceContractGenerationExtension,
IOperationContractGenerationExtension
{
private string commentText;
#region WSDL Import
public WsdlDocumentationImporter()
- {
+ {
}
-
+
public WsdlDocumentationImporter(string text)
{
this.commentText = text;
@@ -52,16 +52,16 @@ public void ImportContract(WsdlImporter importer, WsdlContractConversionContext
}
//
- public void BeforeImport(ServiceDescriptionCollection wsdlDocuments, XmlSchemaSet xmlSchemas, ICollection policy)
+ public void BeforeImport(ServiceDescriptionCollection wsdlDocuments, XmlSchemaSet xmlSchemas, ICollection policy)
{
Console.WriteLine("BeforeImport called.");
}
- public void ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context)
+ public void ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context)
{
Console.WriteLine("ImportEndpoint called.");
}
- #endregion
+ #endregion
#region IServiceContractGenerationExtension Members
//
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_federatedservice/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_federatedservice/cs/source.cs
index 1c095701771..d88392ea9fa 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_federatedservice/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_federatedservice/cs/source.cs
@@ -35,19 +35,19 @@ public sealed class IssuedTokenServiceCredentialsConfiguration
{
//
// This method configures the IssuedTokenAuthentication property of a ServiceHost.
- public static void ConfigureIssuedTokenServiceCredentials(
- ServiceHost sh, bool allowCardspaceTokens, IList knownissuers,
+ public static void ConfigureIssuedTokenServiceCredentials(
+ ServiceHost sh, bool allowCardspaceTokens, IList knownissuers,
X509CertificateValidationMode certMode, X509RevocationMode revocationMode, SamlSerializer ser )
{
// Allow CardSpace tokens.
sh.Credentials.IssuedTokenAuthentication.AllowUntrustedRsaIssuers = allowCardspaceTokens;
-
+
// Set up known issuer certificates.
foreach(X509Certificate2 cert in knownissuers)
sh.Credentials.IssuedTokenAuthentication.KnownCertificates.Add ( cert );
// Set issuer certificate validation and revocation checking modes.
- sh.Credentials.IssuedTokenAuthentication.CertificateValidationMode =
+ sh.Credentials.IssuedTokenAuthentication.CertificateValidationMode =
X509CertificateValidationMode.PeerOrChainTrust;
sh.Credentials.IssuedTokenAuthentication.RevocationMode = X509RevocationMode.Online;
sh.Credentials.IssuedTokenAuthentication.TrustedStoreLocation = StoreLocation.LocalMachine;
@@ -58,7 +58,7 @@ public static void ConfigureIssuedTokenServiceCredentials(
}
//
- // It is a good practice to create a private constructor for a class that only
+ // It is a good practice to create a private constructor for a class that only
// defines static methods.
private IssuedTokenServiceCredentialsConfiguration() { }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_federation/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_federation/cs/source.cs
index 9e07b9a0a4b..1204e7d392a 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_federation/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_federation/cs/source.cs
@@ -53,9 +53,9 @@ public override bool CheckAccess(OperationContext operationContext)
}
}
- // This helper method checks whether SAML Token was issued by STS-B.
- // It compares the Thumbprint Claim of the Issuer against the
- // Certificate of STS-B.
+ // This helper method checks whether SAML Token was issued by STS-B.
+ // It compares the Thumbprint Claim of the Issuer against the
+ // Certificate of STS-B.
private bool IssuedBySTS_B(ClaimSet myClaimSet)
{
ClaimSet issuerClaimSet = myClaimSet.Issuer;
@@ -66,8 +66,8 @@ private bool IssuedBySTS_B(ClaimSet myClaimSet)
return false;
if (issuerClaim.Resource == null) return false;
byte[] claimThumbprint = (byte[])issuerClaim.Resource;
- // It is assumed that stsB_Certificate is a variable of type
- // X509Certificate2 that is initialized with the Certificate of
+ // It is assumed that stsB_Certificate is a variable of type
+ // X509Certificate2 that is initialized with the Certificate of
// STS-B.
X509Certificate2 stsB_Certificate = GetStsBCertificate();
byte[] certThumbprint = stsB_Certificate.GetCertHash();
@@ -94,7 +94,7 @@ private void ProcessSamlSecurityToken()
string samlSubjectNameFormat = "4";
string samlSubjectEmailAddress = "5";
- //
+ //
// Create the list of SAML Attributes.
List samlAttributes = new List();
// Add the userAuthenticated claim.
@@ -103,7 +103,7 @@ private void ProcessSamlSecurityToken()
SamlAttribute mySamlAttribute = new SamlAttribute("http://www.tmpuri.org",
"userAuthenticated", strList);
samlAttributes.Add(mySamlAttribute);
- // Create the SAML token with the userAuthenticated claim. It is assumed that
+ // Create the SAML token with the userAuthenticated claim. It is assumed that
// the method CreateSamlToken() is implemented as part of STS-A.
SamlSecurityToken samlToken = CreateSamlToken(
proofToken,
@@ -112,7 +112,7 @@ private void ProcessSamlSecurityToken()
samlSubjectNameFormat,
samlSubjectEmailAddress,
samlAttributes);
- //
+ //
}
private SamlSecurityToken CreateSamlToken(string proofToken, string issuerToken,
string samlConditions, string samlSubjectNameFormat, string samlSubjectEmailAddress,
@@ -151,8 +151,8 @@ public override bool CheckAccess(OperationContext operationContext)
}
}
- // This helper method checks whether SAML Token was issued by STS-A.
- // It compares the Thumbprint Claim of the Issuer against the
+ // This helper method checks whether SAML Token was issued by STS-A.
+ // It compares the Thumbprint Claim of the Issuer against the
// Certificate of STS-A.
private bool IssuedBySTS_A(ClaimSet myClaimSet)
{
@@ -201,7 +201,7 @@ public SamlSecurityToken ReturnSamlSecurityToken()
"accessAuthorized",
strList));
- // Create the SAML token with the accessAuthorized claim. It is assumed that
+ // Create the SAML token with the accessAuthorized claim. It is assumed that
// the method CreateSamlToken() is implemented as part of STS-B.
SamlSecurityToken samlToken = CreateSamlToken(
proofToken,
@@ -250,7 +250,7 @@ public override bool CheckAccess(OperationContext operationContext)
}
}
- // This helper method performs a rudimentary check for whether
+ // This helper method performs a rudimentary check for whether
//a given email is valid.
private static bool IsValidEmailAddress(string emailAddress)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_iauthorizationpolicy/cs/service.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_iauthorizationpolicy/cs/service.cs
index b17368fd6e6..e87f9a1ad06 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_iauthorizationpolicy/cs/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_iauthorizationpolicy/cs/service.cs
@@ -75,7 +75,7 @@ public class MyServiceAuthorizationManager : ServiceAuthorizationManager
{
//
protected override bool CheckAccessCore(OperationContext operationContext)
- {
+ {
// Extract the action URI from the OperationContext. Match this against the claims
// in the AuthorizationContext.
string action = operationContext.RequestContext.RequestMessage.Headers.Action;
@@ -103,7 +103,7 @@ protected override bool CheckAccessCore(OperationContext operationContext)
//
// If this point is reached, return false to deny access.
- return false;
+ return false;
}
//
}
@@ -123,7 +123,7 @@ public bool Evaluate(EvaluationContext evaluationContext, ref object state)
bool bRet = false;
CustomAuthState customstate = null;
- // If state is null, then this method has not been called before, so
+ // If state is null, then this method has not been called before, so
// set up a custom state.
if (state == null)
{
@@ -184,12 +184,12 @@ public string Id
get { return id; }
}
- // This method returns a collection of action strings that indicate the
+ // This method returns a collection of action strings that indicate the
// operations that the specified username is allowed to call.
private IEnumerable GetAllowedOpList(string username)
{
IList ret = new List();
-
+
if (username == "test1")
{
ret.Add ( "http://Microsoft.ServiceModel.Samples/ICalculator/Add");
@@ -214,7 +214,7 @@ public CustomAuthState()
bClaimsAdded = false;
}
- public bool ClaimsAdded { get { return bClaimsAdded; }
+ public bool ClaimsAdded { get { return bClaimsAdded; }
set { bClaimsAdded = value; } }
}
}
@@ -222,9 +222,9 @@ public CustomAuthState()
//
public class MyCustomUserNameValidator : UserNamePasswordValidator
{
- // This method validates users. It allows two users, test1 and test2
+ // This method validates users. It allows two users, test1 and test2
// with passwords 1tset and 2tset respectively.
- // This code is for illustration purposes only and
+ // This code is for illustration purposes only and
// MUST NOT be used in a production environment because it is NOT secure.
public override void Validate(string userName, string password)
{
@@ -239,13 +239,13 @@ public override void Validate(string userName, string password)
}
}
}
-
+
// Host the service within this EXE console application.
public static void Main()
{
// Get base address from appsettings in configuration.
Uri baseAddress = new Uri(ConfigurationManager.AppSettings["baseAddress"]);
-
+
// Create a ServiceHost for the CalculatorService type and provide the base address.
using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress))
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_impersonationanddelegation/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_impersonationanddelegation/cs/source.cs
index 6cfbc2ba18b..2e80a784984 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_impersonationanddelegation/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_impersonationanddelegation/cs/source.cs
@@ -80,18 +80,18 @@ private void ServiceAuthorizationBehaviorStuff()
Uri myUri = new Uri("hello");
Uri[] addresses = new Uri[] { myUri };
Type c = typeof(HelloService);
- ServiceHost serviceHost = new ServiceHost(c, addresses );
+ ServiceHost serviceHost = new ServiceHost(c, addresses );
//
// Code to create a ServiceHost not shown.
- ServiceAuthorizationBehavior MyServiceAuthoriationBehavior =
+ ServiceAuthorizationBehavior MyServiceAuthoriationBehavior =
serviceHost.Description.Behaviors.Find();
MyServiceAuthoriationBehavior.ImpersonateCallerForAllOperations = true;
//
//
ChannelFactory cf = new ChannelFactory("EchoEndpoint");
- cf.Credentials.Windows.AllowedImpersonationLevel =
+ cf.Credentials.Windows.AllowedImpersonationLevel =
System.Security.Principal.TokenImpersonationLevel.Impersonation;
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_maxclockskew/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_maxclockskew/cs/source.cs
index d74d77a4e13..76da5d6acb5 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_maxclockskew/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_maxclockskew/cs/source.cs
@@ -20,7 +20,7 @@ static void Main()
}
//
- // This method returns a custom binding created from a WSHttpBinding. Alter the method
+ // This method returns a custom binding created from a WSHttpBinding. Alter the method
// to use the appropriate binding for your service, with the appropriate settings.
public static Binding CreateCustomBinding(TimeSpan clockSkew)
{
@@ -30,7 +30,7 @@ public static Binding CreateCustomBinding(TimeSpan clockSkew)
myCustomBinding.Elements.Find();
security.LocalClientSettings.MaxClockSkew = clockSkew;
security.LocalServiceSettings.MaxClockSkew = clockSkew;
- // Get the System.ServiceModel.Security.Tokens.SecureConversationSecurityTokenParameters
+ // Get the System.ServiceModel.Security.Tokens.SecureConversationSecurityTokenParameters
SecureConversationSecurityTokenParameters secureTokenParams =
(SecureConversationSecurityTokenParameters)security.ProtectionTokenParameters;
// From the collection, get the bootstrap element.
@@ -40,12 +40,12 @@ public static Binding CreateCustomBinding(TimeSpan clockSkew)
bootstrap.LocalServiceSettings.MaxClockSkew = clockSkew;
return myCustomBinding;
}
-
+
private void Run()
{
- // Create a custom binding using the method defined above. The MaxClockSkew is set to 30 minutes.
+ // Create a custom binding using the method defined above. The MaxClockSkew is set to 30 minutes.
Binding customBinding= CreateCustomBinding(TimeSpan.FromMinutes(30));
-
+
// Create a ServiceHost instance, and add a metadata endpoint.
// NOTE When using Visual Studio, you must run as administrator.
Uri baseUri = new Uri("http://localhost:1008/");
@@ -56,7 +56,7 @@ private void Run()
// Add an endpoint using the binding, and open the service.
sh.AddServiceEndpoint(typeof(ICalculator), customBinding, "myCalculator");
-
+
sh.Open();
Console.WriteLine("Listening...");
Console.ReadLine();
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_principalpermissionattribute/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_principalpermissionattribute/cs/source.cs
index e9a6656d177..a3e0566bba6 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_principalpermissionattribute/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_principalpermissionattribute/cs/source.cs
@@ -22,7 +22,7 @@ public double Add(double a, double b)
//
//
- // Only a client authenticated with a valid certificate that has the
+ // Only a client authenticated with a valid certificate that has the
// specified subject name and thumbprint can call this method.
[PrincipalPermission(SecurityAction.Demand,
Name = "CN=ReplaceWithSubjectName; 123456712345677E8E230FDE624F841B1CE9D41E")]
@@ -45,13 +45,13 @@ public void WriteServiceSecurityContextData(string fileName)
sw.WriteLine("WindowsIdentity: {0}", ServiceSecurityContext.Current.WindowsIdentity.Name);
sw.WriteLine();
// Write the claimsets in the authorization context. By default, there is only one claimset
- // provided by the system.
+ // provided by the system.
foreach (ClaimSet claimset in ServiceSecurityContext.Current.AuthorizationContext.ClaimSets)
{
foreach (Claim claim in claimset)
{
// Write out each claim type, claim value, and the right. There are two
- // possible values for the right: "identity" and "possessproperty".
+ // possible values for the right: "identity" and "possessproperty".
sw.WriteLine("Claim Type = {0}", claim.ClaimType);
sw.WriteLine("\t Resource = {0}", claim.Resource.ToString());
sw.WriteLine("\t Right = {0}", claim.Right);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_programmingsecurity/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_programmingsecurity/cs/source.cs
index 7a6104fcb78..b69962a40f4 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_programmingsecurity/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_programmingsecurity/cs/source.cs
@@ -58,7 +58,7 @@ private void snippet3()
private void Snippet4()
{
//
- // Specify client credentials on the client.
+ // Specify client credentials on the client.
// Code to set the UserName and Password is not shown here.
CalculatorClient CalculatorClient = new CalculatorClient("myBinding");
CalculatorClient.ClientCredentials.UserName.UserName = ReturnUserName();
@@ -90,7 +90,7 @@ private void Snippet6And7()
//
ServiceHost myServiceHost = new ServiceHost(typeof(CalculatorService));
- // Specify client credentials validation on the service.
+ // Specify client credentials validation on the service.
ServiceCredentials myServiceCredentials =
myServiceHost.Description.Behaviors.Find();
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_settingsecuritymode/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_settingsecuritymode/cs/source.cs
index 39be9202737..72d564ef37c 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_settingsecuritymode/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_settingsecuritymode/cs/source.cs
@@ -109,7 +109,7 @@ private void TcpMessageWithCredentialWindows()
ServiceHost sh = new ServiceHost(typeof(Calculator), netTcpAdddress);
sh.Credentials.ServiceCertificate.SetCertificate(
StoreLocation.LocalMachine, StoreName.My,
- X509FindType.FindByIssuerName, "Contoso.com");
+ X509FindType.FindByIssuerName, "Contoso.com");
sh.AddServiceEndpoint(typeof(ICalculator), b, "TcpCalculator");
sh.Open();
Console.WriteLine("Listening");
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_tcpclient/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_tcpclient/cs/source.cs
index 4416d2ccc33..71d5594aadc 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_tcpclient/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_tcpclient/cs/source.cs
@@ -74,7 +74,7 @@ private void SecureHttp()
{
//
// Create a WSHttpBinding and set its security properties. The
- // security mode is Message, and the client is authenticated with
+ // security mode is Message, and the client is authenticated with
// a certificate.
EndpointAddress ea = new EndpointAddress("http://contoso.com/");
WSHttpBinding b = new WSHttpBinding();
@@ -97,7 +97,7 @@ private void SetCertificate_SubjectName()
{
//
// Create a WSHttpBinding and set its security properties. The
- // security mode is Message, and the client is authenticated with
+ // security mode is Message, and the client is authenticated with
// a certificate.
EndpointAddress ea = new EndpointAddress("http://contoso.com/");
WSHttpBinding b = new WSHttpBinding();
@@ -111,7 +111,7 @@ private void SetCertificate_SubjectName()
// Set the client credential value to a valid certificate.
cc.ClientCredentials.ClientCertificate.SetCertificate(
"CN=MyName, OU=MyOrgUnit, C=US",
- StoreLocation.CurrentUser,
+ StoreLocation.CurrentUser,
StoreName.TrustedPeople);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_usernamevalidator/cs/service.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_usernamevalidator/cs/service.cs
index da6b9893137..9b8e8ea4ad0 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_usernamevalidator/cs/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_usernamevalidator/cs/service.cs
@@ -72,15 +72,15 @@ public double Divide(double n1, double n2)
public class MyServiceAuthorizationManager : ServiceAuthorizationManager
{
-
+
protected override bool CheckAccessCore(OperationContext operationContext)
- {
+ {
// Extract the action URI from the OperationContext. Match this against the claims
// in the AuthorizationContext.
string action = operationContext.RequestContext.RequestMessage.Headers.Action;
Console.WriteLine("action: {0}", action);
- //
+ //
// Iterate through the various claimsets in the AuthorizationContext.
foreach(ClaimSet cs in operationContext.ServiceSecurityContext.AuthorizationContext.ClaimSets)
{
@@ -99,9 +99,9 @@ protected override bool CheckAccessCore(OperationContext operationContext)
}
}
}
-
+
// If we get here, return false, denying access.
- return false;
+ return false;
}
}
@@ -114,7 +114,7 @@ public MyAuthorizationPolicy()
id = Guid.NewGuid().ToString();
}
- //
+ //
public bool Evaluate(EvaluationContext evaluationContext, ref object state)
{
bool bRet = false;
@@ -152,7 +152,7 @@ public bool Evaluate(EvaluationContext evaluationContext, ref object state)
Console.WriteLine("Claim added {0}", s);
}
- // Add claims to the evaluation context.
+ // Add claims to the evaluation context.
evaluationContext.AddClaimSet(this, new DefaultClaimSet(this.Issuer,claims));
// Record that the claims have been added.
@@ -169,8 +169,8 @@ public bool Evaluate(EvaluationContext evaluationContext, ref object state)
return bRet;
}
- //
- //
+ //
+ //
public ClaimSet Issuer
{
get { return ClaimSet.System; }
@@ -181,12 +181,12 @@ public string Id
get { return id; }
}
- // This method returns a collection of action strings that indicate the
+ // This method returns a collection of action strings that indicate the
// operations that the specified username is allowed to call.
private IEnumerable GetAllowedOpList(string username)
{
IList ret = new List();
-
+
if (username == "test1")
{
ret.Add ( "http://Microsoft.ServiceModel.Samples/ICalculator/Add");
@@ -211,7 +211,7 @@ public CustomAuthState()
bClaimsAdded = false;
}
- public bool ClaimsAdded { get { return bClaimsAdded; }
+ public bool ClaimsAdded { get { return bClaimsAdded; }
set { bClaimsAdded = value; } }
}
}
@@ -220,9 +220,9 @@ public CustomAuthState()
public class MyCustomUserNameValidator : UserNamePasswordValidator
{
//
- // This method validates users. It allows two users, test1 and test2
+ // This method validates users. It allows two users, test1 and test2
// with passwords 1tset and 2tset respectively.
- // This code is for illustration purposes only and
+ // This code is for illustration purposes only and
// MUST NOT be used in a production environment because it is NOT secure.
public override void Validate(string userName, string password)
{
@@ -238,13 +238,13 @@ public override void Validate(string userName, string password)
}
//
}
- //
+ //
// Host the service within this EXE console application.
public static void Main()
{
// Get base address from appsettings in configuration.
Uri baseAddress = new Uri(ConfigurationManager.AppSettings["baseAddress"]);
-
+
// Create a ServiceHost for the CalculatorService type and provide the base address.
using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress))
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/c_x509certificatevalidator/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/c_x509certificatevalidator/cs/source.cs
index 503a7c09bbb..3ac63aad539 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/c_x509certificatevalidator/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/c_x509certificatevalidator/cs/source.cs
@@ -10,7 +10,7 @@
[assembly: SecurityPermission(
SecurityAction.RequestMinimum, Execution = true)]
namespace Microsoft.ServiceModel.Samples
-{
+{
[ServiceContract(Namespace="http://Microsoft.ServiceModel.Samples")]
public interface ICalculator
{
@@ -33,9 +33,9 @@ static void Main()
{
using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService)))
{
- serviceHost.Credentials.ClientCertificate.Authentication.CertificateValidationMode =
+ serviceHost.Credentials.ClientCertificate.Authentication.CertificateValidationMode =
X509CertificateValidationMode.Custom;
- serviceHost.Credentials.ClientCertificate.Authentication.CustomCertificateValidator =
+ serviceHost.Credentials.ClientCertificate.Authentication.CustomCertificateValidator =
new MyX509CertificateValidator("CN=Contoso.com");
serviceHost.Open();
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/callbackbehaviorattribute/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/callbackbehaviorattribute/cs/client.cs
index 96b6794c2c0..54c02012436 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/callbackbehaviorattribute/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/callbackbehaviorattribute/cs/client.cs
@@ -7,7 +7,7 @@
namespace Microsoft.WCF.Documentation
{
[CallbackBehaviorAttribute(
- IncludeExceptionDetailInFaults= true,
+ IncludeExceptionDetailInFaults= true,
UseSynchronizationContext=true,
ValidateMustUnderstand=true
)]
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/callbackbehaviorattribute/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/callbackbehaviorattribute/cs/proxycode.cs
index a096213d588..7a2af882dde 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/callbackbehaviorattribute/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/callbackbehaviorattribute/cs/proxycode.cs
@@ -14,7 +14,7 @@
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="SampleDuplexHello", CallbackContract=typeof(SampleDuplexHelloCallback), SessionMode=System.ServiceModel.SessionMode.Required)]
public interface SampleDuplexHello
{
-
+
[System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="http://microsoft.wcf.documentation/SampleDuplexHello/Hello")]
void Hello(string greeting);
}
@@ -22,7 +22,7 @@ public interface SampleDuplexHello
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public interface SampleDuplexHelloCallback
{
-
+
[System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="http://microsoft.wcf.documentation/SampleDuplexHello/Reply")]
void Reply(string responseToGreeting);
}
@@ -36,32 +36,32 @@ public interface SampleDuplexHelloChannel : SampleDuplexHello, System.ServiceMod
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class SampleDuplexHelloClient : System.ServiceModel.DuplexClientBase, SampleDuplexHello
{
-
- public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance) :
+
+ public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance) :
base(callbackInstance)
{
}
-
- public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName) :
+
+ public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName) :
base(callbackInstance, endpointConfigurationName)
{
}
-
- public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName, string remoteAddress) :
+
+ public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName, string remoteAddress) :
base(callbackInstance, endpointConfigurationName, remoteAddress)
{
}
-
- public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(callbackInstance, endpointConfigurationName, remoteAddress)
{
}
-
- public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance, System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleDuplexHelloClient(System.ServiceModel.InstanceContext callbackInstance, System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(callbackInstance, binding, remoteAddress)
{
}
-
+
public void Hello(string greeting)
{
base.Channel.Hello(greeting);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/cfx_wf_gettingstarted/cs/extrasnippets.cs b/samples/snippets/csharp/VS_Snippets_CFX/cfx_wf_gettingstarted/cs/extrasnippets.cs
index 13b0173a3af..1170dff05ef 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/cfx_wf_gettingstarted/cs/extrasnippets.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/cfx_wf_gettingstarted/cs/extrasnippets.cs
@@ -20,7 +20,7 @@ void Snippet2()
void Snippet4()
{
-
+
//
AutoResetEvent syncEvent = new AutoResetEvent(false);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/cfx_wf_gettingstarted/cs/readint.cs b/samples/snippets/csharp/VS_Snippets_CFX/cfx_wf_gettingstarted/cs/readint.cs
index b51ba7551e9..b48d5f7c0dc 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/cfx_wf_gettingstarted/cs/readint.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/cfx_wf_gettingstarted/cs/readint.cs
@@ -25,8 +25,8 @@ protected override void Execute(NativeActivityContext context)
context.CreateBookmark(name, new BookmarkCallback(OnReadComplete));
}
- // NativeActivity derived activities that do asynchronous operations by calling
- // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
+ // NativeActivity derived activities that do asynchronous operations by calling
+ // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
// must override the CanInduceIdle property and return true.
protected override bool CanInduceIdle
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs
index d69a767ad9c..7d9938061fa 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs
@@ -148,16 +148,16 @@ private static void RunWorkflow(Activity wf)
wfApp.OnUnhandledException = delegate(WorkflowApplicationUnhandledExceptionEventArgs e)
{
// Display the unhandled exception.
- Console.WriteLine("OnUnhandledException in Workflow {0}: {1}",
+ Console.WriteLine("OnUnhandledException in Workflow {0}: {1}",
e.InstanceId, e.UnhandledException.Message);
- Console.WriteLine("ExceptionSource: {0} - {1}",
+ Console.WriteLine("ExceptionSource: {0} - {1}",
e.ExceptionSource, e.ExceptionSourceInstanceId);
// Instruct the runtime to terminate the workflow.
return UnhandledExceptionAction.Terminate;
- // Other choices are UnhandledExceptionAction.Abort and
+ // Other choices are UnhandledExceptionAction.Abort and
// UnhandledExceptionAction.Cancel
};
@@ -198,7 +198,7 @@ static void snippet1()
},
new Throw
{
- Exception = new InArgument((env) =>
+ Exception = new InArgument((env) =>
new ApplicationException("Something unexpected happened."))
},
new WriteLine
@@ -222,7 +222,7 @@ static void snippet1()
// Instruct the runtime to terminate the workflow.
return UnhandledExceptionAction.Terminate;
- // Other choices are UnhandledExceptionAction.Abort and
+ // Other choices are UnhandledExceptionAction.Abort and
// UnhandledExceptionAction.Cancel
};
@@ -322,7 +322,7 @@ static void snippet5()
},
new Throw
{
- Exception = new InArgument((env) =>
+ Exception = new InArgument((env) =>
new ApplicationException("Something unexpected happened."))
},
new WriteLine
@@ -411,7 +411,7 @@ static void snippet6()
},
new Throw
{
- Exception = new InArgument((env) =>
+ Exception = new InArgument((env) =>
new ApplicationException("Something unexpected happened."))
},
new WriteLine
@@ -492,7 +492,7 @@ static void snippet7()
},
new Throw
{
- Exception = new InArgument((env) =>
+ Exception = new InArgument((env) =>
new ApplicationException("Something unexpected happened."))
},
new WriteLine
@@ -567,7 +567,7 @@ static void snippet8()
},
new Throw
{
- Exception = new InArgument((env) =>
+ Exception = new InArgument((env) =>
new ApplicationException("Something unexpected happened."))
},
new WriteLine
@@ -688,7 +688,7 @@ static void snippet9()
e.Reason.GetType().FullName,
e.Reason.Message);
};
-
+
wfApp.Idle = delegate(WorkflowApplicationIdleEventArgs e)
{
// Perform any processing that should occur
@@ -1037,7 +1037,7 @@ static void snippet35()
{
Body = new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1098,7 +1098,7 @@ static void snippet36()
{
Body = new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1106,7 +1106,7 @@ static void snippet36()
},
new Throw
{
- Exception = new InArgument((env) =>
+ Exception = new InArgument((env) =>
new ApplicationException("An ApplicationException was thrown."))
},
new WriteLine
@@ -1166,13 +1166,13 @@ static void snippet37()
Activity wf = new Parallel
{
CompletionCondition = true,
- Branches =
+ Branches =
{
new CancellationScope
{
Body = new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1236,13 +1236,13 @@ static void snippet38()
Try = new Parallel
{
CompletionCondition = true,
- Branches =
+ Branches =
{
new CancellationScope
{
Body = new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1250,7 +1250,7 @@ static void snippet38()
},
new Throw
{
- Exception = new InArgument((env) =>
+ Exception = new InArgument((env) =>
new ApplicationException("An ApplicationException was thrown."))
},
new WriteLine
@@ -1322,7 +1322,7 @@ static void snippet39()
{
Body = new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1330,7 +1330,7 @@ static void snippet39()
},
new Throw
{
- Exception = new InArgument((env) =>
+ Exception = new InArgument((env) =>
new ApplicationException("An ApplicationException was thrown."))
},
new WriteLine
@@ -1394,7 +1394,7 @@ static void snippet40()
{
Body = new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1402,7 +1402,7 @@ static void snippet40()
},
new Throw
{
- Exception = new InArgument((env) =>
+ Exception = new InArgument((env) =>
new ApplicationException("An ApplicationException was thrown."))
},
new WriteLine
@@ -1466,7 +1466,7 @@ static void snippet41()
ab.Properties.Add(new DynamicActivityProperty { Name = "Operand2", Type = typeof(InArgument) });
ab.Implementation = new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1537,8 +1537,8 @@ static void snippet41()
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(wf);
foreach (PropertyDescriptor property in properties)
{
- if (property.PropertyType.IsGenericType &&
- (property.PropertyType.GetGenericTypeDefinition() == typeof(InArgument<>) ||
+ if (property.PropertyType.IsGenericType &&
+ (property.PropertyType.GetGenericTypeDefinition() == typeof(InArgument<>) ||
property.PropertyType.GetGenericTypeDefinition() == typeof(InOutArgument<>)))
{
Type targetType = property.PropertyType.GetGenericArguments()[0];
@@ -1585,7 +1585,7 @@ private static Activity ActivityTreeInspection()
},
new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1608,7 +1608,7 @@ private static Activity ActivityTreeInspection()
static void InspectActivity(Activity root, int indent)
{
// Inspect the activity tree using WorkflowInspectionServices.
- IEnumerator activities =
+ IEnumerator activities =
WorkflowInspectionServices.GetActivities(root).GetEnumerator();
Console.WriteLine("{0}{1}", new string(' ', indent), root.DisplayName);
@@ -1660,7 +1660,7 @@ static void snippet57()
},
new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1733,7 +1733,7 @@ static void snippet59()
},
new Sequence
{
- Activities =
+ Activities =
{
new WriteLine
{
@@ -1886,7 +1886,7 @@ static void snippet51()
{
TargetObject = new InArgument(new VisualBasicValue("New Random()")),
MethodName = "Next",
- Parameters =
+ Parameters =
{
new InArgument(1),
new InArgument(101)
@@ -1954,7 +1954,7 @@ static void snippet55()
Implementation = () => new Sequence
{
- Activities =
+ Activities =
{
new Assign
{
@@ -1998,7 +1998,7 @@ static void snippet14()
},
new WriteLine
{
- Text = new InArgument((env) =>
+ Text = new InArgument((env) =>
("Hello, " + name.Get(env)))
}
}
@@ -2393,7 +2393,7 @@ static void snippet22()
},
new WriteLine
{
- Text = new InArgument((env) =>
+ Text = new InArgument((env) =>
("Hello, " + name.Get(env)))
}
}
@@ -2422,7 +2422,7 @@ static void snippet22()
// is idle. If a call to ResumeBookmark is made and the workflow
// is not idle, ResumeBookmark blocks until the workflow becomes
// idle before resuming the bookmark.
- BookmarkResumptionResult result = wfApp.ResumeBookmark("UserName",
+ BookmarkResumptionResult result = wfApp.ResumeBookmark("UserName",
Console.ReadLine());
// Possible BookmarkResumptionResult values:
@@ -2453,7 +2453,7 @@ static void snippet23()
},
new WriteLine
{
- Text = new InArgument((env) =>
+ Text = new InArgument((env) =>
("Hello, " + name.Get(env)))
}
}
@@ -2478,7 +2478,7 @@ static void snippet23()
idleEvent.WaitOne();
// Gather the user's input and resume the bookmark.
- BookmarkResumptionResult result = wfApp.ResumeBookmark("UserName",
+ BookmarkResumptionResult result = wfApp.ResumeBookmark("UserName",
Console.ReadLine(), TimeSpan.FromSeconds(15));
// Possible BookmarkResumptionResult values:
@@ -2508,7 +2508,7 @@ static void snippet24()
},
new WriteLine
{
- Text = new InArgument((env) =>
+ Text = new InArgument((env) =>
("Hello, " + name.Get(env)))
}
}
@@ -2533,7 +2533,7 @@ static void snippet24()
idleEvent.WaitOne();
// Gather the user's input and resume the bookmark.
- BookmarkResumptionResult result = wfApp.ResumeBookmark(new Bookmark("UserName"),
+ BookmarkResumptionResult result = wfApp.ResumeBookmark(new Bookmark("UserName"),
Console.ReadLine());
// Possible BookmarkResumptionResult values:
@@ -2564,7 +2564,7 @@ static void snippet25()
},
new WriteLine
{
- Text = new InArgument((env) =>
+ Text = new InArgument((env) =>
("Hello, " + name.Get(env)))
}
}
@@ -2589,7 +2589,7 @@ static void snippet25()
idleEvent.WaitOne();
// Gather the user's input and resume the bookmark.
- BookmarkResumptionResult result = wfApp.ResumeBookmark(new Bookmark("UserName"),
+ BookmarkResumptionResult result = wfApp.ResumeBookmark(new Bookmark("UserName"),
Console.ReadLine(), TimeSpan.FromSeconds(15));
// Possible BookmarkResumptionResult values:
@@ -2649,7 +2649,7 @@ static void StartAndUnloadInstance()
application.InstanceStore = instanceStore;
- //returning IdleAction.Unload instructs the WorkflowApplication to persists application state and remove it from memory
+ //returning IdleAction.Unload instructs the WorkflowApplication to persists application state and remove it from memory
application.PersistableIdle = (e) =>
{
return PersistableIdleAction.Unload;
@@ -2660,7 +2660,7 @@ static void StartAndUnloadInstance()
instanceUnloaded.Set();
};
- //This call is not required
+ //This call is not required
//Calling persist here captures the application durably before it has been started
application.Persist();
id = application.Id;
@@ -2880,7 +2880,7 @@ static void snippet33()
{
Exception = new InArgument((env) =>new ApplicationException("An ApplicationException was thrown."))
},
- Catches =
+ Catches =
{
new Catch
{
@@ -2999,8 +2999,8 @@ protected override void Execute(NativeActivityContext context)
context.CreateBookmark(name, new BookmarkCallback(OnReadComplete));
}
- // NativeActivity derived activities that do asynchronous operations by calling
- // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
+ // NativeActivity derived activities that do asynchronous operations by calling
+ // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
// must override the CanInduceIdle property and return true.
protected override bool CanInduceIdle
{
@@ -3029,8 +3029,8 @@ protected override void Execute(NativeActivityContext context)
new BookmarkCallback(OnResumeBookmark));
}
- // NativeActivity derived activities that do asynchronous operations by calling
- // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
+ // NativeActivity derived activities that do asynchronous operations by calling
+ // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext
// must override the CanInduceIdle property and return true.
protected override bool CanInduceIdle
{
@@ -3205,7 +3205,7 @@ private void DisposePipeline(Pipeline pipeline)
{
throw new NotImplementedException();
}
-
+
protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
{
throw new NotImplementedException();
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs
index 41613e4aa21..785f03aaaa2 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs
@@ -326,7 +326,7 @@ static void Snippet50()
//
Activity wf = new Sequence()
{
- Activities =
+ Activities =
{
new WriteLine()
{
@@ -364,7 +364,7 @@ static void Snippet51()
//
Activity wf = new Sequence()
{
- Activities =
+ Activities =
{
new WriteLine()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/channelcache/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/channelcache/cs/client.cs
index 11a3ae61269..692f51a8616 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/channelcache/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/channelcache/cs/client.cs
@@ -24,7 +24,7 @@ static void Main(string[] args)
CreateClientWorkflow();
//
-
+
//sharing a channel cache between two workflow applications in a single app-domain.
sharedChannelCache = new SendMessageChannelCache(new ChannelCacheSettings { MaxItemsInCache = 5 }, new ChannelCacheSettings { MaxItemsInCache = 5 });
@@ -38,7 +38,7 @@ static void Main(string[] args)
//disabling the channel cache so that channels are closed after being used.
SendMessageChannelCache disabledChannelCache = new SendMessageChannelCache(new ChannelCacheSettings { MaxItemsInCache = 0 }, new ChannelCacheSettings { MaxItemsInCache = 0 });
-
+
WorkflowApplication workflowApp3 = new WorkflowApplication(workflow);
workflowApp3.Completed = new Action(OnCompleted);
workflowApp3.Extensions.Add(disabledChannelCache);
@@ -46,7 +46,7 @@ static void Main(string[] args)
//
try
- {
+ {
workflowApp1.Run();
completeEvent.WaitOne();
Console.WriteLine("Workflow 1 completed successfully.");
@@ -68,7 +68,7 @@ static void Main(string[] args)
}
static void OnCompleted(WorkflowApplicationCompletedEventArgs completedArgs)
- {
+ {
completeEvent.Set();
}
@@ -77,7 +77,7 @@ static void CreateClientWorkflow()
//
Variable message = new Variable("message", "client");
Variable result = new Variable { Name = "result" };
-
+
Endpoint endpoint = new Endpoint
{
AddressUri = new Uri(Common.Constants.ServiceBaseAddress),
@@ -91,8 +91,8 @@ static void CreateClientWorkflow()
OperationName = "Echo",
Content = new SendParametersContent
{
- Parameters =
- {
+ Parameters =
+ {
{ "message", new InArgument(message) }
}
}
@@ -111,14 +111,14 @@ static void CreateClientWorkflow()
new ReceiveReply
{
Request = requestEcho,
- Content = new ReceiveParametersContent
+ Content = new ReceiveParametersContent
{
- Parameters =
+ Parameters =
{
{ "echo", new OutArgument(result) }
}
}
- },
+ },
new WriteLine {
Text = new InArgument(result)
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/channelcache/cs/service.cs b/samples/snippets/csharp/VS_Snippets_CFX/channelcache/cs/service.cs
index ed49b3f60b7..ac2afb09f74 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/channelcache/cs/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/channelcache/cs/service.cs
@@ -12,8 +12,8 @@ namespace Microsoft.Samples.ChannelCache.EchoWorkflowService
class Program
{
- static WorkflowService service;
-
+ static WorkflowService service;
+
private static void CreateService()
{
//
@@ -27,7 +27,7 @@ private static void CreateService()
CanCreateInstance = true,
Content = new ReceiveParametersContent
{
- Parameters =
+ Parameters =
{
{"message", new OutArgument(message)}
}
@@ -47,10 +47,10 @@ private static void CreateService()
{
Value = new InArgument(env =>("Hello, " + message.Get(env))),
To = new OutArgument(echo)
- },
+ },
new SendReply
- {
- Request = receiveString,
+ {
+ Request = receiveString,
Content = new SendParametersContent
{
Parameters =
@@ -83,7 +83,7 @@ static void Main(string[] args)
WorkflowServiceHost host = new WorkflowServiceHost(service, address);
// A host level channel cache is not necessary for this example as our server workflow
- // does not have a Send activity. However, the following can be used to add a host level
+ // does not have a Send activity. However, the following can be used to add a host level
// channel cache that the Send activities in the service workflow could use.
//Func
}
void Container2()
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/clientbase/cs/clientbase.cs b/samples/snippets/csharp/VS_Snippets_CFX/clientbase/cs/clientbase.cs
index a98305f5923..ba0a43e8175 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/clientbase/cs/clientbase.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/clientbase/cs/clientbase.cs
@@ -14,7 +14,7 @@
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation")]
public interface ISampleService
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/ISampleService/SampleMethod", ReplyAction="http://microsoft.wcf.documentation/ISampleService/SampleMethodResponse")]
string SampleMethod(string msg);
}
@@ -28,31 +28,31 @@ public interface ISampleServiceChannel : ISampleService, System.ServiceModel.ICl
//
public partial class SampleServiceClient : System.ServiceModel.ClientBase, ISampleService
{
-
+
public SampleServiceClient()
{
}
-
- public SampleServiceClient(string endpointConfigurationName) :
+
+ public SampleServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public string SampleMethod(string msg)
{
return base.Channel.SampleMethod(msg);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/clientcredentialssecuritytokenmanager/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/clientcredentialssecuritytokenmanager/cs/source.cs
index ecf61a2cd56..678eaac0d88 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/clientcredentialssecuritytokenmanager/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/clientcredentialssecuritytokenmanager/cs/source.cs
@@ -97,7 +97,7 @@ protected override ClientCredentials CloneCore()
//
//
- internal class MyClientCredentialsSecurityTokenManager :
+ internal class MyClientCredentialsSecurityTokenManager :
ClientCredentialsSecurityTokenManager
{
MyClientCredentials credentials;
@@ -152,16 +152,16 @@ public override SecurityTokenProvider CreateSecurityTokenProvider(
return result;
}
- public override SecurityTokenAuthenticator
- CreateSecurityTokenAuthenticator(SecurityTokenRequirement
+ public override SecurityTokenAuthenticator
+ CreateSecurityTokenAuthenticator(SecurityTokenRequirement
tokenRequirement, out SecurityTokenResolver outOfBandTokenResolver)
{
- return base.CreateSecurityTokenAuthenticator(tokenRequirement,
+ return base.CreateSecurityTokenAuthenticator(tokenRequirement,
out outOfBandTokenResolver);
}
}
//
-
+
//
public class MyServiceCredentials : ServiceCredentials
{
@@ -244,7 +244,7 @@ protected override ServiceCredentials CloneCore()
//
//
- internal class MyServiceCredentialsSecurityTokenManager :
+ internal class MyServiceCredentialsSecurityTokenManager :
ServiceCredentialsSecurityTokenManager
{
MyServiceCredentials credentials;
@@ -318,31 +318,31 @@ public class Client
static void Main(string[] args)
{
//
- EndpointAddress serviceEndpoint =
+ EndpointAddress serviceEndpoint =
new EndpointAddress(new Uri("http://localhost:6060/service"));
CustomBinding binding = new CustomBinding();
- AsymmetricSecurityBindingElement securityBE =
+ AsymmetricSecurityBindingElement securityBE =
SecurityBindingElement.CreateMutualCertificateDuplexBindingElement(
MessageSecurityVersion.
WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10);
- // Add a custom IdentityVerifier because the service uses two certificates
- // (one for signing and one for encryption) and an endpoint identity that
+ // Add a custom IdentityVerifier because the service uses two certificates
+ // (one for signing and one for encryption) and an endpoint identity that
// contains a single identity claim.
securityBE.LocalClientSettings.IdentityVerifier = new MyIdentityVerifier();
binding.Elements.Add(securityBE);
- CompositeDuplexBindingElement compositeDuplex =
+ CompositeDuplexBindingElement compositeDuplex =
new CompositeDuplexBindingElement();
compositeDuplex.ClientBaseAddress = new Uri("http://localhost:6061/client");
binding.Elements.Add(compositeDuplex);
binding.Elements.Add(new OneWayBindingElement());
-
+
binding.Elements.Add(new HttpTransportBindingElement());
-
- using (ChannelFactory factory =
+
+ using (ChannelFactory factory =
new ChannelFactory(binding, serviceEndpoint))
{
MyClientCredentials credentials = new MyClientCredentials();
@@ -372,7 +372,7 @@ public MyIdentityVerifier()
this.defaultVerifier = IdentityVerifier.CreateDefault();
}
- public override bool CheckAccess(EndpointIdentity identity,
+ public override bool CheckAccess(EndpointIdentity identity,
AuthorizationContext authContext)
{
// The following implementation is for demonstration only, and
@@ -381,7 +381,7 @@ public override bool CheckAccess(EndpointIdentity identity,
return true;
}
- public override bool TryGetIdentity(EndpointAddress reference,
+ public override bool TryGetIdentity(EndpointAddress reference,
out EndpointIdentity identity)
{
return this.defaultVerifier.TryGetIdentity(reference, out identity);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/collectiondatacontractattribute/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/collectiondatacontractattribute/cs/source.cs
index 4bc925d3fc8..1bf6e211f0c 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/collectiondatacontractattribute/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/collectiondatacontractattribute/cs/source.cs
@@ -30,7 +30,7 @@ public CustomList(T[] items)
//
//
- // This is the generated code. Note that the class is renamed to "CustomBookList",
+ // This is the generated code. Note that the class is renamed to "CustomBookList",
// and the ItemName is set to "CustomItem".
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.CollectionDataContractAttribute(ItemName = "CustomItem")]
@@ -70,7 +70,7 @@ public CustomList Books()
}
public class Test
- {
+ {
static void Main()
{
Test t = new Test();
@@ -82,16 +82,16 @@ private void Run()
{
WSHttpBinding myBinding = new WSHttpBinding();
myBinding.Security.Mode = SecurityMode.Message;
- myBinding.Security.Message.ClientCredentialType =
+ myBinding.Security.Message.ClientCredentialType =
MessageCredentialType.Windows;
-
- // Create the Type instances for later use and the Uri for
+
+ // Create the Type instances for later use and the Uri for
// the base address.
Type contractType = typeof(ICatalog);
- Type serviceType = typeof(Catalog);
- Uri baseAddress = new
+ Type serviceType = typeof(Catalog);
+ Uri baseAddress = new
Uri("http://localhost:8036/serviceModelSamples/");
-
+
// Create the ServiceHost and add an endpoint, then start
// the service.
ServiceHost myServiceHost =
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/client.cs
index 6284a1b2964..55901abbe02 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/client.cs
@@ -38,7 +38,7 @@ static Activity GetClientWorkflow()
Endpoint = clientEndpoint,
ServiceContractName = Constants.POContractName,
OperationName = Constants.SubmitPOName,
- Content = new SendMessageContent(new InArgument(po))
+ Content = new SendMessageContent(new InArgument(po))
};
//
//
@@ -46,8 +46,8 @@ static Activity GetClientWorkflow()
{
Variables = { po, customer },
Activities =
- {
- new Assign
+ {
+ new Assign
{
To = po,
Value = new InArgument( (e) => new PurchaseOrder() { PartName = "Widget", Quantity = 150 } )
@@ -61,8 +61,8 @@ static Activity GetClientWorkflow()
new CorrelationScope
{
Body = new Sequence
- {
- Activities =
+ {
+ Activities =
{
submitPO,
new ReceiveReply
@@ -72,7 +72,7 @@ static Activity GetClientWorkflow()
}
}
}
- },
+ },
new WriteLine { Text = new InArgument( (e) => string.Format("Received ID for new PO: {0}", po.Get(e).Id) ) },
new Assign { To = new OutArgument( (e) => po.Get(e).Quantity ), Value = 250 },
new WriteLine { Text = "Updated PO with new quantity: 250. Resubmitting updated PurchaseOrder based on POId." },
@@ -83,11 +83,11 @@ static Activity GetClientWorkflow()
ServiceContractName = Constants.POContractName,
OperationName = Constants.UpdatePOName,
Content = SendContent.Create(new InArgument(po))
- },
+ },
//
- new Assign
- {
- To = new OutArgument( (e) => po.Get(e).CustomerId ),
+ new Assign
+ {
+ To = new OutArgument( (e) => po.Get(e).CustomerId ),
Value = new InArgument( (e) => customer.Get(e).Id )
},
new WriteLine { Text = "Updating customer data based on CustomerId." },
@@ -97,7 +97,7 @@ static Activity GetClientWorkflow()
ServiceContractName = Constants.POContractName,
OperationName = Constants.AddCustomerInfoName,
Content = SendContent.Create(new InArgument(po))
- },
+ },
new Send
{
Endpoint = clientEndpoint,
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/service.cs b/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/service.cs
index 190f3c27da1..9d2e28f7730 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/service.cs
@@ -10,7 +10,7 @@
using Microsoft.Samples.ContentBasedCorrelation.SharedTypes;
namespace Microsoft.Samples.ContentBasedCorrelation.Service
-{
+{
class Program
{
static void Main(string[] args)
@@ -54,7 +54,7 @@ static Activity GetServiceWorkflow()
{
To = new OutArgument( (e) => po.Get(e).Id ),
Value = new InArgument( (e) => new Random().Next() )
- },
+ },
//
new SendReply
{
@@ -72,10 +72,10 @@ static Activity GetServiceWorkflow()
{ "PoId", new XPathMessageQuery("sm:body()/ser:int", Constants.XPathMessageContext) }
}
}
- }
- },
+ }
+ },
//
- new Parallel
+ new Parallel
{
CompletionCondition = complete,
Branches =
@@ -86,19 +86,19 @@ static Activity GetServiceWorkflow()
Body = new Receive
{
ServiceContractName = Constants.POContractName,
- OperationName = Constants.UpdatePOName,
+ OperationName = Constants.UpdatePOName,
CorrelatesWith = poidHandle, // identifies that the UpdatePO operation is waiting on the PurchaseOrderId that was used to initialize this handle
CorrelatesOn = new MessageQuerySet // the query that is used on an incoming message to find the requisite PurchaseOrderId specified in the correlation
{
// Id is the name of the incoming parameter within the PurchaseOrder
- { "PoId", new XPathMessageQuery("sm:body()/defns:PurchaseOrder/defns:Id", Constants.XPathMessageContext) }
+ { "PoId", new XPathMessageQuery("sm:body()/defns:PurchaseOrder/defns:Id", Constants.XPathMessageContext) }
},
Content = ReceiveContent.Create(new OutArgument(po)) // creates a ReceiveMessageContent
}
},
new Sequence
{
- Activities =
+ Activities =
{
new Receive
{
@@ -109,7 +109,7 @@ static Activity GetServiceWorkflow()
CorrelatesOn = new MessageQuerySet // the query that is used on an incoming message to find the requisite PurchaseOrderId specified in the correlation
{
// Id is the name of the incoming parameter within the PurchaseOrder
- { "PoId", new XPathMessageQuery("sm:body()/defns:PurchaseOrder/defns:Id", Constants.XPathMessageContext) }
+ { "PoId", new XPathMessageQuery("sm:body()/defns:PurchaseOrder/defns:Id", Constants.XPathMessageContext) }
},
CorrelationInitializers =
{
@@ -119,9 +119,9 @@ static Activity GetServiceWorkflow()
CorrelationHandle = custidHandle,
MessageQuerySet = new MessageQuerySet
{
- // CustomerId is the name of the incoming parameter within the PurchaseOrder
- { "CustId", new XPathMessageQuery("sm:body()/defns:PurchaseOrder/defns:CustomerId", Constants.XPathMessageContext) }
- }
+ // CustomerId is the name of the incoming parameter within the PurchaseOrder
+ { "CustId", new XPathMessageQuery("sm:body()/defns:PurchaseOrder/defns:CustomerId", Constants.XPathMessageContext) }
+ }
}
}
},
@@ -135,7 +135,7 @@ static Activity GetServiceWorkflow()
CorrelatesOn = new MessageQuerySet // the query that is used on an incoming message to find the requisite CustomerId specified in the correlation
{
// Id is the name of the incoming parameter within the Customer type
- { "CustId", new XPathMessageQuery("sm:body()/defns:Customer/defns:Id", Constants.XPathMessageContext) }
+ { "CustId", new XPathMessageQuery("sm:body()/defns:Customer/defns:Id", Constants.XPathMessageContext) }
}
},
new Assign
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/types.cs b/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/types.cs
index 2f1b7559ab1..907976fa474 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/types.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/contentbasedcorrelation/cs/types.cs
@@ -40,7 +40,7 @@ public int CustomerId
{
get { return customerid; }
set { customerid = value; }
- }
+ }
}
[DataContract(Name="Customer", Namespace = Constants.DefaultNamespace)]
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/creationendpoint/cs/creationendpoint.cs b/samples/snippets/csharp/VS_Snippets_CFX/creationendpoint/cs/creationendpoint.cs
index 4d2c2a13027..36cf3e07eaa 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/creationendpoint/cs/creationendpoint.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/creationendpoint/cs/creationendpoint.cs
@@ -22,7 +22,7 @@ public CreationEndpoint(Binding binding, EndpointAddress address)
{
}
- public CreationEndpoint():this (GetDefaultBinding(),
+ public CreationEndpoint():this (GetDefaultBinding(),
new EndpointAddress(new Uri(DefaultBaseUri, new Uri(Guid.NewGuid().ToString(), UriKind.Relative))))
{
}
@@ -32,7 +32,7 @@ static Uri DefaultBaseUri
get
{
if (defaultBaseUri == null)
- {
+ {
defaultBaseUri = new Uri(string.Format(CultureInfo.InvariantCulture, "net.pipe://localhost/workflowCreationEndpoint/{0}/{1}",
Process.GetCurrentProcess().Id,
AppDomain.CurrentDomain.Id));
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.cs
index 7f97f1fe62d..87442ea7ee8 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.cs
@@ -21,7 +21,7 @@ void Run()
try
{
//
- // Download all metadata.
+ // Download all metadata.
ServiceEndpointCollection endpoints
= MetadataResolver.Resolve(
typeof(IStatefulService),
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs
index f6ea783653d..0669eb2b568 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs
@@ -32,7 +32,7 @@ public void ExportPolicy(MetadataExporter exporter, PolicyConversionContext poli
throw new NullReferenceException("The MetadataExporter object passed to the ExporterBindingElement is null.");
if (policyContext == null)
throw new NullReferenceException("The PolicyConversionContext object passed to the ExporterBindingElement is null.");
-
+
XmlElement elem = doc.CreateElement(name1, ns1);
elem.InnerText = "My custom text.";
XmlAttribute att = doc.CreateAttribute("MyCustomAttribute", ns1);
@@ -49,8 +49,8 @@ public void ExportPolicy(MetadataExporter exporter, PolicyConversionContext poli
public override BindingElement Clone()
{
- // Note: All custom binding elements must return a deep clone
- // to enable the run time to support multiple bindings using the
+ // Note: All custom binding elements must return a deep clone
+ // to enable the run time to support multiple bindings using the
// same custom binding.
return this;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyimporter.cs b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyimporter.cs
index 1c541bc519d..b71cafc679a 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyimporter.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyimporter.cs
@@ -22,8 +22,8 @@ public class CustomPolicyImporter : IPolicyImportExtension
* 1. Find the custom assertion to import.
* 2. Insert a supporting custom bindingelement or modify the current binding element collection
* to support the assertion.
- * 3. Remove the assertion from the collection. Once the ImportPolicy method has returned,
- * any remaining assertions for the binding cause the binding to fail import and not be
+ * 3. Remove the assertion from the collection. Once the ImportPolicy method has returned,
+ * any remaining assertions for the binding cause the binding to fail import and not be
* constructed.
*/
public void ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/proxycode.cs
index 00e6389eae1..b5e2fb811fa 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/proxycode.cs
@@ -14,7 +14,7 @@
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="IStatefulService", SessionMode=System.ServiceModel.SessionMode.Required)]
public interface IStatefulService
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/IStatefulService/GetSessionID", ReplyAction="http://microsoft.wcf.documentation/IStatefulService/GetSessionIDResponse")]
string GetSessionID();
}
@@ -28,31 +28,31 @@ public interface IStatefulServiceChannel : IStatefulService, System.ServiceModel
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class StatefulServiceClient : System.ServiceModel.ClientBase, IStatefulService
{
-
+
public StatefulServiceClient()
{
}
-
- public StatefulServiceClient(string endpointConfigurationName) :
+
+ public StatefulServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public StatefulServiceClient(string endpointConfigurationName, string remoteAddress) :
+
+ public StatefulServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public StatefulServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public StatefulServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public StatefulServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public StatefulServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public string GetSessionID()
{
return base.Channel.GetSessionID();
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/services.cs b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/services.cs
index e505cb6e507..a805c28e7c5 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/services.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/services.cs
@@ -6,13 +6,13 @@
namespace Microsoft.WCF.Documentation
{
[ServiceContract(
- Namespace="http://microsoft.wcf.documentation",
+ Namespace="http://microsoft.wcf.documentation",
SessionMode=SessionMode.Required
)]
public interface IStatefulService
{
[OperationContract]
- string GetSessionID();
+ string GetSessionID();
}
[ServiceBehavior(
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/datacontractattribute/cs/overview.cs b/samples/snippets/csharp/VS_Snippets_CFX/datacontractattribute/cs/overview.cs
index 4956bfb3de5..787e3590295 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/datacontractattribute/cs/overview.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/datacontractattribute/cs/overview.cs
@@ -63,7 +63,7 @@ public static void Main()
public static void WriteObject(string path)
{
- // Create a new instance of the Person class and
+ // Create a new instance of the Person class and
// serialize it to an XML file.
Person p1 = new Person("Mary", 1);
// Create a new instance of a StreamWriter
@@ -80,8 +80,8 @@ public static void WriteObject(string path)
}
public static void ReadObject(string path)
{
- // Deserialize an instance of the Person class
- // from an XML file. First create an instance of the
+ // Deserialize an instance of the Person class
+ // from an XML file. First create an instance of the
// XmlDictionaryReader.
FileStream fs = new FileStream(path, FileMode.OpenOrCreate);
XmlDictionaryReader reader =
@@ -118,7 +118,7 @@ public class Person
[DataMember]
private int Age;
- // This is not serialized because the DataMemberAttribute
+ // This is not serialized because the DataMemberAttribute
// has not been applied.
private string MailingAddress;
@@ -205,7 +205,7 @@ public void TestClass()
xe.InnerText = "myContents";
xe.SetAttribute
("myAttribute","myValue");
-
+
XmlAttribute atr = xe.Attributes[0];
XmlComment cmnt = xd.CreateComment("myComment");
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/datacontractformatattribute/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/datacontractformatattribute/cs/source.cs
index ff535038adc..485b5e8f5d3 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/datacontractformatattribute/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/datacontractformatattribute/cs/source.cs
@@ -25,7 +25,7 @@ interface ICalculator
[OperationContract, DataContractFormat(Style = OperationFormatStyle.Rpc)]
double Add(double a, double b);
- [OperationContract, DataContractFormat(Style = OperationFormatStyle.Document)]
+ [OperationContract, DataContractFormat(Style = OperationFormatStyle.Document)]
double Subtract(double a, double b);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/datacontractresolver/cs/datacontractresolver.cs b/samples/snippets/csharp/VS_Snippets_CFX/datacontractresolver/cs/datacontractresolver.cs
index 83cdb23f9b7..57661f5870b 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/datacontractresolver/cs/datacontractresolver.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/datacontractresolver/cs/datacontractresolver.cs
@@ -108,7 +108,7 @@ public MyDataContractResolver(Assembly assembly)
//
// Used at deserialization
- // Allows users to map xsi:type name to any Type
+ // Allows users to map xsi:type name to any Type
public override Type ResolveName(string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver)
{
XmlDictionaryString tName;
@@ -130,7 +130,7 @@ public override bool TryResolveType(Type type, Type declaredType, DataContractRe
{
string name = type.Name;
string namesp = type.Namespace;
- typeName = new XmlDictionaryString(XmlDictionary.Empty, name, 0);
+ typeName = new XmlDictionaryString(XmlDictionary.Empty, name, 0);
typeNamespace = new XmlDictionaryString(XmlDictionary.Empty, namesp, 0);
if (!dictionary.ContainsKey(type.Name))
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/datacontractserializer/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/datacontractserializer/cs/source.cs
index 368c16095af..4022d985b56 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/datacontractserializer/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/datacontractserializer/cs/source.cs
@@ -133,7 +133,7 @@ public string Country
set { Country_value = value; }
}
- // Note that this field is not serialized. Instead, it is
+ // Note that this field is not serialized. Instead, it is
// populated after serialization.
private string Currency_value;
public string Currency
@@ -142,7 +142,7 @@ public string Currency
set { Currency_value = value; }
}
- // Use this method to look up the country and set
+ // Use this method to look up the country and set
// the Currency field after deserialization.
[OnDeserialized]
private void GetLocalRate(StreamingContext sc)
@@ -151,7 +151,7 @@ private void GetLocalRate(StreamingContext sc)
this.Currency = "Yen";
}
- // Implement IExensibleDataObject interface to
+ // Implement IExensibleDataObject interface to
// retain future version information.
private ExtensionDataObject extensionData_Value;
@@ -312,16 +312,16 @@ public static void WriteObjectData(string path)
// Use the writer to start a document.
writer.WriteStartDocument(true);
- // Use the serializer to write the start of the
+ // Use the serializer to write the start of the
// object data. Use it again to write the object
- // data.
+ // data.
ser.WriteStartObject(writer, p);
ser.WriteObjectContent(writer, p);
// Use the writer to add an XML element to the document.
writer.WriteElementString("Citizen", "true");
- // Use the serializer to write the end of the
+ // Use the serializer to write the end of the
// object data. Then use the writer to write the end
// of the document.
ser.WriteEndObject(writer);
@@ -344,7 +344,7 @@ public static void ReadObjectData(string path)
XmlDictionaryReader reader =
XmlDictionaryReader.CreateTextReader(fs, new XmlDictionaryReaderQuotas());
- // Create the DataContractSerializer specifying the type,
+ // Create the DataContractSerializer specifying the type,
// root and namespace to use. The root value corresponds
// to the DataContract.Name value, and the namespace value
// corresponds to the DataContract.Namespace value.
@@ -352,8 +352,8 @@ public static void ReadObjectData(string path)
new DataContractSerializer(typeof(Person),
"Customer", @"http://www.contoso.com");
- // Test if the serializer is on the start of the
- // object data. If so, read the data and write it
+ // Test if the serializer is on the start of the
+ // object data. If so, read the data and write it
// to the console.
while (reader.Read())
{
@@ -445,7 +445,7 @@ public static void Constructor2()
public static void Constructor3()
{
// Create an instance of the DataContractSerializer
- // specifying the type, and name and
+ // specifying the type, and name and
// namespace as strings.
DataContractSerializer ser =
new DataContractSerializer(
@@ -461,7 +461,7 @@ public static void Constructor3()
public static void Constructor4()
{
// Create an instance of the DataContractSerializer
- // specifying the type, and name and
+ // specifying the type, and name and
// namespace as XmlDictionaryString objects.
// Create an XmlDictionary and add values to it.
@@ -533,7 +533,7 @@ public static void Constructor7()
knownTypeList.Add(typeof(PurchaseOrder));
knownTypeList.Add(typeof(PurchaseOrderV3));
- // Create an instance of a class that
+ // Create an instance of a class that
// implements the IDataContractSurrogate interface.
// The implementation code is not shown here.
DCSurrogate mySurrogate = new DCSurrogate();
@@ -559,7 +559,7 @@ public static void Constructor8()
knownTypeList.Add(typeof(PurchaseOrder));
knownTypeList.Add(typeof(PurchaseOrderV3));
- // Create an instance of a class that
+ // Create an instance of a class that
// implements the IDataContractSurrogate interface.
// The implementation code is not shown here.
DCSurrogate mySurrogate = new DCSurrogate();
@@ -593,7 +593,7 @@ public static void Constructor9()
XmlDictionaryString name_value = d.Add("Customer");
XmlDictionaryString ns_value = d.Add("http://www.contoso.com");
- // Create an instance of a class that
+ // Create an instance of a class that
// implements the IDataContractSurrogate interface.
// The implementation code is not shown here.
DCSurrogate mySurrogate = new DCSurrogate();
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/datacontractserializeroperationbehavior/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/datacontractserializeroperationbehavior/cs/source.cs
index f5bd1c48558..cfb7564c56e 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/datacontractserializeroperationbehavior/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/datacontractserializeroperationbehavior/cs/source.cs
@@ -43,7 +43,7 @@ private void DataContractBehavior()
// Change the settings of the behavior.
serializerBehavior.MaxItemsInObjectGraph = 10000;
serializerBehavior.IgnoreExtensionDataObject = true;
-
+
sh.Open();
Console.WriteLine("Listening");
Console.ReadLine();
@@ -69,7 +69,7 @@ private void PrintDescription(ServiceHost sh)
for (c = 0; c < servDesc.Behaviors.Count; c++)
{
servBeh = servDesc.Behaviors[c];
- Console.WriteLine("\t{0}", servBeh.ToString());
+ Console.WriteLine("\t{0}", servBeh.ToString());
}
// Print the endpoint descriptions of the service.
@@ -90,10 +90,10 @@ private void PrintDescription(ServiceHost sh)
Console.WriteLine("\t\tActions:");
for (k = 0; k < opDesc.Messages.Count; k++)
{
- // Print the message action.
+ // Print the message action.
methDesc = opDesc.Messages[k];
Console.WriteLine("\t\t\tAction:{0}", methDesc.Action);
-
+
// Check for the existence of a body, then the body description.
mBodyDesc = methDesc.Body;
if (mBodyDesc.Parts.Count > 0)
@@ -137,7 +137,7 @@ interface ICalculator
[MessageContract(ProtectionLevel = System.Net.Security.ProtectionLevel.Sign)]
public class Calculator : ICalculator
{
-
+
public double Add(double a, double b)
{
return a + b;
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/datamemberattribute/cs/overview.cs b/samples/snippets/csharp/VS_Snippets_CFX/datamemberattribute/cs/overview.cs
index ecfb5bb081d..58f28ea2f6d 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/datamemberattribute/cs/overview.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/datamemberattribute/cs/overview.cs
@@ -11,7 +11,7 @@
class Person : IExtensibleDataObject
{
private string LastNameValue;
- // Apply the DataMemberAttribute to fields (or properties)
+ // Apply the DataMemberAttribute to fields (or properties)
// that must be serialized.
[DataMember()]
public string FirstName;
@@ -26,7 +26,7 @@ public string LastName
[DataMember(Name = "ID")]
public int IdNumber;
- // Note that you can apply the DataMemberAttribute to
+ // Note that you can apply the DataMemberAttribute to
// a private field as well.
[DataMember]
private string Secret;
@@ -39,9 +39,9 @@ public Person(string newfName, string newLName, int newIdNumber)
Secret = newfName + newLName + newIdNumber;
}
- // The extensionDataValue field holds data from future versions
- // of the type. This enables this type to be compatible with
- // future versions. The field is required to implement the
+ // The extensionDataValue field holds data from future versions
+ // of the type. This enables this type to be compatible with
+ // future versions. The field is required to implement the
// IExtensibleDataObject interface.
private ExtensionDataObject extensionDatavalue;
@@ -98,7 +98,7 @@ public static void WriteObject(string filename)
//
public static void ReadObject(string filename)
{
- // Deserialize an instance of the Person class
+ // Deserialize an instance of the Person class
// from an XML file.
FileStream fs = new FileStream(filename,
FileMode.OpenOrCreate);
@@ -138,7 +138,7 @@ public class Employee
[DataMember(EmitDefaultValue = false)]
public int? bonus = null;
- // This will be written as 57800
+ // This will be written as 57800
[DataMember(EmitDefaultValue = false)]
public int targetSalary = 57800;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/client.cs
index ddd5737e182..76a043e6dd7 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/client.cs
@@ -54,7 +54,7 @@ public static void Main()
Console.WriteLine("Press ENTER to exit:");
Console.ReadLine();
- // Done with service.
+ // Done with service.
wcfClient.Close();
Console.WriteLine("Done!");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/proxycode.cs
index c5af2263d91..d4b7a486e69 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/proxycode.cs
@@ -13,19 +13,19 @@
namespace microsoft.wcf.documentation
{
using System.Runtime.Serialization;
-
-
+
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute()]
public partial class OriginalPerson : object, System.Runtime.Serialization.IExtensibleDataObject
{
-
+
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
-
+
private string MessageField;
-
+
private string firstNameField;
-
+
private string lastNameField;
private System.ArgumentException BlobField;
@@ -45,7 +45,7 @@ public System.Runtime.Serialization.ExtensionDataObject ExtensionData
this.extensionDataField = value;
}
}
-
+
[System.Runtime.Serialization.DataMemberAttribute()]
public System.ArgumentException Blob
{
@@ -58,7 +58,7 @@ public System.ArgumentException Blob
this.BlobField = value;
}
}
-
+
[System.Runtime.Serialization.DataMemberAttribute()]
public string Message
{
@@ -71,7 +71,7 @@ public string Message
this.MessageField = value;
}
}
-
+
[System.Runtime.Serialization.DataMemberAttribute()]
public string firstName
{
@@ -84,7 +84,7 @@ public string firstName
this.firstNameField = value;
}
}
-
+
[System.Runtime.Serialization.DataMemberAttribute()]
public string lastName
{
@@ -105,7 +105,7 @@ public string lastName
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="ISampleService")]
public interface ISampleService
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/ISampleService/SampleMethod", ReplyAction="http://microsoft.wcf.documentation/ISampleService/SampleMethodResponse")]
microsoft.wcf.documentation.OriginalPerson SampleMethod(microsoft.wcf.documentation.OriginalPerson personParam);
}
@@ -119,31 +119,31 @@ public interface ISampleServiceChannel : ISampleService, System.ServiceModel.ICl
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class SampleServiceClient : System.ServiceModel.ClientBase, ISampleService
{
-
+
public SampleServiceClient()
{
}
-
- public SampleServiceClient(string endpointConfigurationName) :
+
+ public SampleServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public microsoft.wcf.documentation.OriginalPerson SampleMethod(microsoft.wcf.documentation.OriginalPerson personParam)
{
return base.Channel.SampleMethod(personParam);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/services.cs b/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/services.cs
index 5c9bb8e93ed..07f462deb1f 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/services.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/dcacontainernovalidation/cs/services.cs
@@ -44,7 +44,7 @@ public ExtensionDataObject ExtensionData
}
[ServiceBehaviorAttribute(
- IgnoreExtensionDataObject=false,
+ IgnoreExtensionDataObject=false,
ValidateMustUnderstand=false
)]
class SampleService : ISampleService
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/dynamicactivitycreation/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CFX/dynamicactivitycreation/cs/program.cs
index 5dd72cf190a..7cbb032f6db 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/dynamicactivitycreation/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/dynamicactivitycreation/cs/program.cs
@@ -16,7 +16,7 @@ namespace Microsoft.Samples.DynamicActivityCreation
class Program
{
static void Main(string[] args)
- {
+ {
List numbers = GetInputFromUser(args);
if (numbers != null)
@@ -45,7 +45,7 @@ static void Main(string[] args)
Console.WriteLine();
Console.WriteLine("Press Enter to exit...");
- Console.ReadLine();
+ Console.ReadLine();
}
static List GetInputFromUser(string[] args)
@@ -54,9 +54,9 @@ static List GetInputFromUser(string[] args)
// If there are arguments in the command line use them
if (args.Length > 0)
- {
+ {
try
- {
+ {
numbers.Clear();
foreach (string arg in args)
@@ -89,13 +89,13 @@ static Activity CreateAverageCalculationWorkflow()
// Define the Input and Output arguments that the DynamicActivity binds to
var numbers = new InArgument>();
var average = new OutArgument();
-
+
var result = new Variable() { Name = "result" };
return new DynamicActivity()
{
DisplayName = "Find average",
- Properties =
+ Properties =
{
// Input argument
new DynamicActivityProperty
@@ -120,7 +120,7 @@ static Activity CreateAverageCalculationWorkflow()
{
new ForEach
{
- Values = new ArgumentValue> { ArgumentName = "Numbers" },
+ Values = new ArgumentValue> { ArgumentName = "Numbers" },
Body = new ActivityAction
{
Argument = iterationVariable,
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/calculatorservice.cs b/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/calculatorservice.cs
index 3a24d97139e..05eb2327a6b 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/calculatorservice.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/calculatorservice.cs
@@ -14,10 +14,10 @@
[System.ServiceModel.ServiceContractAttribute(Namespace="Microsoft.WCF.Documentation", ConfigurationName="ICalculator")]
public interface ICalculator
{
-
+
[System.ServiceModel.OperationContractAttribute(ProtectionLevel=System.Net.Security.ProtectionLevel.EncryptAndSign, Action="Microsoft.WCF.Documentation/ICalculator/Add", ReplyAction="Microsoft.WCF.Documentation/ICalculator/AddResponse")]
double Add(double n1, double n2);
-
+
[System.ServiceModel.OperationContractAttribute(ProtectionLevel=System.Net.Security.ProtectionLevel.EncryptAndSign, Action="Microsoft.WCF.Documentation/ICalculator/Subtract", ReplyAction="Microsoft.WCF.Documentation/ICalculator/SubtractResponse")]
double Subtract(double n1, double n2);
}
@@ -31,36 +31,36 @@ public interface ICalculatorChannel : ICalculator, System.ServiceModel.IClientCh
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class CalculatorClient : System.ServiceModel.ClientBase, ICalculator
{
-
+
public CalculatorClient()
{
}
-
- public CalculatorClient(string endpointConfigurationName) :
+
+ public CalculatorClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public CalculatorClient(string endpointConfigurationName, string remoteAddress) :
+
+ public CalculatorClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public CalculatorClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public CalculatorClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public CalculatorClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public CalculatorClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public double Add(double n1, double n2)
{
return base.Channel.Add(n1, n2);
}
-
+
public double Subtract(double n1, double n2)
{
return base.Channel.Subtract(n1, n2);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/client.cs
index 386cf618052..9bf83422f86 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/client.cs
@@ -1,7 +1,7 @@
using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
-
+
public class Client
{
public static void Main()
@@ -19,7 +19,7 @@ public static void Main()
Console.WriteLine("Press ENTER to exit:");
Console.ReadLine();
- // Done with service.
+ // Done with service.
proxy.Close();
Console.WriteLine("Done!");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/snippets.cs b/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/snippets.cs
index 9a31fe6e7c8..c51596836b0 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/snippets.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/endpointaddress/cs/snippets.cs
@@ -14,7 +14,7 @@ namespace Microsoft.WCF.Documentation
{
public class Snippets
{
-
+
public static void Snippet2()
{
// Get base address from app settings in configuration
@@ -26,9 +26,9 @@ public static void Snippet2()
AddressHeader addressHeader2 = AddressHeader.CreateAddressHeader("specialservice2", "http://localhost:8000/service", 2);
AddressHeader[] addressHeaders = new AddressHeader[2] { addressHeader1, addressHeader2 };
-
+
EndpointIdentity endpointIdentity = EndpointIdentity.CreateUpnIdentity(WindowsIdentity.GetCurrent().Name);
-
+
EndpointAddress endpointAddress = new EndpointAddress(
new Uri
("http://localhost:8003/servicemodelsamples/service/incode/identity"),
@@ -46,7 +46,7 @@ public static void Snippet3()
//Create new address headers for special services and add them to an array
AddressHeader addressHeader1 = AddressHeader.CreateAddressHeader("specialservice1", "http://localhost:8000/service", 1);
AddressHeader addressHeader2 = AddressHeader.CreateAddressHeader("specialservice2", "http://localhost:8000/service", 2);
-
+
AddressHeader[] addressHeaders = new AddressHeader[2] { addressHeader1, addressHeader2 };
AddressHeaderCollection addressHeaderColl = new AddressHeaderCollection(addressHeaders);
@@ -58,7 +58,7 @@ public static void Snippet3()
addressHeaderColl);
EndpointIdentity thisEndpointIdentity = endpointAddress.Identity;
//
-
+
//
}
@@ -68,7 +68,7 @@ public static void Snippet4()
AddressHeader addressHeader2 = AddressHeader.CreateAddressHeader("specialservice2", "http://localhost:8000/service", 2);
AddressHeader[] addressHeaders = new AddressHeader[2] { addressHeader1, addressHeader2 };
-
+
EndpointIdentity endpointIdentity = EndpointIdentity.CreateUpnIdentity(WindowsIdentity.GetCurrent().Name);
EndpointAddress endpointAddress = new EndpointAddress(
new Uri("http://localhost:8003/servicemodelsamples/service/incode/identity"), endpointIdentity, addressHeaders);
@@ -84,7 +84,7 @@ public static void Snippet5()
AddressHeader addressHeader2 = AddressHeader.CreateAddressHeader("specialservice2", "http://localhost:8000/service", 2);
AddressHeader[] addressHeaders = new AddressHeader[2] { addressHeader1, addressHeader2 };
-
+
//
EndpointAddress endpointAddress = new EndpointAddress(
new Uri("http://localhost:8003/servicemodelsamples/service/incode/identity"), addressHeaders);
@@ -95,7 +95,7 @@ public static void Snippet5()
Console.WriteLine("The two endpoint addresses are equal");
else
Console.WriteLine("The two endpoint addresses are not equal");
- //
+ //
}
public static void Snippet6()
@@ -120,7 +120,7 @@ public static void Snippet6()
EndpointAddress endpointAddress2 = new EndpointAddress(
new Uri("http://localhost:8003/servicemodelsamples/service/incode/identity"), identity, headers, metadataReader, extensionReader);
- //
+ //
}
public static void Snippet9()
@@ -140,7 +140,7 @@ public static void Snippet9()
Console.WriteLine("The two endpoint addresses are not equal");
else
Console.WriteLine("The two endpoint addresses are equal");
- //
+ //
}
public static void Snippet10()
@@ -161,7 +161,7 @@ public static void Snippet10()
//
XmlDictionaryReader reader = (XmlDictionaryReader) XmlDictionaryReader.Create("addressdata.xml");
EndpointAddress createdEA = EndpointAddress.ReadFrom(reader);
- //
+ //
}
public static void Snippet11()
@@ -174,7 +174,7 @@ public static void Snippet11()
EndpointAddress endpointAddress = new EndpointAddress(
new Uri("http://localhost:8003/servicemodelsamples/service/incode/identity"), addressHeaders);
-
+
XmlWriter writer = XmlWriter.Create("addressdata.xml");
XmlDictionaryWriter dictWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer);
endpointAddress.WriteTo(AddressingVersion.WSAddressing10, dictWriter);
@@ -186,7 +186,7 @@ public static void Snippet11()
XmlDictionaryString xdLocalName = new XmlDictionaryString(XmlDictionary.Empty, "EndpointReference",0);
XmlDictionaryString xdNamespace = new XmlDictionaryString(XmlDictionary.Empty, "http://www.w3.org/2005/08/addressing", 0);
EndpointAddress createdEA = EndpointAddress.ReadFrom(dictReader, xdLocalName, xdNamespace);
- //
+ //
}
public static void Snippet12()
@@ -213,7 +213,7 @@ public static void Snippet12()
dictReader,
"EndpointReference",
"http://www.w3.org/2005/08/addressing");
- //
+ //
}
public static void SnippetAnonymousUri()
@@ -470,7 +470,7 @@ public static void SnippetReadFrom2()
EndpointAddress createdEA = EndpointAddress.ReadFrom
(AddressingVersion.WSAddressing10,
dictReader);
- //
+ //
}
public static void SnippetReadFrom4()
@@ -503,7 +503,7 @@ public static void SnippetReadFrom4()
xdLocalName,
xdNamespace
);
- //
+ //
}
public static void SnippetReadFromVersionToString()
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/enummemberattribute/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/enummemberattribute/cs/source.cs
index b5a7fd402ee..71c42e7d09d 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/enummemberattribute/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/enummemberattribute/cs/source.cs
@@ -114,12 +114,12 @@ private void Serialize(string path)
//
[DataContract]
public enum Shapes
- {
-
+ {
+
[EnumMember(Value="1")]
- Circle,
+ Circle,
[EnumMember(Value="2")]
- Square
+ Square
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/client.cs
index eed7f6b7a4c..9b69f70d6e7 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/client.cs
@@ -20,7 +20,7 @@ public static void Main()
Console.WriteLine("Press ENTER to exit:");
Console.ReadLine();
- // Done with service.
+ // Done with service.
wcfClient.Close();
Console.WriteLine("Done!");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/proxycode.cs
index a2e2e4a88d4..cfe2bbffd67 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/proxycode.cs
@@ -11,17 +11,17 @@
namespace Microsoft.WCF.Documentation
{
using System.Runtime.Serialization;
-
-
+
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute()]
public partial class GreetingFault : object, System.Runtime.Serialization.IExtensibleDataObject
{
-
+
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
-
+
private string MessageField;
-
+
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
@@ -33,7 +33,7 @@ public System.Runtime.Serialization.ExtensionDataObject ExtensionData
this.extensionDataField = value;
}
}
-
+
[System.Runtime.Serialization.DataMemberAttribute()]
public string Message
{
@@ -54,7 +54,7 @@ public string Message
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="ISampleService")]
public interface ISampleService
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/ISampleService/SampleMethod", ReplyAction="http://microsoft.wcf.documentation/ISampleService/SampleMethodResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(Microsoft.WCF.Documentation.GreetingFault), Action="http://www.contoso.com/GreetingFault", Name="GreetingFault", Namespace="http://schemas.datacontract.org/2004/07/Microsoft.WCF.Documentation")]
string SampleMethod(string msg);
@@ -69,31 +69,31 @@ public interface ISampleServiceChannel : ISampleService, System.ServiceModel.ICl
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class SampleServiceClient : System.ServiceModel.ClientBase, ISampleService
{
-
+
public SampleServiceClient()
{
}
-
- public SampleServiceClient(string endpointConfigurationName) :
+
+ public SampleServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public string SampleMethod(string msg)
{
return base.Channel.SampleMethod(msg);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/services.cs b/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/services.cs
index 28a6353e2de..2dad7d0905c 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/services.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/faultcontractattribute/cs/services.cs
@@ -20,10 +20,10 @@ public interface ISampleService{
string SampleMethod(string msg);
//
}
-
+
[DataContractAttribute]
public class GreetingFault
- {
+ {
private string report;
public GreetingFault(string message)
@@ -50,7 +50,7 @@ public string SampleMethod(string msg)
Random rnd = new Random(DateTime.Now.Millisecond);
int test = rnd.Next(5);
if (test % 2 != 0)
- return "The service greets you: " + msg;
+ return "The service greets you: " + msg;
else
//
throw new FaultException(new GreetingFault("A Greeting error occurred. You said: " + msg));
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/filerecordsequence/cs/filerecordsequence.cs b/samples/snippets/csharp/VS_Snippets_CFX/filerecordsequence/cs/filerecordsequence.cs
index d74aa5ce92f..791c923aa39 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/filerecordsequence/cs/filerecordsequence.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/filerecordsequence/cs/filerecordsequence.cs
@@ -29,17 +29,17 @@ public void AppendRecords()
previous = sequence.Append(CreateData("Hello World!"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);
previous = sequence.Append(CreateData("This is my first Logging App"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);
previous = sequence.Append(CreateData("Using FileRecordSequence..."), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);
-
+
Console.WriteLine("Done...");
}
//
-
+
//
- // Read the records added to the log.
+ // Read the records added to the log.
public void ReadRecords()
{
Encoding enc = Encoding.Unicode;
-
+
Console.WriteLine();
Console.WriteLine("Reading Log Records...");
@@ -62,7 +62,7 @@ public void ReadRecords()
}
//
- // Dispose the record sequence and delete the log file.
+ // Dispose the record sequence and delete the log file.
public void Cleanup()
{
// Dispose the sequence
@@ -82,7 +82,7 @@ public void Cleanup()
}
}
- // Converts the given data to Array of ArraSegment
+ // Converts the given data to Array of ArraSegment
public static IList> CreateData(string str)
{
Encoding enc = Encoding.Unicode;
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/freeformactivitydesigner/cs/snippets.cs b/samples/snippets/csharp/VS_Snippets_CFX/freeformactivitydesigner/cs/snippets.cs
index b10b3b7f2c3..a075d5b562a 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/freeformactivitydesigner/cs/snippets.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/freeformactivitydesigner/cs/snippets.cs
@@ -25,7 +25,7 @@ protected override void OnLayoutPosition(ActivityDesignerLayoutEventArgs e)
{
base.OnLayoutPosition(e);
- // Draw a connector between the first and second activities contained in
+ // Draw a connector between the first and second activities contained in
// the sequence activity used by this designer
if (this.IsRootDesigner)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/helloworld/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CFX/helloworld/cs/program.cs
index fd31856b077..1296edca351 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/helloworld/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/helloworld/cs/program.cs
@@ -25,7 +25,7 @@ static Activity CreateWF()
return new Sequence()
{
Variables = { message },
- Activities =
+ Activities =
{
new AppendString()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/client.cs
index babd3308bdd..3b1085791e5 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/client.cs
@@ -1,7 +1,7 @@
using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
-
+
public class Client
{
public static void Main()
@@ -15,7 +15,7 @@ public static void Main()
string greeting = Console.ReadLine();
Console.WriteLine("The service responded: " + wcfClient.SampleMethod(greeting));
- // Done with service.
+ // Done with service.
wcfClient.Close();
Console.WriteLine("Done!");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/proxycode.cs
index 1ee92bab290..93de8084b15 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/icontractbehavior/cs/proxycode.cs
@@ -14,7 +14,7 @@
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="ISampleService")]
public interface ISampleService
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/ISampleService/SampleMethod", ReplyAction="http://microsoft.wcf.documentation/ISampleService/SampleMethodResponse")]
string SampleMethod(string msg);
}
@@ -28,31 +28,31 @@ public interface ISampleServiceChannel : ISampleService, System.ServiceModel.ICl
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class SampleServiceClient : System.ServiceModel.ClientBase, ISampleService
{
-
+
public SampleServiceClient()
{
}
-
- public SampleServiceClient(string endpointConfigurationName) :
+
+ public SampleServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public string SampleMethod(string msg)
{
return base.Channel.SampleMethod(msg);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/idatacontractsurrogate/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/idatacontractsurrogate/cs/source.cs
index 42d40b369b5..18a5a2420a1 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/idatacontractsurrogate/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/idatacontractsurrogate/cs/source.cs
@@ -16,22 +16,22 @@ static void Main(string[] args)
SerializeWithSurrogate("surrogateEmployee.xml");
DeserializeSurrogate("surrogateEmployee.xml");
// Create an XmlSchemaSet to hold schemas from the
- // schema exporter.
+ // schema exporter.
//XmlSchemaSet schemas = new XmlSchemaSet();
//ExportSchemas("surrogateEmployee.xml", ref schemas);
//// Pass the schemas to the importer.
//ImportSchemas(schemas);
}
- static DataContractSerializer CreateSurrogateSerializer()
+ static DataContractSerializer CreateSurrogateSerializer()
{
- // Create an instance of the DataContractSerializer. The
- // constructor demands a knownTypes and surrogate.
- // Create a Generic List for the knownTypes.
+ // Create an instance of the DataContractSerializer. The
+ // constructor demands a knownTypes and surrogate.
+ // Create a Generic List for the knownTypes.
List knownTypes = new List();
LegacyPersonTypeSurrogate surrogate = new LegacyPersonTypeSurrogate ();
- DataContractSerializer surrogateSerializer =
- new DataContractSerializer(typeof(Employee),
+ DataContractSerializer surrogateSerializer =
+ new DataContractSerializer(typeof(Employee),
knownTypes, Int16.MaxValue, false, true, surrogate);
return surrogateSerializer;
}
@@ -50,7 +50,7 @@ static void SerializeWithSurrogate(string filename )
emp.person.last_name = "Ray";
emp.person.age = 44;
- // Create a new writer. Then serialize with the
+ // Create a new writer. Then serialize with the
// surrogate serializer.
FileStream fs =new FileStream(filename, FileMode.Create);
DataContractSerializer surrogateSerializer = CreateSurrogateSerializer();
@@ -69,7 +69,7 @@ static void DeserializeSurrogate( string filename )
{
// Create a new reader object.
FileStream fs2 = new FileStream(filename, FileMode.Open);
- XmlDictionaryReader reader =
+ XmlDictionaryReader reader =
XmlDictionaryReader.CreateTextReader(fs2, new XmlDictionaryReaderQuotas());
Console.WriteLine("Trying to deserialize with surrogate.");
@@ -115,19 +115,19 @@ static void ExportSchemas(string filename , ref XmlSchemaSet schemas)
{
sch.Write(fs3);
}
- }
+ }
}
static void ImportSchemas(XmlSchemaSet schemas ){
Console.WriteLine("Now doing schema import.");
- // The following code demonstrates schema import with
- // a surrogate. The surrogate is used to indicate that
- // the Person class already exists and that there is no
+ // The following code demonstrates schema import with
+ // a surrogate. The surrogate is used to indicate that
+ // the Person class already exists and that there is no
// need to generate a new class when importing the
- // PersonSurrogated data contract. If the surrogate
- // was not used, schema import would generate a
- // PersonSurrogated class, and the person field
- // of Employee would be imported as
+ // PersonSurrogated data contract. If the surrogate
+ // was not used, schema import would generate a
+ // PersonSurrogated class, and the person field
+ // of Employee would be imported as
// PersonSurrogated and not Person.
XsdDataContractImporter xsdimp = new XsdDataContractImporter();
xsdimp.Options = new ImportOptions();
@@ -159,10 +159,10 @@ static void ImportSchemas(XmlSchemaSet schemas ){
// This is the Employee (outer) type used in the sample.
-[DataContract()]
+[DataContract()]
public class Employee
{
- [DataMember()]
+ [DataMember()]
public DateTime date_hired ;
[DataMember()]
@@ -186,7 +186,7 @@ public class Person
[XmlAttribute("Age")]
public Int16 age ;
- public Person() {}
+ public Person() {}
}
// This is the surrogated version of the Person type
@@ -194,7 +194,7 @@ public Person() {}
[DataContract] class PersonSurrogated
{
- // xmlData will store the XML returned for a Person instance
+ // xmlData will store the XML returned for a Person instance
// by the XmlSerializer.
[DataMember()]
public string xmlData;
@@ -204,14 +204,14 @@ [DataContract] class PersonSurrogated
public class LegacyPersonTypeSurrogate:IDataContractSurrogate
{
//
- public Type GetDataContractType(Type type)
+ public Type GetDataContractType(Type type)
{
Console.WriteLine("GetDataContractType invoked");
Console.WriteLine("\t type name: {0}", type.Name);
// "Person" will be serialized as "PersonSurrogated"
// This method is called during serialization,
// deserialization, and schema export.
- if (typeof(Person).IsAssignableFrom(type))
+ if (typeof(Person).IsAssignableFrom(type))
{
Console.WriteLine("\t returning PersonSurrogated");
return typeof(PersonSurrogated);
@@ -222,7 +222,7 @@ public Type GetDataContractType(Type type)
//
public object GetObjectToSerialize(object obj, Type targetType)
-{
+{
Console.WriteLine("GetObjectToSerialize Invoked");
Console.WriteLine("\t type name: {0}", obj.ToString());
Console.WriteLine("\t target type: {0}", targetType.Name);
@@ -244,7 +244,7 @@ public object GetObjectToSerialize(object obj, Type targetType)
//
//
- public object GetDeserializedObject(Object obj , Type targetType)
+ public object GetDeserializedObject(Object obj , Type targetType)
{
Console.WriteLine("GetDeserializedObject invoked");
// This method is called on deserialization.
@@ -266,28 +266,28 @@ public Type GetReferencedTypeOnImport(string typeName,
{
Console.WriteLine("GetReferencedTypeOnImport invoked");
// This method is called on schema import.
- // If a PersonSurrogated data contract is
- // in the specified namespace, do not create a new type for it
+ // If a PersonSurrogated data contract is
+ // in the specified namespace, do not create a new type for it
// because there is already an existing type, "Person".
Console.WriteLine( "\t Type Name: {0}", typeName);
-
+
if (typeName.Equals("PersonSurrogated") )
{
Console.WriteLine("Returning Person");
return typeof(Person);
- }
+ }
return null;
}
//
public System.CodeDom.CodeTypeDeclaration ProcessImportedType(
- System.CodeDom.CodeTypeDeclaration typeDeclaration,
+ System.CodeDom.CodeTypeDeclaration typeDeclaration,
System.CodeDom.CodeCompileUnit compileUnit)
{
// Console.WriteLine("ProcessImportedType invoked")
// Not used in this sample.
- // You could use this method to construct an entirely new CLR
- // type when a certain type is imported, or modify a
+ // You could use this method to construct an entirely new CLR
+ // type when a certain type is imported, or modify a
// generated type in some way.
return typeDeclaration;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/client.cs
index 56a9a308b17..8ccd938cd05 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/client.cs
@@ -5,7 +5,7 @@
using microsoft.wcf.documentation;
// for the client behavior
using Microsoft.WCF.Documentation;
-
+
//
public class Client
{
@@ -26,7 +26,7 @@ public static void Main()
Console.WriteLine("Press ENTER to exit:");
Console.ReadLine();
- // Done with service.
+ // Done with service.
wcfClient.Close();
Console.WriteLine("Done!");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/proxycode.cs
index 2636ba7e139..8cdc0d625ae 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/proxycode.cs
@@ -13,17 +13,17 @@
namespace microsoft.wcf.documentation
{
using System.Runtime.Serialization;
-
-
+
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute()]
public partial class SampleFault : object, System.Runtime.Serialization.IExtensibleDataObject
{
-
+
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
-
+
private string FaultMessageField;
-
+
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
@@ -35,7 +35,7 @@ public System.Runtime.Serialization.ExtensionDataObject ExtensionData
this.extensionDataField = value;
}
}
-
+
[System.Runtime.Serialization.DataMemberAttribute()]
public string FaultMessage
{
@@ -56,7 +56,7 @@ public string FaultMessage
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation")]
public interface ISampleService
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/ISampleService/SampleMethod", ReplyAction="http://microsoft.wcf.documentation/ISampleService/SampleMethodResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(microsoft.wcf.documentation.SampleFault), Action="http://microsoft.wcf.documentation/ISampleService/SampleMethodSampleFaultFault")]
string SampleMethod(string msg);
@@ -70,31 +70,31 @@ public interface ISampleServiceChannel : ISampleService, System.ServiceModel.ICl
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class SampleServiceClient : System.ServiceModel.ClientBase, ISampleService
{
-
+
public SampleServiceClient()
{
}
-
- public SampleServiceClient(string endpointConfigurationName) :
+
+ public SampleServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public string SampleMethod(string msg)
{
return base.Channel.SampleMethod(msg);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/client.cs
index b0a3a6f8b64..c5d1a2bd764 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/client.cs
@@ -33,11 +33,11 @@ public static void Main()
wcfClient.Abort();
}
// Catch unrecognized faults. This handler receives exceptions thrown by WCF
- // services when ServiceDebugBehavior.IncludeExceptionDetailInFaults
+ // services when ServiceDebugBehavior.IncludeExceptionDetailInFaults
// is set to true.
catch (FaultException faultEx)
{
- Console.WriteLine("An unknown exception was received. "
+ Console.WriteLine("An unknown exception was received. "
+ faultEx.Message
+ faultEx.StackTrace
);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/ierrorhandler.cs b/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/ierrorhandler.cs
index d125ea690e0..bfb6031847e 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/ierrorhandler.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/ierrorhandler.cs
@@ -39,12 +39,12 @@ ref Message msg
)
{
Console.WriteLine("ProvideFault called. Converting Exception to GreetingFault....");
- FaultException fe
+ FaultException fe
= new FaultException(new GreetingFault(error.Message));
MessageFault fault = fe.CreateMessageFault();
msg = Message.CreateMessage(
- ver,
- fault,
+ ver,
+ fault,
"http://microsoft.wcf.documentation/ISampleService/SampleMethodGreetingFaultFault"
);
}
@@ -55,23 +55,23 @@ FaultException fe
// This behavior modifies no binding parameters.
#region IServiceBehavior Members
public void AddBindingParameters(
- ServiceDescription description,
- ServiceHostBase serviceHostBase,
- System.Collections.ObjectModel.Collection endpoints,
+ ServiceDescription description,
+ ServiceHostBase serviceHostBase,
+ System.Collections.ObjectModel.Collection endpoints,
System.ServiceModel.Channels.BindingParameterCollection parameters
)
{
return;
}
- // This behavior is an IErrorHandler implementation and
+ // This behavior is an IErrorHandler implementation and
// must be applied to each ChannelDispatcher.
public void ApplyDispatchBehavior(ServiceDescription description, ServiceHostBase serviceHostBase)
{
Console.WriteLine("The EnforceGreetingFaultBehavior has been applied.");
foreach(ChannelDispatcher chanDisp in serviceHostBase.ChannelDispatchers)
{
- chanDisp.ErrorHandlers.Add(this);
+ chanDisp.ErrorHandlers.Add(this);
}
}
@@ -89,7 +89,7 @@ public void Validate(ServiceDescription description, ServiceHostBase serviceHost
{
if (opDesc.Faults.Count == 0)
throw new InvalidOperationException(String.Format(
- "EnforceGreetingFaultBehavior requires a "
+ "EnforceGreetingFaultBehavior requires a "
+ "FaultContractAttribute(typeof(GreetingFault)) in each operation contract. "
+ "The \"{0}\" operation contains no FaultContractAttribute.",
opDesc.Name)
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/proxycode.cs
index 240dd8986aa..151d5da2c6f 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/proxycode.cs
@@ -11,17 +11,17 @@
namespace Microsoft.WCF.Documentation
{
using System.Runtime.Serialization;
-
-
+
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute()]
public partial class GreetingFault : object, System.Runtime.Serialization.IExtensibleDataObject
{
-
+
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
-
+
private string MessageField;
-
+
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
@@ -33,7 +33,7 @@ public System.Runtime.Serialization.ExtensionDataObject ExtensionData
this.extensionDataField = value;
}
}
-
+
[System.Runtime.Serialization.DataMemberAttribute()]
public string Message
{
@@ -54,7 +54,7 @@ public string Message
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="ISampleService")]
public interface ISampleService
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/ISampleService/SampleMethod", ReplyAction="http://microsoft.wcf.documentation/ISampleService/SampleMethodResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(Microsoft.WCF.Documentation.GreetingFault), Action="http://microsoft.wcf.documentation/ISampleService/SampleMethodGreetingFaultFault")]
string SampleMethod(string msg);
@@ -69,31 +69,31 @@ public interface ISampleServiceChannel : ISampleService, System.ServiceModel.ICl
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class SampleServiceClient : System.ServiceModel.ClientBase, ISampleService
{
-
+
public SampleServiceClient()
{
}
-
- public SampleServiceClient(string endpointConfigurationName) :
+
+ public SampleServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public string SampleMethod(string msg)
{
return base.Channel.SampleMethod(msg);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/services.cs b/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/services.cs
index b636a21953a..7b0327ec9d2 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/services.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/ierrorhandler/cs/services.cs
@@ -13,10 +13,10 @@ public interface ISampleService{
[FaultContractAttribute(typeof(GreetingFault))]
string SampleMethod(string msg);
}
-
+
[DataContractAttribute]
public class GreetingFault
- {
+ {
private string report;
public GreetingFault(string message)
@@ -37,7 +37,7 @@ class SampleService : ISampleService
public string SampleMethod(string msg)
{
Console.WriteLine("Client said: " + msg);
- // Note: Not a contractually specified exception. If
+ // Note: Not a contractually specified exception. If
// ServiceBehaviorAttribute.IncludeExceptionDetailInFaults is set to true,
// this fault is experienced on a WCF client as a FaultException.
throw new Exception("A Greeting error occurred. You said: " + msg);
@@ -47,7 +47,7 @@ public string SampleMethod(string msg)
//
/*
-The service output is:
+The service output is:
EnforceGreetingFaultBehavior created.
Validate is called.
@@ -59,9 +59,9 @@ ProvideFault called. Converting Exception to GreetingFault....
HandleError called.
And the client output is:
-
+
Enter the greeting to send:
Why Hello there!
A Greeting error occurred. You said: Why Hello there!
Done!
-*/ //
+*/ //
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/client.cs
index cb80dff9d6f..15935b1137a 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/client.cs
@@ -3,7 +3,7 @@
using System.ServiceModel.Channels;
using microsoft.wcf.documentation;
-
+
public class Client
{
public static void Main()
@@ -20,7 +20,7 @@ public static void Main()
Console.WriteLine("Press ENTER to exit:");
Console.ReadLine();
- // Done with service.
+ // Done with service.
wcfClient.Close();
Console.WriteLine("Done!");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/insertingbehaviors.cs b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/insertingbehaviors.cs
index 15ad2e13eff..5bfa0eb242e 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/insertingbehaviors.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/insertingbehaviors.cs
@@ -15,9 +15,9 @@ public class InspectorInserter : BehaviorExtensionElement, IServiceBehavior, IEn
#region IServiceBehavior Members
public void AddBindingParameters(
- ServiceDescription serviceDescription,
- ServiceHostBase serviceHostBase,
- System.Collections.ObjectModel.Collection endpoints,
+ ServiceDescription serviceDescription,
+ ServiceHostBase serviceHostBase,
+ System.Collections.ObjectModel.Collection endpoints,
BindingParameterCollection bindingParameters
)
{ return; }
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/interactivechannelinitializer.cs b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/interactivechannelinitializer.cs
index aaeb473b220..1e88bd61678 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/interactivechannelinitializer.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/interactivechannelinitializer.cs
@@ -13,17 +13,17 @@ public class InteractiveChannelInitializer : IInteractiveChannelInitializer
{
#region IInteractiveChannelInitializer Members
/*
- To implement IInteractiveChannelInitializer, perform the following steps
+ To implement IInteractiveChannelInitializer, perform the following steps
in IInteractiveChannelInitializer.BeginDisplayInitializationUI:
- 1. Prompt the user and obtain an appropriate System.Net.NetworkCredential.
- 2. Add a custom channel parameter object to the collection returned by the
- IChannel.GetProperty method on the IClientChannel object with a type
- parameter of System.ServiceModel.Channels.ChannelParameterCollection.
- This channel parameter object is used by the custom
- System.ServiceModel.ClientCredentialsSecurityTokenManager to establish
+ 1. Prompt the user and obtain an appropriate System.Net.NetworkCredential.
+ 2. Add a custom channel parameter object to the collection returned by the
+ IChannel.GetProperty method on the IClientChannel object with a type
+ parameter of System.ServiceModel.Channels.ChannelParameterCollection.
+ This channel parameter object is used by the custom
+ System.ServiceModel.ClientCredentialsSecurityTokenManager to establish
the security tokens for the channel.
- 3. Return.
+ 3. Return.
*/
public IAsyncResult BeginDisplayInitializationUI(System.ServiceModel.IClientChannel channel, AsyncCallback callback, object state)
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/interceptors.cs b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/interceptors.cs
index 9d07d158585..0a2a0e20c90 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/interceptors.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/interceptors.cs
@@ -29,8 +29,8 @@ public void BeforeSendReply(ref System.ServiceModel.Channels.Message reply, obje
public void AfterCall(string operationName, object[] outputs, object returnValue, object correlationState)
{
Console.WriteLine(
- "IParameterInspector.AfterCall called for {0} with return value {1}.",
- operationName,
+ "IParameterInspector.AfterCall called for {0} with return value {1}.",
+ operationName,
returnValue.ToString()
);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/proxycode.cs
index d94d0ba1aea..8360cd94cac 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/iinteractivechannelinitializer/cs/proxycode.cs
@@ -13,17 +13,17 @@
namespace microsoft.wcf.documentation
{
using System.Runtime.Serialization;
-
-
+
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute()]
public partial class SampleFault : object, System.Runtime.Serialization.IExtensibleDataObject
{
-
+
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
-
+
private string FaultMessageField;
-
+
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
@@ -35,7 +35,7 @@ public System.Runtime.Serialization.ExtensionDataObject ExtensionData
this.extensionDataField = value;
}
}
-
+
[System.Runtime.Serialization.DataMemberAttribute()]
public string FaultMessage
{
@@ -56,7 +56,7 @@ public string FaultMessage
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="ISampleService")]
public interface ISampleService
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/ISampleService/SampleMethod", ReplyAction="http://microsoft.wcf.documentation/ISampleService/SampleMethodResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(microsoft.wcf.documentation.SampleFault), Action="http://microsoft.wcf.documentation/ISampleService/SampleMethodSampleFaultFault", Name="SampleFault")]
string SampleMethod(string msg);
@@ -71,31 +71,31 @@ public interface ISampleServiceChannel : ISampleService, System.ServiceModel.ICl
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class SampleServiceClient : System.ServiceModel.ClientBase, ISampleService
{
-
+
public SampleServiceClient()
{
}
-
- public SampleServiceClient(string endpointConfigurationName) :
+
+ public SampleServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public string SampleMethod(string msg)
{
return base.Channel.SampleMethod(msg);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/client.cs
index cb80dff9d6f..15935b1137a 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/client.cs
@@ -3,7 +3,7 @@
using System.ServiceModel.Channels;
using microsoft.wcf.documentation;
-
+
public class Client
{
public static void Main()
@@ -20,7 +20,7 @@ public static void Main()
Console.WriteLine("Press ENTER to exit:");
Console.ReadLine();
- // Done with service.
+ // Done with service.
wcfClient.Close();
Console.WriteLine("Done!");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/insertingbehaviors.cs b/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/insertingbehaviors.cs
index ead7016b76a..de633e904f2 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/insertingbehaviors.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/insertingbehaviors.cs
@@ -15,9 +15,9 @@ public class InspectorInserter : BehaviorExtensionElement, IServiceBehavior, IEn
//
#region IServiceBehavior Members
public void AddBindingParameters(
- ServiceDescription serviceDescription,
- ServiceHostBase serviceHostBase,
- System.Collections.ObjectModel.Collection endpoints,
+ ServiceDescription serviceDescription,
+ ServiceHostBase serviceHostBase,
+ System.Collections.ObjectModel.Collection endpoints,
BindingParameterCollection bindingParameters
)
{ return; }
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/interceptors.cs b/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/interceptors.cs
index 8bb4cb9fbda..a1a58ab727d 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/interceptors.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/interceptors.cs
@@ -29,8 +29,8 @@ public void BeforeSendReply(ref System.ServiceModel.Channels.Message reply, obje
public void AfterCall(string operationName, object[] outputs, object returnValue, object correlationState)
{
Console.WriteLine(
- "IParameterInspector.AfterCall called for {0} with return value {1}.",
- operationName,
+ "IParameterInspector.AfterCall called for {0} with return value {1}.",
+ operationName,
returnValue.ToString()
);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/proxycode.cs
index d94d0ba1aea..8360cd94cac 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/interceptors/cs/proxycode.cs
@@ -13,17 +13,17 @@
namespace microsoft.wcf.documentation
{
using System.Runtime.Serialization;
-
-
+
+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute()]
public partial class SampleFault : object, System.Runtime.Serialization.IExtensibleDataObject
{
-
+
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
-
+
private string FaultMessageField;
-
+
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
@@ -35,7 +35,7 @@ public System.Runtime.Serialization.ExtensionDataObject ExtensionData
this.extensionDataField = value;
}
}
-
+
[System.Runtime.Serialization.DataMemberAttribute()]
public string FaultMessage
{
@@ -56,7 +56,7 @@ public string FaultMessage
[System.ServiceModel.ServiceContractAttribute(Namespace="http://microsoft.wcf.documentation", ConfigurationName="ISampleService")]
public interface ISampleService
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://microsoft.wcf.documentation/ISampleService/SampleMethod", ReplyAction="http://microsoft.wcf.documentation/ISampleService/SampleMethodResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(microsoft.wcf.documentation.SampleFault), Action="http://microsoft.wcf.documentation/ISampleService/SampleMethodSampleFaultFault", Name="SampleFault")]
string SampleMethod(string msg);
@@ -71,31 +71,31 @@ public interface ISampleServiceChannel : ISampleService, System.ServiceModel.ICl
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class SampleServiceClient : System.ServiceModel.ClientBase, ISampleService
{
-
+
public SampleServiceClient()
{
}
-
- public SampleServiceClient(string endpointConfigurationName) :
+
+ public SampleServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public string SampleMethod(string msg)
{
return base.Channel.SampleMethod(msg);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/invaliddatacontractexception/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/invaliddatacontractexception/cs/source.cs
index 9ab64fe1671..0e022573a35 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/invaliddatacontractexception/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/invaliddatacontractexception/cs/source.cs
@@ -11,7 +11,7 @@
namespace Example
{
- //
+ //
public class Test
{
static void Main()
@@ -21,7 +21,7 @@ static void Main()
Test t = new Test();
t.Run();
}
-
+
// Catch the InvalidDataContractException here.
catch(InvalidDataContractException iExc)
{
@@ -43,7 +43,7 @@ private void Run()
WSHttpBinding b = new WSHttpBinding(SecurityMode.Message);
// Create a ServiceHost instance, and add a metadata endpoint.
- Uri baseUri= new Uri("http://localhost:1008/");
+ Uri baseUri= new Uri("http://localhost:1008/");
ServiceHost sh = new ServiceHost(typeof(Calculator), baseUri);
// Optional. Add a metadata endpoint. The method is defined below.
@@ -52,7 +52,7 @@ private void Run()
// Add an endpoint using the binding, and open the service.
sh.AddServiceEndpoint(typeof(ICalculator), b, "myCalculator");
sh.Open();
-
+
Console.WriteLine("Listening...");
Console.ReadLine();
}
@@ -66,7 +66,7 @@ private void AddMetadataEndpoint(ref ServiceHost sh)
sh.Description.Behaviors.Add(sm);
}
}
-
+
// This class will cause an InvalidDataContractException to be thrown because
// neither the DataContractAttribute nor DataMemberAttribute has been applied to it.
public class ExtraData
@@ -85,7 +85,7 @@ interface ICalculator
}
public class Calculator : ICalculator
- {
+ {
public double Add(double a, double b)
{
return a + b;
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/irecordsequence/cs/readrecord.cs b/samples/snippets/csharp/VS_Snippets_CFX/irecordsequence/cs/readrecord.cs
index b832eec08e2..f5dbe52623d 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/irecordsequence/cs/readrecord.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/irecordsequence/cs/readrecord.cs
@@ -1,7 +1,7 @@
//
-using System;
-using System.IO;
+using System;
+using System.IO;
using System.IO.Log;
using System.Collections.Generic;
using System.Text;
@@ -9,46 +9,46 @@
namespace MyFileRecordSequence
{
-class ReadRecordsSample
+class ReadRecordsSample
{
- static SequenceNumber AppendRecord(IRecordSequence sequence, string message, SequenceNumber user, SequenceNumber previous)
- {
+ static SequenceNumber AppendRecord(IRecordSequence sequence, string message, SequenceNumber user, SequenceNumber previous)
+ {
MemoryStream data = new MemoryStream();
- BinaryWriter writer = new BinaryWriter(data);
- writer.Write(message); ArraySegment[] segments;
- segments = new ArraySegment[1];
- segments[0] = new ArraySegment(data.GetBuffer(), 0, (int)data.Length);
- return sequence.Append(segments, user, previous,RecordAppendOptions.None);
- }
- public static void Main(string[] args)
- {
- IRecordSequence sequence;
- sequence = new FileRecordSequence(args[0]);
- SequenceNumber a, b, c, d;
- a = AppendRecord(sequence, "This is record A", SequenceNumber.Invalid, SequenceNumber.Invalid);
- Console.WriteLine("Record A has sequence number System.IO.Log", a);
- b = AppendRecord(sequence, "This is record B", a, a);
+ BinaryWriter writer = new BinaryWriter(data);
+ writer.Write(message); ArraySegment[] segments;
+ segments = new ArraySegment[1];
+ segments[0] = new ArraySegment(data.GetBuffer(), 0, (int)data.Length);
+ return sequence.Append(segments, user, previous,RecordAppendOptions.None);
+ }
+ public static void Main(string[] args)
+ {
+ IRecordSequence sequence;
+ sequence = new FileRecordSequence(args[0]);
+ SequenceNumber a, b, c, d;
+ a = AppendRecord(sequence, "This is record A", SequenceNumber.Invalid, SequenceNumber.Invalid);
+ Console.WriteLine("Record A has sequence number System.IO.Log", a);
+ b = AppendRecord(sequence, "This is record B", a, a);
Console.WriteLine("Record B has sequence number System.IO.Log", b);
- c = AppendRecord(sequence, "This is record C", a, a);
- Console.WriteLine("Record C has sequence number System.IO.Log", c);
- d = AppendRecord(sequence, "This is record D", b, c);
- Console.WriteLine("Record D has sequence number System.IO.Log", d);
- foreach(LogRecord record in sequence.ReadLogRecords(a,LogRecordEnumeratorType.Next))
- {
- BinaryReader reader = new BinaryReader(record.Data);
+ c = AppendRecord(sequence, "This is record C", a, a);
+ Console.WriteLine("Record C has sequence number System.IO.Log", c);
+ d = AppendRecord(sequence, "This is record D", b, c);
+ Console.WriteLine("Record D has sequence number System.IO.Log", d);
+ foreach(LogRecord record in sequence.ReadLogRecords(a,LogRecordEnumeratorType.Next))
+ {
+ BinaryReader reader = new BinaryReader(record.Data);
Console.WriteLine("System.IO.Log: T:System.IO.Log.IRecordSequence", record.SequenceNumber, reader.ReadString());
- }
- foreach(LogRecord record in sequence.ReadLogRecords(d, LogRecordEnumeratorType.User))
- {
- BinaryReader reader = new BinaryReader(record.Data);
- Console.WriteLine("System.IO.Log: T:System.IO.Log.IRecordSequence", record.SequenceNumber, reader.ReadString());
- }
- foreach(LogRecord record in sequence.ReadLogRecords(d, LogRecordEnumeratorType.Previous))
- {
- BinaryReader reader = new BinaryReader(record.Data);
- Console.WriteLine("System.IO.Log: T:System.IO.Log.IRecordSequence", record.SequenceNumber, reader.ReadString());
- }
- }
+ }
+ foreach(LogRecord record in sequence.ReadLogRecords(d, LogRecordEnumeratorType.User))
+ {
+ BinaryReader reader = new BinaryReader(record.Data);
+ Console.WriteLine("System.IO.Log: T:System.IO.Log.IRecordSequence", record.SequenceNumber, reader.ReadString());
+ }
+ foreach(LogRecord record in sequence.ReadLogRecords(d, LogRecordEnumeratorType.Previous))
+ {
+ BinaryReader reader = new BinaryReader(record.Data);
+ Console.WriteLine("System.IO.Log: T:System.IO.Log.IRecordSequence", record.SequenceNumber, reader.ReadString());
+ }
+ }
}
//
@@ -81,9 +81,9 @@ public void AppendRecords()
Console.WriteLine("Done...");
}
//
-
+
//
- // Read the records added to the log.
+ // Read the records added to the log.
public void ReadRecords()
{
Encoding enc = Encoding.Unicode;
@@ -110,7 +110,7 @@ public void ReadRecords()
}
//
- // Dispose the record sequence and delete the log file.
+ // Dispose the record sequence and delete the log file.
public void Cleanup()
{
// Dispose the sequence.
@@ -130,7 +130,7 @@ public void Cleanup()
}
}
- // Converts the given data to an Array of ArraySegment
+ // Converts the given data to an Array of ArraySegment
public static IList> CreateData(string str)
{
Encoding enc = Encoding.Unicode;
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/isafeserializationdata/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CFX/isafeserializationdata/cs/source.cs
index 65f1497c264..7c2a30226e4 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/isafeserializationdata/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/isafeserializationdata/cs/source.cs
@@ -6,8 +6,8 @@
using System.Runtime.Serialization.Formatters.Soap;
using System.Security;
-// [assembly: SecurityCritical(SecurityCriticalScope.Everything)]
-// Using the SecurityCriticalAttribute prohibits usage of the
+// [assembly: SecurityCritical(SecurityCriticalScope.Everything)]
+// Using the SecurityCriticalAttribute prohibits usage of the
// ISafeSerializationData interface.
[assembly: AllowPartiallyTrustedCallers]
namespace ISafeSerializationDataExample
@@ -18,7 +18,7 @@ public static void Main()
{
try
{
- // This code forces a division by 0 and catches the
+ // This code forces a division by 0 and catches the
// resulting exception.
try
{
@@ -75,7 +75,7 @@ public static void Main()
[Serializable]
public class NewException : Exception
{
- // Because we don't want the exception state to be serialized normally,
+ // Because we don't want the exception state to be serialized normally,
// we take care of that in the constructor.
[NonSerialized]
private NewExceptionState m_state = new NewExceptionState();
@@ -86,10 +86,10 @@ public NewException(string stringData, int intData)
m_state.StringData = stringData;
m_state.IntData = intData;
- // In response to SerializeObjectState, we need to provide
- // any state to serialize with the exception. In this
+ // In response to SerializeObjectState, we need to provide
+ // any state to serialize with the exception. In this
// case, since our state is already stored in an
- // ISafeSerializationData implementation, we can
+ // ISafeSerializationData implementation, we can
// just provide that.
SerializeObjectState += delegate(object exception,
@@ -97,14 +97,14 @@ public NewException(string stringData, int intData)
{
eventArgs.AddSerializedState(m_state);
};
- // An alternate implementation would be to store the state
- // as local member variables, and in response to this
+ // An alternate implementation would be to store the state
+ // as local member variables, and in response to this
// method create a new instance of an ISafeSerializationData
- // object and populate it with the local state here before
- // passing it through to AddSerializedState.
+ // object and populate it with the local state here before
+ // passing it through to AddSerializedState.
}
- // There is no need to supply a deserialization constructor
- // (with SerializationInfo and StreamingContext parameters),
+ // There is no need to supply a deserialization constructor
+ // (with SerializationInfo and StreamingContext parameters),
// and no need to supply a GetObjectData implementation.
// Data access is through the state object (m_State).
@@ -118,10 +118,10 @@ public int IntData
get { return m_state.IntData; }
}
- // Implement the ISafeSerializationData interface
- // to contain custom exception data in a partially trusted
- // assembly. Use this interface to replace the
- // Exception.GetObjectData method,
+ // Implement the ISafeSerializationData interface
+ // to contain custom exception data in a partially trusted
+ // assembly. Use this interface to replace the
+ // Exception.GetObjectData method,
// which is now marked with the SecurityCriticalAttribute.
[Serializable]
private struct NewExceptionState : ISafeSerializationData
@@ -142,14 +142,14 @@ public int IntData
}
//
- // This method is called when deserialization of the
+ // This method is called when deserialization of the
// exception is complete.
void ISafeSerializationData.CompleteDeserialization
(object obj)
{
- // Since the exception simply contains an instance of
- // the exception state object, we can repopulate it
- // here by just setting its instance field to be equal
+ // Since the exception simply contains an instance of
+ // the exception state object, we can repopulate it
+ // here by just setting its instance field to be equal
// to this deserialized state instance.
NewException exception = obj as NewException;
exception.m_state = this;
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/iunknownserializationdata/cs/iunknownserialization.cs b/samples/snippets/csharp/VS_Snippets_CFX/iunknownserializationdata/cs/iunknownserialization.cs
index 9e0e78a5beb..f8e99df813c 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/iunknownserializationdata/cs/iunknownserialization.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/iunknownserializationdata/cs/iunknownserialization.cs
@@ -8,9 +8,9 @@ namespace IExtensibleDataObjectExample
using System.Xml;
using System.Runtime.Serialization;
using System.IO;
-
+
//
- // Implement the IExtensibleDataObject interface
+ // Implement the IExtensibleDataObject interface
// to store the extra data for future versions.
[DataContract(
Name = "Person",
@@ -37,11 +37,11 @@ public ExtensionDataObject ExtensionData
public string Name;
}
- // The second version of the class adds a new field. The field's
+ // The second version of the class adds a new field. The field's
// data is stored in the ExtensionDataObject field of
- // the first version (Person). You must also set the Name property
- // of the DataContractAttribute to match the first version.
- // If necessary, also set the Namespace property so that the
+ // the first version (Person). You must also set the Name property
+ // of the DataContractAttribute to match the first version.
+ // If necessary, also set the Namespace property so that the
// name of the contracts is the same.
[DataContract(Name = "Person",
Namespace = "http://www.cohowinery.com/employees")]
@@ -93,8 +93,8 @@ public static void Main()
}
}
- // Create an instance of the version 2.0 class. It has
- // extra data (ID field) that version 1.0 does
+ // Create an instance of the version 2.0 class. It has
+ // extra data (ID field) that version 1.0 does
// not understand.
static void WriteVersion2(string path)
{
@@ -148,7 +148,7 @@ static void WriteToVersion1(string path)
fs.Close();
}
- // Deserialize a version 2.0 object.
+ // Deserialize a version 2.0 object.
public static void ReadVersion2(string path)
{
FileStream fs = new FileStream(path, FileMode.Open);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/knowntypeattribute/cs/overview.cs b/samples/snippets/csharp/VS_Snippets_CFX/knowntypeattribute/cs/overview.cs
index 56502033cfb..287222ad3a4 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/knowntypeattribute/cs/overview.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/knowntypeattribute/cs/overview.cs
@@ -17,7 +17,7 @@ static void Main(string[] args)
Serialize("KnownTypeAttributeExample.xml");
Deserialize("KnownTypeAttributeExample.xml");
// Run this twice. The second time, comment out the
- // Serialize call and comment out the
+ // Serialize call and comment out the
// KnownTypeAttribute on the Person class. The
// deserialization will then fail.
}
@@ -73,7 +73,7 @@ public static void Deserialize(string path)
}
}
- // Apply the KnownTypeAttribute to the class that
+ // Apply the KnownTypeAttribute to the class that
// includes a member that returns a Hashtable.
[KnownType(typeof(IDInformation))]
[DataContract]
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/knowntypeattribute_ctor_string/cs/knowntype_ctor1.cs b/samples/snippets/csharp/VS_Snippets_CFX/knowntypeattribute_ctor_string/cs/knowntype_ctor1.cs
index 096c2cdee33..87208b8c262 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/knowntypeattribute_ctor_string/cs/knowntype_ctor1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/knowntypeattribute_ctor_string/cs/knowntype_ctor1.cs
@@ -12,7 +12,7 @@ namespace KnownTypeAttributeExample
using System.Text;
using System.Runtime.Serialization;
using System.IO;
- // The constructor names the method that returns an array
+ // The constructor names the method that returns an array
// of types that can be used during deserialization.
[KnownTypeAttribute("KnownTypes")]
[DataContract]
@@ -46,7 +46,7 @@ public class Manager : Employee
public Manager(string newFName, string newLName)
: base(newFName, newLName)
{ }
-
+
[DataMember]
internal Employee[] Reports;
}
@@ -79,8 +79,8 @@ static void Serialize(string path)
Manager theBoss = new Manager("Michiyo", "Sato");
theBoss.id = 41;
emp.Boss = theBoss;
-
- DataContractSerializer ser =
+
+ DataContractSerializer ser =
new DataContractSerializer(typeof(Employee));
FileStream fs =
@@ -90,7 +90,7 @@ static void Serialize(string path)
}
static void Deserialize(string path)
{
- DataContractSerializer ser =
+ DataContractSerializer ser =
new DataContractSerializer(typeof(Employee));
FileStream fs = new FileStream(path,
FileMode.Open);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/logarchievesnapshot/cs/logarchievesnapshot.cs b/samples/snippets/csharp/VS_Snippets_CFX/logarchievesnapshot/cs/logarchievesnapshot.cs
index 81fef04f62a..dcd51983283 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/logarchievesnapshot/cs/logarchievesnapshot.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/logarchievesnapshot/cs/logarchievesnapshot.cs
@@ -9,54 +9,54 @@ namespace Snippets
{
//
class LogBackup
- {
- static void ArchiveToXML(LogStore logStore, string fileName)
- {
+ {
+ static void ArchiveToXML(LogStore logStore, string fileName)
+ {
LogArchiveSnapshot snapshot = logStore.CreateLogArchiveSnapshot();
-
+
XmlTextWriter writer = new XmlTextWriter(fileName, Encoding.ASCII);
-
+
writer.WriteStartElement("logArchive");
- foreach(FileRegion region in snapshot.ArchiveRegions)
+ foreach(FileRegion region in snapshot.ArchiveRegions)
{
- writer.WriteStartElement("fileRegion");
- writer.WriteElementString("path", region.Path);
- writer.WriteElementString("length", region.FileLength.ToString());
- writer.WriteElementString("offset", region.Offset.ToString());
- using(Stream dataStream = region.GetStream())
- {
- byte[] data = new byte[dataStream.Length];
- dataStream.Read(data, 0, data.Length);
- writer.WriteElementString("data", Convert.ToBase64String(data));
+ writer.WriteStartElement("fileRegion");
+ writer.WriteElementString("path", region.Path);
+ writer.WriteElementString("length", region.FileLength.ToString());
+ writer.WriteElementString("offset", region.Offset.ToString());
+ using(Stream dataStream = region.GetStream())
+ {
+ byte[] data = new byte[dataStream.Length];
+ dataStream.Read(data, 0, data.Length);
+ writer.WriteElementString("data", Convert.ToBase64String(data));
}
writer.WriteEndElement();
}
- writer.WriteEndElement();
- writer.Close();
- logStore.SetArchiveTail(snapshot.LastSequenceNumber);
+ writer.WriteEndElement();
+ writer.Close();
+ logStore.SetArchiveTail(snapshot.LastSequenceNumber);
}
- static void RestoreFromXML(string fileName)
- {
- using(XmlTextReader reader = new XmlTextReader(fileName))
+ static void RestoreFromXML(string fileName)
+ {
+ using(XmlTextReader reader = new XmlTextReader(fileName))
{
- reader.ReadStartElement("logArchive");
- while(reader.IsStartElement())
- {
- string path = reader.ReadElementString("path");
- long length = Int64.Parse(reader.ReadElementString("length"));
- long offset = Int64.Parse(reader.ReadElementString("offset"));
- string dataString = reader.ReadElementString("data");
- byte[] data = Convert.FromBase64String(dataString);
+ reader.ReadStartElement("logArchive");
+ while(reader.IsStartElement())
+ {
+ string path = reader.ReadElementString("path");
+ long length = Int64.Parse(reader.ReadElementString("length"));
+ long offset = Int64.Parse(reader.ReadElementString("offset"));
+ string dataString = reader.ReadElementString("data");
+ byte[] data = Convert.FromBase64String(dataString);
FileStream fileStream;
- using(fileStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write))
- {
- fileStream.SetLength(length);
- fileStream.Position = offset; fileStream.Write(data, 0, data.Length);
+ using(fileStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write))
+ {
+ fileStream.SetLength(length);
+ fileStream.Position = offset; fileStream.Write(data, 0, data.Length);
}
- }
- reader.ReadEndElement();
- }
- }
+ }
+ reader.ReadEndElement();
+ }
+ }
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/managementendpoint/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/managementendpoint/cs/client.cs
index 2483cb288a1..bec00e624b9 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/managementendpoint/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/managementendpoint/cs/client.cs
@@ -155,7 +155,7 @@ static void Snippet12()
new EndpointAddress(new Uri("http://localhost/DataflowControl.xaml")));
controlClient.Unsuspend(instanceId);
-
+
// ...
controlClient.Terminate(instanceId);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/managementendpoint/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CFX/managementendpoint/cs/program.cs
index e1d38ada53b..1bd2e99e72f 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/managementendpoint/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/managementendpoint/cs/program.cs
@@ -18,7 +18,7 @@ static void Main()
// Same workflow as Dataflow sample
Activity workflow = LoadProgram("Dataflow.xaml");
WorkflowServiceHost host = new WorkflowServiceHost(workflow,
- new Uri("http://localhost/Dataflow.xaml"));
+ new Uri("http://localhost/Dataflow.xaml"));
WorkflowControlEndpoint controlEndpoint = new WorkflowControlEndpoint(
new BasicHttpBinding(),
@@ -45,7 +45,7 @@ static void Main()
Console.WriteLine("Hit any key to exit Host...");
Console.ReadLine();
}
-
+
public static Activity LoadProgram(string xamlPath)
{
FileStream stream = null;
@@ -63,5 +63,5 @@ public static Activity LoadProgram(string xamlPath)
return activity;
}
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/client.cs b/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/client.cs
index 41a89d86506..4a19061b781 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/client.cs
@@ -2,7 +2,7 @@
using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
-
+
public class Client
{
public static void Main()
@@ -21,7 +21,7 @@ public static void Main()
Console.WriteLine("Press ENTER to exit:");
Console.ReadLine();
- // Done with service.
+ // Done with service.
wcfClient.Close();
Console.WriteLine("Done!");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/proxycode.cs b/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/proxycode.cs
index 69cf8696712..1e641edda1a 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/proxycode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/proxycode.cs
@@ -14,7 +14,7 @@
[System.ServiceModel.ServiceContractAttribute(Namespace="Microsoft.WCF.Documentation", ConfigurationName="IMessagingHello")]
public interface IMessagingHello
{
-
+
[System.ServiceModel.OperationContractAttribute(Action="http://GreetingMessage/Action", ReplyAction="http://HelloResponseMessage/Action")]
HelloResponseMessage Hello(HelloGreetingMessage request);
}
@@ -24,14 +24,14 @@ public interface IMessagingHello
[System.ServiceModel.MessageContractAttribute(WrapperName="HelloGreetingMessage", WrapperNamespace="Microsoft.WCF.Documentation", IsWrapped=true)]
public partial class HelloGreetingMessage
{
-
+
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.examples.com", Order=0)]
public string Salutations;
-
+
public HelloGreetingMessage()
{
}
-
+
public HelloGreetingMessage(string Salutations)
{
this.Salutations = Salutations;
@@ -43,17 +43,17 @@ public HelloGreetingMessage(string Salutations)
[System.ServiceModel.MessageContractAttribute(WrapperName="HelloResponseMessage", WrapperNamespace="Microsoft.WCF.Documentation", IsWrapped=true)]
public partial class HelloResponseMessage
{
-
+
[System.ServiceModel.MessageHeaderAttribute(Namespace="http://www.examples.com")]
public string OutOfBandData;
-
+
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.examples.com", Order=0)]
public string ResponseToGreeting;
-
+
public HelloResponseMessage()
{
}
-
+
public HelloResponseMessage(string OutOfBandData, string ResponseToGreeting)
{
this.OutOfBandData = OutOfBandData;
@@ -70,31 +70,31 @@ public interface IMessagingHelloChannel : IMessagingHello, System.ServiceModel.I
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class MessagingHelloClient : System.ServiceModel.ClientBase, IMessagingHello
{
-
+
public MessagingHelloClient()
{
}
-
- public MessagingHelloClient(string endpointConfigurationName) :
+
+ public MessagingHelloClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
-
- public MessagingHelloClient(string endpointConfigurationName, string remoteAddress) :
+
+ public MessagingHelloClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public MessagingHelloClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public MessagingHelloClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
-
- public MessagingHelloClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+
+ public MessagingHelloClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
-
+
public HelloResponseMessage Hello(HelloGreetingMessage request)
{
return base.Channel.Hello(request);
diff --git a/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/services.cs b/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/services.cs
index 3520e83b854..c249b1df8c6 100644
--- a/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/services.cs
+++ b/samples/snippets/csharp/VS_Snippets_CFX/messageheaderattribute/cs/services.cs
@@ -48,7 +48,7 @@ public string ExtraValues
/*
The following is the response message, edited for clarity.
-
+
http://HelloResponseMessage/Action
@@ -58,7 +58,7 @@ public string ExtraValues
Service received: Hello.
-
+
*/
}
@@ -70,7 +70,7 @@ public class HelloGreetingMessage
private string localGreeting;
[MessageBodyMember(
- Name = "Salutations",
+ Name = "Salutations",
Namespace = "http://www.examples.com"
)]
public string Greeting
@@ -82,11 +82,11 @@ public string Greeting
/*
The following is the request message, edited for clarity.
-
+
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Environment.NewLine/CS/newline.cs b/samples/snippets/csharp/VS_Snippets_CLR/Environment.NewLine/CS/newline.cs
index bddaee4d19e..f07a829b1c0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Environment.NewLine/CS/newline.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Environment.NewLine/CS/newline.cs
@@ -2,9 +2,9 @@
// Sample for the Environment.NewLine property
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
Console.WriteLine();
Console.WriteLine("NewLine: {0} first line{0} second line{0} third line",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Environment.StackTrace/CS/stacktrace.cs b/samples/snippets/csharp/VS_Snippets_CLR/Environment.StackTrace/CS/stacktrace.cs
index e3589910d2f..6a73058f870 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Environment.StackTrace/CS/stacktrace.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Environment.StackTrace/CS/stacktrace.cs
@@ -2,9 +2,9 @@
// Sample for the Environment.StackTrace property
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
Console.WriteLine();
Console.WriteLine("StackTrace: '{0}'", Environment.StackTrace);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Environment.SystemDirectory/CS/systemdirectory.cs b/samples/snippets/csharp/VS_Snippets_CLR/Environment.SystemDirectory/CS/systemdirectory.cs
index ed8707d1afa..4b5a350cb8b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Environment.SystemDirectory/CS/systemdirectory.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Environment.SystemDirectory/CS/systemdirectory.cs
@@ -2,9 +2,9 @@
// Sample for the Environment.SystemDirectory property
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
Console.WriteLine();
// <-- Keep this information secure! -->
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Environment.TickCount/CS/tickcount.cs b/samples/snippets/csharp/VS_Snippets_CLR/Environment.TickCount/CS/tickcount.cs
index edd48b058d8..e2bc448210a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Environment.TickCount/CS/tickcount.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Environment.TickCount/CS/tickcount.cs
@@ -1,16 +1,16 @@
//
// Sample for the Environment.TickCount property.
-// TickCount cycles between Int32.MinValue, which is a negative
+// TickCount cycles between Int32.MinValue, which is a negative
// number, and Int32.MaxValue once every 49.8 days. This sample
-// removes the sign bit to yield a nonnegative number that cycles
+// removes the sign bit to yield a nonnegative number that cycles
// between zero and Int32.MaxValue once every 24.9 days.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
int result = Environment.TickCount & Int32.MaxValue;
Console.WriteLine("TickCount: {0}", result);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Environment.UserInteractive/CS/userinteractive.cs b/samples/snippets/csharp/VS_Snippets_CLR/Environment.UserInteractive/CS/userinteractive.cs
index 23531a00608..d99081c24be 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Environment.UserInteractive/CS/userinteractive.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Environment.UserInteractive/CS/userinteractive.cs
@@ -2,9 +2,9 @@
// Sample for the Environment.UserInteractive property
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
Console.WriteLine();
Console.WriteLine("UserInteractive: {0}", Environment.UserInteractive);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Environment.WorkingSet/CS/workingset.cs b/samples/snippets/csharp/VS_Snippets_CLR/Environment.WorkingSet/CS/workingset.cs
index 2fa0035e7ea..0b1989ebef3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Environment.WorkingSet/CS/workingset.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Environment.WorkingSet/CS/workingset.cs
@@ -2,9 +2,9 @@
// Sample for the Environment.WorkingSet property
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
Console.WriteLine("WorkingSet: {0}", Environment.WorkingSet);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventArg/CS/eventarg.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventArg/CS/eventarg.cs
index 97bc9dec3e1..1f79e7ca7d6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventArg/CS/eventarg.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventArg/CS/eventarg.cs
@@ -1,20 +1,20 @@
//
-// The following example uses instances of classes in
+// The following example uses instances of classes in
// the System.Reflection namespace to discover an event argument type.
using System;
using System.Reflection;
public delegate void MyDelegate(int i);
-public class MainClass
+public class MainClass
{
public event MyDelegate ev;
- public static void Main()
+ public static void Main()
{
Type delegateType = typeof(MainClass).GetEvent("ev").EventHandlerType;
MethodInfo invoke = delegateType.GetMethod("Invoke");
ParameterInfo[] pars = invoke.GetParameters();
- foreach (ParameterInfo p in pars)
+ foreach (ParameterInfo p in pars)
{
Console.WriteLine(p.ParameterType);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntryType_6/CS/eventlogentrytype_6.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntryType_6/CS/eventlogentrytype_6.cs
index 8175ad6091f..d3b834291c0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntryType_6/CS/eventlogentrytype_6.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntryType_6/CS/eventlogentrytype_6.cs
@@ -5,9 +5,9 @@
// System.Diagnostics.EventLogEntryType.FailureAudit
// System.Diagnostics.EventLogEntryType.SuccessAudit
-/* The following program demonstrates 'Error', 'Warning',
- 'Information', 'FailureAudit' and 'SuccessAudit' members of
- 'EventLogEntryType' enumerator. It creates new source with a
+/* The following program demonstrates 'Error', 'Warning',
+ 'Information', 'FailureAudit' and 'SuccessAudit' members of
+ 'EventLogEntryType' enumerator. It creates new source with a
specified event log, new ID, EventLogEntryType and message,
if does not exist.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_CopyTo/CS/eventlogentry_copyto.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_CopyTo/CS/eventlogentry_copyto.cs
index f75fb5db3d9..2f0a29f2f5b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_CopyTo/CS/eventlogentry_copyto.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_CopyTo/CS/eventlogentry_copyto.cs
@@ -2,7 +2,7 @@
// System.Diagnostics.EventLogEntryCollection.CopyTo(EventLogEntry[],int)
/*
- The following example demonstrates the EventLogEntryCollection class and the
+ The following example demonstrates the EventLogEntryCollection class and the
CopyTo method of EventLogEntryCollection class.A new Source for eventlog 'MyNewLog'
is created.A new entry is created for 'MyNewLog'.The entries of EventLog are copied
to an Array.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_Item/CS/eventlogentry_item.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_Item/CS/eventlogentry_item.cs
index b369fe7ec9a..46a2ac16fc7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_Item/CS/eventlogentry_item.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_Item/CS/eventlogentry_item.cs
@@ -2,13 +2,13 @@
// System.Diagnostics.EventLogEntryCollection.Item
/*
- The following example demonstrates 'Item','Count' properties of
+ The following example demonstrates 'Item','Count' properties of
EventLogEntryCollection class.A new Source for eventlog 'MyNewLog' is created.
- The program checks if a Event source exists.If the source already exists, it gets
- the Log name associated with it otherwise, creates a new event source.
- A new entry is created for 'MyNewLog'.Entries of 'MyNewLog' are obtained and
+ The program checks if a Event source exists.If the source already exists, it gets
+ the Log name associated with it otherwise, creates a new event source.
+ A new entry is created for 'MyNewLog'.Entries of 'MyNewLog' are obtained and
the count and the messages are displayed.
-
+
*/
using System;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_Source/CS/eventlogentry_source.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_Source/CS/eventlogentry_source.cs
index a4f1cbf603a..1985f4c17c7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_Source/CS/eventlogentry_source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLogEntry_Source/CS/eventlogentry_source.cs
@@ -2,9 +2,9 @@
// System.Diagnostics.EventLogEntry.Source
/*
-The following example demonstrates the properties 'EntryType' and 'Source'
-of the class 'EventLogEntry'.
-A new instance of 'EventLog' class is created and is associated to existing
+The following example demonstrates the properties 'EntryType' and 'Source'
+of the class 'EventLogEntry'.
+A new instance of 'EventLog' class is created and is associated to existing
System Log file of local machine. User selects the event type and the latest
entry in the log file of that type and it's source is displayed.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLogInstaller/CS/eventloginstaller.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLogInstaller/CS/eventloginstaller.cs
index 930e78e5982..e083def0c29 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLogInstaller/CS/eventloginstaller.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLogInstaller/CS/eventloginstaller.cs
@@ -8,7 +8,7 @@
// and the instance is added to the Installers collection.
//
// Note:
-// 1) Run this program using the following command:
+// 1) Run this program using the following command:
// InstallUtil.exe
// 2) Uninstall the event log created in step 1 using the
// following command:
@@ -25,7 +25,7 @@ public class MyEventLogInstaller: Installer
{
private EventLogInstaller myEventLogInstaller;
- public MyEventLogInstaller()
+ public MyEventLogInstaller()
{
// Create an instance of an EventLogInstaller.
myEventLogInstaller = new EventLogInstaller();
@@ -37,7 +37,7 @@ public MyEventLogInstaller()
myEventLogInstaller.Log = "MyNewLog";
// Add myEventLogInstaller to the Installer collection.
- Installers.Add(myEventLogInstaller);
+ Installers.Add(myEventLogInstaller);
}
public static void Main()
@@ -45,4 +45,4 @@ public static void Main()
MyEventLogInstaller myInstaller = new MyEventLogInstaller();
}
}
-//
+//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLogProperties/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLogProperties/CS/source.cs
index 26c6d7f4bfb..64c74d70e0b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLogProperties/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLogProperties/CS/source.cs
@@ -38,7 +38,7 @@ static void GetNewOverflowSetting(ref OverflowAction newOverflow,
Console.Write(" DoNotOverwrite,");
Console.Write(" OverwriteAsNeeded");
Console.WriteLine("] : ");
-
+
String input = Console.ReadLine();
if (!String.IsNullOrEmpty(input))
@@ -83,10 +83,10 @@ static void DisplayEventLogProperties()
Console.WriteLine();
Console.WriteLine("{0}:", e.LogDisplayName);
- Console.WriteLine(" Log name = \t\t {0}", e.Log);
+ Console.WriteLine(" Log name = \t\t {0}", e.Log);
Console.WriteLine(" Number of event log entries = {0}", e.Entries.Count.ToString());
-
+
// Determine if there is an event log file for this event log.
RegistryKey regEventLog = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Services\\EventLog\\" + e.Log);
if (regEventLog != null)
@@ -113,7 +113,7 @@ static void DisplayEventLogProperties()
Console.WriteLine(" Log file path = \t ");
}
}
-
+
// Display the maximum size and overflow settings.
sizeKB = e.MaximumKilobytes;
@@ -123,7 +123,7 @@ static void DisplayEventLogProperties()
switch (e.OverflowAction)
{
case OverflowAction.OverwriteOlder:
- Console.WriteLine("\t Entries are retained a minimum of {0} days.",
+ Console.WriteLine("\t Entries are retained a minimum of {0} days.",
e.MinimumRetentionDays);
break;
case OverflowAction.DoNotOverwrite:
@@ -140,13 +140,13 @@ static void DisplayEventLogProperties()
//
//
- // Display the current event log overflow settings, and
+ // Display the current event log overflow settings, and
// prompt the user to input a new overflow setting.
public static void ChangeEventLogOverflowAction(String logName)
{
if (EventLog.Exists(logName))
{
- // Display the current overflow setting of the
+ // Display the current overflow setting of the
// specified event log.
EventLog inputLog = new EventLog(logName);
Console.WriteLine(" Event log {0}", inputLog.Log);
@@ -158,7 +158,7 @@ public static void ChangeEventLogOverflowAction(String logName)
logOverflow.ToString());
if (logOverflow == OverflowAction.OverwriteOlder)
{
- Console.WriteLine("\t Entries are retained a minimum of {0} days.",
+ Console.WriteLine("\t Entries are retained a minimum of {0} days.",
numDays.ToString());
}
@@ -171,12 +171,12 @@ public static void ChangeEventLogOverflowAction(String logName)
inputLog.ModifyOverflowPolicy(logOverflow, numDays);
Console.WriteLine("Event log overflow policy was modified successfully!");
}
- else
+ else
{
Console.WriteLine("Event log overflow policy was not modified.");
}
}
- else
+ else
{
Console.WriteLine("Event log {0} was not found.", logName);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLog_EventSourceCreation_Properties/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLog_EventSourceCreation_Properties/CS/source.cs
index 3ba6add6305..ef81faa93f2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLog_EventSourceCreation_Properties/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLog_EventSourceCreation_Properties/CS/source.cs
@@ -35,7 +35,7 @@ static void Main(string[] args)
mySourceData.MessageResourceFile = args[3];
}
}
- else
+ else
{
// Display a syntax help message.
Console.WriteLine("Input:");
@@ -58,10 +58,10 @@ static void Main(string[] args)
//
// Determine if the source exists on the specified computer.
- if (!EventLog.SourceExists(mySourceData.Source,
+ if (!EventLog.SourceExists(mySourceData.Source,
mySourceData.MachineName))
{
- // The source does not exist.
+ // The source does not exist.
// Verify that the message file exists
// and the event log is local.
@@ -69,7 +69,7 @@ static void Main(string[] args)
if ((mySourceData.MessageResourceFile != null) &&
(mySourceData.MessageResourceFile.Length > 0))
{
- if (mySourceData.MachineName == ".")
+ if (mySourceData.MachineName == ".")
{
if (!System.IO.File.Exists(mySourceData.MessageResourceFile))
{
@@ -78,7 +78,7 @@ static void Main(string[] args)
registerSource = false;
}
}
- else
+ else
{
// For simplicity, do not allow setting the message
// file for a remote event log. To set the message
@@ -103,19 +103,19 @@ static void Main(string[] args)
sourceLog = EventLog.LogNameFromSourceName(mySourceData.Source,
mySourceData.MachineName);
- // Determine if the event source is registered for the
+ // Determine if the event source is registered for the
// specified log.
- if (sourceLog.ToUpper(CultureInfo.InvariantCulture) != mySourceData.LogName.ToUpper(CultureInfo.InvariantCulture))
+ if (sourceLog.ToUpper(CultureInfo.InvariantCulture) != mySourceData.LogName.ToUpper(CultureInfo.InvariantCulture))
{
- // An existing source is registered
+ // An existing source is registered
// to write to a different event log.
Console.WriteLine("Warning: source {0} is already registered to write to event log {1}",
mySourceData.Source, sourceLog);
}
- else
+ else
{
- // The source is already registered
+ // The source is already registered
// to write to the specified event log.
Console.WriteLine("Source {0} already registered to write to event log {1}",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLog_Exists_1/CS/eventlog_exists_1.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLog_Exists_1/CS/eventlog_exists_1.cs
index d6ef81208be..6178b87c80b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLog_Exists_1/CS/eventlog_exists_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLog_Exists_1/CS/eventlog_exists_1.cs
@@ -1,13 +1,13 @@
// System.Diagnostics.EventLog.Exists(String)
/*
- The following sample demonstrates the 'Exists(String)'method of
- 'EventLog' class. It checks for the existence of a log and displays
+ The following sample demonstrates the 'Exists(String)'method of
+ 'EventLog' class. It checks for the existence of a log and displays
the result accordingly.
*/
using System;
-using System.Diagnostics;
+using System.Diagnostics;
class EventLog_Exists_1
{
public static void Main()
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLog_WriteEntry_1_3/CS/eventlog_writeentry_1_3.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLog_WriteEntry_1_3/CS/eventlog_writeentry_1_3.cs
index f99b2ce00bb..97b87c90514 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLog_WriteEntry_1_3/CS/eventlog_writeentry_1_3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLog_WriteEntry_1_3/CS/eventlog_writeentry_1_3.cs
@@ -2,11 +2,11 @@
// System.Diagnostics.EventLog.WriteEntry(String, String, EventLogEntryType, Int32, Int16, Byte[])
// System.Diagnostics.EventLog.EventLog.WriteEntry(String, EventLogEntryType, Int32, Int16)
-/* The following example demonstrates the method
- 'WriteEntry(String, String, EventLogEntryType, Int32, Int16)',
- 'WriteEntry(String, String, EventLogEntryType, Int32, Int16, Byte[]) '
- and 'WriteEntry(String, EventLogEntryType, Int32, Int16)' of class
- 'EventLog'.The following example writes the information to an event log.
+/* The following example demonstrates the method
+ 'WriteEntry(String, String, EventLogEntryType, Int32, Int16)',
+ 'WriteEntry(String, String, EventLogEntryType, Int32, Int16, Byte[]) '
+ and 'WriteEntry(String, EventLogEntryType, Int32, Int16)' of class
+ 'EventLog'.The following example writes the information to an event log.
*/
using System;
using System.Diagnostics;
@@ -44,10 +44,10 @@ public static void Main()
EventLog myLog = new EventLog();
myLog.Source = "ThirdSource";
- // Write an informational entry to the event log.
+ // Write an informational entry to the event log.
Console.WriteLine("Write from third source ");
myLog.WriteEntry("Writing warning to event log.",
EventLogEntryType.Warning, myEventID, myCategory);
- //
+ //
}
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/EventLog_WriteEntry_5/CS/eventlog_writeentry_5.cs b/samples/snippets/csharp/VS_Snippets_CLR/EventLog_WriteEntry_5/CS/eventlog_writeentry_5.cs
index 782f5eb5d01..395a65bea0f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/EventLog_WriteEntry_5/CS/eventlog_writeentry_5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/EventLog_WriteEntry_5/CS/eventlog_writeentry_5.cs
@@ -1,21 +1,21 @@
// System.Diagnostics.EventLog.WriteEntry(String,EventLogEntryType,Int32,Int16,Byte[])
/*
- The following sample demonstrates the
- 'WriteEntry(String, EventLogEntryType, Int32, Int16, Byte[])' method of
+ The following sample demonstrates the
+ 'WriteEntry(String, EventLogEntryType, Int32, Int16, Byte[])' method of
'EventLog' class. It writes an entry to a custom event log, "MyLog".
It creates the source "MySource" if the source does not already exist.
- It creates an 'EventLog' object and calls 'WriteEntry' passing the
+ It creates an 'EventLog' object and calls 'WriteEntry' passing the
description, Log entry type, application specific identifier for the event,
application specific subcategory and data to be associated with the entry.
*/
using System;
using System.Diagnostics;
-
+
class EventLog_WriteEntry_5
{
- public static void Main()
+ public static void Main()
{
try
{
@@ -56,9 +56,9 @@ public static void Main()
}
// Write the entry in the event log.
Console.WriteLine("Writing to EventLog.. ");
- myEventLog.WriteEntry(myMessage,myEventLogEntryType,
+ myEventLog.WriteEntry(myMessage,myEventLogEntryType,
myApplicatinEventId, myApplicatinCategoryId, myRawData);
-//
+//
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ExToString/CS/extostring.cs b/samples/snippets/csharp/VS_Snippets_CLR/ExToString/CS/extostring.cs
index d810c3af781..0c33b698265 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ExToString/CS/extostring.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ExToString/CS/extostring.cs
@@ -4,7 +4,7 @@
public class TestClass
{}
-public class Example
+public class Example
{
public static void Main()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo AppendText/CS/finfo appendtext.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo AppendText/CS/finfo appendtext.cs
index a0ead54ec6f..7805863d5a4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo AppendText/CS/finfo appendtext.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo AppendText/CS/finfo appendtext.cs
@@ -2,18 +2,18 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
FileInfo fi = new FileInfo(@"c:\MyTest.txt");
// This text is added only once to the file.
- if (!fi.Exists)
+ if (!fi.Exists)
{
//Create a file to write to.
- using (StreamWriter sw = fi.CreateText())
+ using (StreamWriter sw = fi.CreateText())
{
sw.WriteLine("Hello");
sw.WriteLine("And");
@@ -23,7 +23,7 @@ public static void Main()
// This text will always be added, making the file longer over time
// if it is not deleted.
- using (StreamWriter sw = fi.AppendText())
+ using (StreamWriter sw = fi.AppendText())
{
sw.WriteLine("This");
sw.WriteLine("is Extra");
@@ -31,17 +31,17 @@ public static void Main()
}
//Open the file to read from.
- using (StreamReader sr = fi.OpenText())
+ using (StreamReader sr = fi.OpenText())
{
string s = "";
- while ((s = sr.ReadLine()) != null)
+ while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//Hello
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Class/CS/finfo class.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Class/CS/finfo class.cs
index 77fd13eac49..903d4a69819 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Class/CS/finfo class.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Class/CS/finfo class.cs
@@ -2,16 +2,16 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = Path.GetTempFileName();
var fi1 = new FileInfo(path);
// Create a file to write to.
- using (StreamWriter sw = fi1.CreateText())
+ using (StreamWriter sw = fi1.CreateText())
{
sw.WriteLine("Hello");
sw.WriteLine("And");
@@ -19,16 +19,16 @@ public static void Main()
}
// Open the file to read from.
- using (StreamReader sr = fi1.OpenText())
+ using (StreamReader sr = fi1.OpenText())
{
var s = "";
- while ((s = sr.ReadLine()) != null)
+ while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
}
- try
+ try
{
string path2 = Path.GetTempFileName();
var fi2 = new FileInfo(path2);
@@ -43,8 +43,8 @@ public static void Main()
// Delete the newly created file.
fi2.Delete();
Console.WriteLine($"{path2} was successfully deleted.");
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.WriteLine($"The process failed: {e.ToString()}");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Create/CS/finfo create.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Create/CS/finfo create.cs
index 30dffb56d25..8e03436d9de 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Create/CS/finfo create.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Create/CS/finfo create.cs
@@ -3,24 +3,24 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\MyTest.txt";
FileInfo fi = new FileInfo(path);
// Delete the file if it exists.
- if (fi.Exists)
+ if (fi.Exists)
{
fi.Delete();
}
//Create the file.
- using (FileStream fs = fi.Create())
+ using (FileStream fs = fi.Create())
{
- Byte[] info =
+ Byte[] info =
new UTF8Encoding(true).GetBytes("This is some text in the file.");
//Add some information to the file.
@@ -28,17 +28,17 @@ public static void Main()
}
//Open the stream and read it back.
- using (StreamReader sr = fi.OpenText())
+ using (StreamReader sr = fi.OpenText())
{
string s = "";
- while ((s = sr.ReadLine()) != null)
+ while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//This is some text in the file.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo CreateText/CS/finfo createtext.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo CreateText/CS/finfo createtext.cs
index 41c0586ea6c..750c3aff6b8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo CreateText/CS/finfo createtext.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo CreateText/CS/finfo createtext.cs
@@ -2,18 +2,18 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
FileInfo fi = new FileInfo(path);
- if (!fi.Exists)
+ if (!fi.Exists)
{
//Create a file to write to.
- using (StreamWriter sw = fi.CreateText())
+ using (StreamWriter sw = fi.CreateText())
{
sw.WriteLine("Hello");
sw.WriteLine("And");
@@ -22,17 +22,17 @@ public static void Main()
}
//Open the file to read from.
- using (StreamReader sr = fi.OpenText())
+ using (StreamReader sr = fi.OpenText())
{
string s = "";
- while ((s = sr.ReadLine()) != null)
+ while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//Hello
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Ctor/CS/finfo ctor.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Ctor/CS/finfo ctor.cs
index 197578e7a78..045f9b008d9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Ctor/CS/finfo ctor.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Ctor/CS/finfo ctor.cs
@@ -2,18 +2,18 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
FileInfo fi1 = new FileInfo(path);
- if (!fi1.Exists)
+ if (!fi1.Exists)
{
//Create a file to write to.
- using (StreamWriter sw = fi1.CreateText())
+ using (StreamWriter sw = fi1.CreateText())
{
sw.WriteLine("Hello");
sw.WriteLine("And");
@@ -22,16 +22,16 @@ public static void Main()
}
//Open the file to read from.
- using (StreamReader sr = fi1.OpenText())
+ using (StreamReader sr = fi1.OpenText())
{
string s = "";
- while ((s = sr.ReadLine()) != null)
+ while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
}
- try
+ try
{
string path2 = path + "temp";
FileInfo fi2 = new FileInfo(path2);
@@ -46,14 +46,14 @@ public static void Main()
//Delete the newly created file.
fi2.Delete();
Console.WriteLine("{0} was successfully deleted.", path2);
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//Hello
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Delete/CS/finfo delete.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Delete/CS/finfo delete.cs
index 75467ae7930..685604cae92 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Delete/CS/finfo delete.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Delete/CS/finfo delete.cs
@@ -2,15 +2,15 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\MyTest.txt";
FileInfo fi1 = new FileInfo(path);
- try
+ try
{
using (StreamWriter sw = fi1.CreateText()) {}
string path2 = path + "temp";
@@ -26,14 +26,14 @@ public static void Main()
//Delete the newly created file.
fi2.Delete();
Console.WriteLine("{0} was successfully deleted.", path2);
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//c:\MyTest.txt was copied to c:\MyTest.txttemp.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Open1/CS/finfo open1.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Open1/CS/finfo open1.cs
index 110e0f5e350..2f4e244faf1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Open1/CS/finfo open1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Open1/CS/finfo open1.cs
@@ -3,19 +3,19 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\MyTest.txt";
FileInfo fi = new FileInfo(path);
// Delete the file if it exists.
- if (!fi.Exists)
+ if (!fi.Exists)
{
//Create the file.
- using (FileStream fs = fi.Create())
+ using (FileStream fs = fi.Create())
{
Byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file.");
//Add some information to the file.
@@ -24,18 +24,18 @@ public static void Main()
}
//Open the stream and read it back.
- using (FileStream fs = fi.Open(FileMode.Open))
+ using (FileStream fs = fi.Open(FileMode.Open))
{
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
- while (fs.Read(b,0,b.Length) > 0)
+ while (fs.Read(b,0,b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//This is some text in the file.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Open2/CS/finfo open2.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Open2/CS/finfo open2.cs
index c22340cdc86..1654e566aeb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo Open2/CS/finfo open2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo Open2/CS/finfo open2.cs
@@ -3,19 +3,19 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\MyTest.txt";
FileInfo fi = new FileInfo(path);
// Delete the file if it exists.
- if (!fi.Exists)
+ if (!fi.Exists)
{
//Create the file.
- using (FileStream fs = fi.Create())
+ using (FileStream fs = fi.Create())
{
Byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file.");
//Add some information to the file.
@@ -24,21 +24,21 @@ public static void Main()
}
//Open the stream and read it back.
- using (FileStream fs = fi.Open(FileMode.Open, FileAccess.Read))
+ using (FileStream fs = fi.Open(FileMode.Open, FileAccess.Read))
{
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
- while (fs.Read(b,0,b.Length) > 0)
+ while (fs.Read(b,0,b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
- try
+ try
{
//Try to write to the file.
fs.Write(b,0,b.Length);
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.WriteLine("Writing was disallowed, as expected: {0}",
e.ToString());
@@ -46,7 +46,7 @@ public static void Main()
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//This is some text in the file.
@@ -62,7 +62,7 @@ public static void Main()
//
//
//
-//Writing was disallowed, as expected: System.NotSupportedException: Stream does
+//Writing was disallowed, as expected: System.NotSupportedException: Stream does
//not support writing.
// at System.IO.__Error.WriteNotSupported()
// at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenRead/CS/finfo openread.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenRead/CS/finfo openread.cs
index 5c8c2fa76f4..0caf9e17ec1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenRead/CS/finfo openread.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenRead/CS/finfo openread.cs
@@ -3,19 +3,19 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\MyTest.txt";
FileInfo fi = new FileInfo(path);
// Delete the file if it exists.
- if (!fi.Exists)
+ if (!fi.Exists)
{
//Create the file.
- using (FileStream fs = fi.Create())
+ using (FileStream fs = fi.Create())
{
Byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file.");
//Add some information to the file.
@@ -24,19 +24,19 @@ public static void Main()
}
//Open the stream and read it back.
- using (FileStream fs = fi.OpenRead())
+ using (FileStream fs = fi.OpenRead())
{
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
- while (fs.Read(b,0,b.Length) > 0)
+ while (fs.Read(b,0,b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//This is some text in the file.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenText/CS/file opentext.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenText/CS/file opentext.cs
index bc0dacc65aa..ae0151ebd46 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenText/CS/file opentext.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenText/CS/file opentext.cs
@@ -3,9 +3,9 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\MyTest.txt";
@@ -17,7 +17,7 @@ public static void Main()
// Create the file.
using (FileStream fs = fi.Create())
{
- Byte[] info =
+ Byte[] info =
new UTF8Encoding(true).GetBytes("This is some text in the file.");
// Add some information to the file.
@@ -30,14 +30,14 @@ public static void Main()
using (StreamReader sr = fi.OpenText())
{
string s = "";
- while ((s = sr.ReadLine()) != null)
+ while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//This is some text in the file.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenWrite/CS/file openwrite.cs b/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenWrite/CS/file openwrite.cs
index 8ee827c52b2..5ae6b424f1e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenWrite/CS/file openwrite.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FInfo OpenWrite/CS/file openwrite.cs
@@ -3,17 +3,17 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\Temp\MyTest.txt";
FileInfo fi = new FileInfo(path);
// Open the stream for writing.
- using (FileStream fs = fi.OpenWrite())
+ using (FileStream fs = fi.OpenWrite())
{
- Byte[] info =
+ Byte[] info =
new UTF8Encoding(true).GetBytes("This is to test the OpenWrite method.");
// Add some information to the file.
@@ -21,19 +21,19 @@ public static void Main()
}
// Open the stream and read it back.
- using (FileStream fs = fi.OpenRead())
+ using (FileStream fs = fi.OpenRead())
{
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
- while (fs.Read(b,0,b.Length) > 0)
+ while (fs.Read(b,0,b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//This is to test the OpenWrite method.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FSizeSort/CS/fsizesort.cs b/samples/snippets/csharp/VS_Snippets_CLR/FSizeSort/CS/fsizesort.cs
index 0478742ec5c..87d92cf2580 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FSizeSort/CS/fsizesort.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FSizeSort/CS/fsizesort.cs
@@ -33,7 +33,7 @@ static void Main()
// method defined below.
ListDirectoriesAndFiles(infos);
- // Display the results to the console.
+ // Display the results to the console.
Console.WriteLine("Directories: {0}", directories);
Console.WriteLine("Files: {0}", files);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FStream CanSeek/CS/fstream canseek.cs b/samples/snippets/csharp/VS_Snippets_CLR/FStream CanSeek/CS/fstream canseek.cs
index 3ea3d73175f..6925038a3b0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FStream CanSeek/CS/fstream canseek.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FStream CanSeek/CS/fstream canseek.cs
@@ -3,27 +3,27 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
// Delete the file if it exists.
- if (File.Exists(path))
+ if (File.Exists(path))
{
File.Delete(path);
}
//Create the file.
- using (FileStream fs = File.Create(path))
+ using (FileStream fs = File.Create(path))
{
- if (fs.CanSeek)
+ if (fs.CanSeek)
{
Console.WriteLine("The stream connected to {0} is seekable.", path);
- }
- else
+ }
+ else
{
Console.WriteLine("The stream connected to {0} is not seekable.", path);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FStream CanWrite/CS/fstream canwrite.cs b/samples/snippets/csharp/VS_Snippets_CLR/FStream CanWrite/CS/fstream canwrite.cs
index b361eb2bce8..435b9eb1871 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FStream CanWrite/CS/fstream canwrite.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FStream CanWrite/CS/fstream canwrite.cs
@@ -3,10 +3,10 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
@@ -14,13 +14,13 @@ public static void Main()
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.ReadOnly);
//Create the file.
- using (FileStream fs = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Read))
+ using (FileStream fs = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Read))
{
- if (fs.CanWrite)
+ if (fs.CanWrite)
{
Console.WriteLine("The stream for file {0} is writable.", path);
- }
- else
+ }
+ else
{
Console.WriteLine("The stream for file {0} is not writable.", path);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FieldBuilder_SetOffset/CS/fieldbuilder_setoffset.cs b/samples/snippets/csharp/VS_Snippets_CLR/FieldBuilder_SetOffset/CS/fieldbuilder_setoffset.cs
index 8f929e7edd1..49032619913 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FieldBuilder_SetOffset/CS/fieldbuilder_setoffset.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FieldBuilder_SetOffset/CS/fieldbuilder_setoffset.cs
@@ -2,11 +2,11 @@
// System.Reflection.Emit.FieldBuilder.SetMarshal
/*
- The following program demonstrates 'SetOffset' and 'SetMarshal'
- methods of 'FieldBuilder' class.A new Class is defined and a
- 'PInvoke' method 'OpenFile' method of 'Kernel32.dll' is defined
+ The following program demonstrates 'SetOffset' and 'SetMarshal'
+ methods of 'FieldBuilder' class.A new Class is defined and a
+ 'PInvoke' method 'OpenFile' method of 'Kernel32.dll' is defined
in the class.Instance of the class is created and the method is invoked.
- To execute this program, make sure a file named 'MyFile.txt' should be there
+ To execute this program, make sure a file named 'MyFile.txt' should be there
in the current directory.
*/
@@ -46,17 +46,17 @@ public static Type CreateType(AppDomain currentDomain)
typeof(short),FieldAttributes.Public);
FieldBuilder myFieldBuilder6= myTypeBuilder2.DefineField("myPathName",
typeof(char[]),FieldAttributes.Public);
- myFieldBuilder6.SetMarshal(UnmanagedMarshal.DefineByValArray(128));
+ myFieldBuilder6.SetMarshal(UnmanagedMarshal.DefineByValArray(128));
myFieldBuilder6.SetOffset(4);
- Type myType1 = myTypeBuilder2.CreateType();
+ Type myType1 = myTypeBuilder2.CreateType();
// Create the PInvoke method for 'OpenFile' method of 'Kernel32.dll'.
- Type[] myParameters={ typeof(string), myType1 ,typeof(uint)};
+ Type[] myParameters={ typeof(string), myType1 ,typeof(uint)};
MethodBuilder myMethodBuilder= myTypeBuilder.DefinePInvokeMethod("OpenFile",
"kernel32.dll",MethodAttributes.Public|MethodAttributes.Static|MethodAttributes.HideBySig,
CallingConventions.Standard,typeof(IntPtr),
myParameters,CallingConvention.Winapi,CharSet.None);
Type myAttributeType = typeof(MethodImplAttribute);
- ConstructorInfo myConstructorInfo =
+ ConstructorInfo myConstructorInfo =
myAttributeType.GetConstructor(new Type[1]{typeof(MethodImplOptions)});
CustomAttributeBuilder myAttributeBuilder = new CustomAttributeBuilder(myConstructorInfo,
new object[1]{MethodImplOptions.PreserveSig});
@@ -74,11 +74,11 @@ public static void Main()
try
{
Type myType = CreateType(Thread.GetDomain());
- Type myClass2 = myType.Module.GetType("MyClass2");
+ Type myClass2 = myType.Module.GetType("MyClass2");
object myParam2 = Activator.CreateInstance(myClass2);
uint myUint=0x00000800;
object[] myArgs= {"MyFile.Txt",myParam2,myUint};
- Object myObject = myType.InvokeMember("OpenFile",BindingFlags.Public |
+ Object myObject = myType.InvokeMember("OpenFile",BindingFlags.Public |
BindingFlags.InvokeMethod | BindingFlags.Static,null,null,myArgs);
Console.WriteLine("MyClass.OpenFile method returned: \"{0}\"", myObject);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo/CS/fieldinfo.cs b/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo/CS/fieldinfo.cs
index 344b760c5aa..225ebb1b191 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo/CS/fieldinfo.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo/CS/fieldinfo.cs
@@ -13,7 +13,7 @@ public static void Main()
// Get the type and fields of FieldInfoClass.
myFieldInfo = myType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance
| BindingFlags.Public);
- Console.WriteLine("\nThe fields of " +
+ Console.WriteLine("\nThe fields of " +
"FieldInfoClass are \n");
// Display the field information of FieldInfoClass.
for(int i = 0; i < myFieldInfo.Length; i++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_FieldHandle/CS/fieldinfo_fieldhandle.cs b/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_FieldHandle/CS/fieldinfo_fieldhandle.cs
index 38d9b817e85..2b02d5c29d0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_FieldHandle/CS/fieldinfo_fieldhandle.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_FieldHandle/CS/fieldinfo_fieldhandle.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Reflection;
-
+
public class MyClass
{
public string MyField = "Microsoft";
@@ -11,7 +11,7 @@ public class FieldInfo_FieldHandle
{
public static void Main()
{
-
+
MyClass myClass =new MyClass();
// Get the type of MyClass.
@@ -20,9 +20,9 @@ public static void Main()
try
{
// Get the field information of MyField.
- FieldInfo myFieldInfo = myType.GetField("MyField", BindingFlags.Public
+ FieldInfo myFieldInfo = myType.GetField("MyField", BindingFlags.Public
| BindingFlags.Instance);
-
+
// Determine whether or not the FieldInfo object is null.
if(myFieldInfo!=null)
{
@@ -35,7 +35,7 @@ public static void Main()
{
Console.WriteLine("The myFieldInfo object is null.");
}
- }
+ }
catch(Exception e)
{
Console.WriteLine("Exception: {0}", e.Message);
@@ -45,8 +45,8 @@ public static void Main()
public static void DisplayFieldHandle(RuntimeFieldHandle myFieldHandle)
{
// Get the type from the handle.
- FieldInfo myField = FieldInfo.GetFieldFromHandle(myFieldHandle);
-
+ FieldInfo myField = FieldInfo.GetFieldFromHandle(myFieldHandle);
+
// Display the type.
Console.WriteLine("\nDisplaying the field from the handle.\n");
Console.WriteLine("The type is {0}.", myField.ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_GetFieldFromHandle/CS/fieldinfo_getfieldfromhandle.cs b/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_GetFieldFromHandle/CS/fieldinfo_getfieldfromhandle.cs
index 1f864c87593..2d26b3d8840 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_GetFieldFromHandle/CS/fieldinfo_getfieldfromhandle.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_GetFieldFromHandle/CS/fieldinfo_getfieldfromhandle.cs
@@ -22,7 +22,7 @@ public static void Main()
{
// Get the RuntimeFieldHandle of myFieldInfoArray.
myRuntimeFieldHandle = myFieldInfoArray[i].FieldHandle;
- // Call the GetFieldFromHandle method.
+ // Call the GetFieldFromHandle method.
FieldInfo myFieldInfo = FieldInfo.GetFieldFromHandle(myRuntimeFieldHandle);
// Display the FieldInfo of myFieldInfo.
Console.WriteLine("{0}", myFieldInfo);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_GetFieldFromHandle2/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_GetFieldFromHandle2/cs/source.cs
index 51a5d8389d8..fc1d6e4d8b0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_GetFieldFromHandle2/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FieldInfo_GetFieldFromHandle2/cs/source.cs
@@ -2,7 +2,7 @@
using System;
using System.Reflection;
-// A generic class with a field whose type is specified by the
+// A generic class with a field whose type is specified by the
// generic type parameter of the class.
public class Test
{
@@ -17,7 +17,7 @@ public static void Main()
RuntimeTypeHandle rth = typeof(Test).TypeHandle;
RuntimeFieldHandle rfh = typeof(Test).GetField("TestField").FieldHandle;
- // When a field belongs to a constructed generic type,
+ // When a field belongs to a constructed generic type,
// such as Test, retrieving the field from the
// field handle requires the type handle of the constructed
// generic type. An exception is thrown if the type is not
@@ -37,8 +37,8 @@ public static void Main()
Console.WriteLine("\r\nThe type of {0} is: {1}", fi.Name, fi.FieldType);
// All constructions of Test for which T is a reference
- // type share the same implementation, so the same runtime
- // field handle can be used to retrieve the FieldInfo for
+ // type share the same implementation, so the same runtime
+ // field handle can be used to retrieve the FieldInfo for
// TestField on any such construction. Here the runtime field
// handle is used with Test
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File GetAttributes/CS/file getattributes.cs b/samples/snippets/csharp/VS_Snippets_CLR/File GetAttributes/CS/file getattributes.cs
index adb5380f2e4..f309f5ec27e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File GetAttributes/CS/file getattributes.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File GetAttributes/CS/file getattributes.cs
@@ -3,14 +3,14 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
// Create the file if it does not exist.
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
File.Create(path);
}
@@ -23,8 +23,8 @@ public static void Main()
attributes = RemoveAttribute(attributes, FileAttributes.Hidden);
File.SetAttributes(path, attributes);
Console.WriteLine("The {0} file is no longer hidden.", path);
- }
- else
+ }
+ else
{
// Hide the file.
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File GetLastAccess/CS/file getlastaccess.cs b/samples/snippets/csharp/VS_Snippets_CLR/File GetLastAccess/CS/file getlastaccess.cs
index cd303eda95a..e83db7a9a26 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File GetLastAccess/CS/file getlastaccess.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File GetLastAccess/CS/file getlastaccess.cs
@@ -2,15 +2,15 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
- try
+ try
{
string path = @"c:\Temp\MyTest.txt";
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
File.Create(path);
}
@@ -24,9 +24,9 @@ public static void Main()
File.SetLastAccessTime(path, DateTime.Now);
dt = File.GetLastAccessTime(path);
Console.WriteLine("The last access time for this file was {0}.", dt);
- }
+ }
- catch (Exception e)
+ catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File GetLastWrite/CS/file getlastwrite.cs b/samples/snippets/csharp/VS_Snippets_CLR/File GetLastWrite/CS/file getlastwrite.cs
index 90feb4a986c..211412b1aa7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File GetLastWrite/CS/file getlastwrite.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File GetLastWrite/CS/file getlastwrite.cs
@@ -2,18 +2,18 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
- try
+ try
{
string path = @"c:\Temp\MyTest.txt";
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
File.Create(path);
- }
- else
+ }
+ else
{
// Take an action that will affect the write time.
File.SetLastWriteTime(path, new DateTime(1985,4,3));
@@ -27,9 +27,9 @@ public static void Main()
File.SetLastWriteTime(path, DateTime.Now);
dt = File.GetLastWriteTime(path);
Console.WriteLine("The last write time for this file was {0}.", dt);
- }
+ }
- catch (Exception e)
+ catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File Move/CS/file move.cs b/samples/snippets/csharp/VS_Snippets_CLR/File Move/CS/file move.cs
index d23e9193c55..b080ae8f325 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File Move/CS/file move.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File Move/CS/file move.cs
@@ -2,15 +2,15 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
string path2 = @"c:\temp2\MyTest.txt";
- try
+ try
{
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
// This statement ensures that the file is created,
// but the handle is not kept.
@@ -26,16 +26,16 @@ public static void Main()
Console.WriteLine("{0} was moved to {1}.", path, path2);
// See if the original exists now.
- if (File.Exists(path))
+ if (File.Exists(path))
{
Console.WriteLine("The original file still exists, which is unexpected.");
- }
- else
+ }
+ else
{
Console.WriteLine("The original file no longer exists, which is expected.");
}
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File Open1/CS/file open1.cs b/samples/snippets/csharp/VS_Snippets_CLR/File Open1/CS/file open1.cs
index f71f34fc9ab..f589fc1ede4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File Open1/CS/file open1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File Open1/CS/file open1.cs
@@ -3,13 +3,13 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
// Create a temporary file, and put some data into it.
string path = Path.GetTempFileName();
- using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Write, FileShare.None))
+ using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Write, FileShare.None))
{
Byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file.");
// Add some information to the file.
@@ -17,12 +17,12 @@ public static void Main()
}
// Open the stream and read it back.
- using (FileStream fs = File.Open(path, FileMode.Open))
+ using (FileStream fs = File.Open(path, FileMode.Open))
{
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
- while (fs.Read(b,0,b.Length) > 0)
+ while (fs.Read(b,0,b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File Open2/CS/file open2.cs b/samples/snippets/csharp/VS_Snippets_CLR/File Open2/CS/file open2.cs
index 9ea5e395890..20f747ffe18 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File Open2/CS/file open2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File Open2/CS/file open2.cs
@@ -3,21 +3,21 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
// This sample assumes that you have a folder named "c:\temp" on your computer.
string filePath = @"c:\temp\MyTest.txt";
// Delete the file if it exists.
- if (File.Exists(filePath))
+ if (File.Exists(filePath))
{
File.Delete(filePath);
}
-
+
// Create the file.
- using (FileStream fs = File.Create(filePath))
+ using (FileStream fs = File.Create(filePath))
{
Byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file.");
// Add some information to the file.
@@ -25,22 +25,22 @@ public static void Main()
}
// Open the stream and read it back.
- using (FileStream fs = File.Open(filePath, FileMode.Open, FileAccess.Read))
+ using (FileStream fs = File.Open(filePath, FileMode.Open, FileAccess.Read))
{
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
- while (fs.Read(b,0,b.Length) > 0)
+ while (fs.Read(b,0,b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
- try
+ try
{
// Try to write to the file.
fs.Write(b,0,b.Length);
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.WriteLine("Writing was disallowed, as expected: {0}", e.ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File Open3/CS/file open3.cs b/samples/snippets/csharp/VS_Snippets_CLR/File Open3/CS/file open3.cs
index f22464e9d84..9271514f937 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File Open3/CS/file open3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File Open3/CS/file open3.cs
@@ -3,17 +3,17 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
// Create the file if it does not exist.
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
// Create the file.
- using (FileStream fs = File.Create(path))
+ using (FileStream fs = File.Create(path))
{
Byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file.");
@@ -23,25 +23,25 @@ public static void Main()
}
// Open the stream and read it back.
- using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.None))
+ using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.None))
{
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
- while (fs.Read(b,0,b.Length) > 0)
+ while (fs.Read(b,0,b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
- try
+ try
{
// Try to get another handle to the same file.
- using (FileStream fs2 = File.Open(path, FileMode.Open))
+ using (FileStream fs2 = File.Open(path, FileMode.Open))
{
// Do some task here.
}
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.Write("Opening the file twice is disallowed.");
Console.WriteLine(", as expected: {0}", e.ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File OpenRead/CS/file openread.cs b/samples/snippets/csharp/VS_Snippets_CLR/File OpenRead/CS/file openread.cs
index 7e12167bab5..5e5f1de296c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File OpenRead/CS/file openread.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File OpenRead/CS/file openread.cs
@@ -3,16 +3,16 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
// Create the file.
- using (FileStream fs = File.Create(path))
+ using (FileStream fs = File.Create(path))
{
Byte[] info = new UTF8Encoding(true).GetBytes("This is some text in the file.");
@@ -22,12 +22,12 @@ public static void Main()
}
// Open the stream and read it back.
- using (FileStream fs = File.OpenRead(path))
+ using (FileStream fs = File.OpenRead(path))
{
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
- while (fs.Read(b,0,b.Length) > 0)
+ while (fs.Read(b,0,b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File OpenText/CS/file opentext.cs b/samples/snippets/csharp/VS_Snippets_CLR/File OpenText/CS/file opentext.cs
index 52cd6f17396..2fe0dd24aa0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File OpenText/CS/file opentext.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File OpenText/CS/file opentext.cs
@@ -3,18 +3,18 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
// Create the file.
- using (FileStream fs = File.Create(path))
+ using (FileStream fs = File.Create(path))
{
- Byte[] info =
+ Byte[] info =
new UTF8Encoding(true).GetBytes("This is some text in the file.");
// Add some information to the file.
@@ -23,10 +23,10 @@ public static void Main()
}
// Open the stream and read it back.
- using (StreamReader sr = File.OpenText(path))
+ using (StreamReader sr = File.OpenText(path))
{
string s = "";
- while ((s = sr.ReadLine()) != null)
+ while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File OpenWrite/CS/file openwrite.cs b/samples/snippets/csharp/VS_Snippets_CLR/File OpenWrite/CS/file openwrite.cs
index 21a61a1fe6c..edf9c5a2175 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File OpenWrite/CS/file openwrite.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File OpenWrite/CS/file openwrite.cs
@@ -3,16 +3,16 @@
using System.IO;
using System.Text;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
// Open the stream and write to it.
- using (FileStream fs = File.OpenWrite(path))
+ using (FileStream fs = File.OpenWrite(path))
{
- Byte[] info =
+ Byte[] info =
new UTF8Encoding(true).GetBytes("This is to test the OpenWrite method.");
// Add some information to the file.
@@ -20,12 +20,12 @@ public static void Main()
}
// Open the stream and read it back.
- using (FileStream fs = File.OpenRead(path))
+ using (FileStream fs = File.OpenRead(path))
{
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
- while (fs.Read(b,0,b.Length) > 0)
+ while (fs.Read(b,0,b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File SetLastAccess/CS/file setlastaccess.cs b/samples/snippets/csharp/VS_Snippets_CLR/File SetLastAccess/CS/file setlastaccess.cs
index dc39d5ab81f..833edc3f19b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File SetLastAccess/CS/file setlastaccess.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File SetLastAccess/CS/file setlastaccess.cs
@@ -2,15 +2,15 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
- try
+ try
{
string path = @"c:\Temp\MyTest.txt";
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
File.Create(path);
// Update the last access time.
@@ -25,8 +25,8 @@ public static void Main()
File.SetLastAccessTime(path, DateTime.Now);
dt = File.GetLastAccessTime(path);
Console.WriteLine("The last access time for this file was {0}.", dt);
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File SetLastWrite/CS/file setlastwrite.cs b/samples/snippets/csharp/VS_Snippets_CLR/File SetLastWrite/CS/file setlastwrite.cs
index 105885e771d..25c4665ce31 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File SetLastWrite/CS/file setlastwrite.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File SetLastWrite/CS/file setlastwrite.cs
@@ -2,18 +2,18 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
- try
+ try
{
string path = @"c:\Temp\MyTest.txt";
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
File.Create(path);
- }
- else
+ }
+ else
{
// Take an action that will affect the write time.
File.SetLastWriteTime(path, new DateTime(1985,4,3));
@@ -27,8 +27,8 @@ public static void Main()
File.SetLastWriteTime(path, DateTime.Now);
dt = File.GetLastWriteTime(path);
Console.WriteLine("The last write time for this file was {0}.", dt);
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FileInfoCopyTo1/CS/fileinfocopyto1.cs b/samples/snippets/csharp/VS_Snippets_CLR/FileInfoCopyTo1/CS/fileinfocopyto1.cs
index 6ee64c40b7c..1e1a4f6c45e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FileInfoCopyTo1/CS/fileinfocopyto1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FileInfoCopyTo1/CS/fileinfocopyto1.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class CopyToTest
+public class CopyToTest
{
- public static void Main()
+ public static void Main()
{
try
{
@@ -36,7 +36,7 @@ public static void Main()
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//This is the information in the first file:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FileLength/CS/filelength.cs b/samples/snippets/csharp/VS_Snippets_CLR/FileLength/CS/filelength.cs
index 8bc996a97b9..29940229940 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FileLength/CS/filelength.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FileLength/CS/filelength.cs
@@ -18,7 +18,7 @@ public static void Main()
Console.WriteLine("The size of {0} is {1} bytes.", f.Name, f.Length);
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//The directory c:\ contains the following files:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FileSystemInfo/CS/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/FileSystemInfo/CS/program.cs
index 95d436d4600..55801725f93 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FileSystemInfo/CS/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FileSystemInfo/CS/program.cs
@@ -38,7 +38,7 @@ static void DisplayFileSystemInfoAttributes(FileSystemInfo fsi)
}
// Output will vary based on contents of drive C.
-
+
// Directory entry C:\Documents and Settings was created on Tuesday, November 25, 2003
// Directory entry C:\Inetpub was created on Monday, January 12, 2004
// Directory entry C:\Program Files was created on Tuesday, November 25, 2003
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/FileSystemWatcher/cs/filesystemwatcher.cs b/samples/snippets/csharp/VS_Snippets_CLR/FileSystemWatcher/cs/filesystemwatcher.cs
index 084b5187b28..f65951616b4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/FileSystemWatcher/cs/filesystemwatcher.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/FileSystemWatcher/cs/filesystemwatcher.cs
@@ -14,13 +14,13 @@ static void Main(string[] args)
//
// Watch for changes in LastAccess and LastWrite times, and
- // the renaming of files or directories.
+ // the renaming of files or directories.
fsw.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
| NotifyFilters.FileName |NotifyFilters.DirectoryName;
//
//
- // Register a handler that gets called when a
+ // Register a handler that gets called when a
// file is created, changed, or deleted.
fsw.Changed += new FileSystemEventHandler(OnChanged);
@@ -31,7 +31,7 @@ static void Main(string[] args)
// Register a handler that gets called when a file is renamed.
fsw.Renamed += new RenamedEventHandler(OnRenamed);
- // Register a handler that gets called if the
+ // Register a handler that gets called if the
// FileSystemWatcher needs to report an error.
fsw.Error += new ErrorEventHandler(OnError);
//
@@ -44,9 +44,9 @@ static void Main(string[] args)
Console.WriteLine("Press \'Enter\' to quit the sample.");
Console.ReadLine();
}
- //
+ //
- //
+ //
// This method is called when a file is created, changed, or deleted.
private static void OnChanged(object source, FileSystemEventArgs e)
{
@@ -66,7 +66,7 @@ private static void OnRenamed(object source, RenamedEventArgs e)
}
//
- //
+ //
// This method is called when the FileSystemWatcher detects an error.
private static void OnError(object source, ErrorEventArgs e)
{
@@ -75,7 +75,7 @@ private static void OnError(object source, ErrorEventArgs e)
// Give more information if the error is due to an internal buffer overflow.
if (e.GetException().GetType() == typeof(InternalBufferOverflowException))
{
- // This can happen if Windows is reporting many file system events quickly
+ // This can happen if Windows is reporting many file system events quickly
// and internal buffer of the FileSystemWatcher is not large enough to handle this
// rate of events. The InternalBufferOverflowException error informs the application
// that some of the file system events are being lost.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/File_AppendText/CS/file_appendtext.cs b/samples/snippets/csharp/VS_Snippets_CLR/File_AppendText/CS/file_appendtext.cs
index d24db692c7c..735f55bbc25 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/File_AppendText/CS/file_appendtext.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/File_AppendText/CS/file_appendtext.cs
@@ -2,16 +2,16 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path = @"c:\temp\MyTest.txt";
// This text is added only once to the file.
- if (!File.Exists(path))
+ if (!File.Exists(path))
{
// Create a file to write to.
- using (StreamWriter sw = File.CreateText(path))
+ using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine("Hello");
sw.WriteLine("And");
@@ -21,7 +21,7 @@ public static void Main()
// This text is always added, making the file longer over time
// if it is not deleted.
- using (StreamWriter sw = File.AppendText(path))
+ using (StreamWriter sw = File.AppendText(path))
{
sw.WriteLine("This");
sw.WriteLine("is Extra");
@@ -29,10 +29,10 @@ public static void Main()
}
// Open the file to read from.
- using (StreamReader sr = File.OpenText(path))
+ using (StreamReader sr = File.OpenText(path))
{
string s = "";
- while ((s = sr.ReadLine()) != null)
+ while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Formatting.Composite/cs/Composite1.cs b/samples/snippets/csharp/VS_Snippets_CLR/Formatting.Composite/cs/Composite1.cs
index c4d93b086eb..660aa4270e0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Formatting.Composite/cs/Composite1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Formatting.Composite/cs/Composite1.cs
@@ -10,20 +10,20 @@ public static void Main()
String.Format("Name = {0}, hours = {1:hh}", name, DateTime.Now);
//
//
-
+
//
string FormatString1 = String.Format("{0:dddd MMMM}", DateTime.Now);
string FormatString2 = DateTime.Now.ToString("dddd MMMM");
//
-
+
//
int MyInt = 100;
Console.WriteLine("{0:C}", MyInt);
- // The example displays the following output
+ // The example displays the following output
// if en-US is the current culture:
// $100.00
//
-
+
CallSnippet5();
CallSnippet6();
}
@@ -35,7 +35,7 @@ private static void CallSnippet5()
Console.WriteLine(String.Format("Name = {0}, hours = {1:hh}, minutes = {1:mm}",
myName, DateTime.Now));
// Depending on the current time, the example displays output like the following:
- // Name = Fred, hours = 11, minutes = 30
+ // Name = Fred, hours = 11, minutes = 30
//
}
@@ -47,12 +47,12 @@ private static void CallSnippet6()
int myInt = 100;
string FormatFName = String.Format("First Name = |{0,10}|", myFName);
string FormatLName = String.Format("Last Name = |{0,10}|", myLName);
- string FormatPrice = String.Format("Price = |{0,10:C}|", myInt);
+ string FormatPrice = String.Format("Price = |{0,10:C}|", myInt);
Console.WriteLine(FormatFName);
Console.WriteLine(FormatLName);
Console.WriteLine(FormatPrice);
Console.WriteLine();
-
+
FormatFName = String.Format("First Name = |{0,-10}|", myFName);
FormatLName = String.Format("Last Name = |{0,-10}|", myLName);
FormatPrice = String.Format("Price = |{0,-10:C}|", myInt);
@@ -69,5 +69,5 @@ private static void CallSnippet6()
// Last Name = |Opals |
// Price = |$100.00 |
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Formatting.Composite/cs/Escaping1.cs b/samples/snippets/csharp/VS_Snippets_CLR/Formatting.Composite/cs/Escaping1.cs
index c958cc3378d..74ee232f191 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Formatting.Composite/cs/Escaping1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Formatting.Composite/cs/Escaping1.cs
@@ -6,11 +6,11 @@ public static void Main()
{
//
int value = 6324;
- string output = string.Format("{0}{1:D}{2}",
+ string output = string.Format("{0}{1:D}{2}",
"{", value, "}");
Console.WriteLine(output);
// The example displays the following output:
- // {6324}
+ // {6324}
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/GCNotification/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_CLR/GCNotification/cs/Program.cs
index 218ac183e4e..6a78266f4e8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/GCNotification/cs/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/GCNotification/cs/Program.cs
@@ -8,20 +8,20 @@ namespace GCNotify
{
class Program
{
- // Variable for continual checking in the
+ // Variable for continual checking in the
// While loop in the WaitForFullGCProc method.
static bool checkForNotify = false;
- // Variable for suspending work
+ // Variable for suspending work
// (such servicing allocated server requests)
- // after a notification is received and then
+ // after a notification is received and then
// resuming allocation after inducing a garbage collection.
static bool bAllocate = false;
// Variable for ending the example.
static bool finalExit = false;
- // Collection for objects that
+ // Collection for objects that
// simulate the server request workload.
static List load = new List();
@@ -29,7 +29,7 @@ public static void Main(string[] args)
{
try
{
- // Register for a notification.
+ // Register for a notification.
GC.RegisterForFullGCNotification(10, 10);
Console.WriteLine("Registered for GC notification.");
@@ -60,7 +60,7 @@ public static void Main(string[] args)
Console.WriteLine("Gen 2 collection count: {0}", GC.CollectionCount(2).ToString());
lastCollCount = newCollCount;
}
-
+
// For ending the example (arbitrary).
if (newCollCount == 500)
{
@@ -96,12 +96,12 @@ public static void OnFullGCApproachNotify()
Console.WriteLine("Redirecting requests.");
- // Method that tells the request queuing
- // server to not direct requests to this server.
+ // Method that tells the request queuing
+ // server to not direct requests to this server.
RedirectRequests();
- // Method that provides time to
- // finish processing pending requests.
+ // Method that provides time to
+ // finish processing pending requests.
FinishExistingRequests();
// This is a good time to induce a GC collection
@@ -148,9 +148,9 @@ public static void WaitForFullGCProc()
else
{
// This can occur if a timeout period
- // is specified for WaitForFullGCApproach(Timeout)
- // or WaitForFullGCComplete(Timeout)
- // and the time out period has elapsed.
+ // is specified for WaitForFullGCApproach(Timeout)
+ // or WaitForFullGCComplete(Timeout)
+ // and the time out period has elapsed.
Console.WriteLine("GC Notification not applicable.");
break;
}
@@ -179,7 +179,7 @@ public static void WaitForFullGCProc()
}
Thread.Sleep(500);
- // FinalExit is set to true right before
+ // FinalExit is set to true right before
// the main thread cancelled notification.
if (finalExit)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.IDictionary/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.IDictionary/CS/source.cs
index 84bfc43562b..72222fca4a2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.IDictionary/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.IDictionary/CS/source.cs
@@ -1,12 +1,12 @@
-// Do not use snippets 31 & 32 with snippet 21; snippet 21 goes
+// Do not use snippets 31 & 32 with snippet 21; snippet 21 goes
// with snippet 2, which already provides enough context. (2 and
-// 21 were originally one snippet, but had to be split when 31
+// 21 were originally one snippet, but had to be split when 31
// was added, because I don't trust overlapping snippets any
-// more.)
+// more.)
//
// Note further that {2, 21} is NOT USED right now because
// the complete sample (snippet 1) is located in IDictionary.Add.
-//
+//
// The groups are:
// {2, 21} - Add
// {31, 3, 4, 32} - Item
@@ -33,7 +33,7 @@ public static void Main()
//
IDictionary openWith = new Dictionary();
- // Add some elements to the dictionary. There are no
+ // Add some elements to the dictionary. There are no
// duplicate keys, but some of the values are duplicates.
// IDictionary.Add throws an exception if incorrect types
// are supplied for key or value.
@@ -50,12 +50,12 @@ public static void Main()
}
catch (ArgumentException ex)
{
- Console.WriteLine("An exception was caught for " +
+ Console.WriteLine("An exception was caught for " +
"IDictionary.Add. Exception message:\n\t{0}\n",
ex.Message);
}
- // The Add method throws an exception if the new key is
+ // The Add method throws an exception if the new key is
// already in the dictionary.
try
{
@@ -68,26 +68,26 @@ public static void Main()
//
//
- // The Item property is another name for the indexer, so you
- // can omit its name when accessing elements.
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ // The Item property is another name for the indexer, so you
+ // can omit its name when accessing elements.
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// The indexer can be used to change the value associated
// with a key.
openWith["rtf"] = "winword.exe";
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// If a key does not exist, setting the indexer for that key
// adds a new key/value pair.
openWith["doc"] = "winword.exe";
- // The indexer returns null if the key is of the wrong data
+ // The indexer returns null if the key is of the wrong data
// type.
- Console.WriteLine("The indexer returns null"
+ Console.WriteLine("The indexer returns null"
+ " if the key is of the wrong type:");
- Console.WriteLine("For key = 2, value = {0}.",
+ Console.WriteLine("For key = 2, value = {0}.",
openWith[2]);
// The indexer throws an exception when setting a value
@@ -98,7 +98,7 @@ public static void Main()
}
catch (ArgumentException)
{
- Console.WriteLine("A key of the wrong type was specified"
+ Console.WriteLine("A key of the wrong type was specified"
+ " when assigning to the indexer.");
}
//
@@ -107,17 +107,17 @@ public static void Main()
// Unlike the default Item property on the Dictionary class
// itself, IDictionary.Item does not throw an exception
// if the requested key is not in the dictionary.
- Console.WriteLine("For key = \"tif\", value = {0}.",
+ Console.WriteLine("For key = \"tif\", value = {0}.",
openWith["tif"]);
//
//
- // Contains can be used to test keys before inserting
+ // Contains can be used to test keys before inserting
// them.
if (!openWith.Contains("ht"))
{
openWith.Add("ht", "hypertrm.exe");
- Console.WriteLine("Value added for key = \"ht\": {0}",
+ Console.WriteLine("Value added for key = \"ht\": {0}",
openWith["ht"]);
}
@@ -134,7 +134,7 @@ public static void Main()
Console.WriteLine();
foreach( DictionaryEntry de in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
de.Key, de.Value);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IDic/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IDic/CS/source.cs
index 21b822ed9d7..d3dc2c8822e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IDic/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IDic/CS/source.cs
@@ -6,27 +6,27 @@ public class Example
{
public static void Main()
{
- // Create a new sorted dictionary of strings, with string
+ // Create a new sorted dictionary of strings, with string
// keys.
- SortedDictionary openWith =
+ SortedDictionary openWith =
new SortedDictionary();
-
- // Add some elements to the dictionary.
+
+ // Add some elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
-
- // Create a Dictionary of strings with string keys, and
+
+ // Create a Dictionary of strings with string keys, and
// initialize it with the contents of the sorted dictionary.
- Dictionary copy =
+ Dictionary copy =
new Dictionary(openWith);
// List the contents of the copy.
Console.WriteLine();
foreach( KeyValuePair kvp in copy )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IDicIEqC/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IDicIEqC/CS/source.cs
index d60f10e56b2..2fb66d97a39 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IDicIEqC/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IDicIEqC/CS/source.cs
@@ -6,30 +6,30 @@ public class Example
{
public static void Main()
{
- // Create a new sorted dictionary of strings, with string
+ // Create a new sorted dictionary of strings, with string
// keys and a case-insensitive comparer.
- SortedDictionary openWith =
+ SortedDictionary openWith =
new SortedDictionary(
StringComparer.CurrentCultureIgnoreCase);
-
- // Add some elements to the dictionary.
+
+ // Add some elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("Bmp", "paint.exe");
openWith.Add("DIB", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
-
+
// Create a Dictionary of strings with string keys and a
// case-insensitive equality comparer, and initialize it
// with the contents of the sorted dictionary.
- Dictionary copy =
- new Dictionary(openWith,
+ Dictionary copy =
+ new Dictionary(openWith,
StringComparer.CurrentCultureIgnoreCase);
// List the contents of the copy.
Console.WriteLine();
foreach( KeyValuePair kvp in copy )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IEqC/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IEqC/CS/source.cs
index 9f3d9045cec..1ba0add4b96 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IEqC/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_IEqC/CS/source.cs
@@ -6,19 +6,19 @@ public class Example
{
public static void Main()
{
- // Create a new Dictionary of strings, with string keys
+ // Create a new Dictionary of strings, with string keys
// and a case-insensitive comparer for the current culture.
- Dictionary openWith =
- new Dictionary(
+ Dictionary openWith =
+ new Dictionary(
StringComparer.CurrentCultureIgnoreCase);
-
+
// Add some elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("DIB", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
- // Try to add a fifth element with a key that is the same
+ // Try to add a fifth element with a key that is the same
// except for case; this would be allowed with the default
// comparer.
try
@@ -29,12 +29,12 @@ public static void Main()
{
Console.WriteLine("\nBMP is already in the dictionary.");
}
-
+
// List the contents of the sorted dictionary.
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
+ Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32/CS/source.cs
index 8b06469e80e..02a11de708c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32/CS/source.cs
@@ -8,20 +8,20 @@ public static void Main()
{
// Create a new dictionary of strings, with string keys and
// an initial capacity of 4.
- Dictionary openWith =
+ Dictionary openWith =
new Dictionary(4);
-
- // Add 4 elements to the dictionary.
+
+ // Add 4 elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
-
+
// List the contents of the dictionary.
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32IEqC/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32IEqC/CS/source.cs
index 559c4963b6e..74ab55caa62 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32IEqC/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary.ctor_Int32IEqC/CS/source.cs
@@ -7,19 +7,19 @@ public class Example
public static void Main()
{
// Create a new dictionary of strings, with string keys, an
- // initial capacity of 5, and a case-insensitive equality
+ // initial capacity of 5, and a case-insensitive equality
// comparer.
- Dictionary openWith =
- new Dictionary(5,
+ Dictionary openWith =
+ new Dictionary(5,
StringComparer.CurrentCultureIgnoreCase);
-
- // Add 4 elements to the dictionary.
+
+ // Add 4 elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("DIB", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
- // Try to add a fifth element with a key that is the same
+ // Try to add a fifth element with a key that is the same
// except for case; this would be allowed with the default
// comparer.
try
@@ -30,12 +30,12 @@ public static void Main()
{
Console.WriteLine("\nBMP is already in the dictionary.");
}
-
+
// List the contents of the dictionary.
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
+ Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary/CS/source.cs
index 79659341371..808e76c4712 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Dictionary/CS/source.cs
@@ -9,17 +9,17 @@ public static void Main()
//
// Create a new dictionary of strings, with string keys.
//
- Dictionary openWith =
+ Dictionary openWith =
new Dictionary();
- // Add some elements to the dictionary. There are no
+ // Add some elements to the dictionary. There are no
// duplicate keys, but some of the values are duplicates.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
- // The Add method throws an exception if the new key is
+ // The Add method throws an exception if the new key is
// already in the dictionary.
try
{
@@ -32,15 +32,15 @@ public static void Main()
//
//
- // The Item property is another name for the indexer, so you
- // can omit its name when accessing elements.
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ // The Item property is another name for the indexer, so you
+ // can omit its name when accessing elements.
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// The indexer can be used to change the value associated
// with a key.
openWith["rtf"] = "winword.exe";
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// If a key does not exist, setting the indexer for that key
@@ -53,7 +53,7 @@ public static void Main()
// not in the dictionary.
try
{
- Console.WriteLine("For key = \"tif\", value = {0}.",
+ Console.WriteLine("For key = \"tif\", value = {0}.",
openWith["tif"]);
}
catch (KeyNotFoundException)
@@ -64,7 +64,7 @@ public static void Main()
//
// When a program often has to try keys that turn out not to
- // be in the dictionary, TryGetValue can be a more efficient
+ // be in the dictionary, TryGetValue can be a more efficient
// way to retrieve values.
string value = "";
if (openWith.TryGetValue("tif", out value))
@@ -78,12 +78,12 @@ public static void Main()
//
//
- // ContainsKey can be used to test keys before inserting
+ // ContainsKey can be used to test keys before inserting
// them.
if (!openWith.ContainsKey("ht"))
{
openWith.Add("ht", "hypertrm.exe");
- Console.WriteLine("Value added for key = \"ht\": {0}",
+ Console.WriteLine("Value added for key = \"ht\": {0}",
openWith["ht"]);
}
//
@@ -94,7 +94,7 @@ public static void Main()
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.IDictionary/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.IDictionary/CS/source.cs
index be75530a565..5e67ba707cf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.IDictionary/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.IDictionary/CS/source.cs
@@ -7,19 +7,19 @@ public class Example
public static void Main()
{
//
- // Create a new dictionary of strings, with string keys,
+ // Create a new dictionary of strings, with string keys,
// and access it through the IDictionary generic interface.
- IDictionary openWith =
+ IDictionary openWith =
new Dictionary();
- // Add some elements to the dictionary. There are no
+ // Add some elements to the dictionary. There are no
// duplicate keys, but some of the values are duplicates.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
- // The Add method throws an exception if the new key is
+ // The Add method throws an exception if the new key is
// already in the dictionary.
try
{
@@ -32,15 +32,15 @@ public static void Main()
//
//
- // The Item property is another name for the indexer, so you
- // can omit its name when accessing elements.
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ // The Item property is another name for the indexer, so you
+ // can omit its name when accessing elements.
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// The indexer can be used to change the value associated
// with a key.
openWith["rtf"] = "winword.exe";
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// If a key does not exist, setting the indexer for that key
@@ -53,7 +53,7 @@ public static void Main()
// not in the dictionary.
try
{
- Console.WriteLine("For key = \"tif\", value = {0}.",
+ Console.WriteLine("For key = \"tif\", value = {0}.",
openWith["tif"]);
}
catch (KeyNotFoundException)
@@ -64,7 +64,7 @@ public static void Main()
//
// When a program often has to try keys that turn out not to
- // be in the dictionary, TryGetValue can be a more efficient
+ // be in the dictionary, TryGetValue can be a more efficient
// way to retrieve values.
string value = "";
if (openWith.TryGetValue("tif", out value))
@@ -78,12 +78,12 @@ public static void Main()
//
//
- // ContainsKey can be used to test keys before inserting
+ // ContainsKey can be used to test keys before inserting
// them.
if (!openWith.ContainsKey("ht"))
{
openWith.Add("ht", "hypertrm.exe");
- Console.WriteLine("Value added for key = \"ht\": {0}",
+ Console.WriteLine("Value added for key = \"ht\": {0}",
openWith["ht"]);
}
//
@@ -94,7 +94,7 @@ public static void Main()
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Queue/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Queue/cs/source.cs
index d08a79ec526..21a64b1f789 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Queue/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Queue/cs/source.cs
@@ -20,7 +20,7 @@ public static void Main()
}
Console.WriteLine("\nDequeuing '{0}'", numbers.Dequeue());
- Console.WriteLine("Peek at next item to dequeue: {0}",
+ Console.WriteLine("Peek at next item to dequeue: {0}",
numbers.Peek());
Console.WriteLine("Dequeuing '{0}'", numbers.Dequeue());
@@ -33,13 +33,13 @@ public static void Main()
{
Console.WriteLine(number);
}
-
+
// Create an array twice the size of the queue and copy the
- // elements of the queue, starting at the middle of the
- // array.
+ // elements of the queue, starting at the middle of the
+ // array.
string[] array2 = new string[numbers.Count * 2];
numbers.CopyTo(array2, numbers.Count);
-
+
// Create a second queue, using the constructor that accepts an
// IEnumerable(Of T).
Queue queueCopy2 = new Queue(array2);
@@ -50,7 +50,7 @@ public static void Main()
Console.WriteLine(number);
}
- Console.WriteLine("\nqueueCopy.Contains(\"four\") = {0}",
+ Console.WriteLine("\nqueueCopy.Contains(\"four\") = {0}",
queueCopy.Contains("four"));
Console.WriteLine("\nqueueCopy.Clear()");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/CS/source.cs
index 3def6851294..d0cf3ac45db 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.IDictionary/CS/source.cs
@@ -1,12 +1,12 @@
-// Do not use snippets 31 & 32 with snippet 21; snippet 21 goes
+// Do not use snippets 31 & 32 with snippet 21; snippet 21 goes
// with snippet 2, which already provides enough context. (2 and
-// 21 were originally one snippet, but had to be split when 31
+// 21 were originally one snippet, but had to be split when 31
// was added, because I don't trust overlapping snippets any
-// more.)
+// more.)
//
// Note further that {2, 21} is NOT USED right now because
// the complete sample (snippet 1) is located in IDictionary.Add.
-//
+//
// The groups are:
// {2, 21} - Add
// {31, 3, 4, 32} - Item
@@ -33,7 +33,7 @@ public static void Main()
//
IDictionary openWith = new SortedDictionary();
- // Add some elements to the dictionary. There are no
+ // Add some elements to the dictionary. There are no
// duplicate keys, but some of the values are duplicates.
// IDictionary.Add throws an exception if incorrect types
// are supplied for key or value.
@@ -50,12 +50,12 @@ public static void Main()
}
catch (ArgumentException ex)
{
- Console.WriteLine("An exception was caught for " +
+ Console.WriteLine("An exception was caught for " +
"IDictionary.Add. Exception message:\n\t{0}\n",
ex.Message);
}
- // The Add method throws an exception if the new key is
+ // The Add method throws an exception if the new key is
// already in the dictionary.
try
{
@@ -68,26 +68,26 @@ public static void Main()
//
//
- // The Item property is another name for the indexer, so you
- // can omit its name when accessing elements.
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ // The Item property is another name for the indexer, so you
+ // can omit its name when accessing elements.
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// The indexer can be used to change the value associated
// with a key.
openWith["rtf"] = "winword.exe";
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// If a key does not exist, setting the indexer for that key
// adds a new key/value pair.
openWith["doc"] = "winword.exe";
- // The indexer returns null if the key is of the wrong data
+ // The indexer returns null if the key is of the wrong data
// type.
- Console.WriteLine("The indexer returns null"
+ Console.WriteLine("The indexer returns null"
+ " if the key is of the wrong type:");
- Console.WriteLine("For key = 2, value = {0}.",
+ Console.WriteLine("For key = 2, value = {0}.",
openWith[2]);
// The indexer throws an exception when setting a value
@@ -98,7 +98,7 @@ public static void Main()
}
catch (ArgumentException)
{
- Console.WriteLine("A key of the wrong type was specified"
+ Console.WriteLine("A key of the wrong type was specified"
+ " when assigning to the indexer.");
}
//
@@ -107,17 +107,17 @@ public static void Main()
// Unlike the default Item property on the Dictionary class
// itself, IDictionary.Item does not throw an exception
// if the requested key is not in the dictionary.
- Console.WriteLine("For key = \"tif\", value = {0}.",
+ Console.WriteLine("For key = \"tif\", value = {0}.",
openWith["tif"]);
//
//
- // Contains can be used to test keys before inserting
+ // Contains can be used to test keys before inserting
// them.
if (!openWith.Contains("ht"))
{
openWith.Add("ht", "hypertrm.exe");
- Console.WriteLine("Value added for key = \"ht\": {0}",
+ Console.WriteLine("Value added for key = \"ht\": {0}",
openWith["ht"]);
}
@@ -134,7 +134,7 @@ public static void Main()
Console.WriteLine();
foreach( DictionaryEntry de in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
de.Key, de.Value);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IComp/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IComp/CS/source.cs
index c294fd941bf..9072a2332d7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IComp/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IComp/CS/source.cs
@@ -6,19 +6,19 @@ public class Example
{
public static void Main()
{
- // Create a new SortedDictionary of strings, with string keys
+ // Create a new SortedDictionary of strings, with string keys
// and a case-insensitive comparer for the current culture.
- SortedDictionary openWith =
- new SortedDictionary(
+ SortedDictionary openWith =
+ new SortedDictionary(
StringComparer.CurrentCultureIgnoreCase);
-
+
// Add some elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("DIB", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
- // Try to add a fifth element with a key that is the same
+ // Try to add a fifth element with a key that is the same
// except for case; this would be allowed with the default
// comparer.
try
@@ -29,12 +29,12 @@ public static void Main()
{
Console.WriteLine("\nBMP is already in the dictionary.");
}
-
+
// List the contents of the sorted dictionary.
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
+ Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDic/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDic/CS/source.cs
index 162c752ef4e..9bd7d4c9e27 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDic/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDic/CS/source.cs
@@ -8,25 +8,25 @@ public static void Main()
{
// Create a new Dictionary of strings, with string keys.
//
- Dictionary openWith =
+ Dictionary openWith =
new Dictionary();
-
- // Add some elements to the dictionary.
+
+ // Add some elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
-
- // Create a SortedDictionary of strings with string keys,
+
+ // Create a SortedDictionary of strings with string keys,
// and initialize it with the contents of the Dictionary.
- SortedDictionary copy =
+ SortedDictionary copy =
new SortedDictionary(openWith);
// List the contents of the copy.
Console.WriteLine();
foreach( KeyValuePair kvp in copy )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDicIComp/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDicIComp/CS/source.cs
index 50d7550c4a3..935d3782d4c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDicIComp/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary.ctor_IDicIComp/CS/source.cs
@@ -7,38 +7,38 @@ public class Example
public static void Main()
{
// Create a new Dictionary of strings, with string keys and
- // a case-insensitive equality comparer for the current
+ // a case-insensitive equality comparer for the current
// culture.
- Dictionary openWith =
+ Dictionary openWith =
new Dictionary
(StringComparer.CurrentCultureIgnoreCase);
-
- // Add some elements to the dictionary.
+
+ // Add some elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("Bmp", "paint.exe");
openWith.Add("DIB", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
-
+
// List the contents of the Dictionary.
Console.WriteLine();
foreach( KeyValuePair kvp in openWith)
{
- Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
+ Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
kvp.Value);
}
- // Create a SortedDictionary of strings with string keys and a
+ // Create a SortedDictionary of strings with string keys and a
// case-insensitive equality comparer for the current culture,
// and initialize it with the contents of the Dictionary.
- SortedDictionary copy =
- new SortedDictionary(openWith,
+ SortedDictionary copy =
+ new SortedDictionary(openWith,
StringComparer.CurrentCultureIgnoreCase);
// List the sorted contents of the copy.
Console.WriteLine();
foreach( KeyValuePair kvp in copy )
{
- Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
+ Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary/CS/source.cs
index cb8c3f5e818..01678314909 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedDictionary/CS/source.cs
@@ -9,17 +9,17 @@ public static void Main()
//
// Create a new sorted dictionary of strings, with string
// keys.
- SortedDictionary openWith =
+ SortedDictionary openWith =
new SortedDictionary();
- // Add some elements to the dictionary. There are no
+ // Add some elements to the dictionary. There are no
// duplicate keys, but some of the values are duplicates.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
- // The Add method throws an exception if the new key is
+ // The Add method throws an exception if the new key is
// already in the dictionary.
try
{
@@ -32,15 +32,15 @@ public static void Main()
//
//
- // The Item property is another name for the indexer, so you
- // can omit its name when accessing elements.
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ // The Item property is another name for the indexer, so you
+ // can omit its name when accessing elements.
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// The indexer can be used to change the value associated
// with a key.
openWith["rtf"] = "winword.exe";
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// If a key does not exist, setting the indexer for that key
@@ -53,7 +53,7 @@ public static void Main()
// not in the dictionary.
try
{
- Console.WriteLine("For key = \"tif\", value = {0}.",
+ Console.WriteLine("For key = \"tif\", value = {0}.",
openWith["tif"]);
}
catch (KeyNotFoundException)
@@ -64,7 +64,7 @@ public static void Main()
//
// When a program often has to try keys that turn out not to
- // be in the dictionary, TryGetValue can be a more efficient
+ // be in the dictionary, TryGetValue can be a more efficient
// way to retrieve values.
string value = "";
if (openWith.TryGetValue("tif", out value))
@@ -78,12 +78,12 @@ public static void Main()
//
//
- // ContainsKey can be used to test keys before inserting
+ // ContainsKey can be used to test keys before inserting
// them.
if (!openWith.ContainsKey("ht"))
{
openWith.Add("ht", "hypertrm.exe");
- Console.WriteLine("Value added for key = \"ht\": {0}",
+ Console.WriteLine("Value added for key = \"ht\": {0}",
openWith["ht"]);
}
//
@@ -94,14 +94,14 @@ public static void Main()
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
//
//
// To get the values alone, use the Values property.
- SortedDictionary.ValueCollection valueColl =
+ SortedDictionary.ValueCollection valueColl =
openWith.Values;
// The elements of the ValueCollection are strongly typed
@@ -115,7 +115,7 @@ public static void Main()
//
// To get the keys alone, use the Keys property.
- SortedDictionary.KeyCollection keyColl =
+ SortedDictionary.KeyCollection keyColl =
openWith.Keys;
// The elements of the KeyCollection are strongly typed
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.IDictionary/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.IDictionary/CS/source.cs
index fb5e992a748..418c0a42728 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.IDictionary/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.IDictionary/CS/source.cs
@@ -1,12 +1,12 @@
-// Do not use snippets 31 & 32 with snippet 21; snippet 21 goes
+// Do not use snippets 31 & 32 with snippet 21; snippet 21 goes
// with snippet 2, which already provides enough context. (2 and
-// 21 were originally one snippet, but had to be split when 31
+// 21 were originally one snippet, but had to be split when 31
// was added, because I don't trust overlapping snippets any
-// more.)
+// more.)
//
// Note further that {2, 21} is NOT USED right now because
// the complete sample (snippet 1) is located in IDictionary.Add.
-//
+//
// The groups are:
// {2, 21} - Add
// {31, 3, 4, 32} - Item
@@ -33,7 +33,7 @@ public static void Main()
//
IDictionary openWith = new SortedList();
- // Add some elements to the sorted list. There are no
+ // Add some elements to the sorted list. There are no
// duplicate keys, but some of the values are duplicates.
// IDictionary.Add throws an exception if incorrect types
// are supplied for key or value.
@@ -50,12 +50,12 @@ public static void Main()
}
catch (ArgumentException ex)
{
- Console.WriteLine("An exception was caught for " +
+ Console.WriteLine("An exception was caught for " +
"IDictionary.Add. Exception message:\n\t{0}\n",
ex.Message);
}
- // The Add method throws an exception if the new key is
+ // The Add method throws an exception if the new key is
// already in the sorted list.
try
{
@@ -68,26 +68,26 @@ public static void Main()
//
//
- // The Item property is another name for the indexer, so you
- // can omit its name when accessing elements.
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ // The Item property is another name for the indexer, so you
+ // can omit its name when accessing elements.
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// The indexer can be used to change the value associated
// with a key.
openWith["rtf"] = "winword.exe";
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// If a key does not exist, setting the indexer for that key
// adds a new key/value pair.
openWith["doc"] = "winword.exe";
- // The indexer returns null if the key is of the wrong data
+ // The indexer returns null if the key is of the wrong data
// type.
- Console.WriteLine("The indexer returns null"
+ Console.WriteLine("The indexer returns null"
+ " if the key is of the wrong type:");
- Console.WriteLine("For key = 2, value = {0}.",
+ Console.WriteLine("For key = 2, value = {0}.",
openWith[2]);
// The indexer throws an exception when setting a value
@@ -98,7 +98,7 @@ public static void Main()
}
catch (ArgumentException)
{
- Console.WriteLine("A key of the wrong type was specified"
+ Console.WriteLine("A key of the wrong type was specified"
+ " when assigning to the indexer.");
}
//
@@ -107,17 +107,17 @@ public static void Main()
// Unlike the default Item property on the SorteList class
// itself, IDictionary.Item does not throw an exception
// if the requested key is not in the sorted list.
- Console.WriteLine("For key = \"tif\", value = {0}.",
+ Console.WriteLine("For key = \"tif\", value = {0}.",
openWith["tif"]);
//
//
- // Contains can be used to test keys before inserting
+ // Contains can be used to test keys before inserting
// them.
if (!openWith.Contains("ht"))
{
openWith.Add("ht", "hypertrm.exe");
- Console.WriteLine("Value added for key = \"ht\": {0}",
+ Console.WriteLine("Value added for key = \"ht\": {0}",
openWith["ht"]);
}
@@ -134,7 +134,7 @@ public static void Main()
Console.WriteLine();
foreach( DictionaryEntry de in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
de.Key, de.Value);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IComp/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IComp/CS/source.cs
index 45f81b88a05..161213df6b9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IComp/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IComp/CS/source.cs
@@ -8,17 +8,17 @@ public static void Main()
{
// Create a new sorted list of strings, with string keys and
// a case-insensitive comparer for the current culture.
- SortedList openWith =
- new SortedList(
+ SortedList openWith =
+ new SortedList(
StringComparer.CurrentCultureIgnoreCase);
-
- // Add some elements to the list.
+
+ // Add some elements to the list.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("DIB", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
- // Try to add a fifth element with a key that is the same
+ // Try to add a fifth element with a key that is the same
// except for case; this would be allowed with the default
// comparer.
try
@@ -29,12 +29,12 @@ public static void Main()
{
Console.WriteLine("\nBMP is already in the sorted list.");
}
-
+
// List the contents of the sorted list.
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
+ Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IDic/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IDic/CS/source.cs
index 2726db2544d..16043cd798f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IDic/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IDic/CS/source.cs
@@ -8,25 +8,25 @@ public static void Main()
{
// Create a new Dictionary of strings, with string keys.
//
- Dictionary openWith =
+ Dictionary openWith =
new Dictionary();
-
- // Add some elements to the dictionary.
+
+ // Add some elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
-
- // Create a SortedList of strings with string keys,
+
+ // Create a SortedList of strings with string keys,
// and initialize it with the contents of the Dictionary.
- SortedList copy =
+ SortedList copy =
new SortedList(openWith);
// List the contents of the copy.
Console.WriteLine();
foreach( KeyValuePair kvp in copy )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IDicIComp/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IDicIComp/CS/source.cs
index ded813b1db3..a82aaa407c5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IDicIComp/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_IDicIComp/CS/source.cs
@@ -7,30 +7,30 @@ public class Example
public static void Main()
{
// Create a new Dictionary of strings, with string keys and
- // a case-insensitive equality comparer for the current
+ // a case-insensitive equality comparer for the current
// culture.
- Dictionary openWith =
+ Dictionary openWith =
new Dictionary
(StringComparer.CurrentCultureIgnoreCase);
-
- // Add some elements to the dictionary.
+
+ // Add some elements to the dictionary.
openWith.Add("txt", "notepad.exe");
openWith.Add("Bmp", "paint.exe");
openWith.Add("DIB", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
-
- // Create a SortedList of strings with string keys and a
+
+ // Create a SortedList of strings with string keys and a
// case-insensitive equality comparer for the current culture,
// and initialize it with the contents of the Dictionary.
- SortedList copy =
- new SortedList(openWith,
+ SortedList copy =
+ new SortedList(openWith,
StringComparer.CurrentCultureIgnoreCase);
// List the sorted contents of the copy.
Console.WriteLine();
foreach( KeyValuePair kvp in copy )
{
- Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
+ Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_Int32/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_Int32/CS/source.cs
index 2780ad90158..fa0457170a4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_Int32/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_Int32/CS/source.cs
@@ -8,20 +8,20 @@ public static void Main()
{
// Create a new sorted list of strings, with string keys and
// an initial capacity of 4.
- SortedList openWith =
+ SortedList openWith =
new SortedList(4);
-
- // Add 4 elements to the list.
+
+ // Add 4 elements to the list.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
-
+
// List the contents of the sorted list.
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_Int32IComp/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_Int32IComp/CS/source.cs
index dac77d8896c..637163bbd0a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_Int32IComp/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList.ctor_Int32IComp/CS/source.cs
@@ -8,17 +8,17 @@ public static void Main()
{
// Create a new sorted list of strings, with string keys, an
// initial capacity of 5, and a case-insensitive comparer.
- SortedList openWith =
- new SortedList(5,
+ SortedList openWith =
+ new SortedList(5,
StringComparer.CurrentCultureIgnoreCase);
-
- // Add 4 elements to the list.
+
+ // Add 4 elements to the list.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("DIB", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
- // Try to add a fifth element with a key that is the same
+ // Try to add a fifth element with a key that is the same
// except for case; this would be allowed with the default
// comparer.
try
@@ -29,12 +29,12 @@ public static void Main()
{
Console.WriteLine("\nBMP is already in the sorted list.");
}
-
+
// List the contents of the sorted list.
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
+ Console.WriteLine("Key = {0}, Value = {1}", kvp.Key,
kvp.Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/remarks.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/remarks.cs
index 667381e8e0b..a4effdfee3c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/remarks.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/remarks.cs
@@ -10,7 +10,7 @@ public static void Main()
SortedList mySortedList =
new SortedList();
- // Add some elements to the list. There are no
+ // Add some elements to the list. There are no
// duplicate keys, but some of the values are duplicates.
mySortedList.Add(0, "notepad.exe");
mySortedList.Add(1, "paint.exe");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/source.cs
index 701ffff584d..8e5dcb226a2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.SortedList/CS/source.cs
@@ -9,17 +9,17 @@ public static void Main()
//
// Create a new sorted list of strings, with string
// keys.
- SortedList openWith =
+ SortedList openWith =
new SortedList();
- // Add some elements to the list. There are no
+ // Add some elements to the list. There are no
// duplicate keys, but some of the values are duplicates.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
openWith.Add("dib", "paint.exe");
openWith.Add("rtf", "wordpad.exe");
- // The Add method throws an exception if the new key is
+ // The Add method throws an exception if the new key is
// already in the list.
try
{
@@ -32,15 +32,15 @@ public static void Main()
//
//
- // The Item property is another name for the indexer, so you
- // can omit its name when accessing elements.
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ // The Item property is another name for the indexer, so you
+ // can omit its name when accessing elements.
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// The indexer can be used to change the value associated
// with a key.
openWith["rtf"] = "winword.exe";
- Console.WriteLine("For key = \"rtf\", value = {0}.",
+ Console.WriteLine("For key = \"rtf\", value = {0}.",
openWith["rtf"]);
// If a key does not exist, setting the indexer for that key
@@ -53,7 +53,7 @@ public static void Main()
// not in the list.
try
{
- Console.WriteLine("For key = \"tif\", value = {0}.",
+ Console.WriteLine("For key = \"tif\", value = {0}.",
openWith["tif"]);
}
catch (KeyNotFoundException)
@@ -64,7 +64,7 @@ public static void Main()
//
// When a program often has to try keys that turn out not to
- // be in the list, TryGetValue can be a more efficient
+ // be in the list, TryGetValue can be a more efficient
// way to retrieve values.
string value = "";
if (openWith.TryGetValue("tif", out value))
@@ -78,12 +78,12 @@ public static void Main()
//
//
- // ContainsKey can be used to test keys before inserting
+ // ContainsKey can be used to test keys before inserting
// them.
if (!openWith.ContainsKey("ht"))
{
openWith.Add("ht", "hypertrm.exe");
- Console.WriteLine("Value added for key = \"ht\": {0}",
+ Console.WriteLine("Value added for key = \"ht\": {0}",
openWith["ht"]);
}
//
@@ -94,7 +94,7 @@ public static void Main()
Console.WriteLine();
foreach( KeyValuePair kvp in openWith )
{
- Console.WriteLine("Key = {0}, Value = {1}",
+ Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
//
@@ -103,7 +103,7 @@ public static void Main()
// To get the values alone, use the Values property.
IList ilistValues = openWith.Values;
- // The elements of the list are strongly typed with the
+ // The elements of the list are strongly typed with the
// type that was specified for the SorteList values.
Console.WriteLine();
foreach( string s in ilistValues )
@@ -121,7 +121,7 @@ public static void Main()
// To get the keys alone, use the Keys property.
IList ilistKeys = openWith.Keys;
- // The elements of the list are strongly typed with the
+ // The elements of the list are strongly typed with the
// type that was specified for the SortedList keys.
Console.WriteLine();
foreach( string s in ilistKeys )
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs
index d9ba6e211cd..0d3cc69f659 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Generic.Stack/cs/source.cs
@@ -20,7 +20,7 @@ public static void Main()
}
Console.WriteLine("\nPopping '{0}'", numbers.Pop());
- Console.WriteLine("Peek at next item to destack: {0}",
+ Console.WriteLine("Peek at next item to destack: {0}",
numbers.Peek());
Console.WriteLine("Popping '{0}'", numbers.Pop());
@@ -33,13 +33,13 @@ public static void Main()
{
Console.WriteLine(number);
}
-
+
// Create an array twice the size of the stack and copy the
- // elements of the stack, starting at the middle of the
- // array.
+ // elements of the stack, starting at the middle of the
+ // array.
string[] array2 = new string[numbers.Count * 2];
numbers.CopyTo(array2, numbers.Count);
-
+
// Create a second stack, using the constructor that accepts an
// IEnumerable(Of T).
Stack stack3 = new Stack(array2);
@@ -50,7 +50,7 @@ public static void Main()
Console.WriteLine(number);
}
- Console.WriteLine("\nstack2.Contains(\"four\") = {0}",
+ Console.WriteLine("\nstack2.Contains(\"four\") = {0}",
stack2.Contains("four"));
Console.WriteLine("\nstack2.Clear()");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/GenericMethodBuilder/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/GenericMethodBuilder/CS/source.cs
index c7c14783e0f..4184f4da239 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/GenericMethodBuilder/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/GenericMethodBuilder/CS/source.cs
@@ -5,59 +5,59 @@
class DemoMethodBuilder
{
-
+
public static void Main()
{
// Creating a dynamic assembly requires an AssemblyName
// object, and the current application domain.
//
- AssemblyName asmName =
+ AssemblyName asmName =
new AssemblyName("DemoMethodBuilder1");
AppDomain domain = AppDomain.CurrentDomain;
- AssemblyBuilder demoAssembly =
+ AssemblyBuilder demoAssembly =
domain.DefineDynamicAssembly(
- asmName,
+ asmName,
AssemblyBuilderAccess.RunAndSave
);
- // Define the module that contains the code. For an
- // assembly with one module, the module name is the
+ // Define the module that contains the code. For an
+ // assembly with one module, the module name is the
// assembly name plus a file extension.
- ModuleBuilder demoModule =
+ ModuleBuilder demoModule =
demoAssembly.DefineDynamicModule(
- asmName.Name,
+ asmName.Name,
asmName.Name + ".dll"
);
-
+
TypeBuilder demoType = demoModule.DefineType(
- "DemoType",
+ "DemoType",
TypeAttributes.Public | TypeAttributes.Abstract
);
//
// Define a Shared, Public method with standard calling
// conventions. Do not specify the parameter types or the
- // return type, because type parameters will be used for
+ // return type, because type parameters will be used for
// those types, and the type parameters have not been
// defined yet.
MethodBuilder demoMethod = demoType.DefineMethod(
- "DemoMethod",
+ "DemoMethod",
MethodAttributes.Public | MethodAttributes.Static
);
//
//
// Defining generic parameters for the method makes it a
- // generic method. By convention, type parameters are
+ // generic method. By convention, type parameters are
// single alphabetic characters. T and U are used here.
//
string[] typeParamNames = {"T", "U"};
- GenericTypeParameterBuilder[] typeParameters =
+ GenericTypeParameterBuilder[] typeParameters =
demoMethod.DefineGenericParameters(typeParamNames);
- // The second type parameter is constrained to be a
+ // The second type parameter is constrained to be a
// reference type.
- typeParameters[1].SetGenericParameterAttributes(
+ typeParameters[1].SetGenericParameterAttributes(
GenericParameterAttributes.ReferenceTypeConstraint);
//
@@ -65,9 +65,9 @@ public static void Main()
// Use the IsGenericMethod property to find out if a
// dynamic method is generic, and IsGenericMethodDefinition
// to find out if it defines a generic method.
- Console.WriteLine("Is DemoMethod generic? {0}",
+ Console.WriteLine("Is DemoMethod generic? {0}",
demoMethod.IsGenericMethod);
- Console.WriteLine("Is DemoMethod a generic method definition? {0}",
+ Console.WriteLine("Is DemoMethod a generic method definition? {0}",
demoMethod.IsGenericMethodDefinition);
//
@@ -94,7 +94,7 @@ public static void Main()
// Complete the type.
Type dt = demoType.CreateType();
- // To bind types to a dynamic generic method, you must
+ // To bind types to a dynamic generic method, you must
// first call the GetMethod method on the completed type.
// You can then define an array of types, and bind them
// to the method.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca1.cs b/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca1.cs
index e5140701847..e489366b791 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca1.cs
@@ -19,7 +19,7 @@ static void Main() {
((AssemblyTitleAttribute)attr).Title);
// Check for the AssemblyDescription attribute.
- else if (attr.GetType() ==
+ else if (attr.GetType() ==
typeof(AssemblyDescriptionAttribute))
Console.WriteLine("Assembly description is \"{0}\".",
((AssemblyDescriptionAttribute)attr).Description);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca2.cs b/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca2.cs
index 5dd277d6d30..8d410b01d1a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca2.cs
@@ -22,13 +22,13 @@ static void Main(string[] args) {
// Check for the Description attribute.
if (attr.GetType() == typeof(DescriptionAttribute))
Console.WriteLine("Module {0} has the description " +
- "\"{1}\".", module.Name,
+ "\"{1}\".", module.Name,
((DescriptionAttribute)attr).Description);
// Check for the CLSCompliant attribute.
else if (attr.GetType() == typeof(CLSCompliantAttribute))
Console.WriteLine("Module {0} {1} CLSCompliant.",
module.Name,
- ((CLSCompliantAttribute)attr).IsCompliant ?
+ ((CLSCompliantAttribute)attr).IsCompliant ?
"is" : "is not");
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca3.cs b/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca3.cs
index a24ad5966a3..f4714d1ebad 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca3.cs
@@ -20,7 +20,7 @@ static void Main(string[] args) {
if (attr.GetType() == typeof(GuidAttribute)) {
// Display the GUID.
Console.WriteLine("Class {0} has a GUID.", clsType.Name);
- Console.WriteLine("GUID: {" +
+ Console.WriteLine("GUID: {" +
((GuidAttribute)attr).Value + "}.");
}
@@ -36,7 +36,7 @@ static void Main(string[] args) {
}
}
-/*
+/*
* Output:
* Class ClassWithGuidAndProgId has a GUID.
* GUID: {BF235B41-52D1-46CC-9C55-046793DB363F}.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca5.cs b/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca5.cs
index 33a3406742c..3bac6b5666c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/GetCustomAttributes/CS/ca5.cs
@@ -23,7 +23,7 @@ static void Main(string[] args) {
ParameterInfo[] pInfo = mInfo.GetParameters();
if (pInfo != null) {
// Iterate through all the attributes for the parameter.
- foreach(Attribute attr in
+ foreach(Attribute attr in
Attribute.GetCustomAttributes(pInfo[0])) {
// Check for the ParamArray attribute.
if (attr.GetType() == typeof(ParamArrayAttribute))
@@ -31,7 +31,7 @@ static void Main(string[] args) {
"has the ParamArray attribute.",
pInfo[0].Name, mInfo.Name);
// Check for the Description attribute.
- else if (attr.GetType() ==
+ else if (attr.GetType() ==
typeof(DescriptionAttribute)) {
Console.WriteLine("Parameter {0} for method {1} " +
"has a description attribute.",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/GetFldVal/CS/getfldval.cs b/samples/snippets/csharp/VS_Snippets_CLR/GetFldVal/CS/getfldval.cs
index 061de59ccc1..792bb499be7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/GetFldVal/CS/getfldval.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/GetFldVal/CS/getfldval.cs
@@ -5,7 +5,7 @@
class Example
{
public static String val = "test";
-
+
public static void Main()
{
FieldInfo fld = typeof(Example).GetField("val");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/GetHashCode/CS/hashcode.cs b/samples/snippets/csharp/VS_Snippets_CLR/GetHashCode/CS/hashcode.cs
index 1435a2fe4b1..7da35f3b273 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/GetHashCode/CS/hashcode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/GetHashCode/CS/hashcode.cs
@@ -4,38 +4,38 @@
using System.Collections.Generic;
// A custom attribute to allow two authors per method.
-public class AuthorsAttribute : Attribute
+public class AuthorsAttribute : Attribute
{
protected string _authorName1;
protected string _authorName2;
- public AuthorsAttribute(string name1, string name2)
+ public AuthorsAttribute(string name1, string name2)
{
_authorName1 = name1;
_authorName2 = name2;
}
- public string AuthorName1
+ public string AuthorName1
{
get { return _authorName1; }
set { _authorName1 = value; }
}
- public string AuthorName2
+ public string AuthorName2
{
get { return _authorName2; }
set { _authorName2 = value; }
}
// Use the hash code of the string objects and xor them together.
- public override int GetHashCode()
+ public override int GetHashCode()
{
return _authorName1.GetHashCode() ^ _authorName2.GetHashCode();
}
}
// Provide the author names for each method of the class.
-public class TestClass
+public class TestClass
{
[Authors("Immanuel Kant", "Lao Tzu")]
public void Method1()
@@ -60,29 +60,29 @@ public void Method5()
class Example
{
- static void Main()
+ static void Main()
{
// Get the class type to access its metadata.
Type clsType = typeof(TestClass);
// Store author information in a list of tuples.
- var authorsInfo = new List>();
+ var authorsInfo = new List>();
// Iterate through all the methods of the class.
- foreach(var method in clsType.GetMethods())
+ foreach(var method in clsType.GetMethods())
{
// Get the Authors attribute for the method if it exists.
- AuthorsAttribute authAttr =
+ AuthorsAttribute authAttr =
(AuthorsAttribute)Attribute.GetCustomAttribute(
method, typeof(AuthorsAttribute));
- if (authAttr != null)
+ if (authAttr != null)
// Add the information to the author list.
authorsInfo.Add(Tuple.Create(clsType.Name + "." + method.Name,
authAttr));
}
// Iterate through the list
- bool[] listed = new bool[authorsInfo.Count];
+ bool[] listed = new bool[authorsInfo.Count];
Console.WriteLine("Method authors:\n");
for (int ctr = 0; ctr < authorsInfo.Count; ctr++) {
@@ -93,19 +93,19 @@ static void Main()
listed[ctr] = true;
Console.WriteLine(" {0}", authorInfo.Item1);
for (int ctr2 = ctr + 1; ctr2 < authorsInfo.Count; ctr2++) {
- if (!listed[ctr2])
+ if (!listed[ctr2])
if (authorInfo.Item2.Equals(authorsInfo[ctr2].Item2)) {
Console.WriteLine(" {0}", authorsInfo[ctr2].Item1);
- listed[ctr2] = true;
+ listed[ctr2] = true;
}
- }
- }
+ }
+ }
}
}
}
// The example displays the following output:
// Method authors:
-//
+//
// Immanuel Kant and Lao Tzu
// TestClass.Method1
// TestClass.Method3
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Guid/CS/Guids.cs b/samples/snippets/csharp/VS_Snippets_CLR/Guid/CS/Guids.cs
index 012e2ae59e2..823dbb1acdb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Guid/CS/Guids.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Guid/CS/Guids.cs
@@ -18,8 +18,8 @@ public void MyMethod() {}
public static void Main( string []args )
{
GuidAttribute IMyInterfaceAttribute = (GuidAttribute) Attribute.GetCustomAttribute(typeof(IMyInterface), typeof(GuidAttribute));
-
- System.Console.WriteLine("IMyInterface Attribute: " + IMyInterfaceAttribute.Value );
+
+ System.Console.WriteLine("IMyInterface Attribute: " + IMyInterfaceAttribute.Value );
// Use the string to create a guid.
Guid myGuid1 = new Guid(IMyInterfaceAttribute.Value );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/HMACMD5/CS/hmacmd5.cs b/samples/snippets/csharp/VS_Snippets_CLR/HMACMD5/CS/hmacmd5.cs
index f149c233d93..e955be5472c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/HMACMD5/CS/hmacmd5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/HMACMD5/CS/hmacmd5.cs
@@ -54,7 +54,7 @@ public static void Main(string[] Fileargs)
}
} //end main
// Computes a keyed hash for a source file and creates a target file with the keyed hash
- // prepended to the contents of the source file.
+ // prepended to the contents of the source file.
public static void SignFile(byte[] key, String sourceFile, String destFile)
{
// Initialize the keyed hash object.
@@ -86,12 +86,12 @@ public static void SignFile(byte[] key, String sourceFile, String destFile)
return;
} // end SignFile
- // Compares the key in the source file with a new key created for the data portion of the file. If the keys
+ // Compares the key in the source file with a new key created for the data portion of the file. If the keys
// compare the data has not been tampered with.
public static bool VerifyFile(byte[] key, String sourceFile)
{
bool err = false;
- // Initialize the keyed hash object.
+ // Initialize the keyed hash object.
using (HMACMD5 hmac = new HMACMD5(key))
{
// Create an array to hold the keyed hash value read from the file.
@@ -102,7 +102,7 @@ public static bool VerifyFile(byte[] key, String sourceFile)
// Read in the storedHash.
inStream.Read(storedHash, 0, storedHash.Length);
// Compute the hash of the remaining contents of the file.
- // The stream is properly positioned at the beginning of the content,
+ // The stream is properly positioned at the beginning of the content,
// immediately after the stored hash value.
byte[] computedHash = hmac.ComputeHash(inStream);
// compare the computed hash with the stored value
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/HMACRIPEMD160/CS/hmacripemd160.cs b/samples/snippets/csharp/VS_Snippets_CLR/HMACRIPEMD160/CS/hmacripemd160.cs
index b408f5bb0af..9525559d22d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/HMACRIPEMD160/CS/hmacripemd160.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/HMACRIPEMD160/CS/hmacripemd160.cs
@@ -54,7 +54,7 @@ public static void Main(string[] Fileargs)
}
} //end main
// Computes a keyed hash for a source file and creates a target file with the keyed hash
- // prepended to the contents of the source file.
+ // prepended to the contents of the source file.
public static void SignFile(byte[] key, String sourceFile, String destFile)
{
// Initialize the keyed hash object.
@@ -86,12 +86,12 @@ public static void SignFile(byte[] key, String sourceFile, String destFile)
return;
} // end SignFile
- // Compares the key in the source file with a new key created for the data portion of the file. If the keys
+ // Compares the key in the source file with a new key created for the data portion of the file. If the keys
// compare the data has not been tampered with.
public static bool VerifyFile(byte[] key, String sourceFile)
{
bool err = false;
- // Initialize the keyed hash object.
+ // Initialize the keyed hash object.
using (HMACRIPEMD160 hmac = new HMACRIPEMD160(key))
{
// Create an array to hold the keyed hash value read from the file.
@@ -102,7 +102,7 @@ public static bool VerifyFile(byte[] key, String sourceFile)
// Read in the storedHash.
inStream.Read(storedHash, 0, storedHash.Length);
// Compute the hash of the remaining contents of the file.
- // The stream is properly positioned at the beginning of the content,
+ // The stream is properly positioned at the beginning of the content,
// immediately after the stored hash value.
byte[] computedHash = hmac.ComputeHash(inStream);
// compare the computed hash with the stored value
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA1/CS/hmacsha1.cs b/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA1/CS/hmacsha1.cs
index 1dbf91e4ae3..e28571d61de 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA1/CS/hmacsha1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA1/CS/hmacsha1.cs
@@ -54,7 +54,7 @@ public static void Main(string[] Fileargs)
}
} //end main
// Computes a keyed hash for a source file and creates a target file with the keyed hash
- // prepended to the contents of the source file.
+ // prepended to the contents of the source file.
public static void SignFile(byte[] key, String sourceFile, String destFile)
{
// Initialize the keyed hash object.
@@ -86,12 +86,12 @@ public static void SignFile(byte[] key, String sourceFile, String destFile)
return;
} // end SignFile
- // Compares the key in the source file with a new key created for the data portion of the file. If the keys
+ // Compares the key in the source file with a new key created for the data portion of the file. If the keys
// compare the data has not been tampered with.
public static bool VerifyFile(byte[] key, String sourceFile)
{
bool err = false;
- // Initialize the keyed hash object.
+ // Initialize the keyed hash object.
using (HMACSHA1 hmac = new HMACSHA1(key))
{
// Create an array to hold the keyed hash value read from the file.
@@ -102,7 +102,7 @@ public static bool VerifyFile(byte[] key, String sourceFile)
// Read in the storedHash.
inStream.Read(storedHash, 0, storedHash.Length);
// Compute the hash of the remaining contents of the file.
- // The stream is properly positioned at the beginning of the content,
+ // The stream is properly positioned at the beginning of the content,
// immediately after the stored hash value.
byte[] computedHash = hmac.ComputeHash(inStream);
// compare the computed hash with the stored value
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA256/CS/hmacsha256.cs b/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA256/CS/hmacsha256.cs
index 4cdac44ed19..6617860f36a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA256/CS/hmacsha256.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA256/CS/hmacsha256.cs
@@ -54,7 +54,7 @@ public static void Main(string[] Fileargs)
}
} //end main
// Computes a keyed hash for a source file and creates a target file with the keyed hash
- // prepended to the contents of the source file.
+ // prepended to the contents of the source file.
public static void SignFile(byte[] key, String sourceFile, String destFile)
{
// Initialize the keyed hash object.
@@ -86,12 +86,12 @@ public static void SignFile(byte[] key, String sourceFile, String destFile)
return;
} // end SignFile
- // Compares the key in the source file with a new key created for the data portion of the file. If the keys
+ // Compares the key in the source file with a new key created for the data portion of the file. If the keys
// compare the data has not been tampered with.
public static bool VerifyFile(byte[] key, String sourceFile)
{
bool err = false;
- // Initialize the keyed hash object.
+ // Initialize the keyed hash object.
using (HMACSHA256 hmac = new HMACSHA256(key))
{
// Create an array to hold the keyed hash value read from the file.
@@ -102,7 +102,7 @@ public static bool VerifyFile(byte[] key, String sourceFile)
// Read in the storedHash.
inStream.Read(storedHash, 0, storedHash.Length);
// Compute the hash of the remaining contents of the file.
- // The stream is properly positioned at the beginning of the content,
+ // The stream is properly positioned at the beginning of the content,
// immediately after the stored hash value.
byte[] computedHash = hmac.ComputeHash(inStream);
// compare the computed hash with the stored value
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA384/CS/hmacsha384.cs b/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA384/CS/hmacsha384.cs
index 7ac2be4e76f..d73e3f548c5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA384/CS/hmacsha384.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA384/CS/hmacsha384.cs
@@ -54,7 +54,7 @@ public static void Main(string[] Fileargs)
}
} //end main
// Computes a keyed hash for a source file and creates a target file with the keyed hash
- // prepended to the contents of the source file.
+ // prepended to the contents of the source file.
public static void SignFile(byte[] key, String sourceFile, String destFile)
{
// Initialize the keyed hash object.
@@ -86,12 +86,12 @@ public static void SignFile(byte[] key, String sourceFile, String destFile)
return;
} // end SignFile
- // Compares the key in the source file with a new key created for the data portion of the file. If the keys
+ // Compares the key in the source file with a new key created for the data portion of the file. If the keys
// compare the data has not been tampered with.
public static bool VerifyFile(byte[] key, String sourceFile)
{
bool err = false;
- // Initialize the keyed hash object.
+ // Initialize the keyed hash object.
using (HMACSHA384 hmac = new HMACSHA384(key))
{
// Create an array to hold the keyed hash value read from the file.
@@ -102,7 +102,7 @@ public static bool VerifyFile(byte[] key, String sourceFile)
// Read in the storedHash.
inStream.Read(storedHash, 0, storedHash.Length);
// Compute the hash of the remaining contents of the file.
- // The stream is properly positioned at the beginning of the content,
+ // The stream is properly positioned at the beginning of the content,
// immediately after the stored hash value.
byte[] computedHash = hmac.ComputeHash(inStream);
// compare the computed hash with the stored value
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA512/CS/hmacsha512.cs b/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA512/CS/hmacsha512.cs
index f3dee598aa7..e447dcfc8c9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA512/CS/hmacsha512.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/HMACSHA512/CS/hmacsha512.cs
@@ -54,7 +54,7 @@ public static void Main(string[] Fileargs)
}
} //end main
// Computes a keyed hash for a source file and creates a target file with the keyed hash
- // prepended to the contents of the source file.
+ // prepended to the contents of the source file.
public static void SignFile(byte[] key, String sourceFile, String destFile)
{
// Initialize the keyed hash object.
@@ -86,12 +86,12 @@ public static void SignFile(byte[] key, String sourceFile, String destFile)
return;
} // end SignFile
- // Compares the key in the source file with a new key created for the data portion of the file. If the keys
+ // Compares the key in the source file with a new key created for the data portion of the file. If the keys
// compare the data has not been tampered with.
public static bool VerifyFile(byte[] key, String sourceFile)
{
bool err = false;
- // Initialize the keyed hash object.
+ // Initialize the keyed hash object.
using (HMACSHA512 hmac = new HMACSHA512(key))
{
// Create an array to hold the keyed hash value read from the file.
@@ -102,7 +102,7 @@ public static bool VerifyFile(byte[] key, String sourceFile)
// Read in the storedHash.
inStream.Read(storedHash, 0, storedHash.Length);
// Compute the hash of the remaining contents of the file.
- // The stream is properly positioned at the beginning of the content,
+ // The stream is properly positioned at the beginning of the content,
// immediately after the stored hash value.
byte[] computedHash = hmac.ComputeHash(inStream);
// compare the computed hash with the stored value
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/HttpParseException/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/HttpParseException/cs/source.cs
index 18ceac65ff0..62b8bbe45cd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/HttpParseException/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/HttpParseException/cs/source.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using System.Security.Permissions;
using System.Collections;
@@ -58,7 +58,7 @@ public class CustomHtmlSelectWithHttpParseException : HtmlSelect
// Override the AddParsedSubObject method.
protected override void AddParsedSubObject(object obj)
{
-
+
string _outputtext;
if (obj is MyCustomOption)
{
@@ -66,7 +66,7 @@ protected override void AddParsedSubObject(object obj)
ListItem li = new ListItem(_outputtext, ((MyCustomOption)obj).value);
base.Items.Add(li);
}
- }
+ }
}
}
-//
\ No newline at end of file
+//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IComparable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/IComparable Example/CS/source.cs
index 49b726dceb6..8a701018f64 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IComparable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IComparable Example/CS/source.cs
@@ -2,24 +2,24 @@
using System;
using System.Collections;
-public class Temperature : IComparable
+public class Temperature : IComparable
{
// The temperature value
protected double temperatureF;
public int CompareTo(object obj) {
if (obj == null) return 1;
-
+
Temperature otherTemperature = obj as Temperature;
- if (otherTemperature != null)
+ if (otherTemperature != null)
return this.temperatureF.CompareTo(otherTemperature.temperatureF);
else
throw new ArgumentException("Object is not a Temperature");
}
- public double Fahrenheit
+ public double Fahrenheit
{
- get
+ get
{
return this.temperatureF;
}
@@ -28,13 +28,13 @@ public double Fahrenheit
}
}
- public double Celsius
+ public double Celsius
{
- get
+ get
{
return (this.temperatureF - 32) * (5.0/9);
}
- set
+ set
{
this.temperatureF = (value * 9.0/5) + 32;
}
@@ -48,19 +48,19 @@ public static void Main()
ArrayList temperatures = new ArrayList();
// Initialize random number generator.
Random rnd = new Random();
-
+
// Generate 10 temperatures between 0 and 100 randomly.
for (int ctr = 1; ctr <= 10; ctr++)
{
int degrees = rnd.Next(0, 100);
Temperature temp = new Temperature();
temp.Fahrenheit = degrees;
- temperatures.Add(temp);
+ temperatures.Add(temp);
}
// Sort ArrayList.
temperatures.Sort();
-
+
foreach (Temperature temp in temperatures)
Console.WriteLine(temp.Fahrenheit);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IComparable`1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/IComparable`1 Example/CS/source.cs
index cee988477e2..e46a2f47948 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IComparable`1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IComparable`1 Example/CS/source.cs
@@ -4,16 +4,16 @@
public class Temperature : IComparable
{
- // Implement the generic CompareTo method with the Temperature
- // class as the Type parameter.
+ // Implement the generic CompareTo method with the Temperature
+ // class as the Type parameter.
//
public int CompareTo(Temperature other)
{
// If other is not a valid object reference, this instance is greater.
if (other == null) return 1;
-
- // The temperature comparison depends on the comparison of
- // the underlying Double values.
+
+ // The temperature comparison depends on the comparison of
+ // the underlying Double values.
return m_value.CompareTo(other.m_value);
}
@@ -22,7 +22,7 @@ public int CompareTo(Temperature other)
{
return operand1.CompareTo(operand2) == 1;
}
-
+
// Define the is less than operator.
public static bool operator < (Temperature operand1, Temperature operand2)
{
@@ -34,7 +34,7 @@ public int CompareTo(Temperature other)
{
return operand1.CompareTo(operand2) >= 0;
}
-
+
// Define the is less than or equal to operator.
public static bool operator <= (Temperature operand1, Temperature operand2)
{
@@ -44,7 +44,7 @@ public int CompareTo(Temperature other)
// The underlying temperature value.
protected double m_value = 0.0;
- public double Celsius
+ public double Celsius
{
get
{
@@ -52,7 +52,7 @@ public double Celsius
}
}
- public double Kelvin
+ public double Kelvin
{
get
{
@@ -81,7 +81,7 @@ public class Example
{
public static void Main()
{
- SortedList temps =
+ SortedList temps =
new SortedList();
// Add entries to the sorted list, out of order.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_BeginFaultBlock/CS/ilgenerator_beginfaultblock.cs b/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_BeginFaultBlock/CS/ilgenerator_beginfaultblock.cs
index 56fe0a52dd4..0f10931877a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_BeginFaultBlock/CS/ilgenerator_beginfaultblock.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_BeginFaultBlock/CS/ilgenerator_beginfaultblock.cs
@@ -5,7 +5,7 @@
class. Exception is raised by passing two integer values which are out of range,
the same is caught in the 'BeginExceptionBlock' which is non-filtered. First it
checks for the exception thrown in the 'BeginFaultBlock' and then emits the MSIL
- instructions in 'BeginExceptFilterBlock'.
+ instructions in 'BeginExceptFilterBlock'.
*/
//
@@ -85,7 +85,7 @@ public static Type AddType()
// Call finally block.
myAdderIL.BeginFinallyBlock();
-
+
myAdderIL.Emit(OpCodes.Ldstr, "{0}");
myAdderIL.Emit(OpCodes.Ldloc_S, myLocalBuilder2);
myAdderIL.EmitCall(OpCodes.Callvirt, myExToStrMI, null);
@@ -108,7 +108,7 @@ public static void Main()
Type myAddType = AddType();
object myObject1 = Activator.CreateInstance(myAddType);
object[] myObject2 = new object[]{11,12};
-
+
// Invoke member.
myAddType.InvokeMember("DoAdd",BindingFlags.InvokeMethod,null,myObject1,myObject2);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_BeginFinallyBlock_2/CS/ilgenerator_beginfinallyblock_2.cs b/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_BeginFinallyBlock_2/CS/ilgenerator_beginfinallyblock_2.cs
index f33174ff456..f05dfce4c45 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_BeginFinallyBlock_2/CS/ilgenerator_beginfinallyblock_2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_BeginFinallyBlock_2/CS/ilgenerator_beginfinallyblock_2.cs
@@ -88,7 +88,7 @@ public static Type AddType()
// Call catch block.
myAdderIL.BeginCatchBlock(null);
-
+
// Call other catch block.
myAdderIL.BeginCatchBlock(typeof(OverflowException));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_Begin_EndScope/CS/ilgenerator_begin_endscope.cs b/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_Begin_EndScope/CS/ilgenerator_begin_endscope.cs
index 3b3d3134f29..05396e8ab96 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_Begin_EndScope/CS/ilgenerator_begin_endscope.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ILGenerator_Begin_EndScope/CS/ilgenerator_begin_endscope.cs
@@ -8,7 +8,7 @@
constructor 'myConstructor' and a method 'myMethod' are created dynamically. Their IL's
are generated. A local variable 'myLocalBuilder' is declared using 'DeclareLocal' property
of 'myMethodIL'. The scope of 'myLocalBuilder' is specified using 'BeginScope' and
- 'EndScope' methods. Respective messages related to scope are printed on the console.
+ 'EndScope' methods. Respective messages related to scope are printed on the console.
*/
//
@@ -40,7 +40,7 @@ public static void Main()
TypeBuilder myTypeBuilder = myModule.DefineType("MyDynamicClass",
TypeAttributes.Public);
// Define a public string field.
- FieldBuilder myField = myTypeBuilder.DefineField("MyDynamicField",
+ FieldBuilder myField = myTypeBuilder.DefineField("MyDynamicField",
typeof(String), FieldAttributes.Public);
// Create the constructor.
Type[] myConstructorArgs = {typeof(String)};
@@ -72,7 +72,7 @@ public static void Main()
Console.WriteLine("'myLocalBuilder' type is: {0}", myLocalBuilder.LocalType);
myMethodIL.Emit(OpCodes.Ldstr, "Local value");
myMethodIL.Emit(OpCodes.Stloc_0, myLocalBuilder);
-
+
// End the scope of 'myLocalBuilder'.
myMethodIL.EndScope();
@@ -96,7 +96,7 @@ public static void Main()
}
catch(Exception e)
{
- Console.WriteLine("Exception: {0}", e.Message );
+ Console.WriteLine("Exception: {0}", e.Message );
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IO.Compression.Deflate1/CS/deflatetest.cs b/samples/snippets/csharp/VS_Snippets_CLR/IO.Compression.Deflate1/CS/deflatetest.cs
index 011f6c37c70..3fd81bb2f3c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IO.Compression.Deflate1/CS/deflatetest.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IO.Compression.Deflate1/CS/deflatetest.cs
@@ -8,7 +8,7 @@ public class Program
static string directoryPath = @"c:\temp";
public static void Main()
{
-
+
DirectoryInfo directorySelected = new DirectoryInfo(directoryPath);
Compress(directorySelected);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IO.Compression.GZip1/CS/gziptest.cs b/samples/snippets/csharp/VS_Snippets_CLR/IO.Compression.GZip1/CS/gziptest.cs
index 764a4923e8e..5941e469091 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IO.Compression.GZip1/CS/gziptest.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IO.Compression.GZip1/CS/gziptest.cs
@@ -23,12 +23,12 @@ public static void Compress(DirectoryInfo directorySelected)
{
using (FileStream originalFileStream = fileToCompress.OpenRead())
{
- if ((File.GetAttributes(fileToCompress.FullName) &
+ if ((File.GetAttributes(fileToCompress.FullName) &
FileAttributes.Hidden) != FileAttributes.Hidden & fileToCompress.Extension != ".gz")
{
using (FileStream compressedFileStream = File.Create(fileToCompress.FullName + ".gz"))
{
- using (GZipStream compressionStream = new GZipStream(compressedFileStream,
+ using (GZipStream compressionStream = new GZipStream(compressedFileStream,
CompressionMode.Compress))
{
originalFileStream.CopyTo(compressionStream);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IO.DiretoryInfo.GetAccessControl-SetAccessControl/CS/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/IO.DiretoryInfo.GetAccessControl-SetAccessControl/CS/sample.cs
index a06c72ee628..f7457c9e9e9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IO.DiretoryInfo.GetAccessControl-SetAccessControl/CS/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IO.DiretoryInfo.GetAccessControl-SetAccessControl/CS/sample.cs
@@ -39,11 +39,11 @@ public static void AddDirectorySecurity(string FileName, string Account, FileSys
// Create a new DirectoryInfo object.
DirectoryInfo dInfo = new DirectoryInfo(FileName);
- // Get a DirectorySecurity object that represents the
+ // Get a DirectorySecurity object that represents the
// current security settings.
DirectorySecurity dSecurity = dInfo.GetAccessControl();
- // Add the FileSystemAccessRule to the security settings.
+ // Add the FileSystemAccessRule to the security settings.
dSecurity.AddAccessRule(new FileSystemAccessRule(Account,
Rights,
ControlType));
@@ -58,11 +58,11 @@ public static void RemoveDirectorySecurity(string FileName, string Account, File
// Create a new DirectoryInfo object.
DirectoryInfo dInfo = new DirectoryInfo(FileName);
- // Get a DirectorySecurity object that represents the
+ // Get a DirectorySecurity object that represents the
// current security settings.
DirectorySecurity dSecurity = dInfo.GetAccessControl();
- // Add the FileSystemAccessRule to the security settings.
+ // Add the FileSystemAccessRule to the security settings.
dSecurity.RemoveAccessRule(new FileSystemAccessRule(Account,
Rights,
ControlType));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Encrypt-Decrypt/CS/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Encrypt-Decrypt/CS/sample.cs
index 3cb54d5b6d6..4eda3341f0a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Encrypt-Decrypt/CS/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Encrypt-Decrypt/CS/sample.cs
@@ -59,7 +59,7 @@ public static void RemoveEncryption(string FileName)
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//Encrypt c:\MyTest.txt
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Exists/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Exists/cs/sample.cs
index 20915184525..61efb50e8d7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Exists/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Exists/cs/sample.cs
@@ -18,8 +18,8 @@ public byte[] OpenDataFile(string FileName)
// Check to see if the file exists.
FileInfo fInfo = new FileInfo(FileName);
-
- // You can throw a personalized exception if
+
+ // You can throw a personalized exception if
// the file does not exist.
if (!fInfo.Exists)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/CS/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/CS/sample.cs
index 361476dbfea..7db44a8c9ea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/CS/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.GetAccessControl-SetAccessControl/CS/sample.cs
@@ -16,16 +16,16 @@ public static void Main()
Console.WriteLine("Adding access control entry for " + FileName);
// Add the access control entry to the file.
- // Before compiling this snippet, change MyDomain to your
- // domain name and MyAccessAccount to the name
+ // Before compiling this snippet, change MyDomain to your
+ // domain name and MyAccessAccount to the name
// you use to access your domain.
AddFileSecurity(FileName, @"MyDomain\MyAccessAccount", FileSystemRights.ReadData, AccessControlType.Allow);
Console.WriteLine("Removing access control entry from " + FileName);
// Remove the access control entry from the file.
- // Before compiling this snippet, change MyDomain to your
- // domain name and MyAccessAccount to the name
+ // Before compiling this snippet, change MyDomain to your
+ // domain name and MyAccessAccount to the name
// you use to access your domain.
RemoveFileSecurity(FileName, @"MyDomain\MyAccessAccount", FileSystemRights.ReadData, AccessControlType.Allow);
@@ -43,11 +43,11 @@ public static void AddFileSecurity(string FileName, string Account, FileSystemRi
// Create a new FileInfo object.
FileInfo fInfo = new FileInfo(FileName);
- // Get a FileSecurity object that represents the
+ // Get a FileSecurity object that represents the
// current security settings.
FileSecurity fSecurity = fInfo.GetAccessControl();
- // Add the FileSystemAccessRule to the security settings.
+ // Add the FileSystemAccessRule to the security settings.
fSecurity.AddAccessRule(new FileSystemAccessRule(Account,
Rights,
ControlType));
@@ -62,11 +62,11 @@ public static void RemoveFileSecurity(string FileName, string Account, FileSyste
// Create a new FileInfo object.
FileInfo fInfo = new FileInfo(FileName);
- // Get a FileSecurity object that represents the
+ // Get a FileSecurity object that represents the
// current security settings.
FileSecurity fSecurity = fInfo.GetAccessControl();
- // Add the FileSystemAccessRule to the security settings.
+ // Add the FileSystemAccessRule to the security settings.
fSecurity.RemoveAccessRule(new FileSystemAccessRule(Account,
Rights,
ControlType));
@@ -76,7 +76,7 @@ public static void RemoveFileSecurity(string FileName, string Account, FileSyste
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//Adding access control entry for c:\test.xml
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Replace/CS/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Replace/CS/sample.cs
index a51f3e54de6..d9d363d8329 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Replace/CS/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.Replace/CS/sample.cs
@@ -10,7 +10,7 @@ public static void Main()
{
try
{
- // originalFile and fileToReplace must contain the path to files that already exist in the
+ // originalFile and fileToReplace must contain the path to files that already exist in the
// file system. backUpOfFileToReplace is created during the execution of the Replace method.
string originalFile = "test.txt";
@@ -51,7 +51,7 @@ public static void ReplaceFile(string fileToMoveAndDelete, string fileToReplace,
}
}
}
-//Move the contents of test.txt into test2.txt, delete test.txt, and
+//Move the contents of test.txt into test2.txt, delete test.txt, and
//create a backup of test2.txt.
//Done
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.isReadOnly/CS/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.isReadOnly/CS/sample.cs
index 09d3198fa61..cff8849fae3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.isReadOnly/CS/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IO.FileInfo.isReadOnly/CS/sample.cs
@@ -51,7 +51,7 @@ public static bool IsFileReadOnly(string FileName)
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//The file read-only value for c:\test.xml is: True
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IdnMapping.GetX/CS/getx.cs b/samples/snippets/csharp/VS_Snippets_CLR/IdnMapping.GetX/CS/getx.cs
index 1a968d79c07..54f292a9703 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IdnMapping.GetX/CS/getx.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IdnMapping.GetX/CS/getx.cs
@@ -6,13 +6,13 @@
using System;
using System.Globalization;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
-/*
- Define a domain name consisting of the labels: GREEK SMALL LETTER
- PI (U+03C0); IDEOGRAPHIC FULL STOP (U+3002); GREEK SMALL LETTER
+/*
+ Define a domain name consisting of the labels: GREEK SMALL LETTER
+ PI (U+03C0); IDEOGRAPHIC FULL STOP (U+3002); GREEK SMALL LETTER
THETA (U+03B8); FULLWIDTH FULL STOP (U+FF0E); and "com".
*/
string name = "\u03C0\u3002\u03B8\uFF0Ecom";
@@ -57,7 +57,7 @@ public static void Main()
static void CodePoints(string value, string title)
{
Console.WriteLine("Display the Unicode code points of {0}", title);
- foreach (char c in value)
+ foreach (char c in value)
{
Console.Write("{0:x4} ", Convert.ToInt32(c));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile1.cs b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile1.cs
index 2fc7dcb9bef..86f7bf7a370 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile1.cs
@@ -3,7 +3,7 @@
//
using System;
using System.Runtime.InteropServices;
-// by default all classes in this assembly will use COM implementaion
+// by default all classes in this assembly will use COM implementaion
[assembly:IDispatchImpl(IDispatchImplType.CompatibleImpl)]
namespace MyNamespace
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile2.cs b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile2.cs
index c74205bef00..16876b8d800 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile2.cs
@@ -37,22 +37,22 @@ namespace MyModule
[ComImport]
[Guid("73EB4AF8-BE9C-4b49-B3A4-24F4FF657B26")]
- public interface IMyStorage
+ public interface IMyStorage
{
[DispId(1)]
[return : MarshalAs( UnmanagedType.Interface )]
Object GetItem( [In, MarshalAs( UnmanagedType.BStr )] String bstrName );
[DispId(2)]
- void GetItems( [In, MarshalAs( UnmanagedType.BStr )] String bstrLocation,
- [Out, MarshalAs( UnmanagedType.SafeArray,
+ void GetItems( [In, MarshalAs( UnmanagedType.BStr )] String bstrLocation,
+ [Out, MarshalAs( UnmanagedType.SafeArray,
SafeArraySubType = VarEnum.VT_VARIANT )] out Object[] Items );
[DispId(3)]
- void GetItemDescriptions( [In] String bstrLocation,
+ void GetItemDescriptions( [In] String bstrLocation,
[In, Out, MarshalAs( UnmanagedType.SafeArray )] ref Object[] varDescriptions );
- bool IsEmpty
+ bool IsEmpty
{
[DispId(4)]
[return : MarshalAs( UnmanagedType.VariantBool )]
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile3.cs b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile3.cs
index 164b260861b..f16cffa9801 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile3.cs
@@ -16,12 +16,12 @@ public static bool IsCOMAssembly( Assembly a )
{
ImportedFromTypeLibAttribute imptlb = ( ImportedFromTypeLibAttribute )AsmAttributes[0];
string strImportedFrom = imptlb.Value;
-
+
// Print out the name of the DLL from which the assembly is imported.
Console.WriteLine( "Assembly " + a.FullName + " is imported from " + strImportedFrom );
return true;
- }
+ }
// This is not a COM assembly.
Console.WriteLine( "Assembly " + a.FullName + " is not imported from COM" );
return false;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile4.cs b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile4.cs
index 58e04e42665..6564c6c844e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile4.cs
@@ -15,7 +15,7 @@ public static bool IsHiddenInterface( Type InterfaceType )
{
TypeLibTypeAttribute tlt = ( TypeLibTypeAttribute ) InterfaceAttributes[0];
TypeLibTypeFlags flags = tlt.Value;
- return ( flags & TypeLibTypeFlags.FHidden ) != 0;
+ return ( flags & TypeLibTypeFlags.FHidden ) != 0;
}
return false;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile5.cs b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile5.cs
index 4f608b94576..79c3706fbbf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ImprovedInteropSnippets/CS/codefile5.cs
@@ -18,7 +18,7 @@ public static bool IsHiddenMethod( MethodInfo mi )
{
TypeLibFuncAttribute tlf = ( TypeLibFuncAttribute )MethodAttributes[0];
TypeLibFuncFlags flags = tlf.Value;
- return ( flags & TypeLibFuncFlags.FHidden ) != 0;
+ return ( flags & TypeLibFuncFlags.FHidden ) != 0;
}
return false;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IndentedTextWriterExample/CS/form1.cs b/samples/snippets/csharp/VS_Snippets_CLR/IndentedTextWriterExample/CS/form1.cs
index cdd401f06be..f36e9574f00 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IndentedTextWriterExample/CS/form1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IndentedTextWriterExample/CS/form1.cs
@@ -17,11 +17,11 @@ private string CreateMultilevelIndentString()
{
//
// Creates a TextWriter to use as the base output writer.
- System.IO.StringWriter baseTextWriter = new System.IO.StringWriter();
+ System.IO.StringWriter baseTextWriter = new System.IO.StringWriter();
- // Create an IndentedTextWriter and set the tab string to use
+ // Create an IndentedTextWriter and set the tab string to use
// as the indentation string for each indentation level.
- System.CodeDom.Compiler.IndentedTextWriter indentWriter = new IndentedTextWriter(baseTextWriter, " ");
+ System.CodeDom.Compiler.IndentedTextWriter indentWriter = new IndentedTextWriter(baseTextWriter, " ");
//
//
@@ -41,7 +41,7 @@ private void WriteLevel(IndentedTextWriter indentWriter, int level, int totalLev
{
// Output a test string with a new-line character at the end.
indentWriter.WriteLine("This is a test phrase. Current indentation level: "+level.ToString());
-
+
// If not yet at the highest recursion level, call this output method for the next level of indentation.
if( level < totalLevels )
{
@@ -63,7 +63,7 @@ private void WriteLevel(IndentedTextWriter indentWriter, int level, int totalLev
}
// Outputs a test string with a new-line character at the end.
- indentWriter.WriteLine("This is a test phrase. Current indentation level: "+level.ToString());
+ indentWriter.WriteLine("This is a test phrase. Current indentation level: "+level.ToString());
}
//
//
@@ -77,9 +77,9 @@ public Form1()
{
System.Windows.Forms.Button button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
- this.SuspendLayout();
- this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
+ this.SuspendLayout();
+ this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.Location = new System.Drawing.Point(8, 40);
this.textBox1.Multiline = true;
@@ -99,11 +99,11 @@ public Form1()
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "IndentedTextWriter example";
- this.ResumeLayout(false);
+ this.ResumeLayout(false);
}
[STAThread]
- static void Main()
+ static void Main()
{
Application.Run(new Form1());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InnerEx/CS/innerex.cs b/samples/snippets/csharp/VS_Snippets_CLR/InnerEx/CS/innerex.cs
index 2c8b8209a23..0a73cd4452b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InnerEx/CS/innerex.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InnerEx/CS/innerex.cs
@@ -31,7 +31,7 @@ public void ThrowInner ()
throw new AppException("Exception in ThrowInner method.");
}
- public void CatchInner()
+ public void CatchInner()
{
try {
this.ThrowInner();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallEventArgs/CS/installeventargs.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallEventArgs/CS/installeventargs.cs
index 5c386d0b3b5..8ef95c195ea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallEventArgs/CS/installeventargs.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallEventArgs/CS/installeventargs.cs
@@ -4,22 +4,22 @@
// System.Configuration.Install.InstallEventArgs.SavedState
/*
- The following example demonstrates the 'InstallEventArgs()' and
+ The following example demonstrates the 'InstallEventArgs()' and
'InstallEventArgs(IDictionary)' constructors and the 'SavedState'
property of the 'InstallEventArgs' property. There are two new
events called 'BeforeCommit' and 'AfterCommit'. The handlers of
these events are invoked from the protected methods named 'OnBeforeCommit'
- and 'OnAfterCommit' respectively. These events are raised when the
+ and 'OnAfterCommit' respectively. These events are raised when the
'Commit' method is called.
-
- Note :
- a) The two events named 'BeforeCommit' and 'AfterCommit' are added
+
+ Note :
+ a) The two events named 'BeforeCommit' and 'AfterCommit' are added
only for example purposes, since there are already
events named 'Committing' and 'Committed' which perform the same
function. This example can be made a basis for a new stage being
added to the already existing four stages namely 'Install', 'Commit',
'Rollback' and 'Uninstall'.
-
+
b) Run the example with the help of InstallUtil.exe
InstallUtil InstallEventArgs.exe
*/
@@ -38,7 +38,7 @@ public class MyInstaller : Installer
// Simple events to handle before and after commit handlers.
public event InstallEventHandler BeforeCommit;
public event InstallEventHandler AfterCommit;
-
+
public MyInstaller()
{
// Add handlers to the events.
@@ -75,13 +75,13 @@ public override void Uninstall(IDictionary savedState)
base.Uninstall(savedState);
Console.WriteLine("UnInstall ...\n");
}
-
+
//
// Protected method that invoke the handlers associated with the 'BeforeCommit' event.
protected virtual void OnBeforeCommit(IDictionary savedState)
{
if(BeforeCommit != null)
- BeforeCommit(this, new InstallEventArgs(savedState));
+ BeforeCommit(this, new InstallEventArgs(savedState));
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallException/CS/installexception.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallException/CS/installexception.cs
index ee0e00739a3..e29049d67da 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallException/CS/installexception.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallException/CS/installexception.cs
@@ -9,19 +9,19 @@
This example shows an assembly having its own installer named 'MyInstaller'
which has an attribute 'RunInstallerAttribute', indicating that this installer
will be invoked by InstallUtil.exe. InstallUtil.exe calls the 'Install', 'Commit',
- 'Rollback' and 'Uninstall' methods. The code in 'Commit' method presumes that
- a file named 'FileDoesNotExist.txt' exists before the installation of the
+ 'Rollback' and 'Uninstall' methods. The code in 'Commit' method presumes that
+ a file named 'FileDoesNotExist.txt' exists before the installation of the
assembly can be committed. If the file 'FileDoesNotExist.txt' does not exist
- 'Commit' raises a 'InstallException'. Same is the case with 'Uninstall',
- uninstalltion will only progress if the file named 'FileDoesNotExist.txt'
+ 'Commit' raises a 'InstallException'. Same is the case with 'Uninstall',
+ uninstalltion will only progress if the file named 'FileDoesNotExist.txt'
exists else it raises an 'InstallException'. In 'Rollback' some piece of
code is executed which may raise an exception. If the exception is raised then
it is caught and an 'InstallException' is raised with that exception being passed
to it.
-
+
Note : Run this example with the help of 'InstallUtil.exe'
InstallUtil InstallException.exe
- InstallUtil /u InstallException.exe
+ InstallUtil /u InstallException.exe
*/
//
@@ -100,4 +100,4 @@ public static void Main()
Console.WriteLine("This assembly is just an example for the Installer");
}
}
-//
\ No newline at end of file
+//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Add/CS/MyAssembly1.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Add/CS/MyAssembly1.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Add/CS/MyAssembly1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Add/CS/MyAssembly1.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Add/CS/MyAssembly2.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Add/CS/MyAssembly2.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Add/CS/MyAssembly2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Add/CS/MyAssembly2.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/MyAssembly1.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/MyAssembly1.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/MyAssembly1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/MyAssembly1.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/MyAssembly2.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/MyAssembly2.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/MyAssembly2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/MyAssembly2.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/installercollection_addrange1.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/installercollection_addrange1.cs
index f7a0178a582..65ab9a19ce9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/installercollection_addrange1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_AddRange1/CS/installercollection_addrange1.cs
@@ -2,9 +2,9 @@
/*
The following example demonstrates the 'AddRange(Installer[])'
- method of the 'InstallerCollection' class. It Creates 'AssemblyInstaller'
- instances for 'MyAssembly1.exe' and for 'MyAssembly2.exe'. These
- instances are added to an instance of 'TransactedInstaller'. The installation
+ method of the 'InstallerCollection' class. It Creates 'AssemblyInstaller'
+ instances for 'MyAssembly1.exe' and for 'MyAssembly2.exe'. These
+ instances are added to an instance of 'TransactedInstaller'. The installation
process installs both 'MyAssembly1.exe' and 'MyAssembly2.exe'.
*/
@@ -27,17 +27,17 @@ public static void Main()
InstallContext myInstallContext;
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
- myAssemblyInstaller =
+ myAssemblyInstaller =
new AssemblyInstaller("MyAssembly1.exe", null);
- // Add the instance of 'AssemblyInstaller' to the list of installers.
+ // Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers.Add(myAssemblyInstaller);
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
- myAssemblyInstaller =
+ myAssemblyInstaller =
new AssemblyInstaller("MyAssembly2.exe", null);
- // Add the instance of 'AssemblyInstaller' to the list of installers.
+ // Add the instance of 'AssemblyInstaller' to the list of installers.
myInstallers.Add(myAssemblyInstaller);
// Add the installers to the 'TransactedInstaller' instance.
@@ -45,7 +45,7 @@ public static void Main()
//
// Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
+ myInstallContext =
new InstallContext("Install.log", null);
myTransactedInstaller.Context = myInstallContext;
@@ -56,5 +56,5 @@ public static void Main()
{
Console.WriteLine("Exception raised : {0}", e.Message);
}
- }
+ }
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/MyAssembly1.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/MyAssembly1.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/MyAssembly1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/MyAssembly1.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/MyAssembly2.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/MyAssembly2.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/MyAssembly2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/MyAssembly2.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/installercollection_copyto.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/installercollection_copyto.cs
index dae1866d9b0..7cdb6286c3a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/installercollection_copyto.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_CopyTo/CS/installercollection_copyto.cs
@@ -3,10 +3,10 @@
/*
The following example demonstrates the 'CopyTo(Installer[], Int32)' method
of the 'InstallerCollection' class. It Creates 'AssemblyInstaller' instances
- for 'MyAssembly1.exe' and 'MyAssembly2.exe'. These instances of
+ for 'MyAssembly1.exe' and 'MyAssembly2.exe'. These instances of
'AssemblyInstaller' are added to an instance of 'TransactedInstaller'
instance. The names of the assemblies to be installed
- are displayed on the console. The installation process then installs
+ are displayed on the console. The installation process then installs
both 'MyAssembly1.exe' and 'MyAssembly2.exe'.
*/
@@ -38,7 +38,7 @@ public static void Main()
// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Add(myAssemblyInstaller);
-
+
Installer[] myInstallers =
new Installer[myTransactedInstaller.Installers.Count];
@@ -55,11 +55,11 @@ public static void Main()
}
//
// Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
+ myInstallContext =
new InstallContext("Install.log", null);
myTransactedInstaller.Context = myInstallContext;
// Install an assembly.
- myTransactedInstaller.Install(new Hashtable());
- }
+ myTransactedInstaller.Install(new Hashtable());
+ }
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/MyAssembly1.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/MyAssembly1.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/MyAssembly1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/MyAssembly1.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/MyAssembly2.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/MyAssembly2.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/MyAssembly2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/MyAssembly2.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/installercollection_insert.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/installercollection_insert.cs
index a27471856d5..80627ba656b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/installercollection_insert.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Insert/CS/installercollection_insert.cs
@@ -3,12 +3,12 @@
/*
The following example demonstrates the 'Insert(Int32, Installer)' and
- 'AddRange(InstallerCollection)' methods of the 'InstallerCollection'
- class. It Creates 'AssemblyInstaller' instances for 'MyAssembly1.exe'
- and 'MyAssembly2.exe'. These instances of 'AssemblyInstaller' are
+ 'AddRange(InstallerCollection)' methods of the 'InstallerCollection'
+ class. It Creates 'AssemblyInstaller' instances for 'MyAssembly1.exe'
+ and 'MyAssembly2.exe'. These instances of 'AssemblyInstaller' are
added to an instance of 'TransactedInstaller' named 'myTransactedInstaller1'.
The installers in the 'myTransactedInstaller1' are copied to another
- instance of 'TransactedInstaller' named 'myTransactedInstaller2'.The
+ instance of 'TransactedInstaller' named 'myTransactedInstaller2'.The
installation process installs both 'MyAssembly1.exe' and 'MyAssembly2.exe'.
*/
@@ -31,14 +31,14 @@ public static void Main()
InstallContext myInstallContext;
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
- myAssemblyInstaller =
+ myAssemblyInstaller =
new AssemblyInstaller("MyAssembly1.exe", null);
// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller1.Installers.Insert(0, myAssemblyInstaller);
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
- myAssemblyInstaller =
+ myAssemblyInstaller =
new AssemblyInstaller("MyAssembly2.exe", null);
// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
@@ -51,11 +51,11 @@ public static void Main()
//
// Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
+ myInstallContext =
new InstallContext("Install.log", null);
myTransactedInstaller2.Context = myInstallContext;
// Install an assembly.
- myTransactedInstaller2.Install(new Hashtable());
- }
+ myTransactedInstaller2.Install(new Hashtable());
+ }
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/MyAssembly1.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/MyAssembly1.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/MyAssembly1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/MyAssembly1.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/MyAssembly2.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/MyAssembly2.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/MyAssembly2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/MyAssembly2.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/installercollection_item.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/installercollection_item.cs
index 9715c28e53e..d4a573c2adf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/installercollection_item.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Item/CS/installercollection_item.cs
@@ -1,11 +1,11 @@
// System.Configuration.Install.InstallerCollection.Item(Int32)
/*
- The following example demonstrates the 'Item(Int32)' method of the
+ The following example demonstrates the 'Item(Int32)' method of the
'InstallerCollection' class. It creates 'AssemblyInstaller' instances
- for 'MyAssembly1.exe' and 'MyAssembly2.exe'. These instances are added
- to an instance of 'TransactedInstaller'. The names of all the assemblies
- that are to be installed are displayed to the console.The installation
+ for 'MyAssembly1.exe' and 'MyAssembly2.exe'. These instances are added
+ to an instance of 'TransactedInstaller'. The names of all the assemblies
+ that are to be installed are displayed to the console.The installation
process installs both 'MyAssembly1.exe' and 'MyAssembly2.exe'.
*/
@@ -27,17 +27,17 @@ public static void Main()
InstallContext myInstallContext;
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
- myAssemblyInstaller =
+ myAssemblyInstaller =
new AssemblyInstaller("MyAssembly1.exe", null);
// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Add(myAssemblyInstaller);
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
- myAssemblyInstaller =
+ myAssemblyInstaller =
new AssemblyInstaller("MyAssembly2.exe", null);
- // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
+ // Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Add(myAssemblyInstaller);
//Print the assemblies to be installed.
@@ -47,13 +47,13 @@ public static void Main()
{
if((myInstallers[i].GetType()).Equals(typeof(AssemblyInstaller)))
{
- Console.WriteLine("{0} {1}", i + 1,
+ Console.WriteLine("{0} {1}", i + 1,
((AssemblyInstaller)myInstallers[i]).Path);
}
}
//
// Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
+ myInstallContext =
new InstallContext("Install.log", null);
myTransactedInstaller.Context = myInstallContext;
@@ -64,5 +64,5 @@ public static void Main()
{
Console.WriteLine("Exception raised : {0}", e.Message);
}
- }
+ }
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/MyAssembly1.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/MyAssembly1.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/MyAssembly1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/MyAssembly1.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/MyAssembly2.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/MyAssembly2.cs
index 5a4c960133b..abbf22f4344 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/MyAssembly2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/MyAssembly2.cs
@@ -1,6 +1,6 @@
/*
This program is supposed to be used with the IntallerCollection_***.cs
- examples. Provide the exe of this program as input to the
+ examples. Provide the exe of this program as input to the
InstallerCollection_***.exe programs.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/installercollection_remove.cs b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/installercollection_remove.cs
index 17b74b6f987..5c9a10a1cb6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/installercollection_remove.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InstallerCollection_Remove/CS/installercollection_remove.cs
@@ -4,7 +4,7 @@
/*
The following example demonstrates the 'Remove(Installer)',
- 'Contains(Installer)' and 'IndexOf(Installer)' methods of the
+ 'Contains(Installer)' and 'IndexOf(Installer)' methods of the
'InstallerCollection' class. Create's 'AssemblyInstaller' instances
for 'MyAssembly1.exe' and for 'MyAssembly2.exe'. These instances
of 'AssemblyInstaller' are added to an instance of 'TransactedInstaller'.
@@ -35,14 +35,14 @@ public static void Main()
InstallContext myInstallContext;
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
- myAssemblyInstaller1 =
+ myAssemblyInstaller1 =
new AssemblyInstaller("MyAssembly1.exe", null);
// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Insert(0, myAssemblyInstaller1);
// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
- myAssemblyInstaller2 =
+ myAssemblyInstaller2 =
new AssemblyInstaller("MyAssembly2.exe", null);
// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
@@ -65,13 +65,13 @@ public static void Main()
{
if((myInstallers[i].GetType()).Equals(typeof(AssemblyInstaller)))
{
- Console.WriteLine("{0} {1}", i + 1,
+ Console.WriteLine("{0} {1}", i + 1,
((AssemblyInstaller)myInstallers[i]).Path);
}
}
// Create a instance of 'InstallContext' with log file named 'Install.log'.
- myInstallContext =
+ myInstallContext =
new InstallContext("Install.log", null);
myTransactedInstaller.Context = myInstallContext;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_AfterInstall/CS/installer_afterinstall.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_AfterInstall/CS/installer_afterinstall.cs
index 01fe0ddeb61..c0db2f7bebe 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_AfterInstall/CS/installer_afterinstall.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_AfterInstall/CS/installer_afterinstall.cs
@@ -1,13 +1,13 @@
/*
System.Configuration.Install.Installer.AfterInstall
- The following example demonstrates the event 'AfterInstall' of the
+ The following example demonstrates the event 'AfterInstall' of the
'Installer' class. The event 'AfterInstall' is raised by the method
'OnAfterInstall'.
-
- Use the installer process 'InstallUtil' to run the assembly
+
+ Use the installer process 'InstallUtil' to run the assembly
'Installer_AfterInstall.exe'.
-
+
*/
using System;
@@ -27,10 +27,10 @@ public class MyInstaller: Installer
private void AfterInstallEventHandler(object sender, InstallEventArgs e)
{
// Add steps to perform any actions after the install process.
- Console.WriteLine("Code for AfterInstallEventHandler");
+ Console.WriteLine("Code for AfterInstallEventHandler");
}
//
-
+
// Override the 'Install' method.
public override void Install(IDictionary savedState)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_AfterUninstall/CS/installer_afteruninstall.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_AfterUninstall/CS/installer_afteruninstall.cs
index ca5f91ba393..0f3eb30f3e9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_AfterUninstall/CS/installer_afteruninstall.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_AfterUninstall/CS/installer_afteruninstall.cs
@@ -1,12 +1,12 @@
/*
System.Configuration.Install.Installer.AfterUninstall
- The following example demonstrates the event 'AfterUninstall' of the
+ The following example demonstrates the event 'AfterUninstall' of the
'Installer' class. This event is raised by the method 'OnAfterUninstall'.
-
- Use the installer process 'InstallUtil -u' to run the assembly
+
+ Use the installer process 'InstallUtil -u' to run the assembly
'Installer_AfterUninstall.exe'.
-
+
*/
using System;
@@ -26,10 +26,10 @@ public class MyInstaller: Installer
private void AfterUninstallEventHandler(object sender, InstallEventArgs e)
{
// Add steps to perform any actions before the Uninstall process.
- Console.WriteLine("Code for AfterUninstallEventHandler");
+ Console.WriteLine("Code for AfterUninstallEventHandler");
}
//
-
+
// Override the 'Install' method.
public override void Install(IDictionary savedState)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeInstall/CS/installer_beforeinstall.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeInstall/CS/installer_beforeinstall.cs
index 38a178afa12..b6c2202e2f1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeInstall/CS/installer_beforeinstall.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeInstall/CS/installer_beforeinstall.cs
@@ -1,13 +1,13 @@
/*
System.Configuration.Install.Installer.BeforeInstall
- The following example demonstrates the event 'BeforeInstall' of the
+ The following example demonstrates the event 'BeforeInstall' of the
'Installer' class. The event 'BeforeInstall' is raised by the method
'OnBeforeInstall'.
-
- Use the installer process 'InstallUtil' to run the assembly
+
+ Use the installer process 'InstallUtil' to run the assembly
Installer_BeforeInstall.exe.
-
+
*/
using System;
@@ -27,10 +27,10 @@ public class MyInstaller: Installer
private void BeforeInstallEventHandler(object sender, InstallEventArgs e)
{
// Add steps to perform any actions before the install process.
- Console.WriteLine("Code for BeforeInstallEventHandler");
+ Console.WriteLine("Code for BeforeInstallEventHandler");
}
//
-
+
// Override the 'Install' method.
public override void Install(IDictionary savedState)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeRollback/CS/installer_beforerollback.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeRollback/CS/installer_beforerollback.cs
index da694fe01d7..40b597de9ac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeRollback/CS/installer_beforerollback.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeRollback/CS/installer_beforerollback.cs
@@ -1,10 +1,10 @@
// System.Configuration.Install.Installer.BeforeRollback
-/* The following program demonstrates the 'BeforeRollback' event of the
+/* The following program demonstrates the 'BeforeRollback' event of the
'Installer' class. It overrides the Install method, explicitly throws
- arguement exception so that 'Rollback' method is called. When the
+ arguement exception so that 'Rollback' method is called. When the
'RollBack' is about to complete, 'BeforeRollback' event occurs and
- a message is displayed when the event occurs.
+ a message is displayed when the event occurs.
*/
//
@@ -29,14 +29,14 @@ private void MyInstaller_BeforeRollBack(object sender, InstallEventArgs e)
{
Console.WriteLine("");
Console.WriteLine("BeforeRollback Event occurred.");
- Console.WriteLine("");
+ Console.WriteLine("");
}
// Event handler for 'AfterRollback' event.
private void MyInstaller_AfterRollback(object sender, InstallEventArgs e)
{
Console.WriteLine("");
Console.WriteLine("AfterRollback Event occurred.");
- Console.WriteLine("");
+ Console.WriteLine("");
}
// Override the 'Install' method.
public override void Install(IDictionary savedState)
@@ -57,7 +57,7 @@ public override void Rollback(IDictionary savedState)
}
public static void Main()
{
- Console.WriteLine("Usage : installutil.exe Installer_BeforeRollback.exe ");
+ Console.WriteLine("Usage : installutil.exe Installer_BeforeRollback.exe ");
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeUninstall/CS/installer_beforeuninstall.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeUninstall/CS/installer_beforeuninstall.cs
index dd0dabf97e1..2fba298e90b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeUninstall/CS/installer_beforeuninstall.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_BeforeUninstall/CS/installer_beforeuninstall.cs
@@ -1,12 +1,12 @@
/*
System.Configuration.Install.Installer.BeforeUninstall
- The following example demonstrates the event 'BeforeUninstall' of the
+ The following example demonstrates the event 'BeforeUninstall' of the
'Installer' class. This event is raised by the method 'OnBeforeUninstall'.
-
- Use the installer process 'InstallUtil -u' to run the assembly
+
+ Use the installer process 'InstallUtil -u' to run the assembly
'Installer_BeforeUninstall.exe'.
-
+
*/
using System;
@@ -26,10 +26,10 @@ public class MyInstaller: Installer
private void BeforeUninstallEventHandler(object sender, InstallEventArgs e)
{
// Add steps to perform any actions before the Uninstall process.
- Console.WriteLine("Code for BeforeUninstallEventHandler");
+ Console.WriteLine("Code for BeforeUninstallEventHandler");
}
//
-
+
// Override the 'Install' method.
public override void Install(IDictionary savedState)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Committed/CS/installer_committed.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Committed/CS/installer_committed.cs
index 5681ff80459..c63612539d3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Committed/CS/installer_committed.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Committed/CS/installer_committed.cs
@@ -7,9 +7,9 @@ The following example demonstrates the methods 'OnCommitting' and
'OnCommitted' are overridden in the derived class. Space is provided
for the user to add the steps to be performed before committing and
after committing.
-
- 'Installer_Committed.exe' needs to be run using the installer process
- 'installutil'.
+
+ 'Installer_Committed.exe' needs to be run using the installer process
+ 'installutil'.
*/
using System;
using System.Collections;
@@ -17,7 +17,7 @@ after committing.
using System.Configuration.Install;
[RunInstaller(true)]
-public class MyInstaller: Installer
+public class MyInstaller: Installer
{
// Override the 'Install' method.
public override void Install(IDictionary savedState)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Committing/CS/installer_committing.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Committing/CS/installer_committing.cs
index 606e3c421e1..bdb20b3762b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Committing/CS/installer_committing.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Committing/CS/installer_committing.cs
@@ -1,7 +1,7 @@
// System.Configuration.Install.Installer.Committing
-/* The following program demonstrates the 'Committing' event of the
- 'Installer' class. When the 'Commit' is about to complete,
+/* The following program demonstrates the 'Committing' event of the
+ 'Installer' class. When the 'Commit' is about to complete,
'Committing' event is fired and a message is displayed.
*/
@@ -29,7 +29,7 @@ private void MyInstaller_Committing(object sender, InstallEventArgs e)
// Override the 'Install' method.
public override void Install(IDictionary savedState)
{
- base.Install(savedState);
+ base.Install(savedState);
}
// Override the 'Commit' method.
public override void Commit(IDictionary savedState)
@@ -43,6 +43,6 @@ public override void Rollback(IDictionary savedState)
}
public static void Main()
{
- Console.WriteLine("Usage : installutil.exe Installer_Committing.exe ");
+ Console.WriteLine("Usage : installutil.exe Installer_Committing.exe ");
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Context/CS/installer_context.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Context/CS/installer_context.cs
index c3c05b26da9..a74f682267a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Context/CS/installer_context.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Context/CS/installer_context.cs
@@ -1,14 +1,14 @@
/*
System.Configuration.Install.Installer.Context
- The following example demonstrates the 'Context' property of
- the 'Installer' class. The contents of the 'Context' property
- like information about the location of the log file for the
- installation, the location of the file to save information
- required by the Uninstall method, and the command line that
- was entered when the installation executable was run is
+ The following example demonstrates the 'Context' property of
+ the 'Installer' class. The contents of the 'Context' property
+ like information about the location of the log file for the
+ installation, the location of the file to save information
+ required by the Uninstall method, and the command line that
+ was entered when the installation executable was run is
displayed on the console.
-
+
Use 'installutil' to run the assembly Installer_Context.exe
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_HelpText/CS/installer_helptext.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_HelpText/CS/installer_helptext.cs
index 2a9752986aa..6b7def8fa85 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_HelpText/CS/installer_helptext.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_HelpText/CS/installer_helptext.cs
@@ -1,9 +1,9 @@
/*
System.Configuration.Install.Installer.HelpText
-
+
The following example demonstrates the property 'HelpText'. The
'HelpText' property is defined in the 'Installer', which when called
- returns the description of the 'Installer' and the command line
+ returns the description of the 'Installer' and the command line
options for the installation executable, such as the InstallUtil.exe utility,
that can be passed to and understood by the 'Installer'.
@@ -15,7 +15,7 @@ that can be passed to and understood by the 'Installer'.
using System.Configuration.Install;
[RunInstaller(true)]
-public class MyInstaller: Installer
+public class MyInstaller: Installer
{
// Override the 'Install' method.
public override void Install(IDictionary savedState)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Install/CS/installer_install.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Install/CS/installer_install.cs
index 4d97440cab2..244df389bc2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Install/CS/installer_install.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Install/CS/installer_install.cs
@@ -2,7 +2,7 @@
System.Configuration.Install.Installer.Install
System.Configuration.Install.Installer.Commit
- The following example demonstrates the 'Install' and 'Commit' methods
+ The following example demonstrates the 'Install' and 'Commit' methods
of the 'Installer' class.
A class is derived from the 'Installer' base class and the Install
and Commit methods are overridden.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Installers/CS/installer_installers.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Installers/CS/installer_installers.cs
index cd0711f08ec..c1fe58442db 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Installers/CS/installer_installers.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Installers/CS/installer_installers.cs
@@ -3,7 +3,7 @@
System.Configuration.Install.Installer.Parent
The following example demonstrates the properties 'Installers' and
- 'Parent'. The Installers property shows the InstallerCollection
+ 'Parent'. The Installers property shows the InstallerCollection
associated with an Installer and the Parent property gets the
installer containing the collection that this installer belongs to.
*/
@@ -22,9 +22,9 @@ public static void Main()
AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
ServiceInstaller myServiceInstaller = new ServiceInstaller();
EventLogInstaller myEventLogInstaller = new EventLogInstaller();
-
+
InstallerCollection myInstallerCollection = myAssemblyInstaller.Installers;
-
+
// Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection.Add(myServiceInstaller);
myInstallerCollection.Add(myEventLogInstaller);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_OnInstall/CS/installer_oninstall.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_OnInstall/CS/installer_oninstall.cs
index ab0d274cbd7..267c2c20a53 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_OnInstall/CS/installer_oninstall.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_OnInstall/CS/installer_oninstall.cs
@@ -5,12 +5,12 @@
The following example demonstrates the methods 'OnBeforeInstall' and
'OnAfterInstall' of the 'Installer' class. The methods 'OnBeforeInstall'
and 'OnAfterInstall' are overridden in the derived class. Space is provided
- to add steps to be done before the installation in 'OnBeforeInstall' method
+ to add steps to be done before the installation in 'OnBeforeInstall' method
and after the installation in 'OnAfterInstall' method.
-
- Use the installer process 'InstallUtil' to run the assembly
+
+ Use the installer process 'InstallUtil' to run the assembly
Installer_OnInstall.exe.
-
+
*/
using System;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Rollback/CS/installer_rollback.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Rollback/CS/installer_rollback.cs
index 9d169120d32..61b88f4b947 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Rollback/CS/installer_rollback.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Rollback/CS/installer_rollback.cs
@@ -26,7 +26,7 @@ public override void Install( IDictionary mySavedState )
Console.WriteLine( "The Install method of 'MyInstallerSample'" +
" has been called" );
Console.WriteLine( "" );
-
+
// Exception generated to call Rollback method.
Exception myException = new Exception();
Console.WriteLine("Exception thrown during Installation");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Uninstall/CS/installer_uninstall.cs b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Uninstall/CS/installer_uninstall.cs
index c59b996fed6..d672552ffce 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Installer_Uninstall/CS/installer_uninstall.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Installer_Uninstall/CS/installer_uninstall.cs
@@ -1,7 +1,7 @@
/*
System.Configuration.Install.Installer.Uninstall
- The following example demonstrates the Uninstall method
+ The following example demonstrates the Uninstall method
of the class 'installer'. The method Uninstall is overridden
in the derived class of 'installer'.
*/
@@ -19,7 +19,7 @@ public class MyInstallerSample : Installer
//
// Override 'Uninstall' method of Installer class.
public override void Uninstall( IDictionary mySavedState )
- {
+ {
if (mySavedState == null)
{
Console.WriteLine("Uninstallation Error !");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Int16_Equals/CS/int16_equals.cs b/samples/snippets/csharp/VS_Snippets_CLR/Int16_Equals/CS/int16_equals.cs
index 07611ff99ed..ac7eadfde41 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Int16_Equals/CS/int16_equals.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Int16_Equals/CS/int16_equals.cs
@@ -1,25 +1,25 @@
// System.Int16.Equals(Object)
-/*
+/*
The following program demonstrates the 'Equals(Object)' method
of struct 'Int16'. This compares an instance of 'Int16' with the
passed in object and returns true if they are equal.
*/
using System;
-class MyInt16_Equals
+class MyInt16_Equals
{
public static void Main()
{
try
{
-//
+//
Int16 myVariable1 = 20;
Int16 myVariable2 = 20;
// Get and display the declaring type.
Console.WriteLine("\nType of 'myVariable1' is '{0}' and"+
- " value is :{1}",myVariable1.GetType(), myVariable1);
+ " value is :{1}",myVariable1.GetType(), myVariable1);
Console.WriteLine("Type of 'myVariable2' is '{0}' and"+
" value is :{1}",myVariable2.GetType(), myVariable2);
@@ -30,8 +30,8 @@ public static void Main()
else
Console.WriteLine( "\nStructures 'myVariable1' and "+
"'myVariable2' are not equal");
-
-//
+
+//
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Int32_Equals/CS/int32_equals.cs b/samples/snippets/csharp/VS_Snippets_CLR/Int32_Equals/CS/int32_equals.cs
index 696968736cb..c1ea7403644 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Int32_Equals/CS/int32_equals.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Int32_Equals/CS/int32_equals.cs
@@ -1,25 +1,25 @@
// System.Int32.Equals(Object)
-/*
+/*
The following program demonstrates the 'Equals(Object)' method
of struct 'Int32'. This compares an instance of 'Int32' with the
passed in object and returns true if they are equal.
*/
using System;
-class MyInt32_Equals
+class MyInt32_Equals
{
public static void Main()
{
try
{
-//
+//
Int32 myVariable1 = 60;
Int32 myVariable2 = 60;
// Get and display the declaring type.
Console.WriteLine("\nType of 'myVariable1' is '{0}' and"+
- " value is :{1}",myVariable1.GetType(), myVariable1);
+ " value is :{1}",myVariable1.GetType(), myVariable1);
Console.WriteLine("Type of 'myVariable2' is '{0}' and"+
" value is :{1}",myVariable2.GetType(), myVariable2);
@@ -30,8 +30,8 @@ public static void Main()
else
Console.WriteLine( "\nStructures 'myVariable1' and "+
"'myVariable2' are not equal");
-
-//
+
+//
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Int64_Equals/CS/int64_equals.cs b/samples/snippets/csharp/VS_Snippets_CLR/Int64_Equals/CS/int64_equals.cs
index 192a866426b..482ca6a12e1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Int64_Equals/CS/int64_equals.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Int64_Equals/CS/int64_equals.cs
@@ -1,6 +1,6 @@
// System.Int64.Equals(Object)
-/*
+/*
The following program demonstrates the 'Equals(Object)' method
of struct 'Int64'. This compares an instance of 'Int64' with the
passed in object and returns true if they are equal.
@@ -13,16 +13,16 @@ public static void Main()
{
try
{
-//
+//
Int64 myVariable1 = 80;
Int64 myVariable2 = 80;
// Get and display the declaring type.
Console.WriteLine("\nType of 'myVariable1' is '{0}' and"+
- " value is :{1}",myVariable1.GetType(), myVariable1);
+ " value is :{1}",myVariable1.GetType(), myVariable1);
Console.WriteLine("Type of 'myVariable2' is '{0}' and"+
" value is :{1}",myVariable2.GetType(), myVariable2);
-
+
// Compare 'myVariable1' instance with 'myVariable2' Object.
if( myVariable1.Equals( myVariable2 ) )
Console.WriteLine( "\nStructures 'myVariable1' and "+
@@ -30,8 +30,8 @@ public static void Main()
else
Console.WriteLine( "\nStructures 'myVariable1' and "+
"'myVariable2' are not equal");
-
-//
+
+//
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Interop CallingConvention/CS/callingconv.cs b/samples/snippets/csharp/VS_Snippets_CLR/Interop CallingConvention/CS/callingconv.cs
index b69aa05c74c..39afeda2e74 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Interop CallingConvention/CS/callingconv.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Interop CallingConvention/CS/callingconv.cs
@@ -5,7 +5,7 @@
internal static class NativeMethods
{
// C# doesn't support varargs so all arguments must be explicitly defined.
- // CallingConvention.Cdecl must be used since the stack is
+ // CallingConvention.Cdecl must be used since the stack is
// cleaned up by the caller.
// int printf( const char *format [, argument]... )
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/InvokeMem/CS/invokemem.cs b/samples/snippets/csharp/VS_Snippets_CLR/InvokeMem/CS/invokemem.cs
index ac53520ceb2..5ddd347d371 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/InvokeMem/CS/invokemem.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/InvokeMem/CS/invokemem.cs
@@ -3,88 +3,88 @@
using System.Reflection;
// This sample class has a field, constructor, method, and property.
-class MyType
+class MyType
{
Int32 myField;
public MyType(ref Int32 x) {x *= 5;}
public override String ToString() {return myField.ToString();}
- public Int32 MyProp
+ public Int32 MyProp
{
get {return myField;}
- set
- {
- if (value < 1)
+ set
+ {
+ if (value < 1)
throw new ArgumentOutOfRangeException("value", value, "value must be > 0");
myField = value;
}
}
}
-class MyApp
+class MyApp
{
- static void Main()
+ static void Main()
{
Type t = typeof(MyType);
// Create an instance of a type.
Object[] args = new Object[] {8};
Console.WriteLine("The value of x before the constructor is called is {0}.", args[0]);
- Object obj = t.InvokeMember(null,
- BindingFlags.DeclaredOnly |
- BindingFlags.Public | BindingFlags.NonPublic |
+ Object obj = t.InvokeMember(null,
+ BindingFlags.DeclaredOnly |
+ BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.CreateInstance, null, null, args);
Console.WriteLine("Type: " + obj.GetType().ToString());
Console.WriteLine("The value of x after the constructor returns is {0}.", args[0]);
// Read and write to a field.
- t.InvokeMember("myField",
- BindingFlags.DeclaredOnly |
- BindingFlags.Public | BindingFlags.NonPublic |
+ t.InvokeMember("myField",
+ BindingFlags.DeclaredOnly |
+ BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.SetField, null, obj, new Object[] {5});
- Int32 v = (Int32) t.InvokeMember("myField",
- BindingFlags.DeclaredOnly |
- BindingFlags.Public | BindingFlags.NonPublic |
+ Int32 v = (Int32) t.InvokeMember("myField",
+ BindingFlags.DeclaredOnly |
+ BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.GetField, null, obj, null);
Console.WriteLine("myField: " + v);
// Call a method.
- String s = (String) t.InvokeMember("ToString",
- BindingFlags.DeclaredOnly |
- BindingFlags.Public | BindingFlags.NonPublic |
+ String s = (String) t.InvokeMember("ToString",
+ BindingFlags.DeclaredOnly |
+ BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.InvokeMethod, null, obj, null);
Console.WriteLine("ToString: " + s);
// Read and write a property. First, attempt to assign an
// invalid value; then assign a valid value; finally, get
// the value.
- try
+ try
{
- // Assign the value zero to MyProp. The Property Set
+ // Assign the value zero to MyProp. The Property Set
// throws an exception, because zero is an invalid value.
- // InvokeMember catches the exception, and throws
+ // InvokeMember catches the exception, and throws
// TargetInvocationException. To discover the real cause
// you must catch TargetInvocationException and examine
- // the inner exception.
- t.InvokeMember("MyProp",
- BindingFlags.DeclaredOnly |
- BindingFlags.Public | BindingFlags.NonPublic |
+ // the inner exception.
+ t.InvokeMember("MyProp",
+ BindingFlags.DeclaredOnly |
+ BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.SetProperty, null, obj, new Object[] {0});
- }
- catch (TargetInvocationException e)
+ }
+ catch (TargetInvocationException e)
{
// If the property assignment failed for some unexpected
// reason, rethrow the TargetInvocationException.
- if (e.InnerException.GetType() !=
- typeof(ArgumentOutOfRangeException))
+ if (e.InnerException.GetType() !=
+ typeof(ArgumentOutOfRangeException))
throw;
Console.WriteLine("An invalid value was assigned to MyProp.");
}
- t.InvokeMember("MyProp",
- BindingFlags.DeclaredOnly |
- BindingFlags.Public | BindingFlags.NonPublic |
+ t.InvokeMember("MyProp",
+ BindingFlags.DeclaredOnly |
+ BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.SetProperty, null, obj, new Object[] {2});
- v = (Int32) t.InvokeMember("MyProp",
- BindingFlags.DeclaredOnly |
- BindingFlags.Public | BindingFlags.NonPublic |
+ v = (Int32) t.InvokeMember("MyProp",
+ BindingFlags.DeclaredOnly |
+ BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.GetProperty, null, obj, null);
Console.WriteLine("MyProp: " + v);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/addinP3Host/cs/P3Host.cs b/samples/snippets/csharp/VS_Snippets_CLR/addinP3Host/cs/P3Host.cs
index a20be772971..9672e7a6175 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/addinP3Host/cs/P3Host.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/addinP3Host/cs/P3Host.cs
@@ -15,8 +15,8 @@ static void Main()
//
// Get path for the pipeline root.
-// Assumes that the current directory is the
-// pipeline directory structure root directory.
+// Assumes that the current directory is the
+// pipeline directory structure root directory.
String pipeRoot = Environment.CurrentDirectory;
//
@@ -35,7 +35,7 @@ static void Main()
// specifying the host's application base, instead of a path,
// for the FindAddIns method.
-Collection tokens =
+Collection tokens =
AddInStore.FindAddIns(typeof(Calculator),PipelineStoreLocation.ApplicationBase);
//
//
@@ -47,7 +47,7 @@ static void Main()
//Activate the selected AddInToken in a new
//application domain with the Internet trust level.
Calculator CalcAddIn = selectedToken.Activate(AddInSecurityLevel.Internet);
-
+
//Run the add-in using a custom method.
RunCalculator(CalcAddIn);
//
@@ -58,7 +58,7 @@ static void Main()
// Construct the path to the add-in.
string addInFilePath = pipeRoot + @"\AddIns\P3AddIn2\P3AddIn2.dll";
-// The fourth parameter, addinTypeName, takes the full name
+// The fourth parameter, addinTypeName, takes the full name
// of the type qualified by its namespace. Same as AddInToken.AddInFullName.
Collection tokenColl = AddInStore.FindAddIn(typeof(Calculator),
pipeRoot, addInFilePath, "CalcAddIns.P3AddIn2");
@@ -66,7 +66,7 @@ static void Main()
//
//
-// Get the AddInController of a
+// Get the AddInController of a
// currently actived add-in (CalcAddIn).
AddInController aiController = AddInController.GetAddInController(CalcAddIn);
@@ -120,7 +120,7 @@ static void Main()
AddinCtl.AddInEnvironment.Process.IsCurrentProcess);
//
//
-// Use qualification data to control
+// Use qualification data to control
// how an add-in should be activated.
if (selectedToken.QualificationData[AddInSegmentType.AddIn]["Isolation"].Equals("NewProcess"))
@@ -150,8 +150,8 @@ static void Main()
{
Console.WriteLine("{0} {1}\n\t QD Name: {2}, QD Value: {3}",
token.Name,
- qdi.Segment,
- qdi.Name,
+ qdi.Segment,
+ qdi.Name,
qdi.Value);
}
}
@@ -160,7 +160,7 @@ static void Main()
}
//
-// Method to select a token by
+// Method to select a token by
// enumeratng the AddInToken collection.
private static AddInToken ChooseAddIn(Collection tokens)
{
@@ -173,14 +173,14 @@ private static AddInToken ChooseAddIn(Collection tokens)
Console.WriteLine("Available add-ins: ");
//
- // Show the token properties for each token
+ // Show the token properties for each token
// in the AddInToken collection (tokens),
// preceded by the add-in number in [] brackets.
int tokNumber = 1;
foreach (AddInToken tok in tokens)
{
Console.WriteLine(String.Format("\t[{0}]: {1} - {2}\n\t{3}\n\t\t {4}\n\t\t {5} - {6}",
- tokNumber.ToString(),
+ tokNumber.ToString(),
tok.Name,
tok.AddInFullName,
tok.AssemblyName,
@@ -208,7 +208,7 @@ private static AddInToken ChooseAddIn(Collection tokens)
private static void RunCalculator(Calculator calc)
{
-
+
if (calc == null)
{
//No calculators were found, read a line and exit.
@@ -230,7 +230,7 @@ private static void RunCalculator(Calculator calc)
Console.WriteLine("Invalid command: {0}. Commands must be formated: [number] [operation] [number]", line);
Console.WriteLine("Available operations: " + calc.Operations);
}
-
+
line = Console.ReadLine();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/adproperties/CS/adproperties.cs b/samples/snippets/csharp/VS_Snippets_CLR/adproperties/CS/adproperties.cs
index d5c9a8fc80c..cc35d43686f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/adproperties/CS/adproperties.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/adproperties/CS/adproperties.cs
@@ -41,10 +41,10 @@ static void Main(string[] args)
Console.WriteLine("ShadowCopyFiles turned on: " + domain.ShadowCopyFiles);
// This will be copied.
- // You must supply a valid fully qualified assembly name here.
+ // You must supply a valid fully qualified assembly name here.
domain.Load("Assembly1 text name, Version, Culture, PublicKeyToken");
// This will not be copied.
- // You must supply a valid fully qualified assembly name here.
+ // You must supply a valid fully qualified assembly name here.
domain.Load("Assembly2 text name, Version, Culture, PublicKeyToken");
// When the shadow copy path is cleared, the CLR will make shadow copies
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/aescryptoservprovider/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/aescryptoservprovider/cs/program.cs
index 1a7ba909a2e..5a17a02f809 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/aescryptoservprovider/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/aescryptoservprovider/cs/program.cs
@@ -12,7 +12,7 @@ public static void Main()
string original = "Here is some data to encrypt!";
// Create a new instance of the AesCryptoServiceProvider
- // class. This generates a new key and initialization
+ // class. This generates a new key and initialization
// vector (IV).
using (AesCryptoServiceProvider myAes = new AesCryptoServiceProvider())
{
@@ -38,7 +38,7 @@ static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
if (IV == null || IV.Length <= 0)
throw new ArgumentNullException("IV");
byte[] encrypted;
-
+
// Create an AesCryptoServiceProvider object
// with the specified key and IV.
using (AesCryptoServiceProvider aesAlg = new AesCryptoServiceProvider())
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/aesmanaged/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/aesmanaged/cs/program.cs
index 70c3f7e7e9d..ecb67858280 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/aesmanaged/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/aesmanaged/cs/program.cs
@@ -12,7 +12,7 @@ public static void Main()
string original = "Here is some data to encrypt!";
// Create a new instance of the AesManaged
- // class. This generates a new key and initialization
+ // class. This generates a new key and initialization
// vector (IV).
using (AesManaged myAes = new AesManaged())
{
@@ -38,7 +38,7 @@ static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
if (IV == null || IV.Length <= 0)
throw new ArgumentNullException("IV");
byte[] encrypted;
-
+
// Create an AesManaged object
// with the specified key and IV.
using (AesManaged aesAlg = new AesManaged())
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/aessample/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/aessample/cs/program.cs
index b1be8591d23..19e04f9b84b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/aessample/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/aessample/cs/program.cs
@@ -12,7 +12,7 @@ public static void Main()
string original = "Here is some data to encrypt!";
// Create a new instance of the Aes
- // class. This generates a new key and initialization
+ // class. This generates a new key and initialization
// vector (IV).
using (Aes myAes = Aes.Create())
{
@@ -39,7 +39,7 @@ static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
if (IV == null || IV.Length <= 0)
throw new ArgumentNullException("IV");
byte[] encrypted;
-
+
// Create an Aes object
// with the specified key and IV.
using (Aes aesAlg = Aes.Create())
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/char.cvtutf32/CS/utf.cs b/samples/snippets/csharp/VS_Snippets_CLR/char.cvtutf32/CS/utf.cs
index 594909ffd4f..f22e09be670 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/char.cvtutf32/CS/utf.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/char.cvtutf32/CS/utf.cs
@@ -3,9 +3,9 @@
// and Char.ConvertToUtf32() overloads.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
int letterA = 0x0041; //U+00041 = LATIN CAPITAL LETTER A
int music = 0x1D161; //U+1D161 = MUSICAL SYMBOL SIXTEENTH NOTE
@@ -15,7 +15,7 @@ public static void Main()
string comment2b = "Create a code point from a surrogate pair at a certain position in a string.";
string comment2c = "Create a code point from a high surrogate and a low surrogate code point.";
-// Convert code point U+0041 to UTF-16. The UTF-16 equivalent of
+// Convert code point U+0041 to UTF-16. The UTF-16 equivalent of
// U+0041 is a Char with hexadecimal value 0041.
Console.WriteLine(comment);
@@ -35,7 +35,7 @@ public static void Main()
// -------------------------------------------------------------------
-// Convert the code point U+1D161 to UTF-16. The UTF-16 equivalent of
+// Convert the code point U+1D161 to UTF-16. The UTF-16 equivalent of
// U+1D161 is a surrogate pair with hexadecimal values D834 and DD61.
Console.WriteLine(comment);
@@ -44,7 +44,7 @@ public static void Main()
Show(s1);
Console.WriteLine();
-// Convert the surrogate pair in the string at index position
+// Convert the surrogate pair in the string at index position
// zero to a code point.
Console.WriteLine(comment2b);
@@ -66,8 +66,8 @@ private static void Show(string s)
{
for (int x = 0; x < s.Length; x++)
{
- Console.Write("0x{0:X}{1}",
- (int)s[x],
+ Console.Write("0x{0:X}{1}",
+ (int)s[x],
((x == s.Length-1)? String.Empty : ", "));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/char.surrogate/CS/sur.cs b/samples/snippets/csharp/VS_Snippets_CLR/char.surrogate/CS/sur.cs
index 9310a9e5105..02d99fe4d7c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/char.surrogate/CS/sur.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/char.surrogate/CS/sur.cs
@@ -4,14 +4,14 @@
// IsSurrogatePair() method
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
char cHigh = '\uD800';
char cLow = '\uDC00';
string s1 = new String(new char[] {'a', '\uD800', '\uDC00', 'z'});
- string divider = String.Concat( Environment.NewLine, new String('-', 70),
+ string divider = String.Concat( Environment.NewLine, new String('-', 70),
Environment.NewLine);
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.isolatedstorage/cs/source2.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.isolatedstorage/cs/source2.cs
index be8bf5c0dca..4741011f7d0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.isolatedstorage/cs/source2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.isolatedstorage/cs/source2.cs
@@ -15,7 +15,7 @@ public static void Main()
isoStore.CreateFile("TestFileC.Txt");
isoStore.CreateFile("TestFileD.Txt");
}
-
+
IEnumerator allFiles = IsolatedStorageFile.GetEnumerator(IsolatedStorageScope.User);
long totalsize = 0;
@@ -24,7 +24,7 @@ public static void Main()
IsolatedStorageFile storeFile = (IsolatedStorageFile)allFiles.Current;
totalsize += (long)storeFile.UsedSize;
}
-
+
Console.WriteLine("The total size = " + totalsize);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.isolatedstorage/cs/source5.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.isolatedstorage/cs/source5.cs
index a38ef7ad894..15fbb125a29 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.isolatedstorage/cs/source5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.isolatedstorage/cs/source5.cs
@@ -33,7 +33,7 @@ static void Main(string[] args)
Console.WriteLine("You have written to the file.");
}
}
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.monitors/cs/badbox1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.monitors/cs/badbox1.cs
index 1fea79073c3..6679cca6b5f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.monitors/cs/badbox1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.monitors/cs/badbox1.cs
@@ -12,7 +12,7 @@ public static void Main()
int nTasks = 0;
object o = nTasks;
List tasks = new List();
-
+
try {
for (int ctr = 0; ctr < 10; ctr++)
tasks.Add(Task.Run( () => { // Instead of doing some work, just sleep.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.monitors/cs/badlock1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.monitors/cs/badlock1.cs
index af47b7c2dd0..ec811542d32 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.monitors/cs/badlock1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.monitors/cs/badlock1.cs
@@ -11,7 +11,7 @@ public static void Main()
int nTasks = 0;
List tasks = new List();
-
+
try {
for (int ctr = 0; ctr < 10; ctr++)
tasks.Add(Task.Run( () => { // Instead of doing some work, just sleep.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/create1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/create1.cs
index 5c264b2ccfb..e5c7a8e2968 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/create1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/create1.cs
@@ -10,14 +10,14 @@
private int carYear;
private int carDoors;
private int carCylinders;
-
- public Automobile(string make, string model, int year) :
- this(make, model, year, 0, 0)
+
+ public Automobile(string make, string model, int year) :
+ this(make, model, year, 0, 0)
{ }
-
- public Automobile(string make, string model, int year,
+
+ public Automobile(string make, string model, int year,
int doors, int cylinders)
- {
+ {
this.carMake = make;
this.carModel = model;
this.carYear = year;
@@ -27,23 +27,23 @@ public Automobile(string make, string model, int year,
public string Make {
get { return this.carMake; }
- }
-
+ }
+
public string Model {
get {return this.carModel; }
- }
-
+ }
+
public int Year {
get { return this.carYear; }
- }
-
+ }
+
public int Doors {
get { return this.carDoors; }
- }
-
+ }
+
public int Cylinders {
get { return this.carCylinders; }
- }
+ }
}
public class Example
@@ -62,9 +62,9 @@ public static void Main()
resx.AddResource("HeaderString3", "Year");
resx.AddResource("HeaderString4", "Doors");
resx.AddResource("HeaderString5", "Cylinders");
- resx.AddResource("Information", SystemIcons.Information);
- resx.AddResource("EarlyAuto1", car1);
- resx.AddResource("EarlyAuto2", car2);
+ resx.AddResource("Information", SystemIcons.Information);
+ resx.AddResource("EarlyAuto1", car1);
+ resx.AddResource("EarlyAuto2", car2);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/enumerate1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/enumerate1.cs
index 17aac54dad0..3e24943c393 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/enumerate1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/enumerate1.cs
@@ -11,29 +11,29 @@ public static void Main()
string resxFile = @".\CarResources.resx";
List autos = new List();
SortedList headers = new SortedList();
-
+
using (ResXResourceReader resxReader = new ResXResourceReader(resxFile))
{
foreach (DictionaryEntry entry in resxReader) {
if (((string) entry.Key).StartsWith("EarlyAuto"))
- autos.Add((Automobile) entry.Value);
- else if (((string) entry.Key).StartsWith("Header"))
- headers.Add((string) entry.Key, (string) entry.Value);
- }
+ autos.Add((Automobile) entry.Value);
+ else if (((string) entry.Key).StartsWith("Header"))
+ headers.Add((string) entry.Key, (string) entry.Value);
+ }
}
string[] headerColumns = new string[headers.Count];
headers.GetValueList().CopyTo(headerColumns, 0);
- Console.WriteLine("{0,-8} {1,-10} {2,-4} {3,-5} {4,-9}\n",
+ Console.WriteLine("{0,-8} {1,-10} {2,-4} {3,-5} {4,-9}\n",
headerColumns);
- foreach (var auto in autos)
- Console.WriteLine("{0,-8} {1,-10} {2,4} {3,5} {4,9}",
- auto.Make, auto.Model, auto.Year,
+ foreach (var auto in autos)
+ Console.WriteLine("{0,-8} {1,-10} {2,4} {3,5} {4,9}",
+ auto.Make, auto.Model, auto.Year,
auto.Doors, auto.Cylinders);
}
}
// The example displays the following output:
// Make Model Year Doors Cylinders
-//
+//
// Ford Model N 1906 0 4
// Ford Model T 1909 2 4
//
@@ -45,14 +45,14 @@ public static void Main()
private int carYear;
private int carDoors;
private int carCylinders;
-
- public Automobile(string make, string model, int year) :
- this(make, model, year, 0, 0)
+
+ public Automobile(string make, string model, int year) :
+ this(make, model, year, 0, 0)
{ }
-
- public Automobile(string make, string model, int year,
+
+ public Automobile(string make, string model, int year,
int doors, int cylinders)
- {
+ {
this.carMake = make;
this.carModel = model;
this.carYear = year;
@@ -62,21 +62,21 @@ public Automobile(string make, string model, int year,
public string Make {
get { return this.carMake; }
- }
-
+ }
+
public string Model {
get {return this.carModel; }
- }
-
+ }
+
public int Year {
get { return this.carYear; }
- }
-
+ }
+
public int Doors {
get { return this.carDoors; }
- }
-
+ }
+
public int Cylinders {
get { return this.carCylinders; }
- }
+ }
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/retrieve1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/retrieve1.cs
index 82dfcca932d..9afee084db3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/retrieve1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.resx/cs/retrieve1.cs
@@ -25,7 +25,7 @@ public CarDisplayApp()
DataGridView grid = new DataGridView();
grid.Location = new Point(10, 60);
this.Controls.Add(grid);
-
+
// Get resources from .resx file.
using (ResXResourceSet resxSet = new ResXResourceSet(resxFile))
{
@@ -36,15 +36,15 @@ public CarDisplayApp()
if (image != null)
pictureBox.Image = image.ToBitmap();
- // Retrieve Automobile objects.
+ // Retrieve Automobile objects.
List carList = new List();
string resName = "EarlyAuto";
- Automobile auto;
+ Automobile auto;
int ctr = 1;
do {
auto = (Automobile) resxSet.GetObject(resName + ctr.ToString());
ctr++;
- if (auto != null)
+ if (auto != null)
carList.Add(auto);
} while (auto != null);
cars = carList.ToArray();
@@ -61,14 +61,14 @@ public CarDisplayApp()
private int carYear;
private int carDoors;
private int carCylinders;
-
- public Automobile(string make, string model, int year) :
- this(make, model, year, 0, 0)
+
+ public Automobile(string make, string model, int year) :
+ this(make, model, year, 0, 0)
{ }
-
- public Automobile(string make, string model, int year,
+
+ public Automobile(string make, string model, int year,
int doors, int cylinders)
- {
+ {
this.carMake = make;
this.carModel = model;
this.carYear = year;
@@ -78,21 +78,21 @@ public Automobile(string make, string model, int year,
public string Make {
get { return this.carMake; }
- }
-
+ }
+
public string Model {
get {return this.carModel; }
- }
-
+ }
+
public int Year {
get { return this.carYear; }
- }
-
+ }
+
public int Doors {
get { return this.carDoors; }
- }
-
+ }
+
public int Cylinders {
get { return this.carCylinders; }
- }
+ }
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/createresources.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/createresources.cs
index a67887b97be..3190a50de2e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/createresources.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/createresources.cs
@@ -12,11 +12,11 @@ public static void Main()
Bitmap bmp = new Bitmap(@".\SplashScreen.jpg");
MemoryStream imageStream = new MemoryStream();
bmp.Save(imageStream, ImageFormat.Jpeg);
-
+
ResXResourceWriter writer = new ResXResourceWriter("AppResources.resx");
writer.AddResource("SplashScreen", imageStream);
writer.Generate();
- writer.Close();
+ writer.Close();
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/ctor1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/ctor1.cs
index 55c8f848c75..37988276e9d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/ctor1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/ctor1.cs
@@ -12,9 +12,9 @@ public static void Main()
static void CallCtor1()
{
//
- ResourceManager rm = new ResourceManager("MyCompany.StringResources",
+ ResourceManager rm = new ResourceManager("MyCompany.StringResources",
typeof(Example).Assembly);
- //
+ //
}
static void CallCtor2()
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example.cs
index a452ae669fc..927be1173a9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example.cs
@@ -4,13 +4,13 @@
[Serializable] public struct PersonTable
{
public readonly int nColumns;
- public readonly string column1;
+ public readonly string column1;
public readonly string column2;
- public readonly string column3;
+ public readonly string column3;
public readonly int width1;
public readonly int width2;
public readonly int width3;
-
+
public PersonTable(string column1, string column2, string column3,
int width1, int width2, int width3)
{
@@ -20,7 +20,7 @@ public PersonTable(string column1, string column2, string column3,
this.width1 = width1;
this.width2 = width2;
this.width3 = width3;
- this.nColumns = typeof(PersonTable).GetFields().Length / 2;
+ this.nColumns = typeof(PersonTable).GetFields().Length / 2;
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example1.cs
index f5e0c0bb604..89d428df23b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example1.cs
@@ -6,7 +6,7 @@ public class CreateResource
{
public static void Main()
{
- PersonTable table = new PersonTable("Name", "Employee Number",
+ PersonTable table = new PersonTable("Name", "Employee Number",
"Age", 30, 18, 5);
ResXResourceWriter rr = new ResXResourceWriter(@".\UIResources.resx");
rr.AddResource("TableName", "Employees of Acme Corporation");
@@ -20,13 +20,13 @@ public static void Main()
[Serializable] public struct PersonTable
{
public readonly int nColumns;
- public readonly string column1;
+ public readonly string column1;
public readonly string column2;
- public readonly string column3;
+ public readonly string column3;
public readonly int width1;
public readonly int width2;
public readonly int width3;
-
+
public PersonTable(string column1, string column2, string column3,
int width1, int width2, int width3)
{
@@ -36,6 +36,6 @@ public PersonTable(string column1, string column2, string column3,
this.width1 = width1;
this.width2 = width2;
this.width3 = width3;
- this.nColumns = typeof(PersonTable).GetFields().Length / 2;
+ this.nColumns = typeof(PersonTable).GetFields().Length / 2;
}
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example2.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example2.cs
index bda0bf163a6..233eca05cbc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example2.cs
@@ -9,13 +9,13 @@ public class Example
public static void Main()
{
string fmtString = String.Empty;
- ResourceManager rm = new ResourceManager("UIResources", typeof(Example).Assembly);
+ ResourceManager rm = new ResourceManager("UIResources", typeof(Example).Assembly);
string title = rm.GetString("TableName");
PersonTable tableInfo = (PersonTable) rm.GetObject("Employees");
if (! String.IsNullOrEmpty(title)) {
- fmtString = "{0," + ((Console.WindowWidth + title.Length) / 2).ToString() + "}";
- Console.WriteLine(fmtString, title);
+ fmtString = "{0," + ((Console.WindowWidth + title.Length) / 2).ToString() + "}";
+ Console.WriteLine(fmtString, title);
Console.WriteLine();
}
@@ -26,7 +26,7 @@ public static void Main()
int width = (int) tableInfo.GetType().GetField(widthName).GetValue(tableInfo);
fmtString = "{0,-" + width.ToString() + "}";
Console.Write(fmtString, value);
- }
+ }
Console.WriteLine();
}
}
@@ -35,13 +35,13 @@ public static void Main()
[Serializable] public struct PersonTable
{
public readonly int nColumns;
- public readonly string column1;
+ public readonly string column1;
public readonly string column2;
- public readonly string column3;
+ public readonly string column3;
public readonly int width1;
public readonly int width2;
public readonly int width3;
-
+
public PersonTable(string column1, string column2, string column3,
int width1, int width2, int width3)
{
@@ -51,6 +51,6 @@ public PersonTable(string column1, string column2, string column3,
this.width1 = width1;
this.width2 = width2;
this.width3 = width3;
- this.nColumns = typeof(PersonTable).GetFields().Length / 2;
+ this.nColumns = typeof(PersonTable).GetFields().Length / 2;
}
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example3.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example3.cs
index c1aee07a821..d8e21c3b9ea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/example3.cs
@@ -12,7 +12,7 @@ public static void Main()
{
string[] cultureNames = { "en-US", "en-CA", "ru-RU", "fr-FR" };
ResourceManager rm = ResourceManager.CreateFileBasedResourceManager("Strings", "Resources", null);
-
+
foreach (var cultureName in cultureNames) {
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName);
string greeting = rm.GetString("Greeting", CultureInfo.CurrentCulture);
@@ -29,16 +29,16 @@ public static void Main()
// Hello!
// What is your name? Dakota
// Hello, Dakota!
-//
+//
// Hello!
// What is your name? Koani
// Hello, Koani!
-//
+//
// Здравствуйте!
// Как вас зовут?Samuel
// Здравствуйте, Samuel!
-//
+//
// Bon jour!
// Comment vous appelez-vous?Yiska
// Bon jour, Yiska!
-//
\ No newline at end of file
+//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/getstream.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/getstream.cs
index 782ff8c45dd..028eb426c86 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/getstream.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/getstream.cs
@@ -11,13 +11,13 @@ public static void Main()
{
ResourceManager rm = new ResourceManager("AppResources", typeof(Example).Assembly);
Bitmap screen = (Bitmap) Image.FromStream(rm.GetStream("SplashScreen"));
-
+
Form frm = new Form();
frm.Size = new Size(300, 300);
PictureBox pic = new PictureBox();
pic.Bounds = frm.RestoreBounds;
- pic.BorderStyle = BorderStyle.Fixed3D;
+ pic.BorderStyle = BorderStyle.Fixed3D;
pic.Image = screen;
pic.SizeMode = PictureBoxSizeMode.StretchImage;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/getstring.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/getstring.cs
index e5b8547cbe1..af2d92da278 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/getstring.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.resources.retrieving/cs/getstring.cs
@@ -12,7 +12,7 @@ public static void Main()
{
string[] cultureNames = { "en-US", "fr-FR", "ru-RU", "es-ES" };
Random rnd = new Random();
- ResourceManager rm = new ResourceManager("Strings",
+ ResourceManager rm = new ResourceManager("Strings",
typeof(Example).Assembly);
for (int ctr = 0; ctr <= cultureNames.Length; ctr++) {
@@ -20,26 +20,26 @@ public static void Main()
CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
-
+
Console.WriteLine("Current culture: {0}", culture.NativeName);
string timeString = rm.GetString("TimeHeader");
- Console.WriteLine("{0} {1:T}\n", timeString, DateTime.Now);
- }
+ Console.WriteLine("{0} {1:T}\n", timeString, DateTime.Now);
+ }
}
}
// The example displays output like the following:
// Current culture: English (United States)
// The current time is 9:34:18 AM
-//
+//
// Current culture: Español (España, alfabetización internacional)
// The current time is 9:34:18
-//
+//
// Current culture: русский (Россия)
// Текущее время — 9:34:18
-//
+//
// Current culture: français (France)
// L'heure actuelle est 09:34:18
-//
+//
// Current culture: русский (Россия)
// Текущее время — 9:34:18
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/compare1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/compare1.cs
index d31b288e8da..ee43f243e3d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/compare1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/compare1.cs
@@ -8,29 +8,29 @@ public class CompareStringSample
public static void Main()
{
string str1 = "Apple";
- string str2 = "Æble";
+ string str2 = "Æble";
// Sets the CurrentCulture to Danish in Denmark.
Thread.CurrentThread.CurrentCulture = new CultureInfo("da-DK");
// Compares the two strings.
int result1 = String.Compare(str1, str2);
- Console.WriteLine("\nWhen the CurrentCulture is \"da-DK\",\nthe " +
- "result of comparing {0} with {1} is: {2}", str1, str2,
+ Console.WriteLine("\nWhen the CurrentCulture is \"da-DK\",\nthe " +
+ "result of comparing {0} with {1} is: {2}", str1, str2,
result1);
// Sets the CurrentCulture to English in the U.S.
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
// Compares the two strings.
int result2 = String.Compare(str1, str2);
- Console.WriteLine("\nWhen the CurrentCulture is \"en-US\",\nthe " +
- "result of comparing {0} with {1} is: {2}", str1, str2,
+ Console.WriteLine("\nWhen the CurrentCulture is \"en-US\",\nthe " +
+ "result of comparing {0} with {1} is: {2}", str1, str2,
result2);
}
}
// The example displays the following output:
// When the CurrentCulture is "da-DK",
// the result of comparing Apple with Æble is: -1
-//
+//
// When the CurrentCulture is "en-US",
// the result of comparing Apple with Æble is: 1
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/index1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/index1.cs
index dc23b2eff03..e74ee8b537d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/index1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/index1.cs
@@ -13,67 +13,67 @@ public static void Main()
// Create CultureInfo objects representing the Danish (Denmark)
// and English (United States) cultures.
- CultureInfo[] cultures = { CultureInfo.CreateSpecificCulture("da-DK"),
+ CultureInfo[] cultures = { CultureInfo.CreateSpecificCulture("da-DK"),
CultureInfo.CreateSpecificCulture("en-US") };
foreach (var ci in cultures) {
Thread.CurrentThread.CurrentCulture = ci;
-
+
int result1 = ci.CompareInfo.IndexOf(str1, find);
int result2 = ci.CompareInfo.IndexOf(str2, find);
- int result3 = ci.CompareInfo.IndexOf(str1, find,
+ int result3 = ci.CompareInfo.IndexOf(str1, find,
+ CompareOptions.Ordinal);
+ int result4 = ci.CompareInfo.IndexOf(str2, find,
CompareOptions.Ordinal);
- int result4 = ci.CompareInfo.IndexOf(str2, find,
- CompareOptions.Ordinal);
-
- Console.WriteLine("\nThe current culture is {0}",
+
+ Console.WriteLine("\nThe current culture is {0}",
CultureInfo.CurrentCulture.Name);
Console.WriteLine("\n CompareInfo.IndexOf(string, char) method:");
- Console.WriteLine(" Position of {0} in the string {1}: {2}",
+ Console.WriteLine(" Position of {0} in the string {1}: {2}",
find, str1, result1);
Console.WriteLine("\n CompareInfo.IndexOf(string, char) method:");
- Console.WriteLine(" Position of {0} in the string {1}: {2}",
+ Console.WriteLine(" Position of {0} in the string {1}: {2}",
find, str2, result2);
Console.WriteLine("\n CompareInfo.IndexOf(string, char, CompareOptions.Ordinal) method");
- Console.WriteLine(" Position of {0} in the string {1}: {2}",
+ Console.WriteLine(" Position of {0} in the string {1}: {2}",
find, str1, result3);
Console.WriteLine("\n CompareInfo.IndexOf(string, char, CompareOptions.Ordinal) method");
- Console.WriteLine(" Position of {0} in the string {1}: {2}",
+ Console.WriteLine(" Position of {0} in the string {1}: {2}",
find, str2, result4);
Console.WriteLine();
- }
+ }
}
}
// The example displays the following output
// The current culture is da-DK
-//
+//
// CompareInfo.IndexOf(string, char) method:
// Position of æ in the string æble: 0
-//
+//
// CompareInfo.IndexOf(string, char) method:
// Position of æ in the string aeble: -1
-//
+//
// CompareInfo.IndexOf(string, char, CompareOptions.Ordinal) method
// Position of æ in the string æble: 0
-//
+//
// CompareInfo.IndexOf(string, char, CompareOptions.Ordinal) method
// Position of æ in the string aeble: -1
-//
-//
+//
+//
// The current culture is en-US
-//
+//
// CompareInfo.IndexOf(string, char) method:
// Position of æ in the string æble: 0
-//
+//
// CompareInfo.IndexOf(string, char) method:
// Position of æ in the string aeble: 0
-//
+//
// CompareInfo.IndexOf(string, char, CompareOptions.Ordinal) method
// Position of æ in the string æble: 0
-//
+//
// CompareInfo.IndexOf(string, char, CompareOptions.Ordinal) method
// Position of æ in the string aeble: -1
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/sort1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/sort1.cs
index bcabf5bf441..6db88e57dee 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/sort1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/sort1.cs
@@ -3,9 +3,9 @@
using System.Globalization;
using System.Threading;
-public class ArraySort
+public class ArraySort
{
- public static void Main(String[] args)
+ public static void Main(String[] args)
{
// Create and initialize a new array to store the strings.
string[] stringArray = { "Apple", "Æble", "Zebra"};
@@ -21,7 +21,7 @@ public static void Main(String[] args)
// Display the values of the array.
Console.WriteLine("After sorting for the culture \"en-US\":");
- PrintIndexAndValues(stringArray);
+ PrintIndexAndValues(stringArray);
// Set the CurrentCulture to "da-DK".
Thread.CurrentThread.CurrentCulture = new CultureInfo("da-DK");
@@ -30,14 +30,14 @@ public static void Main(String[] args)
// Display the values of the array.
Console.WriteLine("After sorting for the culture \"da-DK\":");
- PrintIndexAndValues(stringArray);
+ PrintIndexAndValues(stringArray);
}
- public static void PrintIndexAndValues(string[] myArray)
+ public static void PrintIndexAndValues(string[] myArray)
{
- for (int i = myArray.GetLowerBound(0); i <=
+ for (int i = myArray.GetLowerBound(0); i <=
myArray.GetUpperBound(0); i++ )
Console.WriteLine("[{0}]: {1}", i, myArray[i]);
- Console.WriteLine();
+ Console.WriteLine();
}
}
// The example displays the following output:
@@ -45,12 +45,12 @@ public static void PrintIndexAndValues(string[] myArray)
// [0]: Apple
// [1]: Æble
// [2]: Zebra
-//
+//
// After sorting for the "en-US" culture:
// [0]: Æble
// [1]: Apple
// [2]: Zebra
-//
+//
// After sorting for the culture "da-DK":
// [0]: Apple
// [1]: Zebra
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/sortkey1.cs b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/sortkey1.cs
index 27fed9c1ac6..706338f0a5c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/sortkey1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/conceptual.strings.comparing/cs/sortkey1.cs
@@ -3,9 +3,9 @@
using System.Threading;
using System.Globalization;
-public class SortKeySample
+public class SortKeySample
{
- public static void Main(String[] args)
+ public static void Main(String[] args)
{
String str1 = "Apple";
String str2 = "Æble";
@@ -22,7 +22,7 @@ public static void Main(String[] args)
// Compare the two sort keys and display the results.
int result1 = SortKey.Compare(sc1, sc2);
Console.WriteLine("When the CurrentCulture is \"da-DK\",");
- Console.WriteLine("the result of comparing {0} with {1} is: {2}\n",
+ Console.WriteLine("the result of comparing {0} with {1} is: {2}\n",
str1, str2, result1);
// Set the CurrentCulture to "en-US".
@@ -37,14 +37,14 @@ public static void Main(String[] args)
// Compare the two sort keys and display the results.
int result2 = SortKey.Compare(sc3, sc4);
Console.WriteLine("When the CurrentCulture is \"en-US\",");
- Console.WriteLine("the result of comparing {0} with {1} is: {2}",
+ Console.WriteLine("the result of comparing {0} with {1} is: {2}",
str1, str2, result2);
}
}
// The example displays the following output:
// When the CurrentCulture is "da-DK",
// the result of comparing Apple with Æble is: -1
-//
+//
// When the CurrentCulture is "en-US",
// the result of comparing Apple with Æble is: 1
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.beep/CS/beep.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.beep/CS/beep.cs
index f851b9052e4..bb75ee5eea1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.beep/CS/beep.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.beep/CS/beep.cs
@@ -2,9 +2,9 @@
// This example demonstrates the Console.Beep() method.
using System;
-class Sample
+class Sample
{
- public static void Main(String[] args)
+ public static void Main(String[] args)
{
int x = 0;
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.beep2/CS/b2.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.beep2/CS/b2.cs
index 0b634f78ffc..c52964e8a6c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.beep2/CS/b2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.beep2/CS/b2.cs
@@ -3,12 +3,12 @@
using System;
using System.Threading;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
// Declare the first few notes of the song, "Mary Had A Little Lamb".
- Note[] Mary =
+ Note[] Mary =
{
new Note(Tone.B, Duration.QUARTER),
new Note(Tone.A, Duration.QUARTER),
@@ -40,7 +40,7 @@ protected static void Play(Note[] tune)
}
}
-// Define the frequencies of notes in an octave, as well as
+// Define the frequencies of notes in an octave, as well as
// silence (rest).
protected enum Tone
{
@@ -57,7 +57,7 @@ protected enum Tone
F = 349,
Fsharp = 370,
G = 392,
- Gsharp = 415,
+ Gsharp = 415,
}
// Define the duration of a note in units of milliseconds.
@@ -70,7 +70,7 @@ protected enum Duration
SIXTEENTH = EIGHTH/2,
}
-// Define a note as a frequency (tone) and the amount of
+// Define a note as a frequency (tone) and the amount of
// time (duration) the note plays.
protected struct Note
{
@@ -92,7 +92,7 @@ public Note(Tone frequency, Duration time)
/*
This example produces the following results:
-This example plays the first few notes of "Mary Had A Little Lamb"
+This example plays the first few notes of "Mary Had A Little Lamb"
through the console speaker.
*/
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.bufferHW/CS/hw.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.bufferHW/CS/hw.cs
index afb17fd68f9..202c085e7fb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.bufferHW/CS/hw.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.bufferHW/CS/hw.cs
@@ -1,11 +1,11 @@
//
-// This example demonstrates the Console.BufferHeight and
+// This example demonstrates the Console.BufferHeight and
// Console.BufferWidth properties.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
Console.WriteLine("The current buffer height is {0} rows.",
Console.BufferHeight);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.cancelkeypress/cs/ckp.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.cancelkeypress/cs/ckp.cs
index e7bd00011b9..73b73ecc6ce 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.cancelkeypress/cs/ckp.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.cancelkeypress/cs/ckp.cs
@@ -1,7 +1,7 @@
//
using System;
-class Sample
+class Sample
{
public static void Main()
{
@@ -47,21 +47,21 @@ protected static void myHandler(object sender, ConsoleCancelEventArgs args)
// The example displays output similar to the following:
// Press any key, or 'X' to quit, or CTRL+C to interrupt the read operation:
// Key pressed: J
-//
+//
// Press any key, or 'X' to quit, or CTRL+C to interrupt the read operation:
// Key pressed: Enter
-//
+//
// Press any key, or 'X' to quit, or CTRL+C to interrupt the read operation:
-//
+//
// The read operation has been interrupted.
// Key pressed: ControlC
// Cancel property: False
// Setting the Cancel property to true...
// Cancel property: True
// The read operation will resume...
-//
+//
// Key pressed: Q
-//
+//
// Press any key, or 'X' to quit, or CTRL+C to interrupt the read operation:
// Key pressed: X
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.cursorLTS/CS/lts.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.cursorLTS/CS/lts.cs
index 7089bc15c1f..1c05660c16f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.cursorLTS/CS/lts.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.cursorLTS/CS/lts.cs
@@ -1,12 +1,12 @@
//
-// This example demonstrates the
-// Console.CursorLeft and
+// This example demonstrates the
+// Console.CursorLeft and
// Console.CursorTop properties, and the
-// Console.SetCursorPosition and
+// Console.SetCursorPosition and
// Console.Clear methods.
using System;
-class Sample
+class Sample
{
protected static int origRow;
protected static int origCol;
@@ -25,7 +25,7 @@ protected static void WriteAt(string s, int x, int y)
}
}
- public static void Main()
+ public static void Main()
{
// Clear the screen, then save the top and left coordinates.
Console.Clear();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.cursorsize/CS/csize.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.cursorsize/CS/csize.cs
index 1128f26b9f9..d3404c76bee 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.cursorsize/CS/csize.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.cursorsize/CS/csize.cs
@@ -2,9 +2,9 @@
// This example demonstrates the Console.CursorSize property.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
string m0 = "This example increments the cursor size from 1% to 100%:\n";
string m1 = "Cursor size = {0}%. (Press any key to continue...)";
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.cursorvis/CS/vis.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.cursorvis/CS/vis.cs
index 8144bb6dbbc..ee0d1a69d20 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.cursorvis/CS/vis.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.cursorvis/CS/vis.cs
@@ -3,9 +3,9 @@
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
string m1 = "\nThe cursor is {0}.\nType any text then press Enter. " +
"Type '+' in the first column to show \n" +
@@ -20,13 +20,13 @@ public static void Main()
saveCursorSize = Console.CursorSize;
Console.CursorSize = 100; // Emphasize the cursor.
- while(true)
+ while(true)
{
- Console.WriteLine(m1,
- ((Console.CursorVisible == true) ?
+ Console.WriteLine(m1,
+ ((Console.CursorVisible == true) ?
"VISIBLE" : "HIDDEN"));
s = Console.ReadLine();
- if (String.IsNullOrEmpty(s) == false)
+ if (String.IsNullOrEmpty(s) == false)
if (s[0] == '+')
Console.CursorVisible = true;
else if (s[0] == '-')
@@ -40,7 +40,7 @@ public static void Main()
}
/*
This example produces the following results. Note that these results
-cannot depict cursor visibility. You must run the example to see the
+cannot depict cursor visibility. You must run the example to see the
cursor behavior:
The cursor is VISIBLE.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.keyavailable/CS/ka.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.keyavailable/CS/ka.cs
index 8fa9a4727cc..9572d92f9b5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.keyavailable/CS/ka.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.keyavailable/CS/ka.cs
@@ -2,21 +2,21 @@
using System;
using System.Threading;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
ConsoleKeyInfo cki;
do {
Console.WriteLine("\nPress a key to display; press the 'x' key to quit.");
- // Your code could perform some useful task in the following loop. However,
+ // Your code could perform some useful task in the following loop. However,
// for the sake of this example we'll merely pause for a quarter second.
-
+
while (Console.KeyAvailable == false)
Thread.Sleep(250); // Loop until input is entered.
-
+
cki = Console.ReadKey(true);
Console.WriteLine("You pressed the '{0}' key.", cki.Key);
} while(cki.Key != ConsoleKey.X);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.read/CS/read.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.read/CS/read.cs
index f2bf6627d0c..5ca0a2f6997 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.read/CS/read.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.read/CS/read.cs
@@ -2,9 +2,9 @@
// This example demonstrates the Console.Read() method.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
string m1 = "\nType a string of text then press Enter. " +
"Type '+' anywhere in the text to quit:\n";
@@ -14,16 +14,16 @@ public static void Main()
int x;
//
Console.WriteLine(m1);
- do
+ do
{
x = Console.Read();
- try
+ try
{
ch = Convert.ToChar(x);
if (Char.IsWhiteSpace(ch))
{
Console.WriteLine(m3, x);
- if (ch == 0x0a)
+ if (ch == 0x0a)
Console.WriteLine(m1);
}
else
@@ -31,7 +31,7 @@ public static void Main()
Console.WriteLine(m2, ch, x);
}
}
- catch (OverflowException e)
+ catch (OverflowException e)
{
Console.WriteLine("{0} Value read = {1}.", e.Message, x);
ch = Char.MinValue;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.readkey1/CS/rk.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.readkey1/CS/rk.cs
index 434c4f08f00..a0ec8b1d22a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.readkey1/CS/rk.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.readkey1/CS/rk.cs
@@ -1,9 +1,9 @@
//
using System;
-class Example
+class Example
{
- public static void Main()
+ public static void Main()
{
ConsoleKeyInfo cki;
// Prevent example from ending if CTL+C is pressed.
@@ -11,7 +11,7 @@ public static void Main()
Console.WriteLine("Press any combination of CTL, ALT, and SHIFT, and a console key.");
Console.WriteLine("Press the Escape (Esc) key to quit: \n");
- do
+ do
{
cki = Console.ReadKey();
Console.Write(" --- You pressed ");
@@ -25,14 +25,14 @@ public static void Main()
// This example displays output similar to the following:
// Press any combination of CTL, ALT, and SHIFT, and a console key.
// Press the Escape (Esc) key to quit:
-//
-// a --- You pressed A
-// k --- You pressed ALT+K
-// ► --- You pressed CTL+P
-// --- You pressed RightArrow
-// R --- You pressed SHIFT+R
-// --- You pressed CTL+I
-// j --- You pressed ALT+J
-// O --- You pressed SHIFT+O
-// § --- You pressed CTL+U
+//
+// a --- You pressed A
+// k --- You pressed ALT+K
+// ► --- You pressed CTL+P
+// --- You pressed RightArrow
+// R --- You pressed SHIFT+R
+// --- You pressed CTL+I
+// j --- You pressed ALT+J
+// O --- You pressed SHIFT+O
+// § --- You pressed CTL+U
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.readkey2/CS/rkbool.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.readkey2/CS/rkbool.cs
index f9ae9a49c4f..d5dbc99b90c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.readkey2/CS/rkbool.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.readkey2/CS/rkbool.cs
@@ -1,9 +1,9 @@
//
using System;
-class Example
+class Example
{
- public static void Main()
+ public static void Main()
{
ConsoleKeyInfo cki;
// Prevent example from ending if CTL+C is pressed.
@@ -24,7 +24,7 @@ public static void Main()
// This example displays output similar to the following:
// Press any combination of CTL, ALT, and SHIFT, and a console key.
// Press the Escape (Esc) key to quit:
-//
+//
// You pressed CTL+A (character '☺')
// You pressed C (character 'c')
// You pressed CTL+C (character '♥')
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.setwindowsize/CS/sws.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.setwindowsize/CS/sws.cs
index d21e9bf8970..8f654e62aeb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.setwindowsize/CS/sws.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.setwindowsize/CS/sws.cs
@@ -1,14 +1,14 @@
//
// This example demonstrates the Console.SetWindowSize method,
-// the Console.WindowWidth property,
+// the Console.WindowWidth property,
// and the Console.WindowHeight property.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
- int origWidth, width;
+ int origWidth, width;
int origHeight, height;
string m1 = "The current window width is {0}, and the " +
"current window height is {1}.";
@@ -23,7 +23,7 @@ public static void Main()
Console.WriteLine(m1, Console.WindowWidth,
Console.WindowHeight);
Console.WriteLine(m4);
- Console.ReadKey(true);
+ Console.ReadKey(true);
//
// Step 2: Cut the window to 1/4 its original size.
//
@@ -33,7 +33,7 @@ public static void Main()
Console.WriteLine(m2, Console.WindowWidth,
Console.WindowHeight);
Console.WriteLine(m4);
- Console.ReadKey(true);
+ Console.ReadKey(true);
//
// Step 3: Restore the window to its original size.
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.title/CS/mytitle.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.title/CS/mytitle.cs
index 11dc2919e9f..684de21b8cc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.title/CS/mytitle.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.title/CS/mytitle.cs
@@ -2,9 +2,9 @@
// This example demonstrates the Console.Title property.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
Console.WriteLine("The current console title is: \"{0}\"",
Console.Title);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.windowLT/CS/wlt.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.windowLT/CS/wlt.cs
index e2c89d8948a..9097a95b70f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.windowLT/CS/wlt.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.windowLT/CS/wlt.cs
@@ -5,7 +5,7 @@
using System.Text;
using System.IO;
//
-class Sample
+class Sample
{
public static int saveBufferWidth;
public static int saveBufferHeight;
@@ -13,7 +13,7 @@ class Sample
public static int saveWindowWidth;
public static bool saveCursorVisible;
//
- public static void Main()
+ public static void Main()
{
string m1 = "1) Press the cursor keys to move the console window.\n" +
"2) Press any key to begin. When you're finished...\n" +
@@ -27,7 +27,7 @@ public static void Main()
ConsoleKeyInfo cki;
int y;
//
- try
+ try
{
saveBufferWidth = Console.BufferWidth;
saveBufferHeight = Console.BufferHeight;
@@ -70,37 +70,37 @@ public static void Main()
do
{
cki = Console.ReadKey(true);
- switch (cki.Key)
+ switch (cki.Key)
{
case ConsoleKey.LeftArrow:
- if (Console.WindowLeft > 0)
+ if (Console.WindowLeft > 0)
Console.SetWindowPosition(
Console.WindowLeft-1, Console.WindowTop);
break;
case ConsoleKey.UpArrow:
- if (Console.WindowTop > 0)
+ if (Console.WindowTop > 0)
Console.SetWindowPosition(
Console.WindowLeft, Console.WindowTop-1);
break;
case ConsoleKey.RightArrow:
- if (Console.WindowLeft < (Console.BufferWidth-Console.WindowWidth))
+ if (Console.WindowLeft < (Console.BufferWidth-Console.WindowWidth))
Console.SetWindowPosition(
Console.WindowLeft+1, Console.WindowTop);
break;
case ConsoleKey.DownArrow:
- if (Console.WindowTop < (Console.BufferHeight-Console.WindowHeight))
+ if (Console.WindowTop < (Console.BufferHeight-Console.WindowHeight))
Console.SetWindowPosition(
Console.WindowLeft, Console.WindowTop+1);
break;
}
- }
+ }
while (cki.Key != ConsoleKey.Escape); // end do-while
} // end try
- catch (IOException e)
+ catch (IOException e)
{
Console.WriteLine(e.Message);
}
- finally
+ finally
{
Console.Clear();
Console.SetWindowSize(1, 1);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/console.writelineFmt1/cs/wl.cs b/samples/snippets/csharp/VS_Snippets_CLR/console.writelineFmt1/cs/wl.cs
index 34166795a9e..2be3e9a260f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/console.writelineFmt1/cs/wl.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/console.writelineFmt1/cs/wl.cs
@@ -3,12 +3,12 @@
// Formatting for this example uses the "en-US" culture.
using System;
-class Sample
+class Sample
{
enum Color {Yellow = 1, Blue, Green};
static DateTime thisDate = DateTime.Now;
- public static void Main()
+ public static void Main()
{
Console.Clear();
@@ -25,7 +25,7 @@ public static void Main()
"(P) Percent:. . . . . . . . . {1:P}\n" +
"(R) Round-trip: . . . . . . . {1:R}\n" +
"(X) Hexadecimal:. . . . . . . {0:X}\n",
- -123, -123.45f);
+ -123, -123.45f);
// Format the current date in various ways.
Console.WriteLine("Standard DateTime Format Specifiers");
@@ -44,7 +44,7 @@ public static void Main()
"(s) Sortable: . . . . . . . . {0:s}\n" +
"(u) Universal sortable: . . . {0:u} (invariant)\n" +
"(U) Universal full date/time: {0:U}\n" +
- "(Y) Year: . . . . . . . . . . {0:Y}\n",
+ "(Y) Year: . . . . . . . . . . {0:Y}\n",
thisDate);
// Format a Color enumeration value in various ways.
@@ -54,8 +54,8 @@ public static void Main()
" (default):. . . . . . . . {0} (default = 'G')\n" +
"(F) Flags:. . . . . . . . . . {0:F} (flags or integer)\n" +
"(D) Decimal number: . . . . . {0:D}\n" +
- "(X) Hexadecimal:. . . . . . . {0:X}\n",
- Color.Green);
+ "(X) Hexadecimal:. . . . . . . {0:X}\n",
+ Color.Green);
}
}
/*
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/contractexample/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/contractexample/cs/program.cs
index 9fbf46df6c5..a4c012313e8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/contractexample/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/contractexample/cs/program.cs
@@ -4,7 +4,7 @@
using System;
using System.Diagnostics.Contracts;
-// An IArray is an ordered collection of objects.
+// An IArray is an ordered collection of objects.
[ContractClass(typeof(IArrayContract))]
public interface IArray
{
@@ -20,7 +20,7 @@ int Count
get;
}
- // Adds an item to the list.
+ // Adds an item to the list.
// The return value is the position the new element was inserted in.
int Add(Object value);
@@ -28,7 +28,7 @@ int Count
void Clear();
// Inserts value into the array at position index.
- // index must be non-negative and less than or equal to the
+ // index must be non-negative and less than or equal to the
// number of elements in the array. If index equals the number
// of items in the array, then value is appended to the end.
void Insert(int index, Object value);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/convert.tobase64chararray/CS/tb64ca.cs b/samples/snippets/csharp/VS_Snippets_CLR/convert.tobase64chararray/CS/tb64ca.cs
index 9ae1ec59f7b..912d85ab9a8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/convert.tobase64chararray/CS/tb64ca.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/convert.tobase64chararray/CS/tb64ca.cs
@@ -4,9 +4,9 @@
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
byte[] byteArray1 = new byte[256];
byte[] byteArray2 = new byte[256];
@@ -20,7 +20,7 @@ public static void Main()
string ruler1b = " 5 6 7 ";
string ruler2b = "123456789012345678901234567890123456";
string ruler3b = "----+----+----+----+----+----+----+-";
- string ruler = String.Concat(ruler1a, ruler1b, nl,
+ string ruler = String.Concat(ruler1a, ruler1b, nl,
ruler2a, ruler2b, nl,
ruler3a, ruler3b);
@@ -35,8 +35,8 @@ public static void Main()
Console.Write("{0}{0}", nl);
// 2) Convert the input Byte array to a Char array, with newlines inserted.
- charArrayLength =
- Convert.ToBase64CharArray(byteArray1, 0, byteArray1.Length,
+ charArrayLength =
+ Convert.ToBase64CharArray(byteArray1, 0, byteArray1.Length,
charArray, 0, Base64FormattingOptions.InsertLineBreaks);
Console.WriteLine("2) Convert the input Byte array to a Char array with newlines.");
Console.Write(" Output: A Char array (length = {0}). ", charArrayLength);
@@ -50,7 +50,7 @@ public static void Main()
byteArray2 = Convert.FromBase64CharArray(charArray, 0, charArrayLength);
// 4) Are the input and output Byte arrays equivalent?
- Console.WriteLine("4) The output Byte array is equal to the input Byte array: {0}",
+ Console.WriteLine("4) The output Byte array is equal to the input Byte array: {0}",
ArraysAreEqual(byteArray1, byteArray2));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/convert.tobase64string/CS/tb64s.cs b/samples/snippets/csharp/VS_Snippets_CLR/convert.tobase64string/CS/tb64s.cs
index 5175a2bfebd..e06ac7c5d64 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/convert.tobase64string/CS/tb64s.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/convert.tobase64string/CS/tb64s.cs
@@ -1,11 +1,11 @@
//
-// This example demonstrates the Convert.ToBase64String() and
+// This example demonstrates the Convert.ToBase64String() and
// Convert.FromBase64String() methods
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
byte[] inArray = new byte[256];
byte[] outArray = new byte[256];
@@ -25,11 +25,11 @@ public static void Main()
string ruler1b = " 5 6 7 ";
string ruler2b = "123456789012345678901234567890123456";
string ruler3b = "----+----+----+----+----+----+----+-";
- string ruler = String.Concat(ruler1a, ruler1b, nl,
+ string ruler = String.Concat(ruler1a, ruler1b, nl,
ruler2a, ruler2b, nl,
ruler3a, ruler3b, nl);
-// 1) Display an arbitrary array of input data (inArray). The data could be
+// 1) Display an arbitrary array of input data (inArray). The data could be
// derived from user input, a file, an algorithm, etc.
Console.WriteLine(step1);
@@ -42,15 +42,15 @@ public static void Main()
}
Console.Write("{0}{0}", nl);
-// 2) Convert a subarray of the input data to a base64 string. In this case,
+// 2) Convert a subarray of the input data to a base64 string. In this case,
// the subarray is the entire input data array. New lines (CRLF) are inserted.
Console.WriteLine(step2);
- s2 = Convert.ToBase64String(inArray, 0, inArray.Length,
+ s2 = Convert.ToBase64String(inArray, 0, inArray.Length,
Base64FormattingOptions.InsertLineBreaks);
Console.WriteLine("{0}{1}{2}{3}", nl, ruler, s2, nl);
-// 3) Convert the input data to a base64 string. In this case, the entire
+// 3) Convert the input data to a base64 string. In this case, the entire
// input data array is converted by default. New lines (CRLF) are inserted.
Console.WriteLine(step3);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/convertchangetype/CS/convertchangetype.cs b/samples/snippets/csharp/VS_Snippets_CLR/convertchangetype/CS/convertchangetype.cs
index bd102d3b0a4..e0ddb57c3c4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/convertchangetype/CS/convertchangetype.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/convertchangetype/CS/convertchangetype.cs
@@ -12,7 +12,7 @@ public static void Main() {
string s = "12/12/98";
DateTime dt = (DateTime)Convert.ChangeType(s, typeof(DateTime));
- Console.WriteLine("The string value {0} when converted to a Date becomes {1}", s, dt);
+ Console.WriteLine("The string value {0} when converted to a Date becomes {1}", s, dt);
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/cryptography.dataprotector/cs/class1.cs b/samples/snippets/csharp/VS_Snippets_CLR/cryptography.dataprotector/cs/class1.cs
index 4df385db78a..17a3a730110 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/cryptography.dataprotector/cs/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/cryptography.dataprotector/cs/class1.cs
@@ -9,7 +9,7 @@ public sealed class MyDataProtector : DataProtector
public DataProtectionScope Scope { get; set; }
//
// This implementation gets the HashedPurpose from the base class and passes it as OptionalEntropy to ProtectedData.
- // The default for DataProtector is to prepend the hash to the plain text, but because we are using the hash
+ // The default for DataProtector is to prepend the hash to the plain text, but because we are using the hash
// as OptionalEntropy there is no need to prepend it.
protected override bool PrependHashedPurposeToPlaintext
{
@@ -20,7 +20,7 @@ protected override bool PrependHashedPurposeToPlaintext
}
//
//
- // To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission
+ // To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission
// in the constructor, but Assert the permission when ProviderProtect is called. This is similar to FileStream
// where access is checked at time of creation, not time of use.
[SecuritySafeCritical]
@@ -32,7 +32,7 @@ protected override byte[] ProviderProtect(byte[] userData)
}
//
//
- // To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission
+ // To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission
// in the constructor, but Assert the permission when ProviderUnProtect is called. This is similar to FileStream
// where access is checked at time of creation, not time of use.
[SecuritySafeCritical]
@@ -50,8 +50,8 @@ public override bool IsReprotectRequired(byte[] encryptedData)
}
//
// Public constructor
- // The Demand for DataProtectionPermission is in the constructor because we Assert this permission
- // in the ProviderProtect/ProviderUnprotect methods.
+ // The Demand for DataProtectionPermission is in the constructor because we Assert this permission
+ // in the ProviderProtect/ProviderUnprotect methods.
[DataProtectionPermission(SecurityAction.Demand, Unrestricted = true)]
[SecuritySafeCritical]
public MyDataProtector(string appName, string primaryPurpose, params string[] specificPurpose)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/cryptography.memoryprotector/cs/class1.cs b/samples/snippets/csharp/VS_Snippets_CLR/cryptography.memoryprotector/cs/class1.cs
index c81e3fdfc39..814cee7cf51 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/cryptography.memoryprotector/cs/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/cryptography.memoryprotector/cs/class1.cs
@@ -8,7 +8,7 @@ public sealed class MemoryProtector : DataProtector
{
public MemoryProtectionScope Scope { get; set; }
//
- protected override bool PrependHashedPurposeToPlaintext
+ protected override bool PrependHashedPurposeToPlaintext
{
get
{
@@ -18,21 +18,21 @@ protected override bool PrependHashedPurposeToPlaintext
}
//
//
- // To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission
+ // To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission
// in the constructor, but Assert the permission when ProviderProtect is called. This is similar to FileStream
// where access is checked at time of creation, not time of use.
[SecuritySafeCritical]
[DataProtectionPermission(SecurityAction.Assert, ProtectData = true)]
protected override byte[] ProviderProtect(byte[] userData)
{
-
+
// Delegate to ProtectedData
ProtectedMemory.Protect(userData, Scope);
return userData;
}
//
//
- // To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission
+ // To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission
// in the constructor, but Assert the permission when ProviderUnprotect is called.. This is similar to FileStream
// where access is checked at time of creation, not time of use.
[SecuritySafeCritical]
@@ -40,7 +40,7 @@ protected override byte[] ProviderProtect(byte[] userData)
protected override byte[] ProviderUnprotect(byte[] encryptedData)
{
- ProtectedMemory.Unprotect(encryptedData,Scope);
+ ProtectedMemory.Unprotect(encryptedData,Scope);
return encryptedData;
}
//
@@ -52,8 +52,8 @@ public override bool IsReprotectRequired(byte[] encryptedData)
}
//
// Public constructor
- // The Demand for DataProtectionPermission is in the constructor because we Assert this permission
- // in the ProviderProtect/ProviderUnprotect methods.
+ // The Demand for DataProtectionPermission is in the constructor because we Assert this permission
+ // in the ProviderProtect/ProviderUnprotect methods.
[DataProtectionPermission(SecurityAction.Demand, Unrestricted = true)]
[SecuritySafeCritical]
public MemoryProtector(string appName, string primaryPurpose, params string[] specificPurpose)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/cryptography.rijndael.create.file/cs/fileexample.cs b/samples/snippets/csharp/VS_Snippets_CLR/cryptography.rijndael.create.file/cs/fileexample.cs
index c4d11ea6966..509b29b1d3d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/cryptography.rijndael.create.file/cs/fileexample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/cryptography.rijndael.create.file/cs/fileexample.cs
@@ -15,7 +15,7 @@ public static void Main()
string original = "Here is some data to encrypt!";
// Create a new instance of the Rijndael
- // class. This generates a new key and initialization
+ // class. This generates a new key and initialization
// vector (IV).
using (Rijndael myRijndael = Rijndael.Create())
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/datetime.ctor_Int64/CS/ticks.cs b/samples/snippets/csharp/VS_Snippets_CLR/datetime.ctor_Int64/CS/ticks.cs
index 3ea8ae0365c..486e2c30c64 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/datetime.ctor_Int64/CS/ticks.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/datetime.ctor_Int64/CS/ticks.cs
@@ -3,11 +3,11 @@
using System;
using System.Globalization;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
-// Instead of using the implicit, default "G" date and time format string, we
+// Instead of using the implicit, default "G" date and time format string, we
// use a custom format string that aligns the results and inserts leading zeroes.
string format = "{0}) The {1} date and time is {2:MM/dd/yyyy hh:mm:ss tt}";
@@ -17,9 +17,9 @@ public static void Main()
// Create a DateTime for the minimum date and time using ticks.
DateTime dt2 = new DateTime(DateTime.MinValue.Ticks);
-// Create a custom DateTime for 7/28/1979 at 10:35:05 PM using a
-// calendar based on the "en-US" culture, and ticks.
- long ticks = new DateTime(1979, 07, 28, 22, 35, 5,
+// Create a custom DateTime for 7/28/1979 at 10:35:05 PM using a
+// calendar based on the "en-US" culture, and ticks.
+ long ticks = new DateTime(1979, 07, 28, 22, 35, 5,
new CultureInfo("en-US", false).Calendar).Ticks;
DateTime dt3 = new DateTime(ticks);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfocreatesub/CS/directoryinfocreatesub.cs b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfocreatesub/CS/directoryinfocreatesub.cs
index c3276317c18..8e4ef673b10 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfocreatesub/CS/directoryinfocreatesub.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfocreatesub/CS/directoryinfocreatesub.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class CreateSubTest
+public class CreateSubTest
{
- public static void Main()
+ public static void Main()
{
// Create a reference to a directory.
DirectoryInfo di = new DirectoryInfo("TempDir");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfodelete/CS/directoryinfodelete.cs b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfodelete/CS/directoryinfodelete.cs
index a597bf1e088..b350b10b61d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfodelete/CS/directoryinfodelete.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfodelete/CS/directoryinfodelete.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class DeleteTest
+public class DeleteTest
{
- public static void Main()
+ public static void Main()
{
// Make a reference to a directory.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetdirectories/CS/directoryinfogetdirectories.cs b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetdirectories/CS/directoryinfogetdirectories.cs
index 02bb68c8835..fa3425c55bb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetdirectories/CS/directoryinfogetdirectories.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetdirectories/CS/directoryinfogetdirectories.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class GetDirectoriesTest
+public class GetDirectoriesTest
{
- public static void Main()
+ public static void Main()
{
// Make a reference to a directory.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetfiles/CS/directoryinfogetfiles.cs b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetfiles/CS/directoryinfogetfiles.cs
index d23b0b0e5f9..e3d344fda5f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetfiles/CS/directoryinfogetfiles.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetfiles/CS/directoryinfogetfiles.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class GetFilesTest
+public class GetFilesTest
{
- public static void Main()
+ public static void Main()
{
// Make a reference to a directory.
DirectoryInfo di = new DirectoryInfo("c:\\");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetfiles/CS/directoryinfogetfiles2.cs b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetfiles/CS/directoryinfogetfiles2.cs
index d5ea728405f..d76aad4f899 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetfiles/CS/directoryinfogetfiles2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfogetfiles/CS/directoryinfogetfiles2.cs
@@ -41,7 +41,7 @@ static void Main(string[] args)
}
}
}
-/*
+/*
This code produces output similar to the following:
No search pattern returns:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfomoveto/CS/directoryinfomoveto.cs b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfomoveto/CS/directoryinfomoveto.cs
index bf0c690a4be..b417c7d2ec7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfomoveto/CS/directoryinfomoveto.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfomoveto/CS/directoryinfomoveto.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class MoveToTest
+public class MoveToTest
{
- public static void Main()
+ public static void Main()
{
// Make a reference to a directory.
@@ -21,13 +21,13 @@ public static void Main()
if (Directory.Exists("NewTempDir") == false)
di.MoveTo("NewTempDir");
- try
+ try
{
// Attempt to delete the subdirectory. Note that because it has been
// moved, an exception is thrown.
dis.Delete(true);
- }
- catch (Exception)
+ }
+ catch (Exception)
{
// Handle this exception in some way, such as with the following code:
// Console.WriteLine("That directory does not exist.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfoparent/CS/directoryinfoparent.cs b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfoparent/CS/directoryinfoparent.cs
index 1cb4bedee82..9636909d0a3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/directoryinfoparent/CS/directoryinfoparent.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/directoryinfoparent/CS/directoryinfoparent.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class MoveToTest
+public class MoveToTest
{
- public static void Main()
+ public static void Main()
{
// Make a reference to a directory.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/directoryinforoot/CS/directoryinforoot.cs b/samples/snippets/csharp/VS_Snippets_CLR/directoryinforoot/CS/directoryinforoot.cs
index e79fcc4e2ff..b3a21487942 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/directoryinforoot/CS/directoryinforoot.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/directoryinforoot/CS/directoryinforoot.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class MoveToTest
+public class MoveToTest
{
- public static void Main()
+ public static void Main()
{
// Make a reference to a directory.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/directoryinforoot/CS/directoryinforoot2.cs b/samples/snippets/csharp/VS_Snippets_CLR/directoryinforoot/CS/directoryinforoot2.cs
index 2dcb173fd83..5eab4b8ecfb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/directoryinforoot/CS/directoryinforoot2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/directoryinforoot/CS/directoryinforoot2.cs
@@ -12,7 +12,7 @@ static void Main(string[] args)
DirectoryInfo di2 = new DirectoryInfo("tempdir");
DirectoryInfo di3 = new DirectoryInfo(@"x:\tempdir");
DirectoryInfo di4 = new DirectoryInfo(@"c:\");
-
+
Console.WriteLine("The root path of '{0}' is '{1}'", di1.FullName, di1.Root);
Console.WriteLine("The root path of '{0}' is '{1}'", di2.FullName, di2.Root);
Console.WriteLine("The root path of '{0}' is '{1}'", di3.FullName, di3.Root);
@@ -20,7 +20,7 @@ static void Main(string[] args)
}
}
}
-/*
+/*
This code produces output similar to the following:
The root path of '\\tempshare\tempdir' is '\\tempshare\tempdir'
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ecdiffiehellmancng/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/ecdiffiehellmancng/cs/program.cs
index 81c35948fac..e1ef2eeeeac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ecdiffiehellmancng/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ecdiffiehellmancng/cs/program.cs
@@ -47,7 +47,7 @@ private static void Send(byte[] key, string secretMessage, out byte[] encryptedM
}
//
}
-public class Bob
+public class Bob
{
public byte[] bobPublicKey;
private byte[] bobKey;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ecdsacng/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/ecdsacng/cs/program.cs
index fae0be98e8d..c74d75effe4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ecdsacng/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ecdsacng/cs/program.cs
@@ -22,7 +22,7 @@ public static void Main(string[] args)
}
}
}
-public class Bob
+public class Bob
{
public byte[] key;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/enum.tostring/CS/tostr.cs b/samples/snippets/csharp/VS_Snippets_CLR/enum.tostring/CS/tostr.cs
index 00f365e009e..77c24150c6e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/enum.tostring/CS/tostr.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/enum.tostring/CS/tostr.cs
@@ -2,11 +2,11 @@
// Sample for Enum.ToString(String)
using System;
-class Sample
+class Sample
{
enum Colors {Red, Green, Blue, Yellow = 12};
- public static void Main()
+ public static void Main()
{
Colors myColor = Colors.Yellow;
@@ -24,7 +24,7 @@ public static void Main()
Console.WriteLine("myColor.ToString(\"X\") = {0}", myColor.ToString("X"));
Console.WriteLine("myColor.ToString(\"d\") = {0}", myColor.ToString("d"));
- Console.WriteLine("myColor.ToString(\"D\") = {0}", myColor.ToString("D"));
+ Console.WriteLine("myColor.ToString(\"D\") = {0}", myColor.ToString("D"));
Console.WriteLine("myColor.ToString(\"f\") = {0}", myColor.ToString("f"));
Console.WriteLine("myColor.ToString(\"F\") = {0}", myColor.ToString("F"));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/enumcompareto/CS/EnumCompareTo.cs b/samples/snippets/csharp/VS_Snippets_CLR/enumcompareto/CS/EnumCompareTo.cs
index 04b8bd5a5cf..b44b18107de 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/enumcompareto/CS/EnumCompareTo.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/enumcompareto/CS/EnumCompareTo.cs
@@ -19,7 +19,7 @@ public static void Main() {
// The example displays the following output:
// Does a Sportscar have more doors than a Motorbike?
// Yes
-//
+//
// Does a Sportscar have more doors than a Sedan?
// No
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/enumequals/CS/EnumEquals.cs b/samples/snippets/csharp/VS_Snippets_CLR/enumequals/CS/EnumEquals.cs
index 86340b9c307..41ea1aae116 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/enumequals/CS/EnumEquals.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/enumequals/CS/EnumEquals.cs
@@ -23,7 +23,7 @@ public static void Main() {
Console.WriteLine();
Console.WriteLine("The value of my color ({0}) is {1}", myColor, Enum.Format(typeof(Colors), myColor, "d"));
Console.WriteLine("The value of my pet (a {0}) is {1}", myPet, Enum.Format(typeof(Mammals), myPet, "d"));
- Console.WriteLine("Even though they have the same value, are they equal? {0}",
+ Console.WriteLine("Even though they have the same value, are they equal? {0}",
myColor.Equals(myPet) ? "Yes" : "No");
}
}
@@ -31,11 +31,11 @@ public static void Main() {
// My favorite animal is a Cat
// Your favorite animal is a Dog
// Do we like the same animal? No
-//
+//
// My favorite color is Red
// Your favorite color is Red
// Do we like the same color? Yes
-//
+//
// The value of my color (Red) is 0
// The value of my pet (a Cat) is 0
// Even though they have the same value, are they equal? No
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/enumgetnames/CS/EnumGetNames.cs b/samples/snippets/csharp/VS_Snippets_CLR/enumgetnames/CS/EnumGetNames.cs
index 2f772d97b88..7bfe15e4332 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/enumgetnames/CS/EnumGetNames.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/enumgetnames/CS/EnumGetNames.cs
@@ -24,7 +24,7 @@ public static void Main() {
// Green
// Blue
// Yellow
-//
+//
// The members of the Styles enum are:
// Plaid
// Striped
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/enumgetvalues/CS/EnumGetValues.cs b/samples/snippets/csharp/VS_Snippets_CLR/enumgetvalues/CS/EnumGetValues.cs
index b85be6277d2..50d91e56151 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/enumgetvalues/CS/EnumGetValues.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/enumgetvalues/CS/EnumGetValues.cs
@@ -24,7 +24,7 @@ public static void Main() {
// 1
// 2
// 3
-//
+//
// The values of the Styles Enum are:
// 0
// 23
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/enumparse/CS/EnumParse.cs b/samples/snippets/csharp/VS_Snippets_CLR/enumparse/CS/EnumParse.cs
index 652bb84115a..930418f47e7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/enumparse/CS/EnumParse.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/enumparse/CS/EnumParse.cs
@@ -11,13 +11,13 @@ public static void Main()
Console.WriteLine("The entries of the Colors enumeration are:");
foreach (string colorName in Enum.GetNames(typeof(Colors)))
{
- Console.WriteLine("{0} = {1:D}", colorName,
+ Console.WriteLine("{0} = {1:D}", colorName,
Enum.Parse(typeof(Colors), colorName));
}
Console.WriteLine();
Colors orange = (Colors) Enum.Parse(typeof(Colors), "Red, Yellow");
- Console.WriteLine("The orange value {0:D} has the combined entries of {0}",
+ Console.WriteLine("The orange value {0:D} has the combined entries of {0}",
orange);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/environment.CommandLine/CS/commandline.cs b/samples/snippets/csharp/VS_Snippets_CLR/environment.CommandLine/CS/commandline.cs
index 6483f9d53d5..9c56c1e3fe0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/environment.CommandLine/CS/commandline.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/environment.CommandLine/CS/commandline.cs
@@ -3,7 +3,7 @@
class Example
{
- public static void Main()
+ public static void Main()
{
Console.WriteLine();
// Invoke this sample with an arbitrary set of command line arguments.
@@ -12,6 +12,6 @@ public static void Main()
}
// The example displays output like the following:
// C:\>env0 ARBITRARY TEXT
-//
+//
// CommandLine: env0 ARBITRARY TEXT
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/environment.ExpandEnvironmentVariables/CS/expandenvironmentvariables.cs b/samples/snippets/csharp/VS_Snippets_CLR/environment.ExpandEnvironmentVariables/CS/expandenvironmentvariables.cs
index c62ca4b5f98..4e5b3ecb6cc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/environment.ExpandEnvironmentVariables/CS/expandenvironmentvariables.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/environment.ExpandEnvironmentVariables/CS/expandenvironmentvariables.cs
@@ -2,9 +2,9 @@
// Sample for the Environment.ExpandEnvironmentVariables method
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
String str;
String nl = Environment.NewLine;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/environment.FailFast/cs/ff.cs b/samples/snippets/csharp/VS_Snippets_CLR/environment.FailFast/cs/ff.cs
index b874ebcf7d7..b0b8cf9da32 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/environment.FailFast/cs/ff.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/environment.FailFast/cs/ff.cs
@@ -3,7 +3,7 @@
class Example
{
- public static void Main()
+ public static void Main()
{
string causeOfFailure = "A catastrophic failure has occurred.";
@@ -11,11 +11,11 @@ public static void Main()
// terminate immediately. The try-finally block is not executed
// and is included only to demonstrate that instructions within
// try-catch blocks and finalizers are not performed.
- try
+ try
{
Environment.FailFast(causeOfFailure);
}
- finally
+ finally
{
Console.WriteLine("This finally block will not be executed.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/environment.class/CS/env0.cs b/samples/snippets/csharp/VS_Snippets_CLR/environment.class/CS/env0.cs
index 01260df1081..1cb18fccce0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/environment.class/CS/env0.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/environment.class/CS/env0.cs
@@ -79,7 +79,7 @@ public static void Main()
}
/*
This example produces results similar to the following:
-(Any result that is lengthy or reveals information that should remain
+(Any result that is lengthy or reveals information that should remain
secure has been omitted and marked "!---OMITTED---!".)
C:\>env0 ARBITRARY TEXT
@@ -111,7 +111,7 @@ at Sample.Main()'
My system drive is C: and my system root is C:\WINNT
GetEnvironmentVariable:
My temporary directory is C:\DOCUME~1\!---OMITTED---!\LOCALS~1\Temp.
-GetEnvironmentVariables:
+GetEnvironmentVariables:
!---OMITTED---!
GetFolderPath: C:\WINNT\System32
GetLogicalDrives: A:\, C:\, D:\
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/environment.getsetenvar/CS/gsev.cs b/samples/snippets/csharp/VS_Snippets_CLR/environment.getsetenvar/CS/gsev.cs
index d16d762ab08..f43adaef02f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/environment.getsetenvar/CS/gsev.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/environment.getsetenvar/CS/gsev.cs
@@ -2,9 +2,9 @@
using System.Collections;
using Microsoft.Win32;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
// Environment variable names for default, process, user, and machine targets.
string defaultEnvVar = nameof(defaultEnvVar);
@@ -22,18 +22,18 @@ public static void Main()
// The default target (the current process).
Environment.SetEnvironmentVariable(defaultEnvVar, dft);
// The current process.
- Environment.SetEnvironmentVariable(processEnvVar, process,
+ Environment.SetEnvironmentVariable(processEnvVar, process,
EnvironmentVariableTarget.Process);
// The current user.
- Environment.SetEnvironmentVariable(userEnvVar, user,
+ Environment.SetEnvironmentVariable(userEnvVar, user,
EnvironmentVariableTarget.User);
// The local machine.
- Environment.SetEnvironmentVariable(machineEnvVar, machine,
+ Environment.SetEnvironmentVariable(machineEnvVar, machine,
EnvironmentVariableTarget.Machine);
// Define an array of environment variables.
string[] envVars = { defaultEnvVar,processEnvVar, userEnvVar, machineEnvVar };
-
+
// Try to get the environment variables from each target.
// The default (no specified target).
Console.WriteLine("Retrieving environment variables from the default target:");
@@ -69,13 +69,13 @@ public static void Main()
// The default target (the current process).
Environment.SetEnvironmentVariable(defaultEnvVar, null);
// The current process.
- Environment.SetEnvironmentVariable(processEnvVar, null,
+ Environment.SetEnvironmentVariable(processEnvVar, null,
EnvironmentVariableTarget.Process);
// The current user.
- Environment.SetEnvironmentVariable(userEnvVar, null,
+ Environment.SetEnvironmentVariable(userEnvVar, null,
EnvironmentVariableTarget.User);
// The local machine.
- Environment.SetEnvironmentVariable(machineEnvVar, null,
+ Environment.SetEnvironmentVariable(machineEnvVar, null,
EnvironmentVariableTarget.Machine);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/environment.processorcount/CS/pc.cs b/samples/snippets/csharp/VS_Snippets_CLR/environment.processorcount/CS/pc.cs
index f07d0fb99f0..2ddef39c830 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/environment.processorcount/CS/pc.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/environment.processorcount/CS/pc.cs
@@ -1,14 +1,14 @@
//
-// This example demonstrates the
+// This example demonstrates the
// Environment.ProcessorCount property.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
Console.WriteLine("The number of processors " +
- "on this computer is {0}.",
+ "on this computer is {0}.",
Environment.ProcessorCount);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/etwtrace/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/etwtrace/cs/program.cs
index 3db084ada73..eb172a9324a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/etwtrace/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/etwtrace/cs/program.cs
@@ -40,7 +40,7 @@ public class Tasks
//
//
- [Event(3, Message = "loading page {1} activityID={0}", Opcode = EventOpcode.Start,
+ [Event(3, Message = "loading page {1} activityID={0}", Opcode = EventOpcode.Start,
Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
public void PageStart(int ID, string url) { if (IsEnabled()) WriteEvent(3, ID, url); }
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/eventlogInstaller_Resources/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/eventlogInstaller_Resources/CS/source.cs
index 7d200a9b9cc..431db940fdb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/eventlogInstaller_Resources/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/eventlogInstaller_Resources/CS/source.cs
@@ -10,7 +10,7 @@
// to be run during an installation.
//
// Note:
-// 1) Run this program using the following command:
+// 1) Run this program using the following command:
// InstallUtil.exe
// 2) Uninstall the event log created in step 1 using the
// following command:
@@ -27,7 +27,7 @@ public class SampleEventLogInstaller : Installer
{
private EventLogInstaller myEventLogInstaller;
- public SampleEventLogInstaller()
+ public SampleEventLogInstaller()
{
// Create an instance of an EventLogInstaller.
myEventLogInstaller = new EventLogInstaller();
@@ -40,12 +40,12 @@ public SampleEventLogInstaller()
myEventLogInstaller.Log = "myNewLog";
// Set the resource file for the event log.
- // The message strings are defined in EventLogMsgs.mc; the message
+ // The message strings are defined in EventLogMsgs.mc; the message
// identifiers used in the application must match those defined in the
// corresponding message resource file. The messages must be built
// into a Win32 resource library and copied to the target path on the
- // system.
-
+ // system.
+
myEventLogInstaller.CategoryResourceFile =
Environment.SystemDirectory + "\\eventlogmsgs.dll";
myEventLogInstaller.CategoryCount = 3;
@@ -55,7 +55,7 @@ public SampleEventLogInstaller()
Environment.SystemDirectory + "\\eventlogmsgs.dll";
// Add myEventLogInstaller to the installer collection.
- Installers.Add(myEventLogInstaller);
+ Installers.Add(myEventLogInstaller);
}
public static void Main()
@@ -63,4 +63,4 @@ public static void Main()
Console.WriteLine("Usage: InstallUtil.exe [.exe | .dll]");
}
}
-//
+//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/eventlog_WriteEvent/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/eventlog_WriteEvent/CS/source.cs
index ff125e0b09a..8aebe6f91bd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/eventlog_WriteEvent/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/eventlog_WriteEvent/CS/source.cs
@@ -10,16 +10,16 @@ class WriteEvent
// The following constants match the message definitions
// in the message resource file. They are used to specify
- // the resource identifier for a localized string in the
+ // the resource identifier for a localized string in the
// message resource file.
- // The message resource file is an .mc file built into a
+ // The message resource file is an .mc file built into a
// Win32 resource file using the message compiler (MC) tool.
//
private const short InstallCategoryMsgId = 1;
private const short QueryCategoryMsgId = 2;
private const short RefreshCategoryMsgId = 3;
-
+
private const short CategoryCount = 3;
//
@@ -56,8 +56,8 @@ static void Main(string[] args)
// Use the default message dll.
- messageFile = String.Format("{0}\\{1}",
- System.Environment.CurrentDirectory,
+ messageFile = String.Format("{0}\\{1}",
+ System.Environment.CurrentDirectory,
"EventLogMsgs.dll");
}
@@ -94,7 +94,7 @@ static void CreateEventSourceSample1(string messageFile)
if(!EventLog.SourceExists(sourceName))
{
// Create a new event source for the custom event log
- // named "myNewLog."
+ // named "myNewLog."
myLogName = "myNewLog";
EventSourceCreationData mySourceData = new EventSourceCreationData(sourceName, myLogName);
@@ -103,22 +103,22 @@ static void CreateEventSourceSample1(string messageFile)
// All event resource identifiers correspond to text in this file.
if (!System.IO.File.Exists(messageFile))
{
- Console.WriteLine("Input message resource file does not exist - {0}",
+ Console.WriteLine("Input message resource file does not exist - {0}",
messageFile);
messageFile = "";
}
- else
+ else
{
// Set the specified file as the resource
- // file for message text, category text, and
- // message parameter strings.
+ // file for message text, category text, and
+ // message parameter strings.
mySourceData.MessageResourceFile = messageFile;
mySourceData.CategoryResourceFile = messageFile;
mySourceData.CategoryCount = CategoryCount;
mySourceData.ParameterResourceFile = messageFile;
- Console.WriteLine("Event source message resource file set to {0}",
+ Console.WriteLine("Event source message resource file set to {0}",
messageFile);
}
@@ -137,7 +137,7 @@ static void CreateEventSourceSample1(string messageFile)
// "Sample Application Log" or some other application-specific
// text.
EventLog myEventLog = new EventLog(myLogName, ".", sourceName);
-
+
if (messageFile.Length > 0)
{
myEventLog.RegisterDisplayName(messageFile, DisplayNameMsgId);
@@ -157,8 +157,8 @@ static void WriteEventSample1()
// for the event log "myNewLog." Use the resource file
// EventLogMsgs.dll in the current directory for message text.
- string messageFile = String.Format("{0}\\{1}",
- System.Environment.CurrentDirectory,
+ string messageFile = String.Format("{0}\\{1}",
+ System.Environment.CurrentDirectory,
"EventLogMsgs.dll");
CreateEventSourceSample1(messageFile);
@@ -166,7 +166,7 @@ static void WriteEventSample1()
// Get the event log corresponding to the existing source.
string myLogName = EventLog.LogNameFromSourceName(sourceName,".");
-
+
EventLog myEventLog = new EventLog(myLogName, ".", sourceName);
// Define two audit events.
@@ -178,14 +178,14 @@ static void WriteEventSample1()
// Insert the method name into the event log message.
string [] insertStrings = {"EventLogSamples.WriteEventSample1"};
-
+
// Write the events to the event log.
- myEventLog.WriteEvent(myAuditSuccessEvent, insertStrings);
+ myEventLog.WriteEvent(myAuditSuccessEvent, insertStrings);
// Append binary data to the audit failure event entry.
byte [] binaryData = { 3, 4, 5, 6 };
- myEventLog.WriteEvent(myAuditFailEvent, binaryData, insertStrings);
+ myEventLog.WriteEvent(myAuditFailEvent, binaryData, insertStrings);
//
}
@@ -197,7 +197,7 @@ static void WriteEventSample2()
string sourceName = "SampleApplicationSource";
if(EventLog.SourceExists(sourceName))
{
-
+
// Define an informational event and a warning event.
// The message identifiers correspond to the message text in the
@@ -207,18 +207,18 @@ static void WriteEventSample2()
// Insert the method name into the event log message.
string [] insertStrings = {"EventLogSamples.WriteEventSample2"};
-
+
// Write the events to the event log.
- EventLog.WriteEvent(sourceName, myInfoEvent);
+ EventLog.WriteEvent(sourceName, myInfoEvent);
// Append binary data to the warning event entry.
byte [] binaryData = { 7, 8, 9, 10 };
- EventLog.WriteEvent(sourceName, myWarningEvent, binaryData, insertStrings);
+ EventLog.WriteEvent(sourceName, myWarningEvent, binaryData, insertStrings);
}
- else
+ else
{
- Console.WriteLine("Warning - event source {0} not registered",
+ Console.WriteLine("Warning - event source {0} not registered",
sourceName);
}
//
@@ -238,7 +238,7 @@ static void EventInstanceSamples()
// The message identifier corresponds to the message text in the
// message resource file defined for the source.
EventInstance myEvent = new EventInstance(UpdateCycleCompleteMsgId, 0);
-
+
// Write the event to the event log using the registered source.
EventLog.WriteEvent(sourceName, myEvent);
@@ -255,9 +255,9 @@ static void EventInstanceSamples()
// Insert the machine name into the event message text.
EventLog.WriteEvent(sourceName, myEvent, Environment.MachineName);
}
- else
+ else
{
- Console.WriteLine("Warning - event source {0} not registered",
+ Console.WriteLine("Warning - event source {0} not registered",
sourceName);
}
@@ -265,7 +265,7 @@ static void EventInstanceSamples()
//
// Get the event log corresponding to the existing source.
string myLogName = EventLog.LogNameFromSourceName(sourceName,".");
-
+
// Find each instance of a specific event log entry in a
// particular event log.
@@ -284,14 +284,14 @@ static void EventInstanceSamples()
{
count ++;
Console.WriteLine();
- Console.WriteLine("Entry ID = {0}",
+ Console.WriteLine("Entry ID = {0}",
entry.InstanceId.ToString());
- Console.WriteLine("Reported at {0}",
+ Console.WriteLine("Reported at {0}",
entry.TimeWritten.ToString());
Console.WriteLine("Message text:");
Console.WriteLine("\t{0}", entry.Message);
}
- }
+ }
Console.WriteLine();
Console.WriteLine("Found {0} events with ID {1} in event log {2}.",
count.ToString(), ServerConnectionDownMsgId.ToString(), myLogName);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programnodata.cs b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programnodata.cs
index 18a63efc1b1..354c66ef5bc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programnodata.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programnodata.cs
@@ -21,7 +21,7 @@ static void Main(string[] args)
static void c_ThresholdReached(object sender, EventArgs e)
{
Console.WriteLine("The threshold was reached.");
- Environment.Exit(0);
+ Environment.Exit(0);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/exception.data/CS/data.cs b/samples/snippets/csharp/VS_Snippets_CLR/exception.data/CS/data.cs
index dc9ad5cf5e8..ccc586fa6c7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/exception.data/CS/data.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/exception.data/CS/data.cs
@@ -3,7 +3,7 @@
using System;
using System.Collections;
-class Sample
+class Sample
{
public static void Main()
{
@@ -24,12 +24,12 @@ public static void RunTest(bool displayDetails)
if (e.Data.Count > 0) {
Console.WriteLine(" Extra details:");
foreach (DictionaryEntry de in e.Data)
- Console.WriteLine(" Key: {0,-20} Value: {1}",
+ Console.WriteLine(" Key: {0,-20} Value: {1}",
"'" + de.Key.ToString() + "'", de.Value);
}
}
}
-
+
public static void NestedRoutine1(bool displayDetails)
{
try {
@@ -41,7 +41,7 @@ public static void NestedRoutine1(bool displayDetails)
throw;
}
}
-
+
public static void NestedRoutine2(bool displayDetails)
{
Exception e = new Exception("This statement is the original exception message.");
@@ -56,14 +56,14 @@ public static void NestedRoutine2(bool displayDetails)
throw e;
}
}
-// The example displays the following output:
+// The example displays the following output:
// Exception with some extra information...
// An exception was thrown.
// This statement is the original exception message.
-// Extra details:
+// Extra details:
// Key: 'ExtraInfo' Value: Information from NestedRoutine1.
// Key: 'MoreExtraInfo' Value: More information from NestedRoutine1.
-//
+//
// Exception with all extra information...
// An exception was thrown.
// This statement is the original exception message.
@@ -72,5 +72,5 @@ public static void NestedRoutine2(bool displayDetails)
// Key: 'IntInfo' Value: -903
// Key: 'DateTimeInfo' Value: 7/29/2013 10:50:13 AM
// Key: 'ExtraInfo' Value: Information from NestedRoutine1.
-// Key: 'MoreExtraInfo' Value: More information from NestedRoutine1.
+// Key: 'MoreExtraInfo' Value: More information from NestedRoutine1.
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/fileinfoappendtext/CS/fileinfoappendtext.cs b/samples/snippets/csharp/VS_Snippets_CLR/fileinfoappendtext/CS/fileinfoappendtext.cs
index 359aa9d0473..63f3590c779 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/fileinfoappendtext/CS/fileinfoappendtext.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/fileinfoappendtext/CS/fileinfoappendtext.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class AppendTextTest
+public class AppendTextTest
{
- public static void Main()
+ public static void Main()
{
FileInfo fi = new FileInfo("temp.txt");
// Create a writer, ready to add entries to the file.
@@ -20,7 +20,7 @@ public static void Main()
Console.WriteLine( sr.ReadLine() );
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//Add as many lines as you like...
//Add another line to the output...
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/fileinfocopyto/CS/fileinfocopyto.cs b/samples/snippets/csharp/VS_Snippets_CLR/fileinfocopyto/CS/fileinfocopyto.cs
index 171b85bbc28..6f2dc4be7cc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/fileinfocopyto/CS/fileinfocopyto.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/fileinfocopyto/CS/fileinfocopyto.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class CopyToTest
+public class CopyToTest
{
- public static void Main()
+ public static void Main()
{
// Create a reference to a file, which might or might not exist.
// If it does not exist, it is not yet created.
@@ -30,7 +30,7 @@ public static void Main()
Console.WriteLine( sr.ReadLine() );
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//This is the information in the first file:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/fileinfodelete/CS/fileinfodelete.cs b/samples/snippets/csharp/VS_Snippets_CLR/fileinfodelete/CS/fileinfodelete.cs
index 07f3effe4eb..0ea70ba5e68 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/fileinfodelete/CS/fileinfodelete.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/fileinfodelete/CS/fileinfodelete.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class DeleteTest
+public class DeleteTest
{
- public static void Main()
+ public static void Main()
{
// Create a reference to a file.
FileInfo fi = new FileInfo("temp.txt");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/fileinfodirectory/CS/fileinfodirectory.cs b/samples/snippets/csharp/VS_Snippets_CLR/fileinfodirectory/CS/fileinfodirectory.cs
index d4af8941661..c03922b8773 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/fileinfodirectory/CS/fileinfodirectory.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/fileinfodirectory/CS/fileinfodirectory.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class DirectoryTest
+public class DirectoryTest
{
- public static void Main()
+ public static void Main()
{
// Open an existing file, or create a new one.
@@ -23,10 +23,10 @@ public static void Main()
Console.WriteLine(info.Name);
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
-//The directory 'C:\Visual Studio 2005\release' contains the following files
+//The directory 'C:\Visual Studio 2005\release' contains the following files
//and directories:
//TempPE
//fileinfodirectory.exe
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/fileinfomain/CS/fileinfomain.cs b/samples/snippets/csharp/VS_Snippets_CLR/fileinfomain/CS/fileinfomain.cs
index e49113693f1..a84b182aedc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/fileinfomain/CS/fileinfomain.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/fileinfomain/CS/fileinfomain.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class FileInfoMainTest
+public class FileInfoMainTest
{
- public static void Main()
+ public static void Main()
{
// Open an existing file, or create a new one.
FileInfo fi = new FileInfo("temp.txt");
@@ -20,7 +20,7 @@ public static void Main()
Console.WriteLine( sr.ReadLine() );
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//Add as many lines as you like...
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/fileinfoname/CS/fileinfoname.cs b/samples/snippets/csharp/VS_Snippets_CLR/fileinfoname/CS/fileinfoname.cs
index 31cb7ca56ce..1991936bc48 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/fileinfoname/CS/fileinfoname.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/fileinfoname/CS/fileinfoname.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class NameTest
+public class NameTest
{
- public static void Main()
+ public static void Main()
{
// Create a reference to the current directory.
DirectoryInfo di = new DirectoryInfo(Environment.CurrentDirectory);
@@ -16,7 +16,7 @@ public static void Main()
Console.WriteLine(fiTemp.Name);
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//The following files exist in the current directory:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/fileinfoopen/CS/fileinfoopen.cs b/samples/snippets/csharp/VS_Snippets_CLR/fileinfoopen/CS/fileinfoopen.cs
index 5d740258a81..45d3c88a5ca 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/fileinfoopen/CS/fileinfoopen.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/fileinfoopen/CS/fileinfoopen.cs
@@ -2,9 +2,9 @@
using System;
using System.IO;
-public class OpenTest
+public class OpenTest
{
- public static void Main()
+ public static void Main()
{
// Open an existing file, or create a new one.
FileInfo fi = new FileInfo("temp.txt");
@@ -13,20 +13,20 @@ public static void Main()
FileStream fs = fi.Open( FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None );
// Create another reference to the same file.
- FileInfo nextfi = new FileInfo("temp.txt");
+ FileInfo nextfi = new FileInfo("temp.txt");
- try
+ try
{
// Try opening the same file, which was locked by the previous process.
nextfi.Open( FileMode.OpenOrCreate, FileAccess.Read );
Console.WriteLine("The file was not locked, and was opened by a second process.");
- }
- catch (IOException)
+ }
+ catch (IOException)
{
Console.WriteLine("The file could not be opened because it was locked by another process.");
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
Console.WriteLine(e.ToString());
}
@@ -36,7 +36,7 @@ public static void Main()
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//The file could not be opened because it was locked by another process.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/generic.ReadOnlyCollection/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/generic.ReadOnlyCollection/cs/source.cs
index b12ff8fa4c3..87f4732ac8f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/generic.ReadOnlyCollection/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/generic.ReadOnlyCollection/cs/source.cs
@@ -14,7 +14,7 @@ public static void Main()
dinosaurs.Add("Deinonychus");
dinosaurs.Add("Compsognathus");
- ReadOnlyCollection readOnlyDinosaurs =
+ ReadOnlyCollection readOnlyDinosaurs =
new ReadOnlyCollection(dinosaurs);
Console.WriteLine();
@@ -25,13 +25,13 @@ public static void Main()
Console.WriteLine("\nCount: {0}", readOnlyDinosaurs.Count);
- Console.WriteLine("\nContains(\"Deinonychus\"): {0}",
+ Console.WriteLine("\nContains(\"Deinonychus\"): {0}",
readOnlyDinosaurs.Contains("Deinonychus"));
- Console.WriteLine("\nreadOnlyDinosaurs[3]: {0}",
+ Console.WriteLine("\nreadOnlyDinosaurs[3]: {0}",
readOnlyDinosaurs[3]);
- Console.WriteLine("\nIndexOf(\"Compsognathus\"): {0}",
+ Console.WriteLine("\nIndexOf(\"Compsognathus\"): {0}",
readOnlyDinosaurs.IndexOf("Compsognathus"));
Console.WriteLine("\nInsert into the wrapped List:");
@@ -47,7 +47,7 @@ public static void Main()
string[] dinoArray = new string[readOnlyDinosaurs.Count + 2];
readOnlyDinosaurs.CopyTo(dinoArray, 1);
- Console.WriteLine("\nCopied array has {0} elements:",
+ Console.WriteLine("\nCopied array has {0} elements:",
dinoArray.Length);
foreach( string dinosaur in dinoArray )
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/gettypeonsteroids/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/gettypeonsteroids/cs/source.cs
index f4cdf218781..601ad891c57 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/gettypeonsteroids/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/gettypeonsteroids/cs/source.cs
@@ -7,25 +7,25 @@ class Example
string test = "System.Collections.Generic.Dictionary`2[System.String,[MyNamespace.MyType, MyAssembly]]";
//
Type t = Type.GetType(test,
- (aName) => aName.Name == "MyAssembly" ?
+ (aName) => aName.Name == "MyAssembly" ?
Assembly.LoadFrom(@".\MyPath\v5.0\MyAssembly.dll") : null,
- (assem, name, ignore) => assem == null ?
- Type.GetType(name, false, ignore) :
+ (assem, name, ignore) => assem == null ?
+ Type.GetType(name, false, ignore) :
assem.GetType(name, false, ignore)
- );
+ );
//
Console.WriteLine(t);
test = "System.Collections.Generic.Dictionary`2[[YourNamespace.YourType, YourAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], [MyNamespace.MyType, MyAssembly]]";
//
Type t2 = Type.GetType(test,
- (aName) => aName.Name == "MyAssembly" ?
- Assembly.LoadFrom(@".\MyPath\v5.0\MyAssembly.dll") :
+ (aName) => aName.Name == "MyAssembly" ?
+ Assembly.LoadFrom(@".\MyPath\v5.0\MyAssembly.dll") :
Assembly.Load(aName),
- (assem, name, ignore) => assem == null ?
- Type.GetType(name, false, ignore) :
+ (assem, name, ignore) => assem == null ?
+ Type.GetType(name, false, ignore) :
assem.GetType(name, false, ignore), true
- );
+ );
//
Console.WriteLine(t2);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array Example/CS/source.cs
index edacca79e87..4cbdf71330c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array Example/CS/source.cs
@@ -56,7 +56,7 @@ public static void PrintValues(int[] myArr)
Console.WriteLine();
}
}
-/*
+/*
This code produces the following output.
Initially,
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Copy1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Copy1 Example/CS/source.cs
index 52e7cab5f01..3dc2d739283 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Copy1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Copy1 Example/CS/source.cs
@@ -1,31 +1,31 @@
//
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes a new Array of type Int32.
Array myIntArray=Array.CreateInstance( typeof(System.Int32), 5 );
for ( int i = myIntArray.GetLowerBound(0); i <= myIntArray.GetUpperBound(0); i++ )
myIntArray.SetValue( i+1, i );
-
+
// Creates and initializes a new Array of type Object.
Array myObjArray = Array.CreateInstance( typeof(System.Object), 5 );
for ( int i = myObjArray.GetLowerBound(0); i <= myObjArray.GetUpperBound(0); i++ )
myObjArray.SetValue( i+26, i );
-
+
// Displays the initial values of both arrays.
Console.WriteLine( "Int32 array:" );
PrintValues( myIntArray );
Console.WriteLine( "Object array:" );
PrintValues( myObjArray );
-
+
// Copies the first element from the Int32 array to the Object array.
Array.Copy( myIntArray, myIntArray.GetLowerBound(0), myObjArray, myObjArray.GetLowerBound(0), 1 );
-
+
// Copies the last two elements from the Object array to the Int32 array.
Array.Copy( myObjArray, myObjArray.GetUpperBound(0) - 1, myIntArray, myIntArray.GetUpperBound(0) - 1, 2 );
-
+
// Displays the values of the modified arrays.
Console.WriteLine( "Int32 array - Last two elements should now be the same as Object array:" );
PrintValues( myIntArray );
@@ -51,7 +51,7 @@ public static void PrintValues( Array myArr ) {
}
/*
This code produces the following output.
-
+
Int32 array:
1 2 3 4 5
Object array:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CopyTo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CopyTo Example/CS/source.cs
index a461584b5c2..9f75bb8ea43 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CopyTo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CopyTo Example/CS/source.cs
@@ -1,9 +1,9 @@
//
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes two new Arrays.
Array mySourceArray=Array.CreateInstance( typeof(String), 6 );
mySourceArray.SetValue( "three", 0 );
@@ -22,14 +22,14 @@ public static void Main() {
myTargetArray.SetValue( "the", 6 );
myTargetArray.SetValue( "lazy", 7 );
myTargetArray.SetValue( "dog", 8 );
-
+
// Displays the values of the Array.
Console.WriteLine( "The target Array contains the following (before and after copying):" );
PrintValues( myTargetArray, ' ' );
-
+
// Copies the source Array to the target Array, starting at index 6.
mySourceArray.CopyTo( myTargetArray, 6 );
-
+
// Displays the values of the Array.
PrintValues( myTargetArray, ' ' );
}
@@ -52,25 +52,25 @@ public static void PrintValues( Array myArr, char mySeparator ) {
}
/*
This code produces the following output.
-
+
The target Array contains the following (before and after copying):
- The quick brown fox jumps over the lazy dog
+ The quick brown fox jumps over the lazy dog
The quick brown fox jumps over three napping cats in the barn
*/
//
//
public class SamplesArray2{
-
+
public static void Main() {
// Creates and initializes the source Array.
Array myArrayZero=Array.CreateInstance( typeof(String), 3 );
myArrayZero.SetValue( "zero", 0 );
myArrayZero.SetValue( "one", 1 );
-
+
// Displays the source Array.
Console.WriteLine( "The array with lower bound=0 contains:" );
PrintIndexAndValues( myArrayZero );
-
+
// Creates and initializes the target Array.
int[] myArrLen = { 4 };
int[] myArrLow = { 2 };
@@ -79,14 +79,14 @@ public static void Main() {
myArrayTwo.SetValue( "three", 3 );
myArrayTwo.SetValue( "four", 4 );
myArrayTwo.SetValue( "five", 5 );
-
+
// Displays the target Array.
Console.WriteLine( "The array with lower bound=2 contains:" );
PrintIndexAndValues( myArrayTwo );
-
+
// Copies from the array with lower bound=0 to the array with lower bound=2.
myArrayZero.CopyTo( myArrayTwo, 3 );
-
+
// Displays the modified target Array.
Console.WriteLine( "\nAfter copying to the target array from index 3:" );
PrintIndexAndValues( myArrayTwo );
@@ -97,19 +97,19 @@ public static void PrintIndexAndValues( Array myArray ) {
Console.WriteLine( "\t[{0}]:\t{1}", i, myArray.GetValue( i ) );
}
}
- /*
+ /*
This code produces the following output.
-
+
The array with lower bound=0 contains:
[0]: zero
[1]: one
- [2]:
+ [2]:
The array with lower bound=2 contains:
[2]: two
[3]: three
[4]: four
[5]: five
-
+
After copying to the target array from index 3:
[2]: two
[3]: zero
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance Example/CS/source.cs
index d68167a0235..b76d0d0c453 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance Example/CS/source.cs
@@ -1,14 +1,14 @@
//
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes a one-dimensional Array of type Int32.
Array my1DArray=Array.CreateInstance( typeof(Int32), 5 );
for ( int i = my1DArray.GetLowerBound(0); i <= my1DArray.GetUpperBound(0); i++ )
my1DArray.SetValue( i+1, i );
-
+
// Displays the values of the Array.
Console.WriteLine( "The one-dimensional Array contains the following values:" );
PrintValues( my1DArray );
@@ -32,7 +32,7 @@ public static void PrintValues( Array myArr ) {
}
/*
This code produces the following output.
-
+
The one-dimensional Array contains the following values:
1 2 3 4 5
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance1 Example/CS/source.cs
index 4a1bf618a5e..131106d70ea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance1 Example/CS/source.cs
@@ -1,15 +1,15 @@
//
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes a two-dimensional Array of type String.
Array my2DArray=Array.CreateInstance( typeof(String), 2, 3 );
for ( int i = my2DArray.GetLowerBound(0); i <= my2DArray.GetUpperBound(0); i++ )
for ( int j = my2DArray.GetLowerBound(1); j <= my2DArray.GetUpperBound(1); j++ )
my2DArray.SetValue( "abc" + i + j, i, j );
-
+
// Displays the values of the Array.
Console.WriteLine( "The two-dimensional Array contains the following values:" );
PrintValues( my2DArray );
@@ -31,9 +31,9 @@ public static void PrintValues( Array myArr ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The two-dimensional Array contains the following values:
abc00 abc01 abc02
abc10 abc11 abc12
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance2 Example/CS/source.cs
index 82cbd9ba4f4..dc97203992a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance2 Example/CS/source.cs
@@ -1,16 +1,16 @@
//
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes a three-dimensional Array of type Object.
Array my3DArray=Array.CreateInstance( typeof(Object), 2, 3, 4 );
for ( int i = my3DArray.GetLowerBound(0); i <= my3DArray.GetUpperBound(0); i++ )
for ( int j = my3DArray.GetLowerBound(1); j <= my3DArray.GetUpperBound(1); j++ )
for ( int k = my3DArray.GetLowerBound(2); k <= my3DArray.GetUpperBound(2); k++ )
my3DArray.SetValue( "abc" + i + j + k, i, j, k );
-
+
// Displays the values of the Array.
Console.WriteLine( "The three-dimensional Array contains the following values:" );
PrintValues( my3DArray );
@@ -34,7 +34,7 @@ public static void PrintValues( Array myArr ) {
}
/*
This code produces the following output.
-
+
The three-dimensional Array contains the following values:
abc000 abc001 abc002 abc003
abc010 abc011 abc012 abc013
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance3 Example/CS/source.cs
index 28834883ca6..b8720a6fcd5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance3 Example/CS/source.cs
@@ -1,9 +1,9 @@
//
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes a multidimensional Array of type String.
int[] myLengthsArray = new int[4] { 2, 3, 4, 5 };
Array my4DArray=Array.CreateInstance( typeof(String), myLengthsArray );
@@ -14,7 +14,7 @@ public static void Main() {
int[] myIndicesArray = new int[4] { i, j, k, l };
my4DArray.SetValue( Convert.ToString(i) + j + k + l, myIndicesArray );
}
-
+
// Displays the values of the Array.
Console.WriteLine( "The four-dimensional Array contains the following values:" );
PrintValues( my4DArray );
@@ -38,7 +38,7 @@ public static void PrintValues( Array myArr ) {
}
/*
This code produces the following output.
-
+
The four-dimensional Array contains the following values:
0000 0001 0002 0003 0004
0010 0011 0012 0013 0014
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance4 Example/CS/source.cs
index db9c353c527..f0ac6d39e3f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.CreateInstance4 Example/CS/source.cs
@@ -1,9 +1,9 @@
//
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes a multidimensional Array of type String.
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
@@ -13,12 +13,12 @@ public static void Main() {
int[] myIndicesArray = new int[2] { i, j };
myArray.SetValue( Convert.ToString(i) + j, myIndicesArray );
}
-
+
// Displays the lower bounds and the upper bounds of each dimension.
Console.WriteLine( "Bounds:\tLower\tUpper" );
for ( int i = 0; i < myArray.Rank; i++ )
Console.WriteLine( "{0}:\t{1}\t{2}", i, myArray.GetLowerBound(i), myArray.GetUpperBound(i) );
-
+
// Displays the values of the Array.
Console.WriteLine( "The Array contains the following values:" );
PrintValues( myArray );
@@ -40,9 +40,9 @@ public static void PrintValues( Array myArr ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
Bounds: Lower Upper
0: 2 4
1: 3 7
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.LastIndexOf Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.LastIndexOf Example/CS/source.cs
index c8996908ef0..70c622c5dba 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.LastIndexOf Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.LastIndexOf Example/CS/source.cs
@@ -42,7 +42,7 @@ void PrintIndexAndValues( Array anArray ) {
Console.WriteLine( "\t[{0}]:\t{1}", i, anArray.GetValue( i ) );
}
- /*
+ /*
This code produces the following output.
The Array contains the following values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Reverse Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Reverse Example/CS/source.cs
index 339524f210d..76757a5a0ba 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Reverse Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Reverse Example/CS/source.cs
@@ -1,9 +1,9 @@
//
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes a new Array.
Array myArray=Array.CreateInstance( typeof(String), 9 );
myArray.SetValue( "The", 0 );
@@ -15,14 +15,14 @@ public static void Main() {
myArray.SetValue( "the", 6 );
myArray.SetValue( "lazy", 7 );
myArray.SetValue( "dog", 8 );
-
+
// Displays the values of the Array.
Console.WriteLine( "The Array initially contains the following values:" );
PrintIndexAndValues( myArray );
-
+
// Reverses the sort of the values of the Array.
Array.Reverse( myArray );
-
+
// Displays the values of the Array.
Console.WriteLine( "After reversing:" );
PrintIndexAndValues( myArray );
@@ -33,9 +33,9 @@ public static void PrintIndexAndValues( Array myArray ) {
Console.WriteLine( "\t[{0}]:\t{1}", i, myArray.GetValue( i ) );
}
}
- /*
+ /*
This code produces the following output.
-
+
The Array initially contains the following values:
[0]: The
[1]: quick
@@ -56,5 +56,5 @@ This code produces the following output.
[6]: brown
[7]: quick
[8]: The
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Reverse1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Reverse1 Example/CS/source.cs
index b6d185ecf75..c418daa6e19 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Reverse1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.Reverse1 Example/CS/source.cs
@@ -1,9 +1,9 @@
//
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes a new Array.
Array myArray=Array.CreateInstance( typeof(String), 9 );
myArray.SetValue( "The", 0 );
@@ -15,14 +15,14 @@ public static void Main() {
myArray.SetValue( "the", 6 );
myArray.SetValue( "lazy", 7 );
myArray.SetValue( "dog", 8 );
-
+
// Displays the values of the Array.
Console.WriteLine( "The Array initially contains the following values:" );
PrintIndexAndValues( myArray );
-
+
// Reverses the sort of the values of the Array.
Array.Reverse( myArray, 1, 3 );
-
+
// Displays the values of the Array.
Console.WriteLine( "After reversing:" );
PrintIndexAndValues( myArray );
@@ -33,9 +33,9 @@ public static void PrintIndexAndValues( Array myArray ) {
Console.WriteLine( "\t[{0}]:\t{1}", i, myArray.GetValue( i ) );
}
}
- /*
+ /*
This code produces the following output.
-
+
The Array initially contains the following values:
[0]: The
[1]: QUICK
@@ -56,5 +56,5 @@ This code produces the following output.
[6]: the
[7]: lazy
[8]: dog
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList Example/CS/source.cs
index fc05bc8e830..c22f239d374 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList Example/CS/source.cs
@@ -2,15 +2,15 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add("Hello");
myAL.Add("World");
myAL.Add("!");
-
+
// Displays the properties and values of the ArrayList.
Console.WriteLine( "myAL" );
Console.WriteLine( " Count: {0}", myAL.Count );
@@ -18,7 +18,7 @@ public static void Main() {
Console.Write( " Values:" );
PrintValues( myAL );
}
-
+
public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.Write( " {0}", obj );
@@ -27,9 +27,9 @@ public static void PrintValues( IEnumerable myList ) {
}
- /*
+ /*
This code produces output similar to the following:
-
+
myAL
Count: 3
Capacity: 4
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Add Example/CS/source.cs
index a5b42298309..7c8bef4b7af 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Add Example/CS/source.cs
@@ -2,16 +2,16 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
myAL.Add( "quick" );
myAL.Add( "brown" );
myAL.Add( "fox" );
-
+
// Creates and initializes a new Queue.
Queue myQueue = new Queue();
myQueue.Enqueue( "jumps" );
@@ -19,21 +19,21 @@ public static void Main() {
myQueue.Enqueue( "the" );
myQueue.Enqueue( "lazy" );
myQueue.Enqueue( "dog" );
-
+
// Displays the ArrayList and the Queue.
Console.WriteLine( "The ArrayList initially contains the following:" );
PrintValues( myAL, '\t' );
Console.WriteLine( "The Queue initially contains the following:" );
PrintValues( myQueue, '\t' );
-
+
// Copies the Queue elements to the end of the ArrayList.
myAL.AddRange( myQueue );
-
+
// Displays the ArrayList.
Console.WriteLine( "The ArrayList now contains the following:" );
PrintValues( myAL, '\t' );
}
-
+
public static void PrintValues( IEnumerable myList, char mySeparator ) {
foreach ( Object obj in myList )
Console.Write( "{0}{1}", mySeparator, obj );
@@ -42,14 +42,14 @@ public static void PrintValues( IEnumerable myList, char mySeparator ) {
}
- /*
+ /*
This code produces the following output.
-
+
The ArrayList initially contains the following:
The quick brown fox
The Queue initially contains the following:
jumps over the lazy dog
The ArrayList now contains the following:
The quick brown fox jumps over the lazy dog
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.BinarySearch1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.BinarySearch1 Example/CS/source.cs
index 3bcfd7388cc..92cd43ff5f3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.BinarySearch1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.BinarySearch1 Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList. BinarySearch requires
// a sorted ArrayList.
ArrayList myAL = new ArrayList();
@@ -14,16 +14,16 @@ public static void Main() {
// Displays the ArrayList.
Console.WriteLine( "The Int32 ArrayList contains the following:" );
PrintValues( myAL );
-
+
// Locates a specific object that does not exist in the ArrayList.
Object myObjectOdd = 3;
FindMyObject( myAL, myObjectOdd );
-
+
// Locates an object that exists in the ArrayList.
Object myObjectEven = 6;
FindMyObject( myAL, myObjectEven );
}
-
+
public static void FindMyObject( ArrayList myList, Object myObject ) {
int myIndex=myList.BinarySearch( myObject );
if ( myIndex < 0 )
@@ -31,19 +31,19 @@ public static void FindMyObject( ArrayList myList, Object myObject ) {
else
Console.WriteLine( "The object to search for ({0}) is at index {1}.", myObject, myIndex );
}
-
+
public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.Write( " {0}", obj );
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The Int32 ArrayList contains the following:
0 2 4 6 8
The object to search for (3) is not found. The next larger object is at index 2.
The object to search for (6) is at index 3.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Clear Example/CS/source.cs
index fa8cc61293d..b111900fe72 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Clear Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -12,37 +12,37 @@ public static void Main() {
myAL.Add( "brown" );
myAL.Add( "fox" );
myAL.Add( "jumps" );
-
+
// Displays the count, capacity and values of the ArrayList.
Console.WriteLine( "Initially," );
Console.WriteLine( " Count : {0}", myAL.Count );
Console.WriteLine( " Capacity : {0}", myAL.Capacity );
Console.Write( " Values:" );
PrintValues( myAL );
-
+
// Trim the ArrayList.
myAL.TrimToSize();
-
+
// Displays the count, capacity and values of the ArrayList.
Console.WriteLine( "After TrimToSize," );
Console.WriteLine( " Count : {0}", myAL.Count );
Console.WriteLine( " Capacity : {0}", myAL.Capacity );
Console.Write( " Values:" );
PrintValues( myAL );
-
+
// Clear the ArrayList.
myAL.Clear();
-
+
// Displays the count, capacity and values of the ArrayList.
Console.WriteLine( "After Clear," );
Console.WriteLine( " Count : {0}", myAL.Count );
Console.WriteLine( " Capacity : {0}", myAL.Capacity );
Console.Write( " Values:" );
PrintValues( myAL );
-
+
// Trim the ArrayList again.
myAL.TrimToSize();
-
+
// Displays the count, capacity and values of the ArrayList.
Console.WriteLine( "After the second TrimToSize," );
Console.WriteLine( " Count : {0}", myAL.Count );
@@ -50,16 +50,16 @@ public static void Main() {
Console.Write( " Values:" );
PrintValues( myAL );
}
-
+
public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.Write( " {0}", obj );
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
Initially,
Count : 5
Capacity : 16
@@ -76,5 +76,5 @@ This code produces the following output.
Count : 0
Capacity : 16
Values:
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.CopyTo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.CopyTo Example/CS/source.cs
index 79b4b54d41a..3a33cb3e748 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.CopyTo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.CopyTo Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes the source ArrayList.
ArrayList mySourceList = new ArrayList();
mySourceList.Add( "three" );
@@ -13,7 +13,7 @@ public static void Main() {
mySourceList.Add( "in" );
mySourceList.Add( "the" );
mySourceList.Add( "barn" );
-
+
// Creates and initializes the one-dimensional target Array.
String[] myTargetArray = new String[15];
myTargetArray[0] = "The";
@@ -25,30 +25,30 @@ public static void Main() {
myTargetArray[6] = "the";
myTargetArray[7] = "lazy";
myTargetArray[8] = "dog";
-
+
// Displays the values of the target Array.
Console.WriteLine( "The target Array contains the following (before and after copying):" );
PrintValues( myTargetArray, ' ' );
-
+
// Copies the second element from the source ArrayList to the target Array starting at index 7.
mySourceList.CopyTo( 1, myTargetArray, 7, 1 );
-
+
// Displays the values of the target Array.
PrintValues( myTargetArray, ' ' );
-
+
// Copies the entire source ArrayList to the target Array starting at index 6.
mySourceList.CopyTo( myTargetArray, 6 );
-
+
// Displays the values of the target Array.
PrintValues( myTargetArray, ' ' );
-
+
// Copies the entire source ArrayList to the target Array starting at index 0.
mySourceList.CopyTo( myTargetArray );
-
+
// Displays the values of the target Array.
PrintValues( myTargetArray, ' ' );
}
-
+
public static void PrintValues( String[] myArr, char mySeparator ) {
for ( int i = 0; i < myArr.Length; i++ )
Console.Write( "{0}{1}", mySeparator, myArr[i] );
@@ -57,14 +57,14 @@ public static void PrintValues( String[] myArr, char mySeparator ) {
}
- /*
+ /*
This code produces the following output.
-
+
The target Array contains the following (before and after copying):
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the napping dog
The quick brown fox jumps over three napping cats in the barn
three napping cats in the barn three napping cats in the barn
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.CopyTo1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.CopyTo1 Example/CS/source.cs
index e26ca4da57c..c5cb5fc1966 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.CopyTo1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.CopyTo1 Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes the source ArrayList.
ArrayList mySourceList = new ArrayList();
mySourceList.Add( "three" );
@@ -13,7 +13,7 @@ public static void Main() {
mySourceList.Add( "in" );
mySourceList.Add( "the" );
mySourceList.Add( "barn" );
-
+
// Creates and initializes the one-dimensional target Array.
String[] myTargetArray = new String[15];
myTargetArray[0] = "The";
@@ -25,30 +25,30 @@ public static void Main() {
myTargetArray[6] = "the";
myTargetArray[7] = "lazy";
myTargetArray[8] = "dog";
-
+
// Displays the values of the target Array.
Console.WriteLine( "The target Array contains the following (before and after copying):" );
PrintValues( myTargetArray, ' ' );
-
+
// Copies the second element from the source ArrayList to the target Array, starting at index 7.
mySourceList.CopyTo( 1, myTargetArray, 7, 1 );
-
+
// Displays the values of the target Array.
PrintValues( myTargetArray, ' ' );
-
+
// Copies the entire source ArrayList to the target Array, starting at index 6.
mySourceList.CopyTo( myTargetArray, 6 );
-
+
// Displays the values of the target Array.
PrintValues( myTargetArray, ' ' );
-
+
// Copies the entire source ArrayList to the target Array, starting at index 0.
mySourceList.CopyTo( myTargetArray );
-
+
// Displays the values of the target Array.
PrintValues( myTargetArray, ' ' );
}
-
+
public static void PrintValues( String[] myArr, char mySeparator ) {
for ( int i = 0; i < myArr.Length; i++ )
Console.Write( "{0}{1}", mySeparator, myArr[i] );
@@ -57,14 +57,14 @@ public static void PrintValues( String[] myArr, char mySeparator ) {
}
- /*
+ /*
This code produces the following output.
-
+
The target Array contains the following (before and after copying):
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the napping dog
The quick brown fox jumps over three napping cats in the barn
three napping cats in the barn three napping cats in the barn
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IndexOf Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IndexOf Example/CS/source.cs
index f30a07acf31..ce34c6aef05 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IndexOf Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IndexOf Example/CS/source.cs
@@ -4,9 +4,9 @@
public class SamplesArrayList
{
- public static void Main()
+ public static void Main()
{
-
+
// Creates and initializes a new ArrayList with three elements of the same value.
ArrayList myAL = new ArrayList();
myAL.Add( "the" );
@@ -52,9 +52,9 @@ public static void PrintIndexAndValues(IEnumerable myList)
Console.WriteLine();
}
}
-/*
+/*
This code produces output similar to the following:
-
+
The ArrayList contains the following values:
[0]: the
[1]: quick
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Insert Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Insert Example/CS/source.cs
index 1f76ea048dd..c297bd47827 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Insert Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Insert Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList using Insert instead of Add.
ArrayList myAL = new ArrayList();
myAL.Insert( 0, "The" );
@@ -13,39 +13,39 @@ public static void Main() {
myAL.Insert( 3, "over" );
myAL.Insert( 4, "the" );
myAL.Insert( 5, "dog" );
-
+
// Creates and initializes a new Queue.
Queue myQueue = new Queue();
myQueue.Enqueue( "quick" );
myQueue.Enqueue( "brown" );
-
+
// Displays the ArrayList and the Queue.
Console.WriteLine( "The ArrayList initially contains the following:" );
PrintValues( myAL );
Console.WriteLine( "The Queue initially contains the following:" );
PrintValues( myQueue );
-
+
// Copies the Queue elements to the ArrayList at index 1.
myAL.InsertRange( 1, myQueue );
-
+
// Displays the ArrayList.
Console.WriteLine( "After adding the Queue, the ArrayList now contains:" );
PrintValues( myAL );
-
+
// Search for "dog" and add "lazy" before it.
myAL.Insert( myAL.IndexOf( "dog" ), "lazy" );
-
+
// Displays the ArrayList.
Console.WriteLine( "After adding \"lazy\", the ArrayList now contains:" );
PrintValues( myAL );
-
+
// Add "!!!" at the end.
myAL.Insert( myAL.Count, "!!!" );
-
+
// Displays the ArrayList.
Console.WriteLine( "After adding \"!!!\", the ArrayList now contains:" );
PrintValues( myAL );
-
+
// Inserting an element beyond Count throws an exception.
try {
myAL.Insert( myAL.Count+1, "anystring" );
@@ -53,16 +53,16 @@ public static void Main() {
Console.WriteLine("Exception: " + myException.ToString());
}
}
-
+
public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.Write( " {0}", obj );
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The ArrayList initially contains the following:
The fox jumps over the dog
The Queue initially contains the following:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IsFixedSize Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IsFixedSize Example/CS/source.cs
index b40565e83a7..b8d2ecfd111 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IsFixedSize Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IsFixedSize Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -16,45 +16,45 @@ public static void Main() {
myAL.Add( "the" );
myAL.Add( "lazy" );
myAL.Add( "dog" );
-
+
// Create a fixed-size wrapper around the ArrayList.
ArrayList myFixedSizeAL = ArrayList.FixedSize( myAL );
-
+
// Display whether the ArrayLists have a fixed size or not.
Console.WriteLine( "myAL {0}.", myAL.IsFixedSize ? "has a fixed size" : "does not have a fixed size" );
Console.WriteLine( "myFixedSizeAL {0}.", myFixedSizeAL.IsFixedSize ? "has a fixed size" : "does not have a fixed size" );
Console.WriteLine();
-
+
// Display both ArrayLists.
Console.WriteLine( "Initially," );
Console.Write( "Standard :" );
PrintValues( myAL, ' ' );
Console.Write( "Fixed size:" );
PrintValues( myFixedSizeAL, ' ' );
-
+
// Sort is allowed in the fixed-size ArrayList.
myFixedSizeAL.Sort();
-
+
// Display both ArrayLists.
Console.WriteLine( "After Sort," );
Console.Write( "Standard :" );
PrintValues( myAL, ' ' );
Console.Write( "Fixed size:" );
PrintValues( myFixedSizeAL, ' ' );
-
+
// Reverse is allowed in the fixed-size ArrayList.
myFixedSizeAL.Reverse();
-
+
// Display both ArrayLists.
Console.WriteLine( "After Reverse," );
Console.Write( "Standard :" );
PrintValues( myAL, ' ' );
Console.Write( "Fixed size:" );
PrintValues( myFixedSizeAL, ' ' );
-
+
// Add an element to the standard ArrayList.
myAL.Add( "AddMe" );
-
+
// Display both ArrayLists.
Console.WriteLine( "After adding to the standard ArrayList," );
Console.Write( "Standard :" );
@@ -62,7 +62,7 @@ public static void Main() {
Console.Write( "Fixed size:" );
PrintValues( myFixedSizeAL, ' ' );
Console.WriteLine();
-
+
// Adding or inserting elements to the fixed-size ArrayList throws an exception.
try {
myFixedSizeAL.Add( "AddMe2" );
@@ -75,7 +75,7 @@ public static void Main() {
Console.WriteLine("Exception: " + myException.ToString());
}
}
-
+
public static void PrintValues( IEnumerable myList, char mySeparator ) {
foreach ( Object obj in myList )
Console.Write( "{0}{1}", mySeparator, obj );
@@ -84,7 +84,7 @@ public static void PrintValues( IEnumerable myList, char mySeparator ) {
}
/*
This code produces the following output.
-
+
myAL does not have a fixed size.
myFixedSizeAL has a fixed size.
@@ -108,5 +108,5 @@ at SamplesArrayList.Main()
at System.Collections.FixedSizeArrayList.Insert(Int32 index, Object obj)
at SamplesArrayList.Main()
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IsSynchronized Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IsSynchronized Example/CS/source.cs
index 19dd23f5578..734650bc72a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IsSynchronized Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.IsSynchronized Example/CS/source.cs
@@ -2,28 +2,28 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
myAL.Add( "quick" );
myAL.Add( "brown" );
myAL.Add( "fox" );
-
+
// Creates a synchronized wrapper around the ArrayList.
ArrayList mySyncdAL = ArrayList.Synchronized( myAL );
-
+
// Displays the sychronization status of both ArrayLists.
Console.WriteLine( "myAL is {0}.", myAL.IsSynchronized ? "synchronized" : "not synchronized" );
Console.WriteLine( "mySyncdAL is {0}.", mySyncdAL.IsSynchronized ? "synchronized" : "not synchronized" );
}
}
- /*
+ /*
This code produces the following output.
-
+
myAL is not synchronized.
mySyncdAL is synchronized.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.LastIndexOf Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.LastIndexOf Example/CS/source.cs
index 0e32ce413d3..dfcc8f65a06 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.LastIndexOf Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.LastIndexOf Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList with three elements of the same value.
ArrayList myAL = new ArrayList();
myAL.Add( "the" );
@@ -19,25 +19,25 @@ public static void Main() {
myAL.Add( "in" );
myAL.Add( "the" );
myAL.Add( "barn" );
-
+
// Displays the values of the ArrayList.
Console.WriteLine( "The ArrayList contains the following values:" );
PrintIndexAndValues( myAL );
-
+
// Searches for the last occurrence of the duplicated value.
String myString = "the";
int myIndex = myAL.LastIndexOf( myString );
Console.WriteLine( "The last occurrence of \"{0}\" is at index {1}.", myString, myIndex );
-
+
// Searches for the last occurrence of the duplicated value in the first section of the ArrayList.
myIndex = myAL.LastIndexOf( myString, 8 );
Console.WriteLine( "The last occurrence of \"{0}\" between the start and index 8 is at index {1}.", myString, myIndex );
-
+
// Searches for the last occurrence of the duplicated value in a section of the ArrayList. Note that the start index is greater than the end index because the search is done backward.
myIndex = myAL.LastIndexOf( myString, 10, 6 );
Console.WriteLine( "The last occurrence of \"{0}\" between index 10 and index 5 is at index {1}.", myString, myIndex );
}
-
+
public static void PrintIndexAndValues( IEnumerable myList ) {
int i = 0;
foreach ( Object obj in myList )
@@ -49,7 +49,7 @@ public static void PrintIndexAndValues( IEnumerable myList ) {
/*
This code produces the following output.
-
+
The ArrayList contains the following values:
[0]: the
[1]: quick
@@ -67,5 +67,5 @@ This code produces the following output.
The last occurrence of "the" is at index 10.
The last occurrence of "the" between the start and index 8 is at index 6.
The last occurrence of "the" between index 10 and index 5 is at index 10.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.ReadOnly1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.ReadOnly1 Example/CS/source.cs
index d6262bb9e97..b5ebfbd6562 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.ReadOnly1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.ReadOnly1 Example/CS/source.cs
@@ -2,22 +2,22 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "red" );
myAL.Add( "orange" );
myAL.Add( "yellow" );
-
+
// Creates a read-only copy of the ArrayList.
ArrayList myReadOnlyAL = ArrayList.ReadOnly( myAL );
-
+
// Displays whether the ArrayList is read-only or writable.
Console.WriteLine( "myAL is {0}.", myAL.IsReadOnly ? "read-only" : "writable" );
Console.WriteLine( "myReadOnlyAL is {0}.", myReadOnlyAL.IsReadOnly ? "read-only" : "writable" );
-
+
// Displays the contents of both collections.
Console.WriteLine( "\nInitially," );
Console.WriteLine( "The original ArrayList myAL contains:" );
@@ -50,7 +50,7 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
myAL is writable.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Remove Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Remove Example/CS/source.cs
index df270bb44fb..588fffb6369 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Remove Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Remove Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -16,42 +16,42 @@ public static void Main() {
myAL.Add( "the" );
myAL.Add( "lazy" );
myAL.Add( "dog" );
-
+
// Displays the ArrayList.
Console.WriteLine( "The ArrayList initially contains the following:" );
PrintValues( myAL );
-
+
// Removes the element containing "lazy".
myAL.Remove( "lazy" );
-
+
// Displays the current state of the ArrayList.
Console.WriteLine( "After removing \"lazy\":" );
PrintValues( myAL );
-
+
// Removes the element at index 5.
myAL.RemoveAt( 5 );
-
+
// Displays the current state of the ArrayList.
Console.WriteLine( "After removing the element at index 5:" );
PrintValues( myAL );
-
+
// Removes three elements starting at index 4.
myAL.RemoveRange( 4, 3 );
-
+
// Displays the current state of the ArrayList.
Console.WriteLine( "After removing three elements starting at index 4:" );
PrintValues( myAL );
}
-
+
public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.Write( " {0}", obj );
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The ArrayList initially contains the following:
The quick brown fox jumps over the lazy dog
After removing "lazy":
@@ -60,5 +60,5 @@ The quick brown fox jumps over the dog
The quick brown fox jumps the dog
After removing three elements starting at index 4:
The quick brown fox
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Repeat Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Repeat Example/CS/source.cs
index e10cf9651be..cf07774b00e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Repeat Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Repeat Example/CS/source.cs
@@ -2,22 +2,22 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates a new ArrayList with five elements and initialize each element with a null value.
ArrayList myAL = ArrayList.Repeat( null, 5 );
-
+
// Displays the count, capacity and values of the ArrayList.
Console.WriteLine( "ArrayList with five elements with a null value" );
Console.WriteLine( " Count : {0}", myAL.Count );
Console.WriteLine( " Capacity : {0}", myAL.Capacity );
Console.Write( " Values:" );
PrintValues( myAL );
-
+
// Creates a new ArrayList with seven elements and initialize each element with the string "abc".
myAL = ArrayList.Repeat( "abc", 7 );
-
+
// Displays the count, capacity and values of the ArrayList.
Console.WriteLine( "ArrayList with seven elements with a string value" );
Console.WriteLine( " Count : {0}", myAL.Count );
@@ -32,9 +32,9 @@ public static void PrintValues( IEnumerable myList ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
ArrayList with five elements with a null value
Count : 5
Capacity : 16
@@ -44,5 +44,5 @@ ArrayList with seven elements with a string value
Capacity : 16
Values: abc abc abc abc abc abc abc
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Reverse Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Reverse Example/CS/source.cs
index 4ca3318c884..101a09f9424 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Reverse Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Reverse Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -16,19 +16,19 @@ public static void Main() {
myAL.Add( "the" );
myAL.Add( "lazy" );
myAL.Add( "dog" );
-
+
// Displays the values of the ArrayList.
Console.WriteLine( "The ArrayList initially contains the following values:" );
PrintValues( myAL );
-
+
// Reverses the sort order of the values of the ArrayList.
myAL.Reverse();
-
+
// Displays the values of the ArrayList.
Console.WriteLine( "After reversing:" );
PrintValues( myAL );
}
-
+
public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.WriteLine( " {0}", obj );
@@ -37,9 +37,9 @@ public static void PrintValues( IEnumerable myList ) {
}
- /*
+ /*
This code produces the following output.
-
+
The ArrayList initially contains the following values:
The
quick
@@ -61,5 +61,5 @@ This code produces the following output.
brown
quick
The
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Reverse1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Reverse1 Example/CS/source.cs
index 50c1d0e4fd0..2736d798876 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Reverse1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Reverse1 Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -16,19 +16,19 @@ public static void Main() {
myAL.Add( "the" );
myAL.Add( "lazy" );
myAL.Add( "dog" );
-
+
// Displays the values of the ArrayList.
Console.WriteLine( "The ArrayList initially contains the following values:" );
PrintValues( myAL );
-
+
// Reverses the sort order of the values of the ArrayList.
myAL.Reverse( 1, 3 );
-
+
// Displays the values of the ArrayList.
Console.WriteLine( "After reversing:" );
PrintValues( myAL );
}
-
+
public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.WriteLine( " {0}", obj );
@@ -37,9 +37,9 @@ public static void PrintValues( IEnumerable myList ) {
}
- /*
+ /*
This code produces the following output.
-
+
The ArrayList initially contains the following values:
The
QUICK
@@ -62,5 +62,5 @@ This code produces the following output.
lazy
dog
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.SetRange Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.SetRange Example/CS/source.cs
index cad0a0b4ac8..3e187b3ffd5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.SetRange Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.SetRange Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -16,27 +16,27 @@ public static void Main() {
myAL.Add( "the" );
myAL.Add( "lazy" );
myAL.Add( "dog" );
-
+
// Creates and initializes the source ICollection.
Queue mySourceList = new Queue();
mySourceList.Enqueue( "big" );
mySourceList.Enqueue( "gray" );
mySourceList.Enqueue( "wolf" );
-
+
// Displays the values of five elements starting at index 0.
ArrayList mySubAL = myAL.GetRange( 0, 5 );
Console.WriteLine( "Index 0 through 4 contains:" );
PrintValues( mySubAL, '\t' );
-
+
// Replaces the values of five elements starting at index 1 with the values in the ICollection.
myAL.SetRange( 1, mySourceList );
-
+
// Displays the values of five elements starting at index 0.
mySubAL = myAL.GetRange( 0, 5 );
Console.WriteLine( "Index 0 through 4 now contains:" );
PrintValues( mySubAL, '\t' );
}
-
+
public static void PrintValues( IEnumerable myList, char mySeparator ) {
foreach ( Object obj in myList )
Console.Write( "{0}{1}", mySeparator, obj );
@@ -45,12 +45,12 @@ public static void PrintValues( IEnumerable myList, char mySeparator ) {
}
- /*
+ /*
This code produces the following output.
-
+
Index 0 through 4 contains:
The quick brown fox jumps
Index 0 through 4 now contains:
The big gray wolf jumps
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Sort Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Sort Example/CS/source.cs
index f25d5c96e29..7cfbbe6dd5d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Sort Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ArrayList.Sort Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -16,19 +16,19 @@ public static void Main() {
myAL.Add( "the" );
myAL.Add( "lazy" );
myAL.Add( "dog" );
-
+
// Displays the values of the ArrayList.
Console.WriteLine( "The ArrayList initially contains the following values:" );
PrintValues( myAL );
-
+
// Sorts the values of the ArrayList.
myAL.Sort();
-
+
// Displays the values of the ArrayList.
Console.WriteLine( "After sorting:" );
PrintValues( myAL );
}
-
+
public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.WriteLine( " {0}", obj );
@@ -37,7 +37,7 @@ public static void PrintValues( IEnumerable myList ) {
}
- /*
+ /*
This code produces the following output.
The ArrayList initially contains the following values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic AttributeUsageAttribute.AttributeUsageAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic AttributeUsageAttribute.AttributeUsageAttribute Example/CS/source.cs
index 6f5721ef5c3..3353137dcff 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic AttributeUsageAttribute.AttributeUsageAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic AttributeUsageAttribute.AttributeUsageAttribute Example/CS/source.cs
@@ -10,7 +10,7 @@ public class DispIdAttribute: System.Attribute
public DispIdAttribute(int value) {
// . . .
}
-
+
public int Value {
get {
// . . .
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray Example/CS/source.cs
index d2ad36ade20..de94fe5aa5b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray Example/CS/source.cs
@@ -2,48 +2,48 @@
using System;
using System.Collections;
public class SamplesBitArray {
-
+
public static void Main() {
-
+
// Creates and initializes several BitArrays.
BitArray myBA1 = new BitArray( 5 );
-
+
BitArray myBA2 = new BitArray( 5, false );
-
+
byte[] myBytes = new byte[5] { 1, 2, 3, 4, 5 };
BitArray myBA3 = new BitArray( myBytes );
-
+
bool[] myBools = new bool[5] { true, false, true, true, false };
BitArray myBA4 = new BitArray( myBools );
-
+
int[] myInts = new int[5] { 6, 7, 8, 9, 10 };
BitArray myBA5 = new BitArray( myInts );
-
+
// Displays the properties and values of the BitArrays.
Console.WriteLine( "myBA1" );
Console.WriteLine( " Count: {0}", myBA1.Count );
Console.WriteLine( " Length: {0}", myBA1.Length );
Console.WriteLine( " Values:" );
PrintValues( myBA1, 8 );
-
+
Console.WriteLine( "myBA2" );
Console.WriteLine( " Count: {0}", myBA2.Count );
Console.WriteLine( " Length: {0}", myBA2.Length );
Console.WriteLine( " Values:" );
PrintValues( myBA2, 8 );
-
+
Console.WriteLine( "myBA3" );
Console.WriteLine( " Count: {0}", myBA3.Count );
Console.WriteLine( " Length: {0}", myBA3.Length );
Console.WriteLine( " Values:" );
PrintValues( myBA3, 8 );
-
+
Console.WriteLine( "myBA4" );
Console.WriteLine( " Count: {0}", myBA4.Count );
Console.WriteLine( " Length: {0}", myBA4.Length );
Console.WriteLine( " Values:" );
PrintValues( myBA4, 8 );
-
+
Console.WriteLine( "myBA5" );
Console.WriteLine( " Count: {0}", myBA5.Count );
Console.WriteLine( " Length: {0}", myBA5.Length );
@@ -66,9 +66,9 @@ public static void PrintValues( IEnumerable myList, int myWidth ) {
}
- /*
+ /*
This code produces the following output.
-
+
myBA1
Count: 5
Length: 5
@@ -117,6 +117,6 @@ False True False True False False False False
False False False False False False False False
False False False False False False False False
False False False False False False False False
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.And Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.And Example/CS/source.cs
index 5893293b7c7..f9cd9cbfa4c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.And Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.And Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesBitArray {
-
+
public static void Main() {
-
+
// Creates and initializes two BitArrays of the same size.
BitArray myBA1 = new BitArray( 4 );
BitArray myBA2 = new BitArray( 4 );
@@ -12,7 +12,7 @@ public static void Main() {
myBA1[2] = myBA1[3] = true;
myBA2[0] = myBA2[2] = false;
myBA2[1] = myBA2[3] = true;
-
+
// Performs a bitwise AND operation between BitArray instances of the same size.
Console.WriteLine( "Initial values" );
Console.Write( "myBA1:" );
@@ -20,19 +20,19 @@ public static void Main() {
Console.Write( "myBA2:" );
PrintValues( myBA2, 8 );
Console.WriteLine();
-
+
Console.WriteLine( "Result" );
Console.Write( "AND:" );
PrintValues( myBA1.And( myBA2 ), 8 );
Console.WriteLine();
-
+
Console.WriteLine( "After AND" );
Console.Write( "myBA1:" );
PrintValues( myBA1, 8 );
Console.Write( "myBA2:" );
PrintValues( myBA2, 8 );
Console.WriteLine();
-
+
// Performing AND between BitArray instances of different sizes returns an exception.
try {
BitArray myBA3 = new BitArray( 8 );
@@ -59,9 +59,9 @@ public static void PrintValues( IEnumerable myList, int myWidth ) {
}
- /*
+ /*
This code produces the following output.
-
+
Initial values
myBA1: False False True True
myBA2: False True False True
@@ -76,5 +76,5 @@ After AND
Exception: System.ArgumentException: Array lengths must be the same.
at System.Collections.BitArray.And(BitArray value)
at SamplesBitArray.Main()
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.CopyTo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.CopyTo Example/CS/source.cs
index 5078212ea6b..9cd7a59737a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.CopyTo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.CopyTo Example/CS/source.cs
@@ -2,58 +2,58 @@
using System;
using System.Collections;
public class SamplesBitArray {
-
+
public static void Main() {
-
+
// Creates and initializes the source BitArray.
BitArray myBA = new BitArray( 4 );
myBA[0] = myBA[1] = myBA[2] = myBA[3] = true;
-
+
// Creates and initializes the one-dimensional target Array of type Boolean.
bool[] myBoolArray = new bool[8];
myBoolArray[0] = false;
myBoolArray[1] = false;
-
+
// Displays the values of the target Array.
Console.WriteLine( "The target Boolean Array contains the following (before and after copying):" );
PrintValues( myBoolArray );
-
+
// Copies the entire source BitArray to the target BitArray, starting at index 3.
myBA.CopyTo( myBoolArray, 3 );
-
+
// Displays the values of the target Array.
PrintValues( myBoolArray );
-
+
// Creates and initializes the one-dimensional target Array of type integer.
int[] myIntArray = new int[8];
myIntArray[0] = 42;
myIntArray[1] = 43;
-
+
// Displays the values of the target Array.
Console.WriteLine( "The target integer Array contains the following (before and after copying):" );
PrintValues( myIntArray );
-
+
// Copies the entire source BitArray to the target BitArray, starting at index 3.
myBA.CopyTo( myIntArray, 3 );
-
+
// Displays the values of the target Array.
PrintValues( myIntArray );
-
+
// Creates and initializes the one-dimensional target Array of type byte.
Array myByteArray = Array.CreateInstance( typeof(byte), 8 );
myByteArray.SetValue( (byte) 10, 0 );
myByteArray.SetValue( (byte) 11, 1 );
-
+
// Displays the values of the target Array.
Console.WriteLine( "The target byte Array contains the following (before and after copying):" );
PrintValues( myByteArray );
-
+
// Copies the entire source BitArray to the target BitArray, starting at index 3.
myBA.CopyTo( myByteArray, 3 );
-
+
// Displays the values of the target Array.
PrintValues( myByteArray );
-
+
// Returns an exception if the array is not of type Boolean, integer or byte.
try {
Array myStringArray=Array.CreateInstance( typeof(String), 8 );
@@ -74,9 +74,9 @@ public static void PrintValues( IEnumerable myArr ) {
}
- /*
+ /*
This code produces the following output.
-
+
The target Boolean Array contains the following (before and after copying):
False False False False False False False False
False False False True True True True False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CS/source.cs
index 14d47f48e6b..223afc6964f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Get Example/CS/source.cs
@@ -2,30 +2,30 @@
using System;
using System.Collections;
public class SamplesBitArray {
-
+
public static void Main() {
-
+
// Creates and initializes a BitArray.
BitArray myBA = new BitArray( 5 );
-
+
// Displays the properties and values of the BitArray.
Console.WriteLine( "myBA values:" );
PrintIndexAndValues( myBA );
-
+
// Sets all the elements to true.
myBA.SetAll( true );
-
+
// Displays the properties and values of the BitArray.
Console.WriteLine( "After setting all elements to true," );
PrintIndexAndValues( myBA );
-
+
// Sets the last index to false.
myBA.Set( myBA.Count - 1, false );
-
+
// Displays the properties and values of the BitArray.
Console.WriteLine( "After setting the last element to false," );
PrintIndexAndValues( myBA );
-
+
// Gets the value of the last two elements.
Console.WriteLine( "The last two elements are: " );
Console.WriteLine( " at index {0} : {1}", myBA.Count - 2, myBA.Get( myBA.Count - 2 ) );
@@ -40,9 +40,9 @@ public static void PrintIndexAndValues( IEnumerable myCol ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
myBA values:
[0]: False
[1]: False
@@ -68,5 +68,5 @@ This code produces the following output.
at index 3 : True
at index 4 : False
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Not Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Not Example/CS/source.cs
index 07a7e08735a..3cbc7b50a92 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Not Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Not Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesBitArray {
-
+
public static void Main() {
-
+
// Creates and initializes two BitArrays of the same size.
BitArray myBA1 = new BitArray( 4 );
BitArray myBA2 = new BitArray( 4 );
@@ -12,7 +12,7 @@ public static void Main() {
myBA1[2] = myBA1[3] = true;
myBA2[0] = myBA2[2] = false;
myBA2[1] = myBA2[3] = true;
-
+
// Performs a bitwise NOT operation between BitArray instances of the same size.
Console.WriteLine( "Initial values" );
Console.Write( "myBA1:" );
@@ -20,10 +20,10 @@ public static void Main() {
Console.Write( "myBA2:" );
PrintValues( myBA2, 8 );
Console.WriteLine();
-
+
myBA1.Not();
myBA2.Not();
-
+
Console.WriteLine( "After NOT" );
Console.Write( "myBA1:" );
PrintValues( myBA1, 8 );
@@ -47,7 +47,7 @@ public static void PrintValues( IEnumerable myList, int myWidth ) {
}
- /*
+ /*
This code produces the following output.
Initial values
@@ -58,5 +58,5 @@ After NOT
myBA1: True True False False
myBA2: True False True False
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Or Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Or Example/CS/source.cs
index 116076455ff..64afd995b91 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Or Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Or Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesBitArray {
-
+
public static void Main() {
-
+
// Creates and initializes two BitArrays of the same size.
BitArray myBA1 = new BitArray( 4 );
BitArray myBA2 = new BitArray( 4 );
@@ -12,7 +12,7 @@ public static void Main() {
myBA1[2] = myBA1[3] = true;
myBA2[0] = myBA2[2] = false;
myBA2[1] = myBA2[3] = true;
-
+
// Performs a bitwise OR operation between BitArray instances of the same size.
Console.WriteLine( "Initial values" );
Console.Write( "myBA1:" );
@@ -20,19 +20,19 @@ public static void Main() {
Console.Write( "myBA2:" );
PrintValues( myBA2, 8 );
Console.WriteLine();
-
+
Console.WriteLine( "Result" );
Console.Write( "OR:" );
PrintValues( myBA1.Or( myBA2 ), 8 );
Console.WriteLine();
-
+
Console.WriteLine( "After OR" );
Console.Write( "myBA1:" );
PrintValues( myBA1, 8 );
Console.Write( "myBA2:" );
PrintValues( myBA2, 8 );
Console.WriteLine();
-
+
// Performing OR between BitArray instances of different sizes returns an exception.
try {
BitArray myBA3 = new BitArray( 8 );
@@ -59,9 +59,9 @@ public static void PrintValues( IEnumerable myList, int myWidth ) {
}
- /*
+ /*
This code produces the following output.
-
+
Initial values
myBA1: False False True True
myBA2: False True False True
@@ -76,6 +76,6 @@ After OR
Exception: System.ArgumentException: Array lengths must be the same.
at System.Collections.BitArray.Or(BitArray value)
at SamplesBitArray.Main()
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Xor Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Xor Example/CS/source.cs
index 873eee1cc23..c73562b340d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Xor Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BitArray.Xor Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesBitArray {
-
+
public static void Main() {
-
+
// Creates and initializes two BitArrays of the same size.
BitArray myBA1 = new BitArray( 4 );
BitArray myBA2 = new BitArray( 4 );
@@ -12,7 +12,7 @@ public static void Main() {
myBA1[2] = myBA1[3] = true;
myBA2[0] = myBA2[2] = false;
myBA2[1] = myBA2[3] = true;
-
+
// Performs a bitwise XOR operation between BitArray instances of the same size.
Console.WriteLine( "Initial values" );
Console.Write( "myBA1:" );
@@ -20,19 +20,19 @@ public static void Main() {
Console.Write( "myBA2:" );
PrintValues( myBA2, 8 );
Console.WriteLine();
-
+
Console.WriteLine( "Result" );
Console.Write( "XOR:" );
PrintValues( myBA1.Xor( myBA2 ), 8 );
Console.WriteLine();
-
+
Console.WriteLine( "After XOR" );
Console.Write( "myBA1:" );
PrintValues( myBA1, 8 );
Console.Write( "myBA2:" );
PrintValues( myBA2, 8 );
Console.WriteLine();
-
+
// Performing XOR between BitArray instances of different sizes returns an exception.
try {
BitArray myBA3 = new BitArray( 8 );
@@ -59,9 +59,9 @@ public static void PrintValues( IEnumerable myList, int myWidth ) {
}
- /*
+ /*
This code produces the following output.
-
+
Initial values
myBA1: False False True True
myBA2: False True False True
@@ -77,5 +77,5 @@ After XOR
at System.Collections.BitArray.Xor(BitArray value)
at SamplesBitArray.Main()
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BooleanSwitch.BooleanSwitch Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BooleanSwitch.BooleanSwitch Example/CS/source.cs
index 6fdfcb9bd0b..c89256f5ba0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BooleanSwitch.BooleanSwitch Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BooleanSwitch.BooleanSwitch Example/CS/source.cs
@@ -9,13 +9,13 @@ public class Form1: Form
// Class level declaration.
/* Create a BooleanSwitch for data.*/
static BooleanSwitch dataSwitch = new BooleanSwitch("Data", "DataAccess module");
-
+
static public void MyMethod(string location) {
//Insert code here to handle processing.
if(dataSwitch.Enabled)
Console.WriteLine("Error happened at " + location);
}
-
+
public static void Main(string[] args) {
//Run the method which writes an error message specifying the location of the error.
MyMethod("in Main");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BooleanSwitch.Enabled Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BooleanSwitch.Enabled Example/CS/source.cs
index 7262acbb56b..605ce19f58e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BooleanSwitch.Enabled Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic BooleanSwitch.Enabled Example/CS/source.cs
@@ -9,17 +9,17 @@ public class Form1: Form
//Class level declaration.
/* Create a BooleanSwitch for data.*/
static BooleanSwitch dataSwitch = new BooleanSwitch("Data", "DataAccess module");
-
+
static public void MyMethod(string location) {
//Insert code here to handle processing.
if(dataSwitch.Enabled)
Console.WriteLine("Error happened at " + location);
}
-
+
public static void Main(string[] args) {
//Run the method that writes an error message specifying the location of the error.
MyMethod("in Main");
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComRegisterFunctionAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComRegisterFunctionAttribute Example/CS/source.cs
index 46c74441c89..c53102a7305 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComRegisterFunctionAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComRegisterFunctionAttribute Example/CS/source.cs
@@ -9,7 +9,7 @@ public static void RegisterFunction(Type t)
{
//Insert code here.
}
-
+
[ComUnregisterFunctionAttribute]
public static void UnregisterFunction(Type t)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComSourceInterfacesAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComSourceInterfacesAttribute Example/CS/source.cs
index 0d2a83bceef..84fb1a7afc7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComSourceInterfacesAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComSourceInterfacesAttribute Example/CS/source.cs
@@ -2,7 +2,7 @@
using System.Runtime.InteropServices;
[ComSourceInterfacesAttribute("ButtonEventsLib.ButtonEvents, ButtonEventsLib")]
-public class Baz
+public class Baz
{
//Insert code here.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComVisibleAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComVisibleAttribute Example/CS/source.cs
index cfab92e171a..df635739b21 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComVisibleAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ComVisibleAttribute Example/CS/source.cs
@@ -8,14 +8,14 @@ public MyClass()
{
//Insert code here.
}
-
+
[ComVisible(false)]
- public int MyMethod(string param)
+ public int MyMethod(string param)
{
return 0;
}
- public bool MyOtherMethod()
+ public bool MyOtherMethod()
{
return true;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic CompilerError Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic CompilerError Example/CS/source.cs
index 4ac44b420a5..ba7792d578d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic CompilerError Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic CompilerError Example/CS/source.cs
@@ -15,17 +15,17 @@ static void Main(string[] args)
Console.WriteLine("This program compiles a CodeDOM program that incorrectly declares multiple data");
Console.WriteLine("types to demonstrate handling compiler errors programmatically.");
Console.WriteLine("");
-
+
// Compile the CodeCompileUnit retrieved from the GetCompileUnit() method.
CSharpCodeProvider provider = new Microsoft.CSharp.CSharpCodeProvider();
-
+
// Initialize a CompilerParameters with the options for compilation.
string[] assemblies = new String[] {"System.dll"};
CompilerParameters options = new CompilerParameters( assemblies, "output.exe");
// Compile the CodeDOM graph and store the results in a CompilerResults.
CompilerResults results = provider.CompileAssemblyFromDom(options, GetCompileUnit());
-
+
// Compilation produces errors. Print out each error.
Console.WriteLine("Listing errors from compilation: ");
Console.WriteLine("");
@@ -40,7 +40,7 @@ public static CodeCompileUnit GetCompileUnit()
// Create a namespace named TestSpace.
CodeNamespace cn = new CodeNamespace("TestSpace");
-
+
// Declare a new type named TestClass.
CodeTypeDeclaration cd = new CodeTypeDeclaration("TestClass");
@@ -59,20 +59,20 @@ public static CodeCompileUnit GetCompileUnit()
cm.Statements.Add(cvd);
// Cast the TestField reference expression to string and assign it to the TestVariable.
- CodeAssignStatement ca = new CodeAssignStatement(new CodeVariableReferenceExpression("TestVariable"),
+ CodeAssignStatement ca = new CodeAssignStatement(new CodeVariableReferenceExpression("TestVariable"),
new CodeCastExpression("System.String2", new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "TestField")));
// This code can be used to generate the following code in C#:
// TestVariable = ((string)(this.TestField));
cm.Statements.Add(ca);
-
+
// Add the TestMethod member to the TestClass type.
cd.Members.Add(cm);
-
+
// Add the TestClass type to the namespace.
cn.Types.Add(cd);
-
+
// Add the TestSpace namespace to the compile unit.
cu.Namespaces.Add(cn);
return cu;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Console Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Console Example/CS/source.cs
index c4d87017d05..9d4eebfb62b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Console Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Console Example/CS/source.cs
@@ -2,7 +2,7 @@
using System;
public class Example {
- public static void Main()
+ public static void Main()
{
Console.Write("Hello ");
Console.WriteLine("World!");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic CryptoStream Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic CryptoStream Example/CS/source.cs
index 783e51149ad..cb54c7e43af 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic CryptoStream Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic CryptoStream Example/CS/source.cs
@@ -7,23 +7,23 @@ public class Sample
{
//
private static void EncryptData(String inName, String outName, byte[] rijnKey, byte[] rijnIV)
- {
+ {
//Create the file streams to handle the input and output files.
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);
FileStream fout = new FileStream(outName, FileMode.OpenOrCreate, FileAccess.Write);
fout.SetLength(0);
-
+
//Create variables to help with read and write.
byte[] bin = new byte[100]; //This is intermediate storage for the encryption.
long rdlen = 0; //This is the total number of bytes written.
long totlen = fin.Length; //This is the total length of the input file.
int len; //This is the number of bytes to be written at a time.
-
- SymmetricAlgorithm rijn = SymmetricAlgorithm.Create(); //Creates the default implementation, which is RijndaelManaged.
+
+ SymmetricAlgorithm rijn = SymmetricAlgorithm.Create(); //Creates the default implementation, which is RijndaelManaged.
CryptoStream encStream = new CryptoStream(fout, rijn.CreateEncryptor(rijnKey, rijnIV), CryptoStreamMode.Write);
-
+
Console.WriteLine("Encrypting...");
-
+
//Read from the input file, then encrypt and write to the output file.
while(rdlen < totlen)
{
@@ -32,10 +32,10 @@ private static void EncryptData(String inName, String outName, byte[] rijnKey, b
rdlen = rdlen + len;
Console.WriteLine("{0} bytes processed", rdlen);
}
-
- encStream.Close();
+
+ encStream.Close();
fout.Close();
- fin.Close();
+ fin.Close();
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DES Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DES Example/CS/source.cs
index 8ac9a74f681..13323a427bf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DES Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DES Example/CS/source.cs
@@ -7,23 +7,23 @@ public class Form1: Form
{
//
private static void EncryptData(String inName, String outName, byte[] desKey, byte[] desIV)
- {
+ {
//Create the file streams to handle the input and output files.
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);
FileStream fout = new FileStream(outName, FileMode.OpenOrCreate, FileAccess.Write);
fout.SetLength(0);
-
+
//Create variables to help with read and write.
byte[] bin = new byte[100]; //This is intermediate storage for the encryption.
long rdlen = 0; //This is the total number of bytes written.
long totlen = fin.Length; //This is the total length of the input file.
int len; //This is the number of bytes to be written at a time.
-
- DES des = new DESCryptoServiceProvider();
+
+ DES des = new DESCryptoServiceProvider();
CryptoStream encStream = new CryptoStream(fout, des.CreateEncryptor(desKey, desIV), CryptoStreamMode.Write);
-
+
Console.WriteLine("Encrypting...");
-
+
//Read from the input file, then encrypt and write to the output file.
while(rdlen < totlen)
{
@@ -32,10 +32,10 @@ private static void EncryptData(String inName, String outName, byte[] desKey, by
rdlen = rdlen + len;
Console.WriteLine("{0} bytes processed", rdlen);
}
-
- encStream.Close();
+
+ encStream.Close();
fout.Close();
- fin.Close();
+ fin.Close();
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTime.ToString2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTime.ToString2 Example/CS/source.cs
index 9a5bb0383e9..3a739ecae08 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTime.ToString2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTime.ToString2 Example/CS/source.cs
@@ -1,8 +1,8 @@
//
using System;
- using System.Globalization;
-
-public class MainClass {
+ using System.Globalization;
+
+public class MainClass {
public static void Main(string[] args) {
DateTime dt = DateTime.Now;
String[] format = {
@@ -26,7 +26,7 @@ public static void Main(string[] args) {
date = dt.ToString(format[i], DateTimeFormatInfo.InvariantInfo);
Console.WriteLine(String.Concat(format[i], " :" , date));
}
-
+
/** Output.
*
* d :08/17/2000
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTimeFormatInfo.GetAllDateTimePatterns Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTimeFormatInfo.GetAllDateTimePatterns Example/CS/source.cs
index 857b485370e..1f0006943eb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTimeFormatInfo.GetAllDateTimePatterns Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DateTimeFormatInfo.GetAllDateTimePatterns Example/CS/source.cs
@@ -2,43 +2,43 @@
using System;
using System.Globalization;
public class SamplesDateTimeFormatInfo {
-
+
public static void Main() {
-
+
// Creates a new DateTimeFormatinfo.
DateTimeFormatInfo myDtfi = new DateTimeFormatInfo();
-
+
// Gets and prints all the patterns.
String[] myPatternsArray = myDtfi.GetAllDateTimePatterns();
Console.WriteLine( "ALL the patterns:" );
PrintIndexAndValues( myPatternsArray );
-
+
// Gets and prints the pattern(s) associated with some of the format characters.
myPatternsArray = myDtfi.GetAllDateTimePatterns('d');
Console.WriteLine( "The patterns for 'd':" );
PrintIndexAndValues( myPatternsArray );
-
+
myPatternsArray = myDtfi.GetAllDateTimePatterns('D');
Console.WriteLine( "The patterns for 'D':" );
PrintIndexAndValues( myPatternsArray );
-
+
myPatternsArray = myDtfi.GetAllDateTimePatterns('f');
Console.WriteLine( "The patterns for 'f':" );
PrintIndexAndValues( myPatternsArray );
-
+
myPatternsArray = myDtfi.GetAllDateTimePatterns('F');
Console.WriteLine( "The patterns for 'F':" );
PrintIndexAndValues( myPatternsArray );
-
+
myPatternsArray = myDtfi.GetAllDateTimePatterns('r');
Console.WriteLine( "The patterns for 'r':" );
PrintIndexAndValues( myPatternsArray );
-
+
myPatternsArray = myDtfi.GetAllDateTimePatterns('R');
Console.WriteLine( "The patterns for 'R':" );
PrintIndexAndValues( myPatternsArray );
}
-
+
public static void PrintIndexAndValues( String[] myArray ) {
int i = 0;
foreach ( String s in myArray )
@@ -48,7 +48,7 @@ public static void PrintIndexAndValues( String[] myArray ) {
}
-/*
+/*
This code produces the following output.
ALL the patterns:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug Example/CS/source.cs
index 3f3a5aabb06..d5772277be4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug Example/CS/source.cs
@@ -14,7 +14,7 @@ static void Main()
Debug.Indent();
Debug.WriteLine("Entering Main");
Console.WriteLine("Hello World.");
- Debug.WriteLine("Exiting Main");
+ Debug.WriteLine("Exiting Main");
Debug.Unindent();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert Example/CS/source.cs
index dcc68de88dc..03d41d7d285 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert Example/CS/source.cs
@@ -12,12 +12,12 @@ protected void Method()
//
// Create an index for an array.
int index;
-
+
// Perform some action that sets the index.
index = -40;
-
- // Test that the index value is valid.
- Debug.Assert(index > -1);
+
+ // Test that the index value is valid.
+ Debug.Assert(index > -1);
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert1 Example/CS/source.cs
index bdd754a1fac..525198e1252 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert1 Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Form1: Form
//
public static void MyMethod(Type type, Type baseType) {
Debug.Assert(type != null, "Type parameter is null");
-
+
// Perform some processing.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert2 Example/CS/source.cs
index e7fc05e9120..75251d057c0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Assert2 Example/CS/source.cs
@@ -8,9 +8,9 @@ public class Form1: Form
protected TextBox textBox1;
//
public static void MyMethod(Type type, Type baseType) {
- Debug.Assert(type != null, "Type parameter is null",
+ Debug.Assert(type != null, "Type parameter is null",
"Can't get object for null type");
-
+
// Perform some processing.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Close Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Close Example/CS/source.cs
index 81ca64811cd..0ad48080360 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Close Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Close Example/CS/source.cs
@@ -10,17 +10,17 @@ class Test
static void Main()
{
// Create a new stream object for an output file named TestFile.txt.
- using (FileStream myFileStream =
+ using (FileStream myFileStream =
new FileStream("TestFile.txt", FileMode.Append))
{
// Add the stream object to the trace listeners.
- TextWriterTraceListener myTextListener =
+ TextWriterTraceListener myTextListener =
new TextWriterTraceListener(myFileStream);
Debug.Listeners.Add(myTextListener);
-
+
// Write output to the file.
Debug.WriteLine("Test output");
-
+
// Flush and close the output stream.
Debug.Flush();
Debug.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Fail Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Fail Example/CS/source.cs
index b58bff8eb69..34fab3f9ecd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Fail Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Fail Example/CS/source.cs
@@ -28,9 +28,9 @@ protected void Method()
case Option.First:
result = 1.0;
break;
-
+
// Insert additional cases.
-
+
default:
Debug.Fail("Unknown Option " + option);
result = 1.0;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Fail1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Fail1 Example/CS/source.cs
index 897f6d49919..7920d15b899 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Fail1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Fail1 Example/CS/source.cs
@@ -17,7 +17,7 @@ protected void Method()
}
//
catch (Exception) {
- Debug.Fail("Invalid value: " + value.ToString(),
+ Debug.Fail("Invalid value: " + value.ToString(),
"Resetting value to newValue.");
value = newValue;
}
@@ -27,9 +27,9 @@ protected void Method()
case MyOption.First:
result = 1.0;
break;
-
+
// Insert additional cases.
-
+
default:
Debug.Fail("Unknown Option " + option1, "Result set to 1.0");
result = 1.0;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.IndentLevel Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.IndentLevel Example/CS/source.cs
index 14562442216..bec2f768957 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.IndentLevel Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.IndentLevel Example/CS/source.cs
@@ -16,7 +16,7 @@ protected void Method()
Debug.WriteLine("Error 2: Directory not found");
Debug.Unindent();
Debug.WriteLine("End of list of errors");
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Listeners Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Listeners Example/CS/source.cs
index b1f3e40f188..8093fd5027d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Listeners Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Listeners Example/CS/source.cs
@@ -10,9 +10,9 @@ class Form1: Form
protected void Method()
{
//
-/* Create a listener that outputs to the console screen, and
+/* Create a listener that outputs to the console screen, and
* add it to the debug listeners. */
- TextWriterTraceListener myWriter = new
+ TextWriterTraceListener myWriter = new
TextWriterTraceListener(System.Console.Out);
Debug.Listeners.Add(myWriter);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Write Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Write Example/CS/source.cs
index 03345df6cf5..362477e2aa9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Write Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.Write Example/CS/source.cs
@@ -10,12 +10,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Debug.Write(myObject, category);
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Debug.WriteLine(" Object is not valid for this category.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf Example/CS/source.cs
index 6d74d5724b4..8cbef805b8f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf Example/CS/source.cs
@@ -10,11 +10,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod() {
// Write the message if the TraceSwitch level is set to Error or higher.
Debug.WriteIf(generalSwitch.TraceError, "My error message. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Debug.WriteIf(generalSwitch.TraceVerbose, "My second error message.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf1 Example/CS/source.cs
index f36d768b980..e12ef2c5bb1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf1 Example/CS/source.cs
@@ -10,11 +10,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject) {
// Write the message if the TraceSwitch level is set to Error or higher.
Debug.WriteIf(generalSwitch.TraceError, myObject);
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Debug.WriteLineIf(generalSwitch.TraceVerbose, " is not a valid value for this method.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf2 Example/CS/source.cs
index 2b566cfc96e..60390d8dd2e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf2 Example/CS/source.cs
@@ -10,12 +10,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Verbose.
- Debug.WriteIf(generalSwitch.TraceVerbose, myObject.ToString() +
+ Debug.WriteIf(generalSwitch.TraceVerbose, myObject.ToString() +
" is not a valid object for category: ", category);
-
+
// Write a second message if the TraceSwitch level is set to Error or higher.
Debug.WriteLineIf(generalSwitch.TraceError, " Please use a different category.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf3 Example/CS/source.cs
index ae57137c89d..1ac0e989509 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteIf3 Example/CS/source.cs
@@ -10,11 +10,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Verbose.
Debug.WriteIf(generalSwitch.TraceVerbose, myObject, category);
-
+
// Write a second message if the TraceSwitch level is set to Error or higher.
Debug.WriteLineIf(generalSwitch.TraceError, " Object is not valid for this category.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine Example/CS/source.cs
index 5d00f6bcd12..ce8a4f08578 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine Example/CS/source.cs
@@ -10,12 +10,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod() {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Debug.Write("My error message. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Debug.WriteLine("My second error message.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine1 Example/CS/source.cs
index 05934275661..54622688f5e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine1 Example/CS/source.cs
@@ -10,12 +10,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject) {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Debug.Write("Invalid object. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Debug.WriteLine(myObject);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine2 Example/CS/source.cs
index 65ce80fa250..46cffae026f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine2 Example/CS/source.cs
@@ -10,12 +10,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(String category) {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Debug.Write("My error message. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Debug.WriteLine("My second error message.", category);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine3 Example/CS/source.cs
index 0573d0b4538..75b31daed89 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLine3 Example/CS/source.cs
@@ -10,12 +10,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Debug.Write("Invalid object for category. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Debug.WriteLine(myObject, category);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf Example/CS/source.cs
index db786d78268..4b29a58b157 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf Example/CS/source.cs
@@ -10,11 +10,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod() {
// Write the message if the TraceSwitch level is set to Error or higher.
Debug.WriteIf(generalSwitch.TraceError, "My error message. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Debug.WriteLineIf(generalSwitch.TraceVerbose, "My second error message.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf1 Example/CS/source.cs
index 5776fd9ca74..a5ddfe3aa4a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf1 Example/CS/source.cs
@@ -10,11 +10,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject) {
// Write the message if the TraceSwitch level is set to Error or higher.
Debug.WriteIf(generalSwitch.TraceError, "Invalid object. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Debug.WriteLineIf(generalSwitch.TraceVerbose, myObject);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf2 Example/CS/source.cs
index 46846866fab..6a1bfa81b41 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf2 Example/CS/source.cs
@@ -10,11 +10,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(String category) {
// Write the message if the TraceSwitch level is set to Error or higher.
Debug.WriteIf(generalSwitch.TraceError, "My error message. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Debug.WriteLineIf(generalSwitch.TraceVerbose, "My second error message.", category);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf3 Example/CS/source.cs
index 058531b0ea5..c2749b4419f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Debug.WriteLineIf3 Example/CS/source.cs
@@ -10,11 +10,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Error or higher.
Debug.WriteIf(generalSwitch.TraceError, "Invalid object for category. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Debug.WriteLineIf(generalSwitch.TraceVerbose, myObject, category);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Delegate Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Delegate Example/CS/source.cs
index 7e4dbf3a16f..a870499f981 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Delegate Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Delegate Example/CS/source.cs
@@ -46,10 +46,10 @@ public static void Main() {
/*
This code produces the following output:
-
+
5 is positive; use the sign "+".
-3 is negative; use the sign "-".
0 is zero; use the sign "".
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DispIdAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DispIdAttribute Example/CS/source.cs
index e006494ab89..47e6daccdac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DispIdAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic DispIdAttribute Example/CS/source.cs
@@ -7,11 +7,11 @@ public MyClass() {}
[DispId(8)]
public void MyMethod() {}
-
+
public int MyOtherMethod() {
return 0;
}
-
+
[DispId(9)]
public bool MyField;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Enum.ToString2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Enum.ToString2 Example/CS/source.cs
index 67fd8f0a9ca..6059e13badb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Enum.ToString2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Enum.ToString2 Example/CS/source.cs
@@ -3,7 +3,7 @@
public class EnumSample {
enum Colors {Red = 1, Blue = 2};
-
+
public static void Main() {
Enum myColors = Colors.Red;
Console.WriteLine("The value of this instance is '{0}'",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ErrorEventArgs Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ErrorEventArgs Example/CS/source.cs
index 381326005e6..160b4be20c2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ErrorEventArgs Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ErrorEventArgs Example/CS/source.cs
@@ -9,14 +9,14 @@ public class Form1: Form
public static void Main(string[] args) {
// Creates an exception with an error message.
Exception myException= new Exception("This is an exception test");
-
+
// Creates an ErrorEventArgs with the exception.
ErrorEventArgs myErrorEventArgs = new ErrorEventArgs(myException);
-
+
// Extracts the exception from the ErrorEventArgs and display it.
Exception myReturnedException = myErrorEventArgs.GetException();
MessageBox.Show("The returned exception is: " + myReturnedException.Message);
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ErrorEventArgs.ErrorEventArgs Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ErrorEventArgs.ErrorEventArgs Example/CS/source.cs
index d0632c2b152..571e4094eea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ErrorEventArgs.ErrorEventArgs Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ErrorEventArgs.ErrorEventArgs Example/CS/source.cs
@@ -9,10 +9,10 @@ public class Form1 : Form {
public static void Main(string[] args) {
//Creates an exception with an error message.
Exception myException= new Exception("This is an exception test");
-
+
//Creates an ErrorEventArgs with the exception.
ErrorEventArgs myErrorEventArgs = new ErrorEventArgs(myException);
-
+
//Extracts the exception from the ErrorEventArgs and display it.
Exception myReturnedException = myErrorEventArgs.GetException();
MessageBox.Show("The returned exception is: " + myReturnedException.Message);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Clear Example/CS/source.cs
index c23c6440a98..1e969fb9c8b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Clear Example/CS/source.cs
@@ -2,7 +2,7 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
@@ -11,8 +11,8 @@ public static void Main(){
EventLog myLog = new EventLog();
myLog.Log = "myNewLog";
- myLog.Clear();
- }
+ myLog.Clear();
+ }
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.CreateEventSource Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.CreateEventSource Example/CS/source.cs
index 79781a5d95f..4980c33058d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.CreateEventSource Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.CreateEventSource Example/CS/source.cs
@@ -2,11 +2,11 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
-
+
// Create the source, if it does not already exist.
if(!EventLog.SourceExists("MySource"))
{
@@ -20,14 +20,14 @@ public static void Main(){
// The source is created. Exit the application to allow it to be registered.
return;
}
-
+
// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "MySource";
-
- // Write an informational entry to the event log.
+
+ // Write an informational entry to the event log.
myLog.WriteEntry("Writing to event log.");
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Delete1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Delete1 Example/CS/source.cs
index 6daaab76da8..bc68acc1884 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Delete1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Delete1 Example/CS/source.cs
@@ -13,7 +13,7 @@ public static void Main()
if (EventLog.SourceExists("MySource", "MyMachine"))
{
- // Find the log associated with this source.
+ // Find the log associated with this source.
logName = EventLog.LogNameFromSourceName("MySource", "MyMachine");
// Make sure the source is in the log we believe it to be in.
if (logName != "MyLog")
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.DeleteEventSource Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.DeleteEventSource Example/CS/source.cs
index 469856d7c06..669aeec8ebf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.DeleteEventSource Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.DeleteEventSource Example/CS/source.cs
@@ -13,7 +13,7 @@ public static void Main()
if (EventLog.SourceExists("MySource"))
{
- // Find the log associated with this source.
+ // Find the log associated with this source.
logName = EventLog.LogNameFromSourceName("MySource", ".");
// Make sure the source is in the log we believe it to be in.
if (logName != "MyLog")
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EnableRaisingEvents Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EnableRaisingEvents Example/CS/source.cs
index df31bdcda79..e174cd7d7ad 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EnableRaisingEvents Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EnableRaisingEvents Example/CS/source.cs
@@ -2,14 +2,14 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
-
+
EventLog myNewLog = new EventLog();
- myNewLog.Log = "MyCustomLog";
-
+ myNewLog.Log = "MyCustomLog";
+
myNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten);
myNewLog.EnableRaisingEvents = true;
@@ -17,8 +17,8 @@ public static void Main(){
// Wait for the EntryWrittenEvent or a quit command.
while(Console.Read() != 'q'){
// Wait.
- }
- }
+ }
+ }
public static void MyOnEntryWritten(Object source, EntryWrittenEventArgs e){
Console.WriteLine("Written: " + e.Entry.Message);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Entries Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Entries Example/CS/source.cs
index bd126a0c0ee..b374bb941de 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Entries Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Entries Example/CS/source.cs
@@ -1,17 +1,17 @@
//
using System;
using System.Diagnostics;
-
+
class MySample{
public static void Main(){
EventLog myLog = new EventLog();
- myLog.Log = "MyNewLog";
+ myLog.Log = "MyNewLog";
foreach(EventLogEntry entry in myLog.Entries){
Console.WriteLine("\tEntry: " + entry.Message);
- }
- }
+ }
+ }
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EntryWritten Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EntryWritten Example/CS/source.cs
index 97e970fce0c..58a6b420f70 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EntryWritten Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EntryWritten Example/CS/source.cs
@@ -2,7 +2,7 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
// This member is used to wait for events.
@@ -11,18 +11,18 @@ class MySample{
public static void Main(){
signal = new AutoResetEvent(false);
- EventLog myNewLog = new EventLog("Application", ".", "testEventLogEvent");
-
+ EventLog myNewLog = new EventLog("Application", ".", "testEventLogEvent");
+
myNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten);
myNewLog.EnableRaisingEvents = true;
myNewLog.WriteEntry("Test message", EventLogEntryType.Information);
- signal.WaitOne();
- }
+ signal.WaitOne();
+ }
public static void MyOnEntryWritten(object source, EntryWrittenEventArgs e){
Console.WriteLine("In event handler");
signal.Set();
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EventLog2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EventLog2 Example/CS/source.cs
index 812fd8051a9..11152e2627b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EventLog2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EventLog2 Example/CS/source.cs
@@ -2,7 +2,7 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main()
@@ -26,8 +26,8 @@ public static void Main()
// Read the event log entries.
foreach(EventLogEntry entry in myLog.Entries){
Console.WriteLine("\tEntry: " + entry.Message);
- }
- }
+ }
+ }
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EventLog3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EventLog3 Example/CS/source.cs
index 1100ed82b0c..1bfcda2f78a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EventLog3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.EventLog3 Example/CS/source.cs
@@ -2,7 +2,7 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
@@ -22,9 +22,9 @@ public static void Main(){
// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog("myNewLog", ".", "MySource");
- // Write an entry to the log.
+ // Write an entry to the log.
myLog.WriteEntry("Writing to event log on " + myLog.MachineName);
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.GetEventLogs1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.GetEventLogs1 Example/CS/source.cs
index f8330d2d1a0..1ac17707126 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.GetEventLogs1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.GetEventLogs1 Example/CS/source.cs
@@ -2,21 +2,21 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
-
+
EventLog[] remoteEventLogs;
-
+
remoteEventLogs = EventLog.GetEventLogs("myServer");
-
+
Console.WriteLine("Number of logs on computer: " + remoteEventLogs.Length);
-
+
foreach(EventLog log in remoteEventLogs){
Console.WriteLine("Log: " + log.Log);
- }
- }
+ }
+ }
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Log Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Log Example/CS/source.cs
index 3ce8fb0f993..c8b4b8cc702 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Log Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Log Example/CS/source.cs
@@ -1,17 +1,17 @@
//
using System;
using System.Diagnostics;
-
+
class MySample{
public static void Main(){
EventLog myNewLog = new EventLog();
- myNewLog.Log = "NewEventLog";
+ myNewLog.Log = "NewEventLog";
foreach(EventLogEntry entry in myNewLog.Entries){
Console.WriteLine("\tEntry: " + entry.Message);
- }
- }
+ }
+ }
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.MachineName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.MachineName Example/CS/source.cs
index 4f55cad561d..fa8c775d5e5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.MachineName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.MachineName Example/CS/source.cs
@@ -1,18 +1,18 @@
//
using System;
using System.Diagnostics;
-
+
class MySample{
public static void Main(){
EventLog myNewLog = new EventLog();
myNewLog.Log = "NewEventLog";
- myNewLog.MachineName = "MyServer";
+ myNewLog.MachineName = "MyServer";
foreach(EventLogEntry entry in myNewLog.Entries){
Console.WriteLine("\tEntry: " + entry.Message);
- }
- }
+ }
+ }
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Source Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Source Example/CS/source.cs
index 9e2472df4ae..a4140ed1a7a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Source Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.Source Example/CS/source.cs
@@ -2,11 +2,11 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
-
+
// Create the source, if it does not already exist.
if(!EventLog.SourceExists("MySource"))
{
@@ -20,16 +20,16 @@ public static void Main(){
// The source is created. Exit the application to allow it to be registered.
return;
}
-
+
// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "MySource";
-
- // Write an informational entry to the event log.
+
+ // Write an informational entry to the event log.
myLog.WriteEntry("Writing to event log.");
-
- Console.WriteLine("Message written to event log.");
+
+ Console.WriteLine("Message written to event log.");
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.SourceExists1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.SourceExists1 Example/CS/source.cs
index d02283c0bd3..cedf98d1b1c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.SourceExists1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.SourceExists1 Example/CS/source.cs
@@ -2,11 +2,11 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
-
+
// Create the source, if it does not already exist.
if(!EventLog.SourceExists("MySource", "MyServer"))
{
@@ -20,16 +20,16 @@ public static void Main(){
// The source is created. Exit the application to allow it to be registered.
return;
}
-
+
// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "MySource";
-
- // Write an informational entry to the event log.
+
+ // Write an informational entry to the event log.
myLog.WriteEntry("Writing to event log.");
-
- Console.WriteLine("Message written to event log.");
+
+ Console.WriteLine("Message written to event log.");
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry1 Example/CS/source.cs
index 8dbca529cbb..870d0a02df2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry1 Example/CS/source.cs
@@ -2,11 +2,11 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
-
+
// Create the source, if it does not already exist.
if(!EventLog.SourceExists("MySource"))
{
@@ -21,7 +21,7 @@ public static void Main(){
return;
}
- // Write an informational entry to the event log.
+ // Write an informational entry to the event log.
EventLog.WriteEntry("MySource", "Writing to event log.");
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry2 Example/CS/source.cs
index 2a7a2b2c303..c2edc041191 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry2 Example/CS/source.cs
@@ -2,7 +2,7 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
@@ -10,10 +10,10 @@ public static void Main(){
// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog("MyNewLog");
myLog.Source = "MyNewLogSource";
-
- // Write an informational entry to the event log.
+
+ // Write an informational entry to the event log.
myLog.WriteEntry("Writing warning to event log.", EventLogEntryType.Warning);
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry3 Example/CS/source.cs
index fb5491fa082..4425cf841c3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLog.WriteEntry3 Example/CS/source.cs
@@ -2,16 +2,16 @@
using System;
using System.Diagnostics;
using System.Threading;
-
+
class MySample{
public static void Main(){
- // Write an informational entry to the event log.
- EventLog.WriteEntry("MySource",
- "Writing warning to event log.",
+ // Write an informational entry to the event log.
+ EventLog.WriteEntry("MySource",
+ "Writing warning to event log.",
EventLogEntryType.Warning);
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLogTraceListener Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLogTraceListener Example/CS/source.cs
index 9fcffb3711c..fd9b8a591ff 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLogTraceListener Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic EventLogTraceListener Example/CS/source.cs
@@ -11,13 +11,13 @@ public static void Main(string[] args) {
// Create a trace listener for the event log.
EventLogTraceListener myTraceListener = new EventLogTraceListener("myEventLogSource");
-
+
// Add the event log trace listener to the collection.
Trace.Listeners.Add(myTraceListener);
-
+
// Write output to the event log.
Trace.WriteLine("Test output");
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ExtensibleClassFactory Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ExtensibleClassFactory Example/CS/source.cs
index 5e9b8ef6166..bd5c8bed640 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ExtensibleClassFactory Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ExtensibleClassFactory Example/CS/source.cs
@@ -20,12 +20,12 @@ public class EcfInner : ECFSRV32Lib.BaseComponent
static CallBack callbackInner;
static void RegisterInner()
- {
+ {
callbackInner = new CallBack();
System.Runtime.InteropServices.ExtensibleClassFactory.RegisterObjectCreationCallback(new System.Runtime.InteropServices.ObjectCreationDelegate(callbackInner.Activate));
}
- //This is the static initializer.
+ //This is the static initializer.
static EcfInner()
{
RegisterInner();
@@ -49,7 +49,7 @@ public int CreateBaseComponent(int Aggregator)
{
return 0;
}
- }
+ }
interface IObjectActivator
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldAttributes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldAttributes Example/CS/source.cs
index a0da3f93d26..497b27506d3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldAttributes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldAttributes Example/CS/source.cs
@@ -22,7 +22,7 @@ public static void Main()
{
Console.WriteLine ("\nReflection.FieldAttributes");
Demo d = new Demo();
-
+
// Get a Type object for Demo, and a FieldInfo for each of
// the three fields. Use the FieldInfo to display field
// name, value for the Demo object in d, and attributes.
@@ -42,10 +42,10 @@ public static void Main()
}
static void DisplayField(Object obj, FieldInfo f)
- {
+ {
// Display the field name, value, and attributes.
//
- Console.WriteLine("{0} = \"{1}\"; attributes: {2}",
+ Console.WriteLine("{0} = \"{1}\"; attributes: {2}",
f.Name, f.GetValue(obj), f.Attributes);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.FieldType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.FieldType Example/CS/source.cs
index 1b72e420257..cc86e14fa5f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.FieldType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.FieldType Example/CS/source.cs
@@ -7,18 +7,18 @@ public class TestClass
// Define a field.
private string field = "private field";
}
-
+
public class Example
{
public static void Main()
{
var cl= new TestClass();
-
+
// Get the type and FieldInfo.
Type t = cl.GetType();
- FieldInfo fi = t.GetField("field",
+ FieldInfo fi = t.GetField("field",
BindingFlags.Instance | BindingFlags.NonPublic);
-
+
// Get and display the field type.
Console.WriteLine("Field Name: {0}.{1}", t.FullName, fi.Name);
Console.WriteLine("Field Value: '{0}'", fi.GetValue(cl));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsAssembly Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsAssembly Example/CS/source.cs
index 0a0a76ca31a..2fb53c25f57 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsAssembly Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsAssembly Example/CS/source.cs
@@ -11,14 +11,14 @@ public class Example
public static void Main()
{
- Console.WriteLine("\n{0,-30}{1,-18}{2}", "", "IsAssembly", "IsFamilyOrAssembly");
- Console.WriteLine("{0,-21}{1,-18}{2,-18}{3}\n",
+ Console.WriteLine("\n{0,-30}{1,-18}{2}", "", "IsAssembly", "IsFamilyOrAssembly");
+ Console.WriteLine("{0,-21}{1,-18}{2,-18}{3}\n",
"", "IsPublic", "IsFamily", "IsFamilyAndAssembly");
-
+
foreach (FieldInfo f in typeof(Example).GetFields(
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public))
{
- Console.WriteLine("{0,-21}{1,-9}{2,-9}{3,-9}{4,-9}{5,-9}",
+ Console.WriteLine("{0,-21}{1,-9}{2,-9}{3,-9}{4,-9}{5,-9}",
f.Name,
f.IsPublic,
f.IsAssembly,
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsInitOnly Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsInitOnly Example/CS/source.cs
index dcf0bd9d5ee..74f68f2629a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsInitOnly Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsInitOnly Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Myfieldb
{
public readonly string field = "B - readonly field";
}
-
+
public class Myfieldinfo
{
public static int Main()
@@ -20,7 +20,7 @@ public static int Main()
Console.WriteLine("\nReflection.FieldInfo");
Myfielda Myfielda = new Myfielda();
Myfieldb Myfieldb = new Myfieldb();
-
+
//Get the Type and FieldInfo.
Type MyTypea = typeof(Myfielda);
FieldInfo Myfieldinfoa = MyTypea.GetField("field",
@@ -28,25 +28,25 @@ public static int Main()
Type MyTypeb = typeof(Myfieldb);
FieldInfo Myfieldinfob = MyTypeb.GetField("field",
BindingFlags.Public | BindingFlags.Instance);
-
+
//Modify the fields.
//Note that Myfieldb is not modified, as it is
//read-only (IsInitOnly is True).
Myfielda.field = "A - modified";
//Myfieldb.field = "B - modified";
-
+
//For the first field, get and display the name, field, and IsInitOnly state.
Console.Write("\n{0} - {1}, IsInitOnly = {2} ",
MyTypea.FullName,
Myfieldinfoa.GetValue(Myfielda),
Myfieldinfoa.IsInitOnly);
-
+
//For the second field get and display the name, field, and IsInitOnly state.
Console.Write("\n{0} - {1}, IsInitOnly = {2} ",
MyTypeb.FullName,
Myfieldinfob.GetValue(Myfieldb),
Myfieldinfob.IsInitOnly);
-
+
return 0;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsPublic Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsPublic Example/CS/source.cs
index d8cf024dc2b..43e2cdcb91b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsPublic Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsPublic Example/CS/source.cs
@@ -18,7 +18,7 @@ class Myfieldb // public
{
public string SomeField = "public field";
}
-
+
public
class Myfieldinfo
{
@@ -27,27 +27,27 @@ public static int Main()
Console.WriteLine("\nReflection.FieldInfo");
Myfielda Myfielda = new Myfielda();
Myfieldb Myfieldb = new Myfieldb();
-
+
// Get the Type and FieldInfo.
Type MyTypea = typeof(Myfielda);
- FieldInfo Myfieldinfoa = MyTypea.GetField("SomeField",
+ FieldInfo Myfieldinfoa = MyTypea.GetField("SomeField",
BindingFlags.NonPublic|BindingFlags.Instance);
Type MyTypeb = typeof(Myfieldb);
FieldInfo Myfieldinfob = MyTypeb.GetField("SomeField");
-
+
// Get and display the IsPublic and IsPrivate property values.
Console.Write("\n{0}.", MyTypea.FullName);
Console.Write("{0} - ", Myfieldinfoa.Name);
Console.Write("{0}", Myfielda.Field);
Console.Write("\n IsPublic = {0}", Myfieldinfoa.IsPublic);
Console.Write("\n IsPrivate = {0}", Myfieldinfoa.IsPrivate);
-
+
Console.Write("\n{0}.", MyTypeb.FullName);
Console.Write("{0} - ", Myfieldinfob.Name);
Console.Write("{0};", Myfieldb.SomeField);
Console.Write("\n IsPublic = {0}", Myfieldinfob.IsPublic);
Console.Write("\n IsPrivate = {0}", Myfieldinfob.IsPrivate);
-
+
return 0;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsStatic Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsStatic Example/CS/source.cs
index 818d342ac3c..93cd4e85464 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsStatic Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.IsStatic Example/CS/source.cs
@@ -15,13 +15,13 @@ public string Field
public class Myfieldb
{
static string field = "B private static field";
- public string Field
+ public string Field
{
get{return field;}
set{if(field!=value){field=value;}}
}
}
-
+
public class Myfieldinfo
{
public static int Main()
@@ -29,23 +29,23 @@ public static int Main()
Console.WriteLine("\nReflection.FieldInfo");
Myfielda Myfielda = new Myfielda();
Myfieldb Myfieldb = new Myfieldb();
-
+
// Get the Type and FieldInfo.
Type MyTypea = typeof(Myfielda);
FieldInfo Myfieldinfoa = MyTypea.GetField("field", BindingFlags.NonPublic|BindingFlags.Instance);
Type MyTypeb = typeof(Myfieldb);
FieldInfo Myfieldinfob = MyTypeb.GetField("field", BindingFlags.NonPublic|BindingFlags.Static);
-
+
// For the first field, get and display the name, field, and IsStatic property value.
Console.Write("\n{0} - ", MyTypea.FullName);
Console.Write("{0}; ", Myfieldinfoa.GetValue(Myfielda));
Console.Write("IsStatic - {0}", Myfieldinfoa.IsStatic);
-
+
// For the second field get and display the name, field, and IsStatic property value.
Console.Write("\n{0} - ", MyTypeb.FullName);
Console.Write("{0}; ", Myfieldinfob.GetValue(Myfieldb));
Console.Write("IsStatic - {0}", Myfieldinfob.IsStatic);
-
+
return 0;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.MemberType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.MemberType Example/CS/source.cs
index 62f083dba9c..c404bda07b6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.MemberType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FieldInfo.MemberType Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Reflection;
-
+
// Make a field.
public class Myfield
{
@@ -11,18 +11,18 @@ public string Field
get{return field;}
}
}
-
+
public class Myfieldinfo
{
public static int Main()
{
Console.WriteLine ("\nReflection.FieldInfo");
Myfield Myfield = new Myfield();
-
+
// Get the Type and FieldInfo.
Type MyType = typeof(Myfield);
FieldInfo Myfieldinfo = MyType.GetField("field", BindingFlags.NonPublic|BindingFlags.Instance);
-
+
// Get and display the MemberType.
Console.Write ("\n{0}.", MyType.FullName);
Console.Write ("{0} - ", Myfieldinfo.Name);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileAccess Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileAccess Example/CS/source.cs
index 349700445fd..53d50c0299f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileAccess Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileAccess Example/CS/source.cs
@@ -9,5 +9,5 @@ protected void Method(string name)
//
FileStream s2 = new FileStream(name, FileMode.Open, FileAccess.Read, FileShare.Read);
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileIOPermission Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileIOPermission Example/CS/source.cs
index 1a707b82004..8b0de474657 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileIOPermission Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileIOPermission Example/CS/source.cs
@@ -21,7 +21,7 @@ static void Main(string[] args)
}
//
-
+
//
FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Read, "C:\\test_r");
f2.AddPathList(FileIOPermissionAccess.Write | FileIOPermissionAccess.Read, "C:\\example\\out.txt");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.CanRead Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.CanRead Example/CS/source.cs
index 0a73a25e96a..0e22bdd1177 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.CanRead Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.CanRead Example/CS/source.cs
@@ -1,8 +1,8 @@
//
using System;
using System.IO;
-
-class TestRW
+
+class TestRW
{
public static void Main(String[] args)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.CanWrite Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.CanWrite Example/CS/source.cs
index cec8228af45..80b69107c52 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.CanWrite Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.CanWrite Example/CS/source.cs
@@ -1,8 +1,8 @@
//
using System;
using System.IO;
-
-class TestRW
+
+class TestRW
{
public static void Main(String[] args)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.Length Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.Length Example/CS/source.cs
index 8a3653aa606..46678806a11 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.Length Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileStream.Length Example/CS/source.cs
@@ -12,5 +12,5 @@ protected void Method(FileStream s)
Console.WriteLine("End of file has been reached.");
}
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileMajorPart Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileMajorPart Example/CS/source.cs
index eb334b1d40a..2e99ca717b6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileMajorPart Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileMajorPart Example/CS/source.cs
@@ -9,10 +9,10 @@ public class Form1: Form
private void GetFileMajorPart() {
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
-
+
// Print the file major part number.
textBox1.Text = "File major part number: " + myFileVersionInfo.FileMajorPart;
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileMinorPart Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileMinorPart Example/CS/source.cs
index ef2ecfdb2da..5c698301590 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileMinorPart Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileMinorPart Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1: Form
{
protected TextBox textBox1;
-
+
//
private void GetFileMinorPart()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileName Example/CS/source.cs
index afa9cc2834b..78081d92155 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FileName Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1: Form
{
protected TextBox textBox1;
-
+
//
private void GetFileName()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FilePrivatePart Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FilePrivatePart Example/CS/source.cs
index 25f58977750..ba0a81faf06 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FilePrivatePart Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.FilePrivatePart Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1: Form
{
protected TextBox textBox1;
-
+
//
private void GetFilePrivatePart()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.InternalName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.InternalName Example/CS/source.cs
index b7235f036e4..26bcc1d26b1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.InternalName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.InternalName Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1: Form
{
protected TextBox textBox1;
-
+
//
private void GetInternalName()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.IsPatched Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.IsPatched Example/CS/source.cs
index 8fc4ffb329b..af6aa299bac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.IsPatched Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.IsPatched Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1: Form
{
protected TextBox textBox1;
-
+
//
private void GetIsPatched()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.LegalCopyright Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.LegalCopyright Example/CS/source.cs
index 60c3ad35d91..55724e7f7be 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.LegalCopyright Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.LegalCopyright Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1 : Form
{
protected TextBox textBox1;
-
+
//
private void GetCopyright()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.PrivateBuild Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.PrivateBuild Example/CS/source.cs
index 341842c4054..adb0f334b11 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.PrivateBuild Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.PrivateBuild Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1: Form
{
protected TextBox textBox1;
-
+
//
private void GetPrivateBuild()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductMajorPart Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductMajorPart Example/CS/source.cs
index 8bca02fe805..dd58e312412 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductMajorPart Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductMajorPart Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1 : Form
{
protected TextBox textBox1;
-
+
//
private void GetProductMajorPart()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductPrivatePart Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductPrivatePart Example/CS/source.cs
index 5d39326666f..f4acf97a7c3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductPrivatePart Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductPrivatePart Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1 : Form
{
protected TextBox textBox1;
-
+
//
private void GetProductPrivatePart()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductVersion Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductVersion Example/CS/source.cs
index 4752ae85455..5acaac8e5b7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductVersion Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.ProductVersion Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1 : Form
{
protected TextBox textBox1;
-
+
//
private void GetProductVersion()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.SpecialBuild Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.SpecialBuild Example/CS/source.cs
index 25f144cc71f..ec27ab3f6e4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.SpecialBuild Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic FileVersionInfo.SpecialBuild Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Form1: Form
{
protected TextBox textBox1;
-
+
//
private void GetSpecialBuild()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic GuidAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic GuidAttribute Example/CS/source.cs
index dc334e26990..1cfd9273f51 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic GuidAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic GuidAttribute Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.Runtime.InteropServices;
[GuidAttribute("9ED54F84-A89D-4fcd-A854-44251E925F09")]
-public class SampleClass
+public class SampleClass
{
// Insert class members here.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hash.MD5 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hash.MD5 Example/CS/source.cs
index 3e68519f8fc..f72b9ce40a1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hash.MD5 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hash.MD5 Example/CS/source.cs
@@ -13,5 +13,5 @@ protected void Method()
Hash hash = new Hash ( myAssembly );
Byte[] hashcode = hash.MD5;
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hash.SHA1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hash.SHA1 Example/CS/source.cs
index ebd35c2113b..ad26262666f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hash.SHA1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hash.SHA1 Example/CS/source.cs
@@ -13,5 +13,5 @@ protected void Method()
Hash hash = new Hash ( myAssembly );
Byte[] hashcode = hash.SHA1;
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic HashAlgorithm Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic HashAlgorithm Example/CS/source.cs
index d32c15ecf6f..c5ad4dd8ce5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic HashAlgorithm Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic HashAlgorithm Example/CS/source.cs
@@ -13,5 +13,5 @@ protected void Method()
HashAlgorithm sha = new SHA1CryptoServiceProvider();
byte[] result = sha.ComputeHash(dataArray);
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable Example/CS/source.cs
index df58b0532c5..814b9dafdba 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable Example/CS/source.cs
@@ -3,16 +3,16 @@
using System.Collections;
public class SamplesHashtable
{
-
+
public static void Main()
{
-
+
// Creates and initializes a new Hashtable.
var myHT = new Hashtable();
myHT.Add("First", "Hello");
myHT.Add("Second", "World");
myHT.Add("Third", "!");
-
+
// Displays the properties and values of the Hashtable.
Console.WriteLine("myHT");
Console.WriteLine($" Count: {myHT.Count}");
@@ -30,9 +30,9 @@ public static void PrintKeysAndValues( Hashtable myHT )
}
- /*
+ /*
This code produces the following output.
-
+
myHT
Count: 3
Keys and Values:
@@ -41,5 +41,5 @@ This code produces the following output.
Third: !
First: Hello
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Add Example/CS/source.cs
index 50d45bba6ed..ada925c96cd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Add Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.Collections;
public class SamplesHashtable
{
-
+
public static void Main()
{
// Creates and initializes a new Hashtable.
@@ -12,7 +12,7 @@ public static void Main()
myHT.Add("two", "quick");
myHT.Add("three", "brown");
myHT.Add("four", "fox");
-
+
// Displays the Hashtable.
Console.WriteLine("The Hashtable contains the following:");
PrintKeysAndValues(myHT);
@@ -26,14 +26,14 @@ public static void PrintKeysAndValues( Hashtable myHT )
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The Hashtable contains the following:
-KEY- -VALUE-
two: quick
three: brown
four: fox
one: The
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Clear Example/CS/source.cs
index 3b40d048995..07043febf80 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Clear Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.Collections;
public class SamplesHashtable
{
-
+
public static void Main()
{
// Creates and initializes a new Hashtable.
@@ -13,16 +13,16 @@ public static void Main()
myHT.Add("three", "brown");
myHT.Add("four", "fox");
myHT.Add("five", "jumps");
-
+
// Displays the count and values of the Hashtable.
Console.WriteLine("Initially,");
Console.WriteLine($" Count : {myHT.Count}");
Console.WriteLine(" Values:");
PrintKeysAndValues(myHT);
-
+
// Clears the Hashtable.
myHT.Clear();
-
+
// Displays the count and values of the Hashtable.
Console.WriteLine("After Clear,");
Console.WriteLine(" Count : {myHT.Count}");
@@ -40,9 +40,9 @@ public static void PrintKeysAndValues( Hashtable myHT )
}
- /*
+ /*
This code produces the following output.
-
+
Initially,
Count : 5
Values:
@@ -58,6 +58,6 @@ This code produces the following output.
Values:
-KEY- -VALUE-
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Contains Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Contains Example/CS/source.cs
index 5bf87b37fe5..6df6a149701 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Contains Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Contains Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.Collections;
public class SamplesHashtable
{
-
+
public static void Main()
{
// Creates and initializes a new Hashtable.
@@ -13,17 +13,17 @@ public static void Main()
myHT.Add(2, "two");
myHT.Add(3, "three");
myHT.Add(4, "four");
-
+
// Displays the values of the Hashtable.
Console.WriteLine("The Hashtable contains the following values:");
PrintIndexAndKeysAndValues(myHT);
-
+
// Searches for a specific key.
int myKey = 2;
Console.WriteLine("The key \"{0}\" is {1}.", myKey, myHT.ContainsKey(myKey) ? "in the Hashtable" : "NOT in the Hashtable");
myKey = 6;
Console.WriteLine("The key \"{0}\" is {1}.", myKey, myHT.ContainsKey(myKey) ? "in the Hashtable" : "NOT in the Hashtable");
-
+
// Searches for a specific value.
var myValue = "three";
Console.WriteLine("The value \"{0}\" is {1}.", myValue, myHT.ContainsValue( myValue ) ? "in the Hashtable" : "NOT in the Hashtable");
@@ -42,9 +42,9 @@ public static void PrintIndexAndKeysAndValues(Hashtable myHT)
}
- /*
+ /*
This code produces the following output.
-
+
The Hashtable contains the following values:
-INDEX- -KEY- -VALUE-
[0]: 4 four
@@ -58,5 +58,5 @@ The key "6" is NOT in the Hashtable.
The value "three" is in the Hashtable.
The value "nine" is NOT in the Hashtable.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.CopyTo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.CopyTo Example/CS/source.cs
index d229fd90ffa..b8ea5f00734 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.CopyTo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.CopyTo Example/CS/source.cs
@@ -3,14 +3,14 @@
using System.Collections;
public class SamplesHashtable
{
-
+
public static void Main()
{
// Creates and initializes the source Hashtable.
var mySourceHT = new Hashtable();
mySourceHT.Add("A", "valueA");
mySourceHT.Add("B", "valueB");
-
+
// Creates and initializes the one-dimensional target Array.
var myTargetArray = new String[15];
myTargetArray[0] = "The";
@@ -22,26 +22,26 @@ public static void Main()
myTargetArray[6] = "the";
myTargetArray[7] = "lazy";
myTargetArray[8] = "dog";
-
+
// Displays the values of the target Array.
Console.WriteLine("The target Array contains the following before:");
PrintValues(myTargetArray, ' ');
-
+
// Copies the keys in the source Hashtable to the target Hashtable, starting at index 6.
Console.WriteLine("After copying the keys, starting at index 6:");
mySourceHT.Keys.CopyTo(myTargetArray, 6);
-
+
// Displays the values of the target Array.
PrintValues(myTargetArray, ' ');
-
+
// Copies the values in the source Hashtable to the target Hashtable, starting at index 6.
Console.WriteLine("After copying the values, starting at index 6:");
mySourceHT.Values.CopyTo(myTargetArray, 6);
-
+
// Displays the values of the target Array.
PrintValues(myTargetArray, ' ');
}
-
+
public static void PrintValues(String[] myArr, char mySeparator)
{
for (int i = 0; i < myArr.Length; i++)
@@ -49,9 +49,9 @@ public static void PrintValues(String[] myArr, char mySeparator)
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The target Array contains the following before:
The quick brown fox jumps over the lazy dog
After copying the keys, starting at index 6:
@@ -59,5 +59,5 @@ The quick brown fox jumps over B A dog
After copying the values, starting at index 6:
The quick brown fox jumps over valueB valueA dog
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.IsSynchronized Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.IsSynchronized Example/CS/source.cs
index 155739cac36..a0bdd8f8427 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.IsSynchronized Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.IsSynchronized Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.Collections;
public class SamplesHashtable
{
-
+
public static void Main()
{
// Creates and initializes a new Hashtable.
@@ -13,19 +13,19 @@ public static void Main()
myHT.Add(2, "two");
myHT.Add(3, "three");
myHT.Add(4, "four");
-
+
// Creates a synchronized wrapper around the Hashtable.
Hashtable mySyncdHT = Hashtable.Synchronized(myHT);
-
+
// Displays the sychronization status of both Hashtables.
Console.WriteLine("myHT is {0}.", myHT.IsSynchronized ? "synchronized" : "not synchronized" );
Console.WriteLine("mySyncdHT is {0}.", mySyncdHT.IsSynchronized ? "synchronized" : "not synchronized");
}
}
- /*
+ /*
This code produces the following output.
-
+
myHT is not synchronized.
mySyncdHT is synchronized.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Remove Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Remove Example/CS/source.cs
index 6dad0e2a294..328be1cd07c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Remove Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Hashtable.Remove Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.Collections;
public class SamplesHashtable
{
-
+
public static void Main()
{
// Creates and initializes a new Hashtable.
@@ -17,14 +17,14 @@ public static void Main()
myHT.Add("3a", "the");
myHT.Add("3b", "lazy");
myHT.Add("3c", "dog");
-
+
// Displays the Hashtable.
Console.WriteLine("The Hashtable initially contains the following:");
PrintKeysAndValues(myHT);
-
+
// Removes the element with the key "3b".
myHT.Remove("3b");
-
+
// Displays the current state of the Hashtable.
Console.WriteLine("After removing \"lazy\":");
PrintKeysAndValues(myHT);
@@ -41,7 +41,7 @@ public static void PrintKeysAndValues(Hashtable myHT)
/*
This code produces the following output.
-
+
The Hashtable initially contains the following:
2c: over
3a: the
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic IReflect.InvokeMember Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic IReflect.InvokeMember Example/CS/source.cs
index 12878e48e14..f7d8d1eba45 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic IReflect.InvokeMember Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic IReflect.InvokeMember Example/CS/source.cs
@@ -2,12 +2,12 @@
using System;
using System.Reflection;
-public class MainClass
-{
+public class MainClass
+{
public static void Main(string[] args)
{
Type tDate = typeof(System.DateTime);
- Object result = tDate.InvokeMember("Now",
+ Object result = tDate.InvokeMember("Now",
BindingFlags.GetProperty, null, null, new Object[0]);
Console.WriteLine(result.ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic InterfaceTypeAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic InterfaceTypeAttribute Example/CS/source.cs
index e6197a3fb5d..62cc29a7b11 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic InterfaceTypeAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic InterfaceTypeAttribute Example/CS/source.cs
@@ -2,14 +2,14 @@
using System.Runtime.InteropServices;
//Interface is exposed to COM as dual.
-interface IMyInterface1
+interface IMyInterface1
{
//Insert code here.
}
//Interface is exposed to COM as IDispatch.
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
-interface IMyInterface2
+interface IMyInterface2
{
//Insert code here.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MarshalByRefObject.InitializeLifetimeService Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MarshalByRefObject.InitializeLifetimeService Example/CS/source.cs
index b4bd01bd3bf..f9f7a6a1d7c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MarshalByRefObject.InitializeLifetimeService Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MarshalByRefObject.InitializeLifetimeService Example/CS/source.cs
@@ -5,7 +5,7 @@
//
public class MyClass : MarshalByRefObject
{
- [SecurityPermissionAttribute(SecurityAction.Demand,
+ [SecurityPermissionAttribute(SecurityAction.Demand,
Flags=SecurityPermissionFlag.Infrastructure)]
public override Object InitializeLifetimeService()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.DeclaringType Example/CS/Example2.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.DeclaringType Example/CS/Example2.cs
index 1cd38adeb64..064fda0ab3d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.DeclaringType Example/CS/Example2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.DeclaringType Example/CS/Example2.cs
@@ -2,28 +2,28 @@
using System;
using System.Reflection;
-interface IValue
+interface IValue
{
int GetValue() ;
};
-
-class A : IValue
+
+class A : IValue
{
- public virtual int GetValue()
- {
- return 0;
+ public virtual int GetValue()
+ {
+ return 0;
}
};
-
-class B : A
+
+class B : A
{
- public new int GetValue()
- {
- return 0;
+ public new int GetValue()
+ {
+ return 0;
}
};
-
-class C : A
+
+class C : A
{ };
class D : A
@@ -56,14 +56,14 @@ private static void ShowMembersAndDeclaringTypes(Type t)
MemberInfo[] members = t.GetMembers();
Console.WriteLine("{0} Members: ", t.Name);
foreach (var member in members)
- Console.WriteLine(" {0}, Declaring type: {1}",
- member.Name, member.DeclaringType.Name);
+ Console.WriteLine(" {0}, Declaring type: {1}",
+ member.Name, member.DeclaringType.Name);
}
}
// The example displays the following output:
// IValue Members:
// GetValue, Declaring type: IValue
-//
+//
// A Members:
// GetValue, Declaring type: A
// ToString, Declaring type: Object
@@ -71,7 +71,7 @@ private static void ShowMembersAndDeclaringTypes(Type t)
// GetHashCode, Declaring type: Object
// GetType, Declaring type: Object
// .ctor, Declaring type: A
-//
+//
// B Members:
// GetValue, Declaring type: B
// GetValue, Declaring type: A
@@ -80,7 +80,7 @@ private static void ShowMembersAndDeclaringTypes(Type t)
// GetHashCode, Declaring type: Object
// GetType, Declaring type: Object
// .ctor, Declaring type: B
-//
+//
// C Members:
// GetValue, Declaring type: A
// ToString, Declaring type: Object
@@ -88,7 +88,7 @@ private static void ShowMembersAndDeclaringTypes(Type t)
// GetHashCode, Declaring type: Object
// GetType, Declaring type: Object
// .ctor, Declaring type: C
-//
+//
// D Members:
// GetValue, Declaring type: D
// ToString, Declaring type: Object
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.DeclaringType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.DeclaringType Example/CS/source.cs
index eadc9aae0c8..c7aaea09498 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.DeclaringType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.DeclaringType Example/CS/source.cs
@@ -2,62 +2,62 @@
using System;
using System.Reflection;
-interface i
+interface i
{
int GetValuue() ;
};
// DeclaringType for MyVar is i.
-
- class A : i
+
+ class A : i
{
public int MyVar() { return 0; }
};
// DeclaringType for MyVar is A.
-
- class B : A
+
+ class B : A
{
new int MyVar() { return 0; }
};
// DeclaringType for MyVar is B.
-
- class C : A
+
+ class C : A
{
};
// DeclaringType for MyVar is A.
-namespace MyNamespace2
+namespace MyNamespace2
{
- class Mymemberinfo
- {
-
- public static void Main(string[] args)
- {
-
+ class Mymemberinfo
+ {
+
+ public static void Main(string[] args)
+ {
+
Console.WriteLine ("\nReflection.MemberInfo");
-
- //Get the Type and MemberInfo.
+
+ //Get the Type and MemberInfo.
Type MyType =Type.GetType("System.IO.BufferedStream");
MemberInfo[] Mymemberinfoarray = MyType.GetMembers();
-
- //Get and display the DeclaringType method.
- Console.WriteLine("\nThere are {0} members in {1}.", Mymemberinfoarray.Length, MyType.FullName);
-
- foreach (MemberInfo Mymemberinfo in Mymemberinfoarray)
- {
- Console.WriteLine("Declaring type of {0} is {1}.", Mymemberinfo.Name, Mymemberinfo.DeclaringType);
+
+ //Get and display the DeclaringType method.
+ Console.WriteLine("\nThere are {0} members in {1}.", Mymemberinfoarray.Length, MyType.FullName);
+
+ foreach (MemberInfo Mymemberinfo in Mymemberinfoarray)
+ {
+ Console.WriteLine("Declaring type of {0} is {1}.", Mymemberinfo.Name, Mymemberinfo.DeclaringType);
}
}
}
}
-namespace MyNamespace3
+namespace MyNamespace3
{
- class A
+ class A
{
virtual public void M () {}
}
- class B: A
+ class B: A
{
override public void M () {}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.MemberType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.MemberType Example/CS/source.cs
index 4d150a161d6..9b69b525453 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.MemberType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.MemberType Example/CS/source.cs
@@ -1,24 +1,24 @@
//
using System;
using System.Reflection;
-
+
class Mymemberinfo
{
public static int Main()
{
Console.WriteLine ("\nReflection.MemberInfo");
-
+
// Get the Type and MemberInfo.
Type MyType = Type.GetType("System.Reflection.PropertyInfo");
MemberInfo[] Mymemberinfoarray = MyType.GetMembers();
-
+
// Get the MemberType method and display the elements.
Console.Write("\nThere are {0} members in ", Mymemberinfoarray.GetLength(0));
Console.Write("{0}.", MyType.FullName);
-
+
for (int counter = 0; counter < Mymemberinfoarray.Length; counter++)
{
- Console.Write("\n" + counter + ". "
+ Console.Write("\n" + counter + ". "
+ Mymemberinfoarray[counter].Name
+ " Member type - " +
Mymemberinfoarray[counter].MemberType.ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.Name Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.Name Example/CS/source.cs
index f840a34fcae..3c7637adc15 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.Name Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MemberInfo.Name Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Reflection;
-
+
class Example
{
public static void Main()
@@ -9,13 +9,13 @@ public static void Main()
// Get the Type and MemberInfo.
Type t = Type.GetType("System.Empty");
MemberInfo[] memberArray = t.GetMembers();
-
+
// Get and display the type that declares the member.
Console.WriteLine("There are {0} members in {1}",
memberArray.Length, t.FullName);
-
+
foreach (var member in memberArray) {
- Console.WriteLine("Member {0} declared by {1}",
+ Console.WriteLine("Member {0} declared by {1}",
member.Name, member.DeclaringType);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodAttributes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodAttributes Example/CS/source.cs
index 642b4220944..4a0f4ab9d5f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodAttributes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodAttributes Example/CS/source.cs
@@ -1,30 +1,30 @@
//
using System;
using System.Reflection;
-
+
class AttributesSample
{
public void Mymethod (int int1m, out string str2m, ref string str3m)
{
str2m = "in Mymethod";
}
-
+
public static int Main(string[] args)
- {
+ {
Console.WriteLine ("Reflection.MethodBase.Attributes Sample");
-
+
// Get the type of the chosen class.
Type MyType = Type.GetType("AttributesSample");
-
+
// Get the method Mymethod on the type.
MethodBase Mymethodbase = MyType.GetMethod("Mymethod");
-
+
// Display the method name and signature.
Console.WriteLine("Mymethodbase = " + Mymethodbase);
-
+
// Get the MethodAttribute enumerated value.
MethodAttributes Myattributes = Mymethodbase.Attributes;
-
+
// Display the flags that are set.
PrintAttributes(typeof(System.Reflection.MethodAttributes), (int) Myattributes);
return 0;
@@ -33,7 +33,7 @@ public static int Main(string[] args)
public static void PrintAttributes(Type attribType, int iAttribValue)
{
if (!attribType.IsEnum) {Console.WriteLine("This type is not an enum."); return;}
-
+
FieldInfo[] fields = attribType.GetFields(BindingFlags.Public | BindingFlags.Static);
for (int i = 0; i < fields.Length; i++)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.Attributes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.Attributes Example/CS/source.cs
index e65c296d1e8..7290f66194e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.Attributes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.Attributes Example/CS/source.cs
@@ -2,30 +2,30 @@
using System;
using System.Reflection;
-
+
class AttributesSample
{
public void Mymethod (int int1m, out string str2m, ref string str3m)
{
str2m = "in Mymethod";
}
-
+
public static int Main(string[] args)
- {
+ {
Console.WriteLine ("Reflection.MethodBase.Attributes Sample");
-
+
// Get the type.
Type MyType = Type.GetType("AttributesSample");
-
+
// Get the method Mymethod on the type.
MethodBase Mymethodbase = MyType.GetMethod("Mymethod");
-
+
// Display the method name.
Console.WriteLine("Mymethodbase = " + Mymethodbase);
-
+
// Get the MethodAttribute enumerated value.
MethodAttributes Myattributes = Mymethodbase.Attributes;
-
+
// Display the flags that are set.
PrintAttributes(typeof(System.Reflection.MethodAttributes), (int) Myattributes);
return 0;
@@ -34,11 +34,11 @@ public static int Main(string[] args)
public static void PrintAttributes(Type attribType, int iAttribValue)
{
if (!attribType.IsEnum)
- {
- Console.WriteLine("This type is not an enum.");
- return;
+ {
+ Console.WriteLine("This type is not an enum.");
+ return;
}
-
+
FieldInfo[] fields = attribType.GetFields(BindingFlags.Public | BindingFlags.Static);
for (int i = 0; i < fields.Length; i++)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.Invoke1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.Invoke1 Example/CS/source.cs
index 8f8dff30778..502c7801691 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.Invoke1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.Invoke1 Example/CS/source.cs
@@ -10,7 +10,7 @@ public MagicClass()
{
magicBaseValue = 9;
}
-
+
public int ItsMagic(int preMagic)
{
return preMagic * magicBaseValue;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAbstract Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAbstract Example/CS/source.cs
index 47eacb50d73..2f43f9426de 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAbstract Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAbstract Example/CS/source.cs
@@ -6,32 +6,32 @@
class methodbase
{
public static int Main(string[] args)
- {
+ {
Console.WriteLine ("\nReflection.MethodBase");
-
+
// Get the types.
- Type MyType1 = Type.GetType("System.Runtime.Serialization.Formatter");
+ Type MyType1 = Type.GetType("System.Runtime.Serialization.Formatter");
Type MyType2 = Type.GetType("System.Reflection.MethodBase");
-
+
// Get and display the methods.
- MethodBase Mymethodbase1 =
+ MethodBase Mymethodbase1 =
MyType1.GetMethod("WriteInt32", BindingFlags.NonPublic|BindingFlags.Instance);
- MethodBase Mymethodbase2 =
+ MethodBase Mymethodbase2 =
MyType2.GetMethod("GetCurrentMethod", BindingFlags.Public|BindingFlags.Static);
-
+
Console.Write("\nMymethodbase = " + Mymethodbase1.ToString());
if (Mymethodbase1.IsAbstract)
Console.Write ("\nMymethodbase is an abstract method.");
else
Console.Write ("\nMymethodbase is not an abstract method.");
-
+
Console.Write("\n\nMymethodbase = " + Mymethodbase2.ToString());
if (Mymethodbase2.IsAbstract)
Console.Write ("\nMymethodbase is an abstract method.");
else
Console.Write ("\nMymethodbase is not an abstract method.");
-
+
return 0;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS/source.cs
index 1e2853567c5..b6bba6f0f9b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsAssembly Example/CS/source.cs
@@ -11,16 +11,16 @@ protected internal void m_protected_public() {}
public static void Main()
{
- Console.WriteLine("\n{0,-30}{1,-18}{2}", "", "IsAssembly", "IsFamilyOrAssembly");
- Console.WriteLine("{0,-21}{1,-18}{2,-18}{3}\n",
+ Console.WriteLine("\n{0,-30}{1,-18}{2}", "", "IsAssembly", "IsFamilyOrAssembly");
+ Console.WriteLine("{0,-21}{1,-18}{2,-18}{3}\n",
"", "IsPublic", "IsFamily", "IsFamilyAndAssembly");
-
+
foreach (MethodBase m in typeof(Example).GetMethods(
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public))
{
if (m.Name.Substring(0, 1) == "m")
{
- Console.WriteLine("{0,-21}{1,-9}{2,-9}{3,-9}{4,-9}{5,-9}",
+ Console.WriteLine("{0,-21}{1,-9}{2,-9}{3,-9}{4,-9}{5,-9}",
m.Name,
m.IsPublic,
m.IsAssembly,
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsPublic Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsPublic Example/CS/source.cs
index 422f4c62d59..d7cee45b78f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsPublic Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsPublic Example/CS/source.cs
@@ -6,33 +6,33 @@
class methodbase
{
public static int Main(string[] args)
- {
-
+ {
+
Console.WriteLine("\nReflection.MethodBase");
-
+
//Get the MethodBase of a method.
-
+
//Get the type
Type MyType = Type.GetType("System.MulticastDelegate");
-
+
//Get and display the method
MethodBase Mymethodbase =
MyType.GetMethod("RemoveImpl",BindingFlags.NonPublic);
-
+
Console.Write("\nMymethodbase = " + Mymethodbase);
-
+
bool Myispublic = Mymethodbase.IsPublic;
if (Myispublic)
Console.Write ("\nMymethodbase is a public method");
else
Console.Write ("\nMymethodbase is not a public method");
-
+
return 0;
}
}
/*
Produces the following output
-
+
Reflection.MethodBase
Mymethodbase = System.Delegate RemoveImpl (System.Delegate)
Mymethodbase is not a public method
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsVirtual Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsVirtual Example/CS/source.cs
index d78a6f2450a..213427c5f9b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsVirtual Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodBase.IsVirtual Example/CS/source.cs
@@ -1,13 +1,13 @@
//
using System;
using System.Reflection;
-
-public class MyClass
+
+public class MyClass
{
- public void MyMethod()
+ public void MyMethod()
{
}
- public static void Main()
+ public static void Main()
{
MethodBase m = typeof(MyClass).GetMethod("MyMethod");
Console.WriteLine("The IsFinal property value of MyMethod is {0}.", m.IsFinal);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodInfo.MemberType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodInfo.MemberType Example/CS/source.cs
index dc9389cb602..c7b358df976 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodInfo.MemberType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodInfo.MemberType Example/CS/source.cs
@@ -1,18 +1,18 @@
//
using System;
using System.Reflection;
-
+
class MyMethodInfo
{
public static int Main()
{
Console.WriteLine("Reflection.MethodInfo");
-
+
// Get the Type and MethodInfo.
Type MyType = Type.GetType("System.Reflection.FieldInfo");
MethodInfo Mymethodinfo = MyType.GetMethod("GetValue");
Console.WriteLine(MyType.FullName + "." + Mymethodinfo.Name);
-
+
// Get and display the MemberType property.
MemberTypes Mymembertypes = Mymethodinfo.MemberType;
@@ -44,7 +44,7 @@ public static int Main()
{
Console.WriteLine("MemberType is of type TypeInfo.");
}
-
+
return 0;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodInfo.ReturnType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodInfo.ReturnType Example/CS/source.cs
index 513200f2424..f035bab79de 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodInfo.ReturnType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodInfo.ReturnType Example/CS/source.cs
@@ -7,12 +7,12 @@ class Mymethodinfo
public static int Main()
{
Console.WriteLine ("\nReflection.MethodInfo");
-
+
// Get the Type and MethodInfo.
Type MyType = Type.GetType("System.Reflection.FieldInfo");
MethodInfo Mymethodinfo = MyType.GetMethod("GetValue");
Console.Write ("\n" + MyType.FullName + "." + Mymethodinfo.Name);
-
+
// Get and display the ReturnType.
Console.Write ("\nReturnType = {0}", Mymethodinfo.ReturnType);
return 0;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodRental.SwapMethodBody Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodRental.SwapMethodBody Example/CS/source.cs
index b86240d50d9..71cb1de2ee8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodRental.SwapMethodBody Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic MethodRental.SwapMethodBody Example/CS/source.cs
@@ -11,7 +11,7 @@ class SwapMethodBodySample
public static void Main(String [] args)
{
// Construct a dynamic assembly
- Guid g = Guid.NewGuid();
+ Guid g = Guid.NewGuid();
AssemblyName asmname = new AssemblyName();
asmname.Name = "tempfile" + g;
AssemblyBuilder asmbuild = System.Threading.Thread.GetDomain().
@@ -24,7 +24,7 @@ public static void Main(String [] args)
MethodBuilder somemethod = tb.DefineMethod
("My method Name",
MethodAttributes.Public | MethodAttributes.Static,
- typeof(int),
+ typeof(int),
new Type[]{} );
// Define the body of the method to return 0.
ILGenerator ilg = somemethod.GetILGenerator();
@@ -39,7 +39,7 @@ public static void Main(String [] args)
} else {
Console.WriteLine("Original method returned 0");
}
-
+
// Define a new method body that will return a 1 instead.
Byte[] methodBytes = {
0x03,
@@ -59,7 +59,7 @@ public static void Main(String [] args)
};
// Get the token for the method whose body you are replacing.
- MethodToken somemethodToken = somemethod.GetToken();
+ MethodToken somemethodToken = somemethod.GetToken();
// Get the pointer to the method body.
GCHandle hmem = GCHandle.Alloc((Object) methodBytes, GCHandleType.Pinned);
@@ -68,8 +68,8 @@ public static void Main(String [] args)
// Swap the old method body with the new body.
MethodRental.SwapMethodBody(
- tbBaked,
- somemethodToken.Token,
+ tbBaked,
+ somemethodToken.Token,
addr,
cbSize,
MethodRental.JitImmediate);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Module.Name Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Module.Name Example/CS/source.cs
index 9a2f5b714de..a1c07fc2e8c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Module.Name Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Module.Name Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System.Reflection;
using System;
-
+
public class Simple
{
public static void Main ()
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Module.ScopeName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Module.ScopeName Example/CS/source.cs
index b0f8b050d84..3b675103116 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Module.ScopeName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Module.ScopeName Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System.Reflection;
using System;
-
+
public class Simple
{
public static void Main ()
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ModuleBuilder.DefineType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ModuleBuilder.DefineType Example/CS/source.cs
index 1817d54d731..de42c885e76 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ModuleBuilder.DefineType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ModuleBuilder.DefineType Example/CS/source.cs
@@ -8,7 +8,7 @@ public void Method()
{
//
AssemblyName asmname = new AssemblyName();
- asmname.Name = "assemfilename.exe";
+ asmname.Name = "assemfilename.exe";
AssemblyBuilder asmbuild = System.Threading.Thread.GetDomain().
DefineDynamicAssembly(asmname, AssemblyBuilderAccess.RunAndSave);
ModuleBuilder modbuild = asmbuild.DefineDynamicModule( "modulename",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic NumberFormatInfo.NumberGroupSizes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic NumberFormatInfo.NumberGroupSizes Example/CS/source.cs
index b47a3bbf796..f459afcd28a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic NumberFormatInfo.NumberGroupSizes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic NumberFormatInfo.NumberGroupSizes Example/CS/source.cs
@@ -2,29 +2,29 @@
using System;
using System.Globalization;
class SamplesNumberFormatInfo {
-
+
public static void Main() {
-
+
// Creates a new NumberFormatinfo.
NumberFormatInfo myNfi = new NumberFormatInfo();
-
+
// Takes a long value.
Int64 myInt = 123456789012345;
-
+
// Displays the value with default formatting.
Console.WriteLine( "Default \t\t:\t{0}", myInt.ToString( "N", myNfi ) );
-
+
// Displays the value with three elements in the GroupSize array.
myNfi.NumberGroupSizes = new int[] { 2, 3, 4 };
Console.WriteLine( "Grouping ( {0} )\t:\t{1}",
PrintArraySet( myNfi.NumberGroupSizes ), myInt.ToString( "N", myNfi ) );
-
+
// Displays the value with zero as the last element in the GroupSize array.
myNfi.NumberGroupSizes = new int[] { 2, 4, 0 };
Console.WriteLine( "Grouping ( {0} )\t:\t{1}",
PrintArraySet( myNfi.NumberGroupSizes ), myInt.ToString( "N", myNfi ) );
}
-
+
public static string PrintArraySet( int[] myArr ) {
string myStr = null;
myStr = myArr[0].ToString();
@@ -34,8 +34,8 @@ public static string PrintArraySet( int[] myArr ) {
}
}
/*
- This code produces the following output.
-
+ This code produces the following output.
+
Default : 123,456,789,012,345.00
Grouping ( 2, 3, 4 ) : 12,3456,7890,123,45.00
Grouping ( 2, 4, 0 ) : 123456789,0123,45.00
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic NumberFormatInfo.NumberNegativePattern Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic NumberFormatInfo.NumberNegativePattern Example/CS/source.cs
index 899953f128a..d2e26fc9cce 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic NumberFormatInfo.NumberNegativePattern Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic NumberFormatInfo.NumberNegativePattern Example/CS/source.cs
@@ -1,11 +1,11 @@
//
using System;
using System.Globalization;
-
+
class Example
{
public static void Main() {
-
+
// Create a new NumberFormatinfo.
NumberFormatInfo nfi = new NumberFormatInfo();
@@ -13,15 +13,15 @@ public static void Main() {
Int64 value = -1234;
// Display the value with default formatting.
- Console.WriteLine("{0,-20} {1,-10}", "Default:",
+ Console.WriteLine("{0,-20} {1,-10}", "Default:",
value.ToString("N", nfi));
// Display the value with other patterns.
for (int i = 0; i <= 4; i++) {
nfi.NumberNegativePattern = i;
- Console.WriteLine("{0,-20} {1,-10}",
- String.Format("Pattern {0}:",
- nfi.NumberNegativePattern),
+ Console.WriteLine("{0,-20} {1,-10}",
+ String.Format("Pattern {0}:",
+ nfi.NumberNegativePattern),
value.ToString("N", nfi));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterAttributes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterAttributes Example/CS/source.cs
index ad8564fa17e..e2407886ebb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterAttributes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterAttributes Example/CS/source.cs
@@ -1,37 +1,37 @@
//
using System;
using System.Reflection;
-
+
class paramatt
{
public static void mymethod (string str1, out string str2, ref string str3)
{
str2 = "string";
}
-
+
public static int Main(string[] args)
{
Console.WriteLine("\nReflection.ParameterAttributes");
-
+
// Get the Type and the method.
-
+
Type Mytype = Type.GetType("paramatt");
MethodBase Mymethodbase = Mytype.GetMethod("mymethod");
-
+
// Display the method.
Console.Write("\nMymethodbase = " + Mymethodbase);
-
+
// Get the ParameterInfo array.
ParameterInfo[] Myarray = Mymethodbase.GetParameters();
-
+
// Get and display the attributes for the second parameter.
ParameterAttributes Myparamattributes = Myarray[1].Attributes;
-
- Console.Write("\nFor the second parameter:\nMyparamattributes = "
+
+ Console.Write("\nFor the second parameter:\nMyparamattributes = "
+ (int) Myparamattributes
+ ", which is an "
+ Myparamattributes.ToString());
-
+
return 0;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.IsOut Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.IsOut Example/CS/source.cs
index 336210999b5..c1192d751fb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.IsOut Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.IsOut Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Reflection;
-
+
class parminfo
{
public static void mymethod (
@@ -9,27 +9,27 @@ public static void mymethod (
{
str2m = "in mymethod";
}
-
+
public static int Main(string[] args)
{
Console.WriteLine("\nReflection.Parameterinfo");
-
+
//Get the ParameterInfo parameter of a function.
-
+
//Get the type.
Type Mytype = Type.GetType("parminfo");
-
+
//Get and display the method.
MethodBase Mymethodbase = Mytype.GetMethod("mymethod");
Console.Write("\nMymethodbase = " + Mymethodbase);
-
+
//Get the ParameterInfo array.
ParameterInfo[] Myarray = Mymethodbase.GetParameters();
-
+
//Get and display the IsOut of each parameter.
foreach (ParameterInfo Myparam in Myarray)
{
- Console.Write ("\nFor parameter # " + Myparam.Position
+ Console.Write ("\nFor parameter # " + Myparam.Position
+ ", the IsOut is - " + Myparam.IsOut );
}
return 0;
@@ -39,7 +39,7 @@ public static int Main(string[] args)
This code produces the following output:
Reflection.ParameterInfo
-
+
Mymethodbase = Void mymethod (Int32, System.String ByRef, System.String ByRef)
For parameter # 0, the IsOut is - False
For parameter # 1, the IsOut is - True
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.Name Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.Name Example/CS/source.cs
index 9659bdb131f..8a79117015f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.Name Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.Name Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Reflection;
-
+
class parminfo
{
public static void mymethod (
@@ -9,27 +9,27 @@ public static void mymethod (
{
str2m = "in mymethod";
}
-
+
public static int Main(string[] args)
- {
+ {
Console.WriteLine("\nReflection.Parameterinfo");
-
+
//Get the ParameterInfo parameter of a function.
-
+
//Get the type.
Type Mytype = Type.GetType("parminfo");
-
+
//Get and display the method.
MethodBase Mymethodbase = Mytype.GetMethod("mymethod");
Console.Write("\nMymethodbase = " + Mymethodbase);
-
+
//Get the ParameterInfo array.
ParameterInfo[] Myarray = Mymethodbase.GetParameters();
-
+
//Get and display the name of each parameter.
foreach (ParameterInfo Myparam in Myarray)
{
- Console.Write ("\nFor parameter # " + Myparam.Position
+ Console.Write ("\nFor parameter # " + Myparam.Position
+ ", the Name is - " + Myparam.Name);
}
return 0;
@@ -39,7 +39,7 @@ public static int Main(string[] args)
This code produces the following output:
Reflection.ParameterInfo
-
+
Mymethodbase
= Void mymethod (Int32, System.String ByRef, System.String ByRef)
For parameter # 0, the Name is - int1m
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.ParameterType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.ParameterType Example/CS/source.cs
index de35349ba3d..9f3d3b0ce1b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.ParameterType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ParameterInfo.ParameterType Example/CS/source.cs
@@ -9,27 +9,27 @@ public static void mymethod (
{
str2m = "in mymethod";
}
-
+
public static int Main(string[] args)
{
Console.WriteLine("\nReflection.Parameterinfo");
-
+
//Get the ParameterInfo parameter of a function.
-
+
//Get the type.
Type Mytype = Type.GetType("parminfo");
-
+
//Get and display the method.
MethodBase Mymethodbase = Mytype.GetMethod("mymethod");
Console.Write("\nMymethodbase = " + Mymethodbase);
-
+
//Get the ParameterInfo array.
ParameterInfo[]Myarray = Mymethodbase.GetParameters();
-
+
//Get and display the ParameterInfo of each parameter.
foreach (ParameterInfo Myparam in Myarray)
{
- Console.Write ("\nFor parameter # " + Myparam.Position
+ Console.Write ("\nFor parameter # " + Myparam.Position
+ ", the ParameterType is - " + Myparam.ParameterType);
}
return 0;
@@ -38,7 +38,7 @@ public static int Main(string[] args)
/*
This code produces the following output:
-
+
Reflection.Parameterinfo
Mymethodbase = Void mymethod(Int32, System.String ByRef, System.String ByRef)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PrincipalPermission.IsSubsetOf Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PrincipalPermission.IsSubsetOf Example/CS/source.cs
index 2cacb69701b..8516cebe837 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PrincipalPermission.IsSubsetOf Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PrincipalPermission.IsSubsetOf Example/CS/source.cs
@@ -7,7 +7,7 @@
public class Form1: Form
{
protected TextBox textBox1;
-
+
public void Method()
{
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyAttributes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyAttributes Example/CS/source.cs
index cbe6e103a97..cc2aa87c1c1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyAttributes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyAttributes Example/CS/source.cs
@@ -1,10 +1,10 @@
//
using System;
using System.Reflection;
-
+
// Define three properties: one read-write, one default,
- // and one read only.
-public class Aproperty
+ // and one read only.
+public class Aproperty
// Define a read-write property.
{
private string caption = "A Default caption";
@@ -17,7 +17,7 @@ public string Caption
}
}
}
-public class Bproperty
+public class Bproperty
// Define a default property.
{
private string caption = "B Default caption";
@@ -27,7 +27,7 @@ public string this [int index]
}
public string Caption
{
-
+
get{return caption;}
set
{
@@ -35,7 +35,7 @@ public string Caption
}
}
}
-public class Cproperty
+public class Cproperty
// Define a read-only property.
{
private string caption = "C Default caption";
@@ -45,41 +45,41 @@ public string Caption
// No setting is allowed, because this is a read-only property.
}
}
-
+
class propertyattributesenum
{
public static int Main(string[] args)
{
Console.WriteLine("\nReflection.PropertyAttributes");
-
+
// Determine whether a property exists, and change its value.
Aproperty Mypropertya = new Aproperty();
Bproperty Mypropertyb = new Bproperty();
Cproperty Mypropertyc = new Cproperty();
Console.Write("\n1. Mypropertya.Caption = " + Mypropertya.Caption );
-
+
Console.Write("\n1. Mypropertyb.Caption = " + Mypropertyb.Caption );
-
+
Console.Write("\n1. Mypropertyc.Caption = " + Mypropertyc.Caption );
-
+
// Only Mypropertya can be changed, as Mypropertyb is read-only.
Mypropertya.Caption = "A- This is changed.";
Mypropertyb.Caption = "B- This is changed.";
// Note that Mypropertyc is not changed because it is read only
-
+
Console.Write("\n\n2. Mypropertya.Caption = " + Mypropertya.Caption );
-
+
Console.Write("\n2. Mypropertyb.Caption = " + Mypropertyb.Caption );
-
+
Console.Write("\n2. Mypropertyc.Caption = " + Mypropertyc.Caption );
-
+
// Get the PropertyAttributes enumeration of the property.
// Get the type.
Type MyTypea = Type.GetType("Aproperty");
Type MyTypeb = Type.GetType("Bproperty");
Type MyTypec = Type.GetType("Cproperty");
-
+
// Get the property attributes.
PropertyInfo Mypropertyinfoa = MyTypea.GetProperty("Caption");
PropertyAttributes Myattributesa = Mypropertyinfoa.Attributes;
@@ -87,9 +87,9 @@ public static int Main(string[] args)
PropertyAttributes Myattributesb = Mypropertyinfob.Attributes;
PropertyInfo Mypropertyinfoc = MyTypec.GetProperty("Caption");
PropertyAttributes Myattributesc = Mypropertyinfoc.Attributes;
-
+
// Display the property attributes value.
-
+
Console.Write("\n\na- " + Myattributesa.ToString());
Console.Write("\nb- " + Myattributesb.ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.CanRead Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.CanRead Example/CS/source.cs
index fc307a78bb1..aa6d33fbe31 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.CanRead Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.CanRead Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Reflection;
-
+
// Define one readable property and one not readable.
public class Mypropertya
{
@@ -22,31 +22,31 @@ public string Caption
}
}
}
-
+
class Mypropertyinfo
{
public static int Main()
{
Console.WriteLine("\nReflection.PropertyInfo");
-
+
// Define two properties.
Mypropertya Mypropertya = new Mypropertya();
Mypropertyb Mypropertyb = new Mypropertyb();
-
+
Console.Write("\nMypropertya.Caption = " + Mypropertya.Caption);
// Mypropertyb.Caption cannot be read, because
// there is no get accessor.
-
+
// Get the type and PropertyInfo.
Type MyTypea = Type.GetType("Mypropertya");
PropertyInfo Mypropertyinfoa = MyTypea.GetProperty("Caption");
Type MyTypeb = Type.GetType("Mypropertyb");
PropertyInfo Mypropertyinfob = MyTypeb.GetProperty("Caption");
-
+
// Get and display the CanRead property.
Console.Write("\nCanRead a - " + Mypropertyinfoa.CanRead);
Console.Write("\nCanRead b - " + Mypropertyinfob.CanRead);
-
+
return 0;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.CanWrite Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.CanWrite Example/CS/source.cs
index 84c3d9797a8..f29b1ed2718 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.CanWrite Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.CanWrite Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Reflection;
-
+
// Define one writable property and one not writable.
public class Mypropertya
{
@@ -21,42 +21,42 @@ public string Caption
get{return caption;}
}
}
-
+
class Mypropertyinfo
{
public static int Main()
{
Console.WriteLine("\nReflection.PropertyInfo");
-
+
// Define two properties.
Mypropertya Mypropertya = new Mypropertya();
Mypropertyb Mypropertyb = new Mypropertyb();
-
+
// Read and display the property.
Console.Write("\nMypropertya.Caption = " + Mypropertya.Caption);
Console.Write("\nMypropertyb.Caption = " + Mypropertyb.Caption);
-
+
// Write to the property.
Mypropertya.Caption = "A- No Change";
// Mypropertyb.Caption cannot be written to because
// there is no set accessor.
-
+
// Read and display the property.
Console.Write("\nMypropertya.Caption = " + Mypropertya.Caption);
Console.Write ("\nMypropertyb.Caption = " + Mypropertyb.Caption);
-
+
// Get the type and PropertyInfo.
Type MyTypea = Type.GetType("Mypropertya");
PropertyInfo Mypropertyinfoa = MyTypea.GetProperty("Caption");
Type MyTypeb = Type.GetType("Mypropertyb");
PropertyInfo Mypropertyinfob = MyTypeb.GetProperty("Caption");
-
+
// Get and display the CanWrite property.
-
+
Console.Write("\nCanWrite a - " + Mypropertyinfoa.CanWrite);
-
+
Console.Write("\nCanWrite b - " + Mypropertyinfob.CanWrite);
-
+
return 0;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetAccessors1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetAccessors1 Example/CS/source.cs
index 852475d28e3..b44ed852399 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetAccessors1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetAccessors1 Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Reflection;
-
+
// Define a property.
public class ClassWithProperty
{
@@ -13,7 +13,7 @@ public string Caption
set { if(_caption != value) _caption = value; }
}
}
-
+
class Example
{
public static void Main()
@@ -24,7 +24,7 @@ public static void Main()
// Get the type and PropertyInfo.
Type t = Type.GetType("ClassWithProperty");
PropertyInfo propInfo = t.GetProperty("Caption");
-
+
// Get the public GetAccessors method.
MethodInfo[] methInfos = propInfo.GetAccessors(true);
Console.WriteLine("There are {0} accessors.",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetGetMethod1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetGetMethod1 Example/CS/source.cs
index 18c95ca9cb3..3346f877aea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetGetMethod1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetGetMethod1 Example/CS/source.cs
@@ -1,9 +1,9 @@
//
using System;
using System.Reflection;
-
+
// Define a property.
-public class Myproperty
+public class Myproperty
{
private string caption = "A Default caption";
public string Caption
@@ -13,19 +13,19 @@ public string Caption
}
}
}
-
+
class Mypropertyinfo
{
public static int Main()
{
Console.WriteLine ("\nReflection.PropertyInfo");
-
+
// Get the type and PropertyInfo for two separate properties.
Type MyTypea = Type.GetType("Myproperty");
PropertyInfo Mypropertyinfoa = MyTypea.GetProperty("Caption");
Type MyTypeb = Type.GetType("System.Reflection.MethodInfo");
PropertyInfo Mypropertyinfob = MyTypeb.GetProperty("MemberType");
-
+
// Get and display the GetGetMethod method for each property.
MethodInfo Mygetmethodinfoa = Mypropertyinfoa.GetGetMethod();
Console.Write ("\nGetAccessor for " + Mypropertyinfoa.Name
@@ -33,7 +33,7 @@ public static int Main()
MethodInfo Mygetmethodinfob = Mypropertyinfob.GetGetMethod();
Console.Write ("\nGetAccessor for " + Mypropertyinfob.Name
+ " returns a " + Mygetmethodinfob.ReturnType);
-
+
// Display the GetGetMethod without using the MethodInfo.
Console.Write ("\n" + MyTypea.FullName + "." + Mypropertyinfoa.Name
+ " GetGetMethod - " + Mypropertyinfoa.GetGetMethod());
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetIndexParameters Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetIndexParameters Example/CS/source.cs
index d64e875ac30..165055dcbdc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetIndexParameters Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetIndexParameters Example/CS/source.cs
@@ -1,9 +1,9 @@
//
using System;
using System.Reflection;
-
+
// A class that contains some properties.
-public class MyProperty
+public class MyProperty
{
// Define a simple string property.
private string caption = "A Default caption";
@@ -14,10 +14,10 @@ public string Caption
}
}
- // A very limited indexer that gets or sets one of four
+ // A very limited indexer that gets or sets one of four
// strings.
private string[] strings = {"abc", "def", "ghi", "jkl"};
- public string this[int Index]
+ public string this[int Index]
{
get
{
@@ -29,7 +29,7 @@ public string this[int Index]
}
}
}
-
+
class Mypropertyinfo
{
public static int Main()
@@ -37,17 +37,17 @@ public static int Main()
// Get the type and PropertyInfo.
Type t = Type.GetType("MyProperty");
PropertyInfo pi = t.GetProperty("Caption");
-
+
// Get the public GetIndexParameters method.
ParameterInfo[] parms = pi.GetIndexParameters();
Console.WriteLine("\r\n" + t.FullName + "." + pi.Name
+ " has " + parms.GetLength(0) + " parameters.");
-
- // Display a property that has parameters. The default
+
+ // Display a property that has parameters. The default
// name of an indexer is "Item".
pi = t.GetProperty("Item");
parms = pi.GetIndexParameters();
- Console.WriteLine(t.FullName + "." + pi.Name + " has " +
+ Console.WriteLine(t.FullName + "." + pi.Name + " has " +
parms.GetLength(0) + " parameters.");
foreach( ParameterInfo p in parms )
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetSetMethod1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetSetMethod1 Example/CS/source.cs
index 998ae2b1c85..95193bdc6cf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetSetMethod1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.GetSetMethod1 Example/CS/source.cs
@@ -1,9 +1,9 @@
//
using System;
using System.Reflection;
-
+
// Define a property.
-public class Myproperty
+public class Myproperty
{
private string caption = "A Default caption";
public string Caption
@@ -13,13 +13,13 @@ public string Caption
}
}
}
-
+
class Mypropertyinfo
{
public static int Main()
{
Console.WriteLine ("\nReflection.PropertyInfo");
-
+
// Get the type and PropertyInfo for two separate properties.
Type MyTypea = Type.GetType("Myproperty");
PropertyInfo Mypropertyinfoa = MyTypea.GetProperty("Caption");
@@ -32,7 +32,7 @@ public static int Main()
MethodInfo Mygetmethodinfob = Mypropertyinfob.GetSetMethod();
Console.Write ("\nSetAccessor for " + Mypropertyinfob.Name
+ " returns a " + Mygetmethodinfob.ReturnType);
-
+
// Display the GetSetMethod without using the MethodInfo.
Console.Write ("\n\n" + MyTypea.FullName + "."
+ Mypropertyinfoa.Name + " GetSetMethod - "
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.MemberType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.MemberType Example/CS/source.cs
index 654a0513df7..00a16551ba0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.MemberType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.MemberType Example/CS/source.cs
@@ -1,20 +1,20 @@
//
using System;
using System.Reflection;
-
+
class Mypropertyinfo
{
public static int Main()
{
Console.WriteLine("\nReflection.PropertyInfo");
-
+
// Get the type and PropertyInfo.
Type MyType = Type.GetType("System.Reflection.MemberInfo");
PropertyInfo Mypropertyinfo = MyType.GetProperty("Name");
-
+
// Read and display the MemberType property.
Console.Write("\nMemberType = " + Mypropertyinfo.MemberType.ToString());
-
+
return 0;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.SetValue1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.SetValue1 Example/CS/source.cs
index 877bde8deb4..da429ebaf11 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.SetValue1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic PropertyInfo.SetValue1 Example/CS/source.cs
@@ -1,40 +1,40 @@
//
using System;
using System.Reflection;
-
+
// Define a class with a property.
-public class TestClass
+public class TestClass
{
private string caption = "A Default caption";
public string Caption
{
get { return caption; }
- set
- {
- if (caption != value)
+ set
+ {
+ if (caption != value)
{
caption = value;
}
}
}
}
-
+
class TestPropertyInfo
{
public static void Main()
{
TestClass t = new TestClass();
-
+
// Get the type and PropertyInfo.
Type myType = t.GetType();
PropertyInfo pinfo = myType.GetProperty("Caption");
-
+
// Display the property value, using the GetValue method.
Console.WriteLine("\nGetValue: " + pinfo.GetValue(t, null));
-
+
// Use the SetValue method to change the caption.
pinfo.SetValue(t, "This caption has been changed.", null);
-
+
// Display the caption again.
Console.WriteLine("GetValue: " + pinfo.GetValue(t, null));
@@ -45,7 +45,7 @@ public static void Main()
/*
This example produces the following output:
-
+
GetValue: A Default caption
GetValue: This caption has been changed
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue Example/CS/source.cs
index 873c29b4e29..18906f611c1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue Example/CS/source.cs
@@ -2,15 +2,15 @@
using System;
using System.Collections;
public class SamplesQueue {
-
+
public static void Main() {
-
+
// Creates and initializes a new Queue.
Queue myQ = new Queue();
myQ.Enqueue("Hello");
myQ.Enqueue("World");
myQ.Enqueue("!");
-
+
// Displays the properties and values of the Queue.
Console.WriteLine( "myQ" );
Console.WriteLine( "\tCount: {0}", myQ.Count );
@@ -24,11 +24,11 @@ public static void PrintValues( IEnumerable myCollection ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
myQ
Count: 3
Values: Hello World !
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.Clear Example/CS/source.cs
index 485e92e840b..2775470651b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.Clear Example/CS/source.cs
@@ -36,9 +36,9 @@ public static void PrintValues( Queue myQ ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
Initially,
Count : 5
Values: The quick brown fox jumps
@@ -46,5 +46,5 @@ This code produces the following output.
Count : 0
Values:
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.CopyTo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.CopyTo Example/CS/source.cs
index c7f67f57f99..f3a7ac64afc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.CopyTo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.CopyTo Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesQueue {
-
+
public static void Main() {
-
+
// Creates and initializes the source Queue.
Queue mySourceQ = new Queue();
mySourceQ.Enqueue( "three" );
@@ -13,7 +13,7 @@ public static void Main() {
mySourceQ.Enqueue( "in" );
mySourceQ.Enqueue( "the" );
mySourceQ.Enqueue( "barn" );
-
+
// Creates and initializes the one-dimensional target Array.
Array myTargetArray=Array.CreateInstance( typeof(String), 15 );
myTargetArray.SetValue( "The", 0 );
@@ -25,20 +25,20 @@ public static void Main() {
myTargetArray.SetValue( "the", 6 );
myTargetArray.SetValue( "lazy", 7 );
myTargetArray.SetValue( "dog", 8 );
-
+
// Displays the values of the target Array.
Console.WriteLine( "The target Array contains the following (before and after copying):" );
PrintValues( myTargetArray, ' ' );
-
+
// Copies the entire source Queue to the target Array, starting at index 6.
mySourceQ.CopyTo( myTargetArray, 6 );
-
+
// Displays the values of the target Array.
PrintValues( myTargetArray, ' ' );
-
+
// Copies the entire source Queue to a new standard array.
Object[] myStandardArray = mySourceQ.ToArray();
-
+
// Displays the values of the new standard array.
Console.WriteLine( "The new standard array contains the following:" );
PrintValues( myStandardArray, ' ' );
@@ -51,14 +51,14 @@ public static void PrintValues( Array myArr, char mySeparator ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The target Array contains the following (before and after copying):
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over three napping cats in the barn
The new standard array contains the following:
three napping cats in the barn
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.Enqueue Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.Enqueue Example/CS/source.cs
index 7e020dd8129..71f444804c3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.Enqueue Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.Enqueue Example/CS/source.cs
@@ -2,51 +2,51 @@
using System;
using System.Collections;
public class SamplesQueue {
-
+
public static void Main() {
-
+
// Creates and initializes a new Queue.
Queue myQ = new Queue();
myQ.Enqueue( "The" );
myQ.Enqueue( "quick" );
myQ.Enqueue( "brown" );
myQ.Enqueue( "fox" );
-
+
// Displays the Queue.
Console.Write( "Queue values:" );
PrintValues( myQ );
-
+
// Removes an element from the Queue.
Console.WriteLine( "(Dequeue)\t{0}", myQ.Dequeue() );
-
+
// Displays the Queue.
Console.Write( "Queue values:" );
PrintValues( myQ );
-
+
// Removes another element from the Queue.
Console.WriteLine( "(Dequeue)\t{0}", myQ.Dequeue() );
-
+
// Displays the Queue.
Console.Write( "Queue values:" );
PrintValues( myQ );
-
+
// Views the first element in the Queue but does not remove it.
Console.WriteLine( "(Peek) \t{0}", myQ.Peek() );
-
+
// Displays the Queue.
Console.Write( "Queue values:" );
PrintValues( myQ );
}
-
+
public static void PrintValues( IEnumerable myCollection ) {
foreach ( Object obj in myCollection )
Console.Write( " {0}", obj );
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
Queue values: The quick brown fox
(Dequeue) The
Queue values: quick brown fox
@@ -55,5 +55,5 @@ This code produces the following output.
(Peek) brown
Queue values: brown fox
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.IsSynchronized Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.IsSynchronized Example/CS/source.cs
index 1d1cc131b21..ed0fc88056e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.IsSynchronized Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Queue.IsSynchronized Example/CS/source.cs
@@ -2,28 +2,28 @@
using System;
using System.Collections;
public class SamplesQueue {
-
+
public static void Main() {
-
+
// Creates and initializes a new Queue.
Queue myQ = new Queue();
myQ.Enqueue( "The" );
myQ.Enqueue( "quick" );
myQ.Enqueue( "brown" );
myQ.Enqueue( "fox" );
-
+
// Creates a synchronized wrapper around the Queue.
Queue mySyncdQ = Queue.Synchronized( myQ );
-
+
// Displays the sychronization status of both Queues.
Console.WriteLine( "myQ is {0}.", myQ.IsSynchronized ? "synchronized" : "not synchronized" );
Console.WriteLine( "mySyncdQ is {0}.", mySyncdQ.IsSynchronized ? "synchronized" : "not synchronized" );
}
}
- /*
+ /*
This code produces the following output.
-
+
myQ is not synchronized.
mySyncdQ is synchronized.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Random.NextBytes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Random.NextBytes Example/CS/source.cs
index 6fe7c8628f9..84c7a8265b5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Random.NextBytes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Random.NextBytes Example/CS/source.cs
@@ -1,16 +1,16 @@
using System;
-public class Example
+public class Example
{
- public static void Main()
+ public static void Main()
{
//
Random rnd = new Random();
Byte[] b = new Byte[10];
rnd.NextBytes(b);
Console.WriteLine("The Random bytes are: ");
- for (int i = 0; i <= b.GetUpperBound(0); i++)
- Console.WriteLine("{0}: {1}", i, b[i]);
+ for (int i = 0; i <= b.GetUpperBound(0); i++)
+ Console.WriteLine("{0}: {1}", i, b[i]);
// The example displays output similar to the following:
// The Random bytes are:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.LocalMachine Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.LocalMachine Example/CS/source.cs
index e59afa54871..f52fbf5ec85 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.LocalMachine Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Registry.LocalMachine Example/CS/source.cs
@@ -35,5 +35,5 @@ static void PrintKeys(RegistryKey rkey) {
break;
}
}
-}
+}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic RegistryKey.GetValue Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic RegistryKey.GetValue Example/CS/source.cs
index 7e4326cf359..36161d8fd9f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic RegistryKey.GetValue Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic RegistryKey.GetValue Example/CS/source.cs
@@ -55,7 +55,7 @@ public static void Main()
string def = (string)rk.GetValue("notavalue", "The default to return");
Console.WriteLine();
Console.WriteLine(def);
-
+
rk.Close();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ResourceWriter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ResourceWriter Example/CS/source.cs
index c66e420877d..e264477112e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ResourceWriter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ResourceWriter Example/CS/source.cs
@@ -4,10 +4,10 @@
public class WriteResources {
public static void Main(string[] args) {
-
+
// Creates a resource writer.
IResourceWriter writer = new ResourceWriter("myResources.resources");
-
+
// Adds resources to the resource writer.
writer.AddResource("String 1", "First String");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA1 Example/CS/source.cs
index 8bec3d937c7..a800506b247 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA1 Example/CS/source.cs
@@ -11,9 +11,9 @@ protected void Method()
{
//
byte[] data = new byte[DATA_SIZE];
-byte[] result;
-
-SHA1 sha = new SHA1CryptoServiceProvider();
+byte[] result;
+
+SHA1 sha = new SHA1CryptoServiceProvider();
// This is one implementation of the abstract class SHA1.
result = sha.ComputeHash(data);
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA1CryptoServiceProvider Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA1CryptoServiceProvider Example/CS/source.cs
index f7fd21c29d4..e1c1869daa9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA1CryptoServiceProvider Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA1CryptoServiceProvider Example/CS/source.cs
@@ -12,9 +12,9 @@ protected void Method()
//
byte[] data = new byte[DATA_SIZE];
-byte[] result;
-
-SHA1 sha = new SHA1CryptoServiceProvider();
+byte[] result;
+
+SHA1 sha = new SHA1CryptoServiceProvider();
// This is one implementation of the abstract class SHA1.
result = sha.ComputeHash(data);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA256 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA256 Example/CS/source.cs
index 345599f6cae..cfc272f85bf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA256 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA256 Example/CS/source.cs
@@ -26,7 +26,7 @@ public static void Main(String[] args)
// Compute and print the hash values for each file in directory.
foreach (FileInfo fInfo in files)
{
- try {
+ try {
// Create a fileStream for the file.
FileStream fileStream = fInfo.Open(FileMode.Open);
// Be sure it's positioned to the beginning of the stream.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA384Managed Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA384Managed Example/CS/source.cs
index b11040838f1..0df812b2aa6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA384Managed Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA384Managed Example/CS/source.cs
@@ -10,10 +10,10 @@ public class Sample
protected void Method()
{
//
-byte[] data = new byte[DATA_SIZE];
+byte[] data = new byte[DATA_SIZE];
byte[] result;
-
-SHA384 shaM = new SHA384Managed();
+
+SHA384 shaM = new SHA384Managed();
result = shaM.ComputeHash(data);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA512Managed Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA512Managed Example/CS/source.cs
index b19e9f2b0c4..a44551112c2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA512Managed Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SHA512Managed Example/CS/source.cs
@@ -10,10 +10,10 @@ public class Sample
protected void Method()
{
//
-byte[] data = new byte[DATA_SIZE];
+byte[] data = new byte[DATA_SIZE];
byte[] result;
-
-SHA512 shaM = new SHA512Managed();
+
+SHA512 shaM = new SHA512Managed();
result = shaM.ComputeHash(data);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Add Example/CS/source.cs
index 3bfea2a6d5b..a73f50eeedb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Add Example/CS/source.cs
@@ -2,16 +2,16 @@
using System;
using System.Collections;
public class SamplesSortedList {
-
+
public static void Main() {
-
+
// Creates and initializes a new SortedList.
SortedList mySL = new SortedList();
mySL.Add( "one", "The" );
mySL.Add( "two", "quick" );
mySL.Add( "three", "brown" );
mySL.Add( "four", "fox" );
-
+
// Displays the SortedList.
Console.WriteLine( "The SortedList contains the following:" );
PrintKeysAndValues( mySL );
@@ -25,9 +25,9 @@ public static void PrintKeysAndValues( SortedList myList ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The SortedList contains the following:
-KEY- -VALUE-
four: fox
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Clear Example/CS/source.cs
index 76a98456a0c..d9dbf832e8f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Clear Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesSortedList {
-
+
public static void Main() {
-
+
// Creates and initializes a new SortedList.
SortedList mySL = new SortedList();
mySL.Add( "one", "The" );
@@ -12,37 +12,37 @@ public static void Main() {
mySL.Add( "three", "brown" );
mySL.Add( "four", "fox" );
mySL.Add( "five", "jumps" );
-
+
// Displays the count, capacity and values of the SortedList.
Console.WriteLine( "Initially," );
Console.WriteLine( " Count : {0}", mySL.Count );
Console.WriteLine( " Capacity : {0}", mySL.Capacity );
Console.WriteLine( " Values:" );
PrintKeysAndValues( mySL );
-
+
// Trims the SortedList.
mySL.TrimToSize();
-
+
// Displays the count, capacity and values of the SortedList.
Console.WriteLine( "After TrimToSize," );
Console.WriteLine( " Count : {0}", mySL.Count );
Console.WriteLine( " Capacity : {0}", mySL.Capacity );
Console.WriteLine( " Values:" );
PrintKeysAndValues( mySL );
-
+
// Clears the SortedList.
mySL.Clear();
-
+
// Displays the count, capacity and values of the SortedList.
Console.WriteLine( "After Clear," );
Console.WriteLine( " Count : {0}", mySL.Count );
Console.WriteLine( " Capacity : {0}", mySL.Capacity );
Console.WriteLine( " Values:" );
PrintKeysAndValues( mySL );
-
+
// Trims the SortedList again.
mySL.TrimToSize();
-
+
// Displays the count, capacity and values of the SortedList.
Console.WriteLine( "After the second TrimToSize," );
Console.WriteLine( " Count : {0}", mySL.Count );
@@ -59,9 +59,9 @@ public static void PrintKeysAndValues( SortedList myList ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
Initially,
Count : 5
Capacity : 16
@@ -72,7 +72,7 @@ This code produces the following output.
one: The
three: brown
two: quick
-
+
After TrimToSize,
Count : 5
Capacity : 5
@@ -83,17 +83,17 @@ This code produces the following output.
one: The
three: brown
two: quick
-
+
After Clear,
Count : 0
Capacity : 16
Values:
-KEY- -VALUE-
-
+
After the second TrimToSize,
Count : 0
Capacity : 16
Values:
-KEY- -VALUE-
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Contains Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Contains Example/CS/source.cs
index 2afda31aa3e..45283d9d399 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Contains Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.Contains Example/CS/source.cs
@@ -1,11 +1,11 @@
//
using System;
using System.Collections;
-
+
public class SamplesSortedList {
-
+
public static void Main() {
-
+
// Creates and initializes a new SortedList.
SortedList mySL = new SortedList();
mySL.Add( 2, "two" );
@@ -13,17 +13,17 @@ public static void Main() {
mySL.Add( 1, "one" );
mySL.Add( 3, "three" );
mySL.Add( 0, "zero" );
-
+
// Displays the values of the SortedList.
Console.WriteLine( "The SortedList contains the following values:" );
PrintIndexAndKeysAndValues( mySL );
-
+
// Searches for a specific key.
int myKey = 2;
Console.WriteLine( "The key \"{0}\" is {1}.", myKey, mySL.ContainsKey( myKey ) ? "in the SortedList" : "NOT in the SortedList" );
myKey = 6;
Console.WriteLine( "The key \"{0}\" is {1}.", myKey, mySL.ContainsKey( myKey ) ? "in the SortedList" : "NOT in the SortedList" );
-
+
// Searches for a specific value.
String myValue = "three";
Console.WriteLine( "The value \"{0}\" is {1}.", myValue, mySL.ContainsValue( myValue ) ? "in the SortedList" : "NOT in the SortedList" );
@@ -39,9 +39,9 @@ public static void PrintIndexAndKeysAndValues( SortedList myList ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The SortedList contains the following values:
-INDEX- -KEY- -VALUE-
[0]: 0 zero
@@ -49,10 +49,10 @@ This code produces the following output.
[2]: 2 two
[3]: 3 three
[4]: 4 four
-
+
The key "2" is in the SortedList.
The key "6" is NOT in the SortedList.
The value "three" is in the SortedList.
The value "nine" is NOT in the SortedList.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.CopyTo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.CopyTo Example/CS/source.cs
index 61a85f7d214..2df29dd3c8f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.CopyTo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.CopyTo Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesSortedList {
-
+
public static void Main() {
-
+
// Creates and initializes the source SortedList.
SortedList mySourceList = new SortedList();
mySourceList.Add( 2, "cats" );
@@ -13,7 +13,7 @@ public static void Main() {
mySourceList.Add( 4, "the" );
mySourceList.Add( 0, "three" );
mySourceList.Add( 5, "barn" );
-
+
// Creates and initializes the one-dimensional target Array.
String[] tempArray = new String[] { "The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog" };
DictionaryEntry[] myTargetArray = new DictionaryEntry[15];
@@ -27,14 +27,14 @@ public static void Main() {
// Displays the values of the target Array.
Console.WriteLine( "The target Array contains the following (before and after copying):" );
PrintValues( myTargetArray, ' ' );
-
+
// Copies the entire source SortedList to the target SortedList, starting at index 6.
mySourceList.CopyTo( myTargetArray, 6 );
-
+
// Displays the values of the target Array.
PrintValues( myTargetArray, ' ' );
}
-
+
public static void PrintValues( DictionaryEntry[] myArr, char mySeparator ) {
for ( int i = 0; i < myArr.Length; i++ )
Console.Write( "{0}{1}", mySeparator, myArr[i].Value );
@@ -45,10 +45,10 @@ public static void PrintValues( DictionaryEntry[] myArr, char mySeparator ) {
/*
This code produces the following output.
-
+
The target Array contains the following (before and after copying):
- The quick brown fox jumps over the lazy dog
+ The quick brown fox jumps over the lazy dog
The quick brown fox jumps over three napping cats in the barn
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.GetByIndex Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.GetByIndex Example/CS/source.cs
index c19239e1815..b0bb90d4f6b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.GetByIndex Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.GetByIndex Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesSortedList {
-
+
public static void Main() {
-
+
// Creates and initializes a new SortedList.
SortedList mySL = new SortedList();
mySL.Add( 1.3, "fox" );
@@ -16,25 +16,25 @@ public static void Main() {
mySL.Add( 1.6, "the" );
mySL.Add( 1.8, "dog" );
mySL.Add( 1.7, "lazy" );
-
+
// Gets the key and the value based on the index.
int myIndex=3;
Console.WriteLine( "The key at index {0} is {1}.", myIndex, mySL.GetKey( myIndex ) );
Console.WriteLine( "The value at index {0} is {1}.", myIndex, mySL.GetByIndex( myIndex ) );
-
+
// Gets the list of keys and the list of values.
IList myKeyList = mySL.GetKeyList();
IList myValueList = mySL.GetValueList();
-
+
// Prints the keys in the first column and the values in the second column.
Console.WriteLine( "\t-KEY-\t-VALUE-" );
for ( int i = 0; i < mySL.Count; i++ )
Console.WriteLine( "\t{0}\t{1}", myKeyList[i], myValueList[i] );
}
}
- /*
+ /*
This code produces the following output.
-
+
The key at index 3 is 1.3.
The value at index 3 is fox.
-KEY- -VALUE-
@@ -47,5 +47,5 @@ 1.5 over
1.6 the
1.7 lazy
1.8 dog
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.IndexOfKey Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.IndexOfKey Example/CS/source.cs
index 0be89d5cf57..2db46cecb81 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.IndexOfKey Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.IndexOfKey Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesSortedList {
-
+
public static void Main() {
-
+
// Creates and initializes a new SortedList.
SortedList mySL = new SortedList();
mySL.Add( 1, "one" );
@@ -12,15 +12,15 @@ public static void Main() {
mySL.Add( 2, "two" );
mySL.Add( 4, "four" );
mySL.Add( 0, "zero" );
-
+
// Displays the values of the SortedList.
Console.WriteLine( "The SortedList contains the following values:" );
PrintIndexAndKeysAndValues( mySL );
-
+
// Searches for a specific key.
int myKey = 2;
Console.WriteLine( "The key \"{0}\" is at index {1}.", myKey, mySL.IndexOfKey( myKey ) );
-
+
// Searches for a specific value.
String myValue = "three";
Console.WriteLine( "The value \"{0}\" is at index {1}.", myValue, mySL.IndexOfValue( myValue ) );
@@ -34,9 +34,9 @@ public static void PrintIndexAndKeysAndValues( SortedList myList ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The SortedList contains the following values:
-INDEX- -KEY- -VALUE-
[0]: 0 zero
@@ -44,8 +44,8 @@ This code produces the following output.
[2]: 2 two
[3]: 3 three
[4]: 4 four
-
+
The key "2" is at index 2.
The value "three" is at index 3.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.IsSynchronized Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.IsSynchronized Example/CS/source.cs
index 16cb2e8b5ad..3bf0c4252b9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.IsSynchronized Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.IsSynchronized Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesSortedList {
-
+
public static void Main() {
-
+
// Creates and initializes a new SortedList.
SortedList mySL = new SortedList();
mySL.Add( 2, "two" );
@@ -12,19 +12,19 @@ public static void Main() {
mySL.Add( 1, "one" );
mySL.Add( 0, "zero" );
mySL.Add( 4, "four" );
-
+
// Creates a synchronized wrapper around the SortedList.
SortedList mySyncdSL = SortedList.Synchronized( mySL );
-
+
// Displays the sychronization status of both SortedLists.
Console.WriteLine( "mySL is {0}.", mySL.IsSynchronized ? "synchronized" : "not synchronized" );
Console.WriteLine( "mySyncdSL is {0}.", mySyncdSL.IsSynchronized ? "synchronized" : "not synchronized" );
}
}
- /*
+ /*
This code produces the following output.
-
+
mySL is not synchronized.
mySyncdSL is synchronized.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.RemoveAt Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.RemoveAt Example/CS/source.cs
index a9786aad400..4ac796cf689 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.RemoveAt Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.RemoveAt Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesSortedList {
-
+
public static void Main() {
-
+
// Creates and initializes a new SortedList.
SortedList mySL = new SortedList();
mySL.Add( "3c", "dog" );
@@ -16,21 +16,21 @@ public static void Main() {
mySL.Add( "3b", "lazy" );
mySL.Add( "2a", "fox" );
mySL.Add( "2b", "jumps" );
-
+
// Displays the SortedList.
Console.WriteLine( "The SortedList initially contains the following:" );
PrintKeysAndValues( mySL );
-
+
// Removes the element with the key "3b".
mySL.Remove( "3b" );
-
+
// Displays the current state of the SortedList.
Console.WriteLine( "After removing \"lazy\":" );
PrintKeysAndValues( mySL );
-
+
// Removes the element at index 5.
mySL.RemoveAt( 5 );
-
+
// Displays the current state of the SortedList.
Console.WriteLine( "After removing the element at index 5:" );
PrintKeysAndValues( mySL );
@@ -44,9 +44,9 @@ public static void PrintKeysAndValues( SortedList myList ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The SortedList initially contains the following:
-KEY- -VALUE-
1a: The
@@ -58,7 +58,7 @@ This code produces the following output.
3a: the
3b: lazy
3c: dog
-
+
After removing "lazy":
-KEY- -VALUE-
1a: The
@@ -69,7 +69,7 @@ This code produces the following output.
2c: over
3a: the
3c: dog
-
+
After removing the element at index 5:
-KEY- -VALUE-
1a: The
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.SetByIndex Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.SetByIndex Example/CS/source.cs
index 364f3b9782a..114785bed45 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.SetByIndex Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic SortedList.SetByIndex Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesSortedList {
-
+
public static void Main() {
-
+
// Creates and initializes a new SortedList.
SortedList mySL = new SortedList();
mySL.Add( 2, "two" );
@@ -12,15 +12,15 @@ public static void Main() {
mySL.Add( 1, "one" );
mySL.Add( 0, "zero" );
mySL.Add( 4, "four" );
-
+
// Displays the values of the SortedList.
Console.WriteLine( "The SortedList contains the following values:" );
PrintIndexAndKeysAndValues( mySL );
-
+
// Replaces the values at index 3 and index 4.
mySL.SetByIndex( 3, "III" );
mySL.SetByIndex( 4, "IV" );
-
+
// Displays the updated values of the SortedList.
Console.WriteLine( "After replacing the value at index 3 and index 4," );
PrintIndexAndKeysAndValues( mySL );
@@ -34,9 +34,9 @@ public static void PrintIndexAndKeysAndValues( SortedList myList ) {
Console.WriteLine();
}
}
- /*
+ /*
This code produces the following output.
-
+
The SortedList contains the following values:
-INDEX- -KEY- -VALUE-
[0]: 0 zero
@@ -44,7 +44,7 @@ This code produces the following output.
[2]: 2 two
[3]: 3 three
[4]: 4 four
-
+
After replacing the value at index 3 and index 4,
-INDEX- -KEY- -VALUE-
[0]: 0 zero
@@ -52,5 +52,5 @@ This code produces the following output.
[2]: 2 two
[3]: 3 III
[4]: 4 IV
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack Example/CS/source.cs
index b6ef30ba186..f6f8c2f5ba0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack Example/CS/source.cs
@@ -2,15 +2,15 @@
using System;
using System.Collections;
public class SamplesStack {
-
+
public static void Main() {
-
+
// Creates and initializes a new Stack.
Stack myStack = new Stack();
myStack.Push("Hello");
myStack.Push("World");
myStack.Push("!");
-
+
// Displays the properties and values of the Stack.
Console.WriteLine( "myStack" );
Console.WriteLine( "\tCount: {0}", myStack.Count );
@@ -26,12 +26,12 @@ public static void PrintValues( IEnumerable myCollection ) {
}
- /*
+ /*
This code produces the following output.
-
+
myStack
Count: 3
Values: ! World Hello
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.Clear Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.Clear Example/CS/source.cs
index 07d17ad59d1..9371a33b0a5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.Clear Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.Clear Example/CS/source.cs
@@ -1,11 +1,11 @@
//
using System;
using System.Collections;
-
+
public class SamplesStack {
-
+
public static void Main() {
-
+
// Creates and initializes a new Stack.
Stack myStack = new Stack();
myStack.Push( "The" );
@@ -13,16 +13,16 @@ public static void Main() {
myStack.Push( "brown" );
myStack.Push( "fox" );
myStack.Push( "jumps" );
-
+
// Displays the count and values of the Stack.
Console.WriteLine( "Initially," );
Console.WriteLine( " Count : {0}", myStack.Count );
Console.Write( " Values:" );
PrintValues( myStack );
-
+
// Clears the Stack.
myStack.Clear();
-
+
// Displays the count and values of the Stack.
Console.WriteLine( "After Clear," );
Console.WriteLine( " Count : {0}", myStack.Count );
@@ -38,15 +38,15 @@ public static void PrintValues( IEnumerable myCollection ) {
}
- /*
+ /*
This code produces the following output.
-
+
Initially,
Count : 5
Values: jumps fox brown quick The
After Clear,
Count : 0
Values:
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.CopyTo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.CopyTo Example/CS/source.cs
index 701233a8417..1003c5d39aa 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.CopyTo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.CopyTo Example/CS/source.cs
@@ -2,9 +2,9 @@
using System;
using System.Collections;
public class SamplesStack {
-
+
public static void Main() {
-
+
// Creates and initializes the source Stack.
Stack mySourceQ = new Stack();
mySourceQ.Push( "barn" );
@@ -13,7 +13,7 @@ public static void Main() {
mySourceQ.Push( "cats" );
mySourceQ.Push( "napping" );
mySourceQ.Push( "three" );
-
+
// Creates and initializes the one-dimensional target Array.
Array myTargetArray=Array.CreateInstance( typeof(String), 15 );
myTargetArray.SetValue( "The", 0 );
@@ -25,20 +25,20 @@ public static void Main() {
myTargetArray.SetValue( "the", 6 );
myTargetArray.SetValue( "lazy", 7 );
myTargetArray.SetValue( "dog", 8 );
-
+
// Displays the values of the target Array.
Console.WriteLine( "The target Array contains the following (before and after copying):" );
PrintValues( myTargetArray, ' ' );
-
+
// Copies the entire source Stack to the target Array, starting at index 6.
mySourceQ.CopyTo( myTargetArray, 6 );
-
+
// Displays the values of the target Array.
PrintValues( myTargetArray, ' ' );
-
+
// Copies the entire source Stack to a new standard array.
Object[] myStandardArray = mySourceQ.ToArray();
-
+
// Displays the values of the new standard array.
Console.WriteLine( "The new standard array contains the following:" );
PrintValues( myStandardArray, ' ' );
@@ -53,12 +53,12 @@ public static void PrintValues( Array myArr, char mySeparator ) {
}
- /*
+ /*
This code produces the following output.
-
+
The target Array contains the following (before and after copying):
- The quick brown fox jumps over the lazy dog
- The quick brown fox jumps over three napping cats in the barn
+ The quick brown fox jumps over the lazy dog
+ The quick brown fox jumps over three napping cats in the barn
The new standard array contains the following:
three napping cats in the barn
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.IsSynchronized Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.IsSynchronized Example/CS/source.cs
index 52c7b64bae7..8d769005ebf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.IsSynchronized Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.IsSynchronized Example/CS/source.cs
@@ -2,19 +2,19 @@
using System;
using System.Collections;
public class SamplesStack {
-
+
public static void Main() {
-
+
// Creates and initializes a new Stack.
Stack myStack = new Stack();
myStack.Push( "The" );
myStack.Push( "quick" );
myStack.Push( "brown" );
myStack.Push( "fox" );
-
+
// Creates a synchronized wrapper around the Stack.
Stack mySyncdStack = Stack.Synchronized( myStack );
-
+
// Displays the sychronization status of both Stacks.
Console.WriteLine( "myStack is {0}.",
myStack.IsSynchronized ? "synchronized" : "not synchronized" );
@@ -22,10 +22,10 @@ public static void Main() {
mySyncdStack.IsSynchronized ? "synchronized" : "not synchronized" );
}
}
- /*
+ /*
This code produces the following output.
-
+
myStack is not synchronized.
mySyncdStack is synchronized.
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.Peek Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.Peek Example/CS/source.cs
index 5bcb01e5adf..21a28d8cad9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.Peek Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stack.Peek Example/CS/source.cs
@@ -2,37 +2,37 @@
using System;
using System.Collections;
public class SamplesStack {
-
+
public static void Main() {
-
+
// Creates and initializes a new Stack.
Stack myStack = new Stack();
myStack.Push( "The" );
myStack.Push( "quick" );
myStack.Push( "brown" );
myStack.Push( "fox" );
-
+
// Displays the Stack.
Console.Write( "Stack values:" );
PrintValues( myStack, '\t' );
-
+
// Removes an element from the Stack.
Console.WriteLine( "(Pop)\t\t{0}", myStack.Pop() );
-
+
// Displays the Stack.
Console.Write( "Stack values:" );
PrintValues( myStack, '\t' );
-
+
// Removes another element from the Stack.
Console.WriteLine( "(Pop)\t\t{0}", myStack.Pop() );
-
+
// Displays the Stack.
Console.Write( "Stack values:" );
PrintValues( myStack, '\t' );
-
+
// Views the first element in the Stack but does not remove it.
Console.WriteLine( "(Peek)\t\t{0}", myStack.Peek() );
-
+
// Displays the Stack.
Console.Write( "Stack values:" );
PrintValues( myStack, '\t' );
@@ -46,9 +46,9 @@ public static void PrintValues( IEnumerable myCollection, char mySeparator ) {
}
- /*
+ /*
This code produces the following output.
-
+
Stack values: fox brown quick The
(Pop) fox
Stack values: brown quick The
@@ -56,6 +56,6 @@ This code produces the following output.
Stack values: quick The
(Peek) quick
Stack values: quick The
- */
+ */
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stream.CanWrite Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stream.CanWrite Example/CS/source.cs
index cb98dfaad12..8d84073e445 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stream.CanWrite Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stream.CanWrite Example/CS/source.cs
@@ -1,11 +1,11 @@
//
using System;
using System.IO;
-
- class TestRW
+
+ class TestRW
{
public static void Main(String[] args)
- {
+ {
FileStream fs = new FileStream("MyFile.txt", FileMode.OpenOrCreate,
FileAccess.Write);
if (fs.CanRead && fs.CanWrite) {
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stream.Read Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stream.Read Example/CS/source.cs
index 1499dc3ab0f..3f9f3bc76dd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stream.Read Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Stream.Read Example/CS/source.cs
@@ -25,7 +25,7 @@ public static void Main()
numBytesToRead -= n;
} while (numBytesToRead > 0);
s.Close();
-
+
Console.WriteLine("number of bytes read: {0:d}", numBytesRead);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic StreamWriter.Write2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic StreamWriter.Write2 Example/CS/source.cs
index 0023706ce97..10beb0c4cf3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic StreamWriter.Write2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic StreamWriter.Write2 Example/CS/source.cs
@@ -1,8 +1,8 @@
//
using System;
using System.IO;
-
-public class SWBuff
+
+public class SWBuff
{
public static void Main(String[] args)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.PadLeft1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.PadLeft1 Example/CS/source.cs
index 783d8ffa925..a351422177e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.PadLeft1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.PadLeft1 Example/CS/source.cs
@@ -4,12 +4,12 @@
class Sample
{
public static void Main()
- {
+ {
string str = "forty-two";
char pad = '.';
- Console.WriteLine(str.PadLeft(15, pad));
- Console.WriteLine(str.PadLeft(2, pad));
+ Console.WriteLine(str.PadLeft(15, pad));
+ Console.WriteLine(str.PadLeft(2, pad));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.PadRight Example/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.PadRight Example/cs/source.cs
index 1a82b6de6d6..976287c84ac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.PadRight Example/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.PadRight Example/cs/source.cs
@@ -7,11 +7,11 @@ public static void Main()
//
string str;
str = "BBQ and Slaw";
-
+
Console.Write("|");
Console.Write(str.PadRight(15));
Console.WriteLine("|"); // Displays "|BBQ and Slaw |".
-
+
Console.Write("|");
Console.Write(str.PadRight(5));
Console.WriteLine("|"); // Displays "|BBQ and Slaw|".
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.Substring1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.Substring1 Example/CS/source.cs
index acfa2827f55..dd7c4431eb1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.Substring1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic String.Substring1 Example/CS/source.cs
@@ -2,7 +2,7 @@
public class Sample
{
- public static void Main()
+ public static void Main()
{
//
String myString = "abc";
@@ -10,15 +10,15 @@ public static void Main()
Console.WriteLine(test1);
bool test2 = String.IsNullOrEmpty(myString.Substring(3, 0)); // This is true.
Console.WriteLine(test2);
- try
+ try
{
string str3 = myString.Substring(3, 1); // This throws ArgumentOutOfRangeException.
Console.WriteLine(str3);
}
- catch (ArgumentOutOfRangeException e)
+ catch (ArgumentOutOfRangeException e)
{
Console.WriteLine(e.Message);
- }
+ }
// The example displays the following output:
// True
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener Example/CS/source.cs
index 0faa764aa70..7b2ce03ecd8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener Example/CS/source.cs
@@ -9,18 +9,18 @@ public class Sample
public static int Main(string[] args) {
// Create a file for output named TestFile.txt.
Stream myFile = File.Create("TestFile.txt");
-
+
/* Create a new text writer using the output stream, and add it to
* the trace listeners. */
- TextWriterTraceListener myTextListener = new
+ TextWriterTraceListener myTextListener = new
TextWriterTraceListener(myFile);
Trace.Listeners.Add(myTextListener);
-
+
// Write output to the file.
Trace.Write("Test output ");
// Flush the output.
- Trace.Flush();
+ Trace.Flush();
return 0;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Close Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Close Example/CS/source.cs
index b38a743b9b1..cb6eb56ff5d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Close Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Close Example/CS/source.cs
@@ -7,7 +7,7 @@
public class TextWriterTraceListenerSample
{
- public static void Main()
+ public static void Main()
{
TextWriterTraceListener myTextListener = null;
@@ -21,7 +21,7 @@ public static void Main()
// Write trace output to all trace listeners.
Trace.WriteLine(DateTime.Now.ToString() + " - Trace output");
-
+
// Remove and close the file writer/trace listener.
myTextListener.Flush();
Trace.Listeners.Remove(myTextListener);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Write Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Write Example/CS/source.cs
index 112a064854f..b8aaa73caaa 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Write Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Write Example/CS/source.cs
@@ -2,7 +2,7 @@
using System.Diagnostics;
//
-public class Sample
+public class Sample
{
void Main(string[] args) {
@@ -11,11 +11,11 @@ void Main(string[] args) {
TextWriterTraceListener myWriter = new TextWriterTraceListener();
myWriter.Writer = System.Console.Out;
Trace.Listeners.Add(myWriter);
-
+
// Write the output to the console screen.
myWriter.Write("Write to console screen. ");
myWriter.WriteLine("Again, write to the Console screen.");
-
+
// Flush and close the output.
myWriter.Flush();
myWriter.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.WriteLine Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.WriteLine Example/CS/source.cs
index 3d1d4edcdab..1660e9c2eb7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.WriteLine Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.WriteLine Example/CS/source.cs
@@ -11,11 +11,11 @@ public static void Main(string[] args) {
TextWriterTraceListener myWriter = new TextWriterTraceListener();
myWriter.Writer = System.Console.Out;
Trace.Listeners.Add(myWriter);
-
+
// Write the output to the console screen.
myWriter.Write("Write to the Console screen. ");
myWriter.WriteLine("Again, write to console screen.");
-
+
// Flush and close the output.
myWriter.Flush();
myWriter.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Writer Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Writer Example/CS/source.cs
index 8fed46b1140..24cc698cbf2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Writer Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TextWriterTraceListener.Writer Example/CS/source.cs
@@ -10,7 +10,7 @@ protected void Method()
TextWriterTraceListener myWriter = new TextWriterTraceListener();
myWriter.Writer = System.Console.Out;
Trace.Listeners.Add(myWriter);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Thread Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Thread Example/CS/source.cs
index 457d01392a9..e568b58b2cf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Thread Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Thread Example/CS/source.cs
@@ -6,7 +6,7 @@
// on a second thread.
public class ThreadExample {
// The ThreadProc method is called when the thread starts.
- // It loops ten times, writing to the console and yielding
+ // It loops ten times, writing to the console and yielding
// the rest of its time slice each time, and then ends.
public static void ThreadProc() {
for (int i = 0; i < 10; i++) {
@@ -18,14 +18,14 @@ public static void ThreadProc() {
public static void Main() {
Console.WriteLine("Main thread: Start a second thread.");
- // The constructor for the Thread class requires a ThreadStart
- // delegate that represents the method to be executed on the
+ // The constructor for the Thread class requires a ThreadStart
+ // delegate that represents the method to be executed on the
// thread. C# simplifies the creation of this delegate.
Thread t = new Thread(new ThreadStart(ThreadProc));
- // Start ThreadProc. Note that on a uniprocessor, the new
- // thread does not get any processor time until the main thread
- // is preempted or yields. Uncomment the Thread.Sleep that
+ // Start ThreadProc. Note that on a uniprocessor, the new
+ // thread does not get any processor time until the main thread
+ // is preempted or yields. Uncomment the Thread.Sleep that
// follows t.Start() to see the difference.
t.Start();
//Thread.Sleep(0);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ThreadExceptionEventArgs Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ThreadExceptionEventArgs Example/CS/source.cs
index 9c46bde3996..a9b0996115a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ThreadExceptionEventArgs Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic ThreadExceptionEventArgs Example/CS/source.cs
@@ -28,7 +28,7 @@ private void button1_Click(object sender, System.EventArgs e)
{
throw new ArgumentException("The parameter was invalid");
}
-
+
public static void Main()
{
// Add the event handler.
@@ -38,7 +38,7 @@ public static void Main()
Application.Run(new ErrorForm());
}
}
-
+
// Create a class to handle the exception event.
internal class CustomExceptionHandler
{
@@ -48,10 +48,10 @@ public static void OnThreadException(object sender, ThreadExceptionEventArgs t)
DialogResult result = ShowThreadExceptionDialog(t.Exception);
// Exit the program when the user clicks Abort.
- if (result == DialogResult.Abort)
+ if (result == DialogResult.Abort)
Application.Exit();
}
-
+
// Create and display the error message.
private static DialogResult ShowThreadExceptionDialog(Exception e)
{
@@ -59,9 +59,9 @@ private static DialogResult ShowThreadExceptionDialog(Exception e)
"with the following information:\n\n";
errorMsg += String.Format("Exception Type: {0}\n\n", e.GetType().Name);
errorMsg += "\n\nStack Trace:\n" + e.StackTrace;
- return MessageBox.Show(errorMsg, "Application Error",
+ return MessageBox.Show(errorMsg, "Application Error",
MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop);
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Timer Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Timer Example/CS/source.cs
index 6ab2b812859..52ad5b92927 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Timer Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Timer Example/CS/source.cs
@@ -1,6 +1,6 @@
//
-// Use this code inside a project created with the Visual C# > Windows Desktop > Console Application template.
-// Replace the code in Program.cs with this code.
+// Use this code inside a project created with the Visual C# > Windows Desktop > Console Application template.
+// Replace the code in Program.cs with this code.
using System;
@@ -16,8 +16,8 @@ public static void Main()
// Normally, the timer is declared at the class level, so that it stays in scope as long as it
// is needed. If the timer is declared in a long-running method, KeepAlive must be used to prevent
// the JIT compiler from allowing aggressive garbage collection to occur before the method ends.
- // You can experiment with this by commenting out the class-level declaration and uncommenting
- // the declaration below; then uncomment the GC.KeepAlive(aTimer) at the end of the method.
+ // You can experiment with this by commenting out the class-level declaration and uncommenting
+ // the declaration below; then uncomment the GC.KeepAlive(aTimer) at the end of the method.
//System.Timers.Timer aTimer;
// Create a timer and set a two second interval.
@@ -30,7 +30,7 @@ public static void Main()
// Create a timer with a two second interval.
aTimer = new System.Timers.Timer(2000);
- // Hook up the Elapsed event for the timer.
+ // Hook up the Elapsed event for the timer.
aTimer.Elapsed += OnTimedEvent;
// Have the timer fire repeated events (true is the default)
@@ -43,8 +43,8 @@ public static void Main()
Console.ReadLine();
// If the timer is declared in a long-running method, use KeepAlive to prevent garbage collection
- // from occurring before the method ends.
- //GC.KeepAlive(aTimer)
+ // from occurring before the method ends.
+ //GC.KeepAlive(aTimer)
}
private static void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
@@ -53,12 +53,12 @@ private static void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e
}
}
-// This example displays output like the following:
-// Press the Enter key to exit the program at any time...
-// The Elapsed event was raised at 5/20/2015 8:48:58 PM
-// The Elapsed event was raised at 5/20/2015 8:49:00 PM
-// The Elapsed event was raised at 5/20/2015 8:49:02 PM
-// The Elapsed event was raised at 5/20/2015 8:49:04 PM
-// The Elapsed event was raised at 5/20/2015 8:49:06 PM
+// This example displays output like the following:
+// Press the Enter key to exit the program at any time...
+// The Elapsed event was raised at 5/20/2015 8:48:58 PM
+// The Elapsed event was raised at 5/20/2015 8:49:00 PM
+// The Elapsed event was raised at 5/20/2015 8:49:02 PM
+// The Elapsed event was raised at 5/20/2015 8:49:04 PM
+// The Elapsed event was raised at 5/20/2015 8:49:06 PM
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Timer.Timer1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Timer.Timer1 Example/CS/source.cs
index 88292edd199..131b5386486 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Timer.Timer1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Timer.Timer1 Example/CS/source.cs
@@ -11,22 +11,22 @@ public static void Main()
// Create a timer with a 1.5 second interval.
double interval = 1500.0;
aTimer = new System.Timers.Timer(interval);
-
+
// Hook up the event handler for the Elapsed event.
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
// Only raise the event the first time Interval elapses.
aTimer.AutoReset = false;
aTimer.Enabled = true;
-
+
// Ensure the event fires before the exit message appears.
System.Threading.Thread.Sleep((int) interval * 2);
Console.WriteLine("Press the Enter key to exit the program.");
Console.ReadLine();
}
-
+
// Handle the Elapsed event.
- private static void OnTimedEvent(object source, ElapsedEventArgs e)
+ private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
Console.WriteLine("Hello World!");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace Example/CS/source.cs
index 220611d2058..29147339bbd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace Example/CS/source.cs
@@ -1,6 +1,6 @@
//
// Specify /d:TRACE when compiling.
-
+
using System;
using System.Diagnostics;
@@ -13,7 +13,7 @@ static void Main()
Trace.Indent();
Trace.WriteLine("Entering Main");
Console.WriteLine("Hello World.");
- Trace.WriteLine("Exiting Main");
+ Trace.WriteLine("Exiting Main");
Trace.Unindent();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert Example/CS/source.cs
index 0bef1713a50..5fe5b322b2c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert Example/CS/source.cs
@@ -8,13 +8,13 @@ public class Form1: Form
//
// Create an index for an array.
protected int index;
-
+
protected void Method()
- {
+ {
// Perform some action that sets the index.
-
- // Test that the index value is valid.
+
+ // Test that the index value is valid.
Trace.Assert(index > -1);
- }
+ }
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert1 Example/CS/source.cs
index 8ea646bf741..7e30dea95d7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert1 Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Form1: Form
//
public static void MyMethod(Type type, Type baseType) {
Trace.Assert(type != null, "Type parameter is null");
-
+
// Perform some processing.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert2 Example/CS/source.cs
index 18b52d36493..fe5d7a3e833 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Assert2 Example/CS/source.cs
@@ -7,9 +7,9 @@ public class Form1: Form
{
//
public static void MyMethod(Type type, Type baseType) {
- Trace.Assert(type != null, "Type parameter is null",
+ Trace.Assert(type != null, "Type parameter is null",
"Can't get object for null type");
-
+
// Perform some processing.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Fail Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Fail Example/CS/source.cs
index 208760f446d..e77c41166e9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Fail Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Fail Example/CS/source.cs
@@ -23,7 +23,7 @@ public void Method( Option option )
case Option.First:
result = 1.0;
break;
-
+
// Insert additional cases.
default:
Trace.Fail("Unknown Option " + option);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Fail1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Fail1 Example/CS/source.cs
index 9aaa1795105..48dd3e3533a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Fail1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Fail1 Example/CS/source.cs
@@ -20,7 +20,7 @@ public void Method(Option option, string userInput)
}
//
catch (Exception) {
- Trace.Fail("Invalid value: " + value.ToString(),
+ Trace.Fail("Invalid value: " + value.ToString(),
"Resetting value to newValue.");
value = newValue;
}
@@ -30,9 +30,9 @@ public void Method(Option option, string userInput)
case Option.First:
result = 1.0;
break;
-
+
// Insert additional cases.
-
+
default:
Trace.Fail("Unsupported option " + option, "Result set to 1.0");
result = 1.0;
@@ -42,7 +42,7 @@ public void Method(Option option, string userInput)
}
[STAThread]
- static void Main()
+ static void Main()
{
Form1 myForm = new Form1();
myForm.Method(Option.Second, "not an integer string");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Flush Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Flush Example/CS/source.cs
index 54359cc26b0..b3544d20578 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Flush Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Flush Example/CS/source.cs
@@ -10,18 +10,18 @@ class Test
static void Main()
{
// Create a file for output named TestFile.txt.
- using (FileStream myFileStream =
+ using (FileStream myFileStream =
new FileStream("TestFile.txt", FileMode.Append))
{
- // Create a new text writer using the output stream
+ // Create a new text writer using the output stream
// and add it to the trace listeners.
- TextWriterTraceListener myTextListener =
+ TextWriterTraceListener myTextListener =
new TextWriterTraceListener(myFileStream);
Trace.Listeners.Add(myTextListener);
-
+
// Write output to the file.
Trace.WriteLine("Test output");
-
+
// Flush and close the output stream.
Trace.Flush();
Trace.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.IndentLevel Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.IndentLevel Example/CS/source.cs
index b1d713bde3b..b6690b635a4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.IndentLevel Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.IndentLevel Example/CS/source.cs
@@ -14,7 +14,7 @@ public void Method()
Trace.WriteLine("Error 2: Directory not found");
Trace.Unindent();
Trace.WriteLine("End of list of errors");
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write Example/CS/source.cs
index c886b1efe9e..d241c8dcdcf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write Example/CS/source.cs
@@ -9,12 +9,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod() {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Trace.Write("My error message. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Trace.WriteLine("My second error message.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write1 Example/CS/source.cs
index 9259fa85914..1f801004683 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write1 Example/CS/source.cs
@@ -9,12 +9,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject) {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Trace.Write(myObject);
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Trace.WriteLine(" is not a valid value for this method.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write2 Example/CS/source.cs
index f242bc2f5c8..4af781d3473 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write2 Example/CS/source.cs
@@ -9,13 +9,13 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
- Trace.Write(myObject.ToString() + " is not a valid object for category: ",
+ Trace.Write(myObject.ToString() + " is not a valid object for category: ",
category);
-
+
// Write a second message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Trace.WriteLine(" Please use a different category.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write3 Example/CS/source.cs
index b768ad931b1..cf3be989442 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.Write3 Example/CS/source.cs
@@ -9,12 +9,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Trace.Write(myObject, category);
-
+
// Write a second message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Trace.WriteLine(" Object is not valid for this category.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf Example/CS/source.cs
index b0310107a8f..5fe0f4f44e9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf Example/CS/source.cs
@@ -9,11 +9,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod() {
// Write the message if the TraceSwitch level is set to Error or higher.
Trace.WriteIf(generalSwitch.TraceError, "My error message. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Trace.WriteLineIf(generalSwitch.TraceVerbose, "My second error message.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf1 Example/CS/source.cs
index bd4bfa5ddaa..c13b28be62f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf1 Example/CS/source.cs
@@ -9,11 +9,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject) {
// Write the message if the TraceSwitch level is set to Error or higher.
Trace.WriteIf(generalSwitch.TraceError, myObject);
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Trace.WriteLineIf(generalSwitch.TraceVerbose, " is not a valid value for this method.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf2 Example/CS/source.cs
index e159fe48579..f29e04cfa09 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf2 Example/CS/source.cs
@@ -9,12 +9,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Verbose.
- Trace.WriteIf(generalSwitch.TraceVerbose, myObject.ToString() +
+ Trace.WriteIf(generalSwitch.TraceVerbose, myObject.ToString() +
" is not a valid object for category: ", category);
-
+
// Write a second message if the TraceSwitch level is set to Error or higher.
Trace.WriteLineIf(generalSwitch.TraceError, " Please use a different category.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf3 Example/CS/source.cs
index 92085035048..ffe80096982 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteIf3 Example/CS/source.cs
@@ -9,11 +9,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Verbose.
Trace.WriteIf(generalSwitch.TraceVerbose, myObject, category);
-
+
// Write a second message if the TraceSwitch level is set to Error or higher.
Trace.WriteLineIf(generalSwitch.TraceError, " Object is not valid for this category.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine1 Example/CS/source.cs
index 98ecb9d094b..70669a2f78b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine1 Example/CS/source.cs
@@ -9,12 +9,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject) {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Trace.Write("Invalid object. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Trace.WriteLine(myObject);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine2 Example/CS/source.cs
index a9eb8b4173f..1899ada3e05 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine2 Example/CS/source.cs
@@ -9,12 +9,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(String category) {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Trace.Write("My error message. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Trace.WriteLine("My second error message.", category);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine3 Example/CS/source.cs
index 88b4d461972..12d86957e86 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLine3 Example/CS/source.cs
@@ -9,12 +9,12 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Error or higher.
if(generalSwitch.TraceError)
Trace.Write("Invalid object for category. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
if(generalSwitch.TraceVerbose)
Trace.WriteLine(myObject, category);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf1 Example/CS/source.cs
index 9dee33f968e..1d843a2d276 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf1 Example/CS/source.cs
@@ -9,11 +9,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject) {
// Write the message if the TraceSwitch level is set to Error or higher.
Trace.WriteIf(generalSwitch.TraceError, "Invalid object. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Trace.WriteLineIf(generalSwitch.TraceVerbose, myObject);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf2 Example/CS/source.cs
index 86c086cf0a7..e53a5c3820a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf2 Example/CS/source.cs
@@ -9,11 +9,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(String category) {
// Write the message if the TraceSwitch level is set to Error or higher.
Trace.WriteIf(generalSwitch.TraceError, "My error message. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Trace.WriteLineIf(generalSwitch.TraceVerbose, "My second error message.", category);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf3 Example/CS/source.cs
index 82628f7edcb..d26059ddc1f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Trace.WriteLineIf3 Example/CS/source.cs
@@ -9,11 +9,11 @@ public class Form1: Form
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch generalSwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyErrorMethod(Object myObject, String category) {
// Write the message if the TraceSwitch level is set to Error or higher.
Trace.WriteIf(generalSwitch.TraceError, "Invalid object for category. ");
-
+
// Write a second message if the TraceSwitch level is set to Verbose.
Trace.WriteLineIf(generalSwitch.TraceVerbose, myObject, category);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceListenerCollection.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceListenerCollection.Add Example/CS/source.cs
index aba93653873..4db5f81b434 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceListenerCollection.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceListenerCollection.Add Example/CS/source.cs
@@ -8,12 +8,12 @@ public class Form1: Form
public void Method()
{
//
-/* Create a listener, which outputs to the console screen, and
+/* Create a listener, which outputs to the console screen, and
* add it to the trace listeners. */
TextWriterTraceListener myWriter = new TextWriterTraceListener();
myWriter.Writer = System.Console.Out;
Trace.Listeners.Add(myWriter);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.Level Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.Level Example/CS/source.cs
index 779587d3c78..529eec828b7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.Level Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.Level Example/CS/source.cs
@@ -8,19 +8,19 @@ public class Form1: Form
//
//Class-level declaration.
/* Create a TraceSwitch to use in the entire application.*/
-
+
static TraceSwitch mySwitch = new TraceSwitch("mySwitch", "Entire Application");
-
+
static public void MyMethod() {
// Write the message if the TraceSwitch level is set to Error or higher.
if(mySwitch.TraceError)
Console.WriteLine("My error message.");
-
+
// Write the message if the TraceSwitch level is set to Verbose.
if(mySwitch.TraceVerbose)
Console.WriteLine("My second error message.");
}
-
+
public static void Main(string[] args) {
// Run the method that prints error messages based on the switch level.
MyMethod();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceError Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceError Example/CS/source.cs
index fb24a659af3..3a7fbedde92 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceError Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceError Example/CS/source.cs
@@ -9,21 +9,21 @@ public class Form1: Form
//Class-level declaration.
/* Create a TraceSwitch to use in the entire application.*/
static TraceSwitch mySwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyMethod() {
// Write the message if the TraceSwitch level is set to Error or higher.
if(mySwitch.TraceError)
Console.WriteLine("My error message.");
-
+
// Write the message if the TraceSwitch level is set to Verbose.
if(mySwitch.TraceVerbose)
Console.WriteLine("My second error message.");
}
-
+
public static void Main(string[] args) {
// Run the method that prints error messages based on the switch level.
MyMethod();
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceInfo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceInfo Example/CS/source.cs
index 9523fa631fc..9f8e71c7d06 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceInfo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceInfo Example/CS/source.cs
@@ -9,21 +9,21 @@ public class Form1: Form
//Class-level declaration.
/* Create a TraceSwitch to use in the entire application.*/
static TraceSwitch mySwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyMethod() {
// Write the message if the TraceSwitch level is set to Info or higher.
if(mySwitch.TraceInfo)
Console.WriteLine("My error message.");
-
+
// Write the message if the TraceSwitch level is set to Verbose.
if(mySwitch.TraceVerbose)
Console.WriteLine("My second error message.");
}
-
+
public static void Main(string[] args) {
// Run the method that prints error messages based on the switch level.
MyMethod();
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceWarning Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceWarning Example/CS/source.cs
index 82dabeba5ef..a6dff991da2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceWarning Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TraceSwitch.TraceWarning Example/CS/source.cs
@@ -9,21 +9,21 @@ public class Form1: Form
//Class-level declaration.
/* Create a TraceSwitch to use in the entire application.*/
static TraceSwitch mySwitch = new TraceSwitch("General", "Entire Application");
-
+
static public void MyMethod() {
// Write the message if the TraceSwitch level is set to Warning or higher.
if(mySwitch.TraceWarning)
Console.WriteLine("My error message.");
-
+
// Write the message if the TraceSwitch level is set to Verbose.
if(mySwitch.TraceVerbose)
Console.WriteLine("My second error message.");
}
-
+
public static void Main(string[] args) {
// Run the method that prints error messages based on the switch level.
MyMethod();
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CS/source.cs
index e6e3136e6ce..454e966f8cc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CS/source.cs
@@ -7,9 +7,9 @@ public class Form1: Form
protected TreeNode mySelectedNode;
//
-/* Get the tree node under the mouse pointer and
+/* Get the tree node under the mouse pointer and
save it in the mySelectedNode variable. */
-private void treeView1_MouseDown(object sender,
+private void treeView1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
mySelectedNode = treeView1.GetNodeAt(e.X, e.Y);
@@ -28,12 +28,12 @@ private void menuItem1_Click(object sender, System.EventArgs e)
}
else
{
- MessageBox.Show("No tree node selected or selected node is a root node.\n" +
+ MessageBox.Show("No tree node selected or selected node is a root node.\n" +
"Editing of root nodes is not allowed.", "Invalid selection");
}
}
-private void treeView1_AfterLabelEdit(object sender,
+private void treeView1_AfterLabelEdit(object sender,
System.Windows.Forms.NodeLabelEditEventArgs e)
{
if (e.Label != null)
@@ -47,21 +47,21 @@ private void treeView1_AfterLabelEdit(object sender,
}
else
{
- /* Cancel the label edit action, inform the user, and
+ /* Cancel the label edit action, inform the user, and
place the node in edit mode again. */
e.CancelEdit = true;
- MessageBox.Show("Invalid tree node label.\n" +
- "The invalid characters are: '@','.', ',', '!'",
+ MessageBox.Show("Invalid tree node label.\n" +
+ "The invalid characters are: '@','.', ',', '!'",
"Node Label Edit");
e.Node.BeginEdit();
}
}
else
{
- /* Cancel the label edit action, inform the user, and
+ /* Cancel the label edit action, inform the user, and
place the node in edit mode again. */
e.CancelEdit = true;
- MessageBox.Show("Invalid tree node label.\nThe label cannot be blank",
+ MessageBox.Show("Invalid tree node label.\nThe label cannot be blank",
"Node Label Edit");
e.Node.BeginEdit();
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TripleDESCryptoServiceProvider Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TripleDESCryptoServiceProvider Example/CS/source.cs
index 3649ff2892f..fdd255ced67 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TripleDESCryptoServiceProvider Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic TripleDESCryptoServiceProvider Example/CS/source.cs
@@ -7,23 +7,23 @@ public class Sample
{
//
private static void EncryptData(String inName, String outName, byte[] tdesKey, byte[] tdesIV)
- {
+ {
//Create the file streams to handle the input and output files.
FileStream fin = new FileStream(inName, FileMode.Open, FileAccess.Read);
FileStream fout = new FileStream(outName, FileMode.OpenOrCreate, FileAccess.Write);
fout.SetLength(0);
-
+
//Create variables to help with read and write.
byte[] bin = new byte[100]; //This is intermediate storage for the encryption.
long rdlen = 0; //This is the total number of bytes written.
long totlen = fin.Length; //This is the total length of the input file.
int len; //This is the number of bytes to be written at a time.
-
- TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
+
+ TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
CryptoStream encStream = new CryptoStream(fout, tdes.CreateEncryptor(tdesKey, tdesIV), CryptoStreamMode.Write);
-
+
Console.WriteLine("Encrypting...");
-
+
//Read from the input file, then encrypt and write to the output file.
while(rdlen < totlen)
{
@@ -32,8 +32,8 @@ private static void EncryptData(String inName, String outName, byte[] tdesKey, b
rdlen = rdlen + len;
Console.WriteLine("{0} bytes processed", rdlen);
}
-
- encStream.Close();
+
+ encStream.Close();
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.DeclaringType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.DeclaringType Example/CS/source.cs
index d31c9552bfd..9fa2cff432b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.DeclaringType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.DeclaringType Example/CS/source.cs
@@ -1,21 +1,21 @@
//
using System;
using System.Reflection;
-
-public abstract class dtype
+
+public abstract class dtype
{
-
- public abstract class MyClassA
+
+ public abstract class MyClassA
{
- public abstract int m();
+ public abstract int m();
}
-
- public abstract class MyClassB : MyClassA
+
+ public abstract class MyClassB : MyClassA
{
}
-
- public static void Main(string[] args)
- {
+
+ public static void Main(string[] args)
+ {
Console.WriteLine("The declaring type of m is {0}.",
typeof(MyClassB).GetMethod("m").DeclaringType);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.EmptyTypes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.EmptyTypes Example/CS/source.cs
index a6edec79534..785ed35dbb0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.EmptyTypes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.EmptyTypes Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Sample
public void Method(Type type) {
ConstructorInfo cInfo;
//
-cInfo = type.GetConstructor (BindingFlags.ExactBinding, null,
+cInfo = type.GetConstructor (BindingFlags.ExactBinding, null,
Type.EmptyTypes, null);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.FilterName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.FilterName Example/CS/source.cs
index ec57f2dc98c..6b5377057d8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.FilterName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.FilterName Example/CS/source.cs
@@ -7,8 +7,8 @@ public void Method()
{
//
// Get the set of methods associated with the type
- MemberInfo[] mi = typeof(Application).FindMembers(MemberTypes.Constructor |
- MemberTypes.Method,
+ MemberInfo[] mi = typeof(Application).FindMembers(MemberTypes.Constructor |
+ MemberTypes.Method,
BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.DeclaredOnly,
Type.FilterName, "*");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source1.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source1.cs
index 5e2ce0958ee..e852c89c11e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source1.cs
@@ -1,16 +1,16 @@
//
using System;
using System.Reflection;
-
+
public class t {
public t() {}
static t() {}
public t(int i) {}
-
+
public static void Main() {
ConstructorInfo[] p = typeof(t).GetConstructors();
Console.WriteLine(p.Length);
-
+
for (int i=0;i
using System;
using System.Reflection;
-
+
public class t {
public t() {}
static t() {}
public t(int i) {}
-
+
public static void Main() {
ConstructorInfo[] p = typeof(t).GetConstructors(
BindingFlags.Public | BindingFlags.Static |
BindingFlags.NonPublic | BindingFlags.Instance);
Console.WriteLine(p.Length);
-
+
for (int i=0;i
//
-public class A
+public class A
{
public class B { }
private class C { }
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.IsSpecialName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.IsSpecialName Example/CS/source.cs
index c2eb0a4c530..ecc5e045dfb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.IsSpecialName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.IsSpecialName Example/CS/source.cs
@@ -8,36 +8,36 @@ public class Sample
{
protected bool ShowMethods;
protected StreamWriter myWriter;
-
+
private void DumpMethods(Type aType)
{
if (!ShowMethods)
return;
MethodInfo[] mInfo = aType.GetMethods();
- myWriter.WriteLine("Methods");
- bool found = false;
+ myWriter.WriteLine("Methods");
+ bool found = false;
if (mInfo.Length != 0)
{
for (int i=0; i < mInfo.Length; i++)
{
- // Only display methods declared in this type. Also
+ // Only display methods declared in this type. Also
// filter out any methods with special names, because these
- // cannot be generally called by the user. That is, their
+ // cannot be generally called by the user. That is, their
// functionality is usually exposed in other ways, for example,
// property get/set methods are exposed as properties.
if (mInfo[i].DeclaringType == aType && !mInfo[i].IsSpecialName)
- {
+ {
found = true;
StringBuilder modifiers = new StringBuilder();
- if (mInfo[i].IsStatic) {modifiers.Append("static ");}
- if (mInfo[i].IsPublic) {modifiers.Append("public ");}
- if (mInfo[i].IsFamily) {modifiers.Append("protected ");}
- if (mInfo[i].IsAssembly) {modifiers.Append("internal ");}
- if (mInfo[i].IsPrivate) {modifiers.Append("private ");}
+ if (mInfo[i].IsStatic) {modifiers.Append("static ");}
+ if (mInfo[i].IsPublic) {modifiers.Append("public ");}
+ if (mInfo[i].IsFamily) {modifiers.Append("protected ");}
+ if (mInfo[i].IsAssembly) {modifiers.Append("internal ");}
+ if (mInfo[i].IsPrivate) {modifiers.Append("private ");}
myWriter.WriteLine("{0} {1}", modifiers, mInfo[i]);
}
- }
- }
+ }
+ }
if (!found)
{
myWriter.WriteLine("(none)");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.MemberType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.MemberType Example/CS/source.cs
index 461eeffa3b0..4b2a6095cb1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.MemberType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.MemberType Example/CS/source.cs
@@ -4,7 +4,7 @@
public class Sample {
public void Method(Type t, MemberInfo mi) {
-
+
//
MemberInfo[] others = t.GetMember(mi.Name, mi.MemberType, BindingFlags.Public |
BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Instance);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.ReflectedType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.ReflectedType Example/CS/source.cs
index 9de85614739..c357a96f4de 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.ReflectedType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.ReflectedType Example/CS/source.cs
@@ -1,16 +1,16 @@
//
using System;
using System.Reflection;
-
+
public abstract class MyClassA
{
- public abstract class MyClassB
+ public abstract class MyClassB
{
}
- public static void Main(string[] args)
- {
+ public static void Main(string[] args)
+ {
Console.WriteLine("Reflected type of MyClassB is {0}",
typeof(MyClassB).ReflectedType); //outputs MyClassA, the enclosing class
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsImpersonationContext.Undo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsImpersonationContext.Undo Example/CS/source.cs
index 10cea54ab09..722cd4d1197 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsImpersonationContext.Undo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsImpersonationContext.Undo Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Form1: Form
protected void Method(IntPtr userToken)
{
//
-WindowsImpersonationContext ImpersonationCtx = WindowsIdentity.Impersonate(userToken);
+WindowsImpersonationContext ImpersonationCtx = WindowsIdentity.Impersonate(userToken);
//Do something under the context of the impersonated user.
ImpersonationCtx.Undo();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsPrincipal.Identity Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsPrincipal.Identity Example/CS/source.cs
index 8fb9879308e..3d3820d5e4c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsPrincipal.Identity Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsPrincipal.Identity Example/CS/source.cs
@@ -10,7 +10,7 @@ protected void Method()
//
WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
String username = wp.Identity.Name;
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsPrincipal.WindowsPrincipal Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsPrincipal.WindowsPrincipal Example/CS/source.cs
index 7d2440159dd..a9a4743cfbc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsPrincipal.WindowsPrincipal Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic WindowsPrincipal.WindowsPrincipal Example/CS/source.cs
@@ -11,7 +11,7 @@ protected void Method()
WindowsIdentity wi = WindowsIdentity.GetCurrent();
WindowsPrincipal wp = new WindowsPrincipal(wi);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example4.cs
index 346b312515f..e16fba3b54a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example4.cs
@@ -17,15 +17,15 @@ namespace App
{
//
using System;
-
+
public class Example
{
public static void Main()
{
String value = "The archaeologist";
String substring = "archæ";
- int position = StringLibrary.SubstringStartsAt(value, substring);
- if (position >= 0)
+ int position = StringLibrary.SubstringStartsAt(value, substring);
+ if (position >= 0)
Console.WriteLine("'{0}' found in '{1}' starting at position {2}",
substring, value, position);
else
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example6.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example6.cs
index a9ed6bde979..f0c64705475 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example6.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example6.cs
@@ -17,15 +17,15 @@ namespace App
{
//
using System;
-
+
public class Example
{
public static void Main()
{
String value = "The archaeologist";
String substring = "archæ";
- int position = StringLibrary.SubstringStartsAt(value, substring);
- if (position >= 0)
+ int position = StringLibrary.SubstringStartsAt(value, substring);
+ if (position >= 0)
Console.WriteLine("'{0}' found in '{1}' starting at position {2}",
substring, value, position);
else
@@ -33,6 +33,6 @@ public static void Main()
}
}
// The example displays the following output:
- // 'archæ' found in 'The archaeologist' starting at position 4
+ // 'archæ' found in 'The archaeologist' starting at position 4
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example8.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example8.cs
index fe43107a60d..ef5baf9cbf8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example8.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/Example8.cs
@@ -21,15 +21,15 @@ namespace App
{
//
using System;
-
+
public class Example
{
public static void Main()
{
String value = "The archaeologist";
String substring = "archæ";
- int position = StringLibrary.SubstringStartsAt(value, substring);
- if (position >= 0)
+ int position = StringLibrary.SubstringStartsAt(value, substring);
+ if (position >= 0)
Console.WriteLine("'{0}' found in '{1}' starting at position {2}",
substring, value, position);
else
@@ -37,6 +37,6 @@ public static void Main()
}
}
// The example displays the following output:
- // 'archæ' found in 'The archaeologist' starting at position 4
+ // 'archæ' found in 'The archaeologist' starting at position 4
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/ForConsumers1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/ForConsumers1.cs
index 568c5650a75..81080c51812 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/ForConsumers1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/ForConsumers1.cs
@@ -9,7 +9,7 @@ public class Example
{
public static void Main()
{
- Console.WriteLine(Path.GetDirectoryName("file://c/temp/dirlist.txt"));
+ Console.WriteLine(Path.GetDirectoryName("file://c/temp/dirlist.txt"));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/GetSwitches3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/GetSwitches3.cs
index 89592c7d7fb..d73939bed61 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/GetSwitches3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/GetSwitches3.cs
@@ -7,24 +7,24 @@
public class Example
{
private const String SettingName = "AppContextSwitchOverrides";
- private const String SwitchName = "Switch.Application.Utilities.SwitchName";
-
+ private const String SwitchName = "Switch.Application.Utilities.SwitchName";
+
public static void Main()
{
bool flag = false;
-
+
// Determine whether the caller has used the AppContext class directly.
if (! AppContext.TryGetSwitch(SwitchName, out flag)) {
// If switch is not defined directly, attempt to retrieve it from a configuration file.
try {
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config == null) return;
-
+
ConfigurationSection sec = config.GetSection("runtime");
- if (sec != null) {
+ if (sec != null) {
String rawXml = sec.SectionInformation.GetRawXml();
if (String.IsNullOrEmpty(rawXml)) return;
-
+
var doc = new XmlDocument();
doc.LoadXml(rawXml);
XmlNode root = doc.FirstChild;
@@ -36,16 +36,16 @@ public static void Main()
XmlAttribute attr = node.Attributes["value"];
String[] nameValuePair = attr.Value.Split('=');
// Determine whether the switch we want is present.
- if (SwitchName.Equals(nameValuePair[0], StringComparison.Ordinal)) {
+ if (SwitchName.Equals(nameValuePair[0], StringComparison.Ordinal)) {
bool tempFlag = false;
if (Boolean.TryParse(CultureInfo.InvariantCulture.TextInfo.ToTitleCase(nameValuePair[1]),
out tempFlag))
- AppContext.SetSwitch(nameValuePair[0], tempFlag);
+ AppContext.SetSwitch(nameValuePair[0], tempFlag);
}
}
- }
+ }
}
- }
+ }
}
catch (ConfigurationErrorsException)
{}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/TestValue1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/TestValue1.cs
index 1486d781a54..73d7e355b5d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/TestValue1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AppContext.Class/cs/TestValue1.cs
@@ -17,10 +17,10 @@ public class AmazingLib
public void PerformAnOperation()
{
- if (!AppContext.TryGetSwitch("Switch.AmazingLib.ThrowOnException", out shouldThrow)) {
- // This is the case where the switch value was not set by the application.
- // The library can choose to get the value of shouldThrow by other means.
- // If no overrides or default values are specified, the value should be 'false'.
+ if (!AppContext.TryGetSwitch("Switch.AmazingLib.ThrowOnException", out shouldThrow)) {
+ // This is the case where the switch value was not set by the application.
+ // The library can choose to get the value of shouldThrow by other means.
+ // If no overrides or default values are specified, the value should be 'false'.
// A false value implies the latest behavior.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/BadSearch.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/BadSearch.cs
index 809d740f012..2844ac2b01a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/BadSearch.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/BadSearch.cs
@@ -6,12 +6,12 @@ public class Example
{
public static void Main()
{
- var list = new List();
+ var list = new List();
list.AddRange( new String[] { "A", "B", "C" } );
// Get the index of the element whose value is "Z".
int index = list.FindIndex((new StringSearcher("Z")).FindEquals);
try {
- Console.WriteLine("Index {0} contains '{1}'", index, list[index]);
+ Console.WriteLine("Index {0} contains '{1}'", index, list[index]);
}
catch (ArgumentOutOfRangeException e) {
Console.WriteLine(e.Message);
@@ -22,15 +22,15 @@ public static void Main()
internal class StringSearcher
{
String value;
-
+
public StringSearcher(String value)
{
this.value = value;
}
-
- public bool FindEquals(String s)
+
+ public bool FindEquals(String s)
{
- return s.Equals(value, StringComparison.InvariantCulture);
+ return s.Equals(value, StringComparison.InvariantCulture);
}
}
// The example displays the following output:
@@ -42,13 +42,13 @@ public class Example2
{
public static void Test()
{
- var list = new List();
+ var list = new List();
list.AddRange( new String[] { "A", "B", "C" } );
//
// Get the index of the element whose value is "Z".
int index = list.FindIndex((new StringSearcher("Z")).FindEquals);
if (index >= 0)
- Console.WriteLine("'Z' is found at index {0}", list[index]);
+ Console.WriteLine("'Z' is found at index {0}", list[index]);
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/EmptyString1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/EmptyString1.cs
index 5f0107b3d1c..2a807d47016 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/EmptyString1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/EmptyString1.cs
@@ -7,10 +7,10 @@ public static void Main()
{
String[] words = { "the", "today", "tomorrow", " ", "" };
foreach (var word in words)
- Console.WriteLine("First character of '{0}': '{1}'",
+ Console.WriteLine("First character of '{0}': '{1}'",
word, GetFirstCharacter(word));
}
-
+
private static char GetFirstCharacter(String s)
{
return s[0];
@@ -21,7 +21,7 @@ private static char GetFirstCharacter(String s)
// First character of //today//: //t//
// First character of //tomorrow//: //t//
// First character of // //: // //
-//
+//
// Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
// at Example.Main()
//
@@ -31,14 +31,14 @@ public static class StringLib
//
static char GetFirstCharacter(String s)
{
- if (String.IsNullOrEmpty(s))
+ if (String.IsNullOrEmpty(s))
return '\u0000';
- else
+ else
return s[0];
}
//
-
- public static char DoNothing(String s)
+
+ public static char DoNothing(String s)
{
return GetFirstCharacter(s);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Enumerator1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Enumerator1.cs
index 474ba58c7c7..e907d559bef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Enumerator1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Enumerator1.cs
@@ -5,12 +5,12 @@ public class Example
{
public static void Main()
{
- var list = new List();
+ var list = new List();
list.AddRange( new String[] { "A", "B", "C" } );
//
// Display each element in the list.
- foreach (var item in list)
+ foreach (var item in list)
Console.WriteLine("'{0}'", item);
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/FindWords1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/FindWords1.cs
index ac83040511e..5f2faeb6b6f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/FindWords1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/FindWords1.cs
@@ -11,7 +11,7 @@ public static void Main()
foreach (var word in FindWords(sentence))
Console.WriteLine(" '{0}'", word);
}
-
+
static String[] FindWords(String s)
{
int start = 0, end = 0;
@@ -22,7 +22,7 @@ static String[] FindWords(String s)
end = s.IndexOfAny(delimiters, start);
if (end >= 0) {
if (end - start > 0)
- words.Add(s.Substring(start, end - start));
+ words.Add(s.Substring(start, end - start));
start = end++;
}
@@ -30,8 +30,8 @@ static String[] FindWords(String s)
if (start < s.Length - 1)
words.Add(s.Substring(start));
}
- }
- return words.ToArray();
+ }
+ return words.ToArray();
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoElements2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoElements2.cs
index 9d0a42dc3d5..fb36222b0bf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoElements2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoElements2.cs
@@ -8,10 +8,10 @@ public static void Main()
{
var numbers = new List();
numbers.AddRange( new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20 } );
-
+
var squares = new List();
for (int ctr = 0; ctr < numbers.Count; ctr++)
- squares[ctr] = (int) Math.Pow(numbers[ctr], 2);
+ squares[ctr] = (int) Math.Pow(numbers[ctr], 2);
}
}
// The example displays the following output:
@@ -31,7 +31,7 @@ public void Test()
//
var squares = new List();
for (int ctr = 0; ctr < numbers.Count; ctr++)
- squares.Add((int) Math.Pow(numbers[ctr], 2));
+ squares.Add((int) Math.Pow(numbers[ctr], 2));
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoFind1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoFind1.cs
index e600d85348f..0c3cf17a518 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoFind1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoFind1.cs
@@ -5,12 +5,12 @@ public class Example
{
public static void Main()
{
- String[] phrases = { "ocean blue", "concerned citizen",
+ String[] phrases = { "ocean blue", "concerned citizen",
"runOnPhrase" };
foreach (var phrase in phrases)
Console.WriteLine("Second word is {0}", GetSecondWord(phrase));
}
-
+
static String GetSecondWord(String s)
{
int pos = s.IndexOf(" ");
@@ -20,7 +20,7 @@ static String GetSecondWord(String s)
// The example displays the following output:
// Second word is blue
// Second word is citizen
-//
+//
// Unhandled Exception: System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
// Parameter name: startIndex
// at System.String.Substring(Int32 startIndex, Int32 length)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoFind2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoFind2.cs
index 910df712eef..176af50e685 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoFind2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/NoFind2.cs
@@ -5,22 +5,22 @@ public class Example
{
public static void Main()
{
- String[] phrases = { "ocean blue", "concerned citizen",
+ String[] phrases = { "ocean blue", "concerned citizen",
"runOnPhrase" };
foreach (var phrase in phrases) {
String word = GetSecondWord(phrase);
if (! String.IsNullOrEmpty(word))
Console.WriteLine("Second word is {0}", word);
- }
+ }
}
-
+
static String GetSecondWord(String s)
{
int pos = s.IndexOf(" ");
if (pos >= 0)
return s.Substring(pos).Trim();
else
- return String.Empty;
+ return String.Empty;
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/OOR1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/OOR1.cs
index 785e18d8e72..e6dda9d3f90 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/OOR1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/OOR1.cs
@@ -8,7 +8,7 @@ public static void Main()
int dimension1 = 10;
int dimension2 = -1;
try {
- Array arr = Array.CreateInstance(typeof(String),
+ Array arr = Array.CreateInstance(typeof(String),
dimension1, dimension2);
}
catch (ArgumentOutOfRangeException e) {
@@ -30,11 +30,11 @@ public void MakeValid()
//
int dimension1 = 10;
int dimension2 = 10;
- Array arr = Array.CreateInstance(typeof(String),
- dimension1, dimension2);
+ Array arr = Array.CreateInstance(typeof(String),
+ dimension1, dimension2);
//
}
-
+
public void Validate()
{
int dimension1 = 10;
@@ -44,10 +44,10 @@ public void Validate()
if (dimension1 < 0 || dimension2 < 0) {
Console.WriteLine("Unable to create the array.");
Console.WriteLine("Specify non-negative values for the two dimensions.");
- }
+ }
else {
- arr = Array.CreateInstance(typeof(String),
- dimension1, dimension2);
+ arr = Array.CreateInstance(typeof(String),
+ dimension1, dimension2);
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/OOR2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/OOR2.cs
index 13248e32b8f..83a43329b68 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/OOR2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/OOR2.cs
@@ -6,13 +6,13 @@ public class Example
{
public static void Main()
{
- var list = new List();
+ var list = new List();
list.AddRange( new String[] { "A", "B", "C" } );
try {
// Display the elements in the list by index.
- for (int ctr = 0; ctr <= list.Count; ctr++)
+ for (int ctr = 0; ctr <= list.Count; ctr++)
Console.WriteLine("Index {0}: {1}", ctr, list[ctr]);
- }
+ }
catch (ArgumentOutOfRangeException e) {
Console.WriteLine(e.Message);
}
@@ -30,12 +30,12 @@ public class Example2
{
public static void Test()
{
- var list = new List();
+ var list = new List();
list.AddRange( new String[] { "A", "B", "C" } );
//
// Display the elements in the list by index.
- for (int ctr = 0; ctr < list.Count; ctr++)
+ for (int ctr = 0; ctr < list.Count; ctr++)
Console.WriteLine("Index {0}: {1}", ctr, list[ctr]);
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Race1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Race1.cs
index 6482433a5d1..baaedc2702a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Race1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Race1.cs
@@ -7,36 +7,36 @@ public class Continent
{
public String Name { get; set; }
public int Population { get; set; }
- public Decimal Area { get; set; }
+ public Decimal Area { get; set; }
}
public class Example
{
static List continents = new List();
- static String msg;
-
+ static String msg;
+
public static void Main()
{
- String[] names = { "Africa", "Antarctica", "Asia",
+ String[] names = { "Africa", "Antarctica", "Asia",
"Australia", "Europe", "North America",
"South America" };
// Populate the list.
foreach (var name in names) {
var th = new Thread(PopulateContinents);
th.Start(name);
- }
+ }
Console.WriteLine(msg);
Console.WriteLine();
// Display the list.
for (int ctr = 0; ctr < names.Length; ctr++) {
var continent = continents[ctr];
- Console.WriteLine("{0}: Area: {1}, Population {2}",
+ Console.WriteLine("{0}: Area: {1}, Population {2}",
continent.Name, continent.Population,
continent.Area);
}
}
-
+
private static void PopulateContinents(Object obj)
{
String name = obj.ToString();
@@ -56,9 +56,9 @@ private static void PopulateContinents(Object obj)
// Adding //Europe// to the list.
// Adding //North America// to the list.
// Adding //South America// to the list.
-//
-//
-//
+//
+//
+//
// Unhandled Exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
// Parameter name: index
// at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Race2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Race2.cs
index 57a04039952..6f74c7badac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Race2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/cs/Race2.cs
@@ -7,7 +7,7 @@ public class Continent
{
public String Name { get; set; }
public int Population { get; set; }
- public Decimal Area { get; set; }
+ public Decimal Area { get; set; }
}
public class Example
@@ -18,16 +18,16 @@ public class Example
public static void Main()
{
- String[] names = { "Africa", "Antarctica", "Asia",
+ String[] names = { "Africa", "Antarctica", "Asia",
"Australia", "Europe", "North America",
"South America" };
gate = new CountdownEvent(names.Length);
-
+
// Populate the list.
foreach (var name in names) {
var th = new Thread(PopulateContinents);
th.Start(name);
- }
+ }
// Display the list.
gate.Wait();
@@ -37,16 +37,16 @@ public static void Main()
var arr = continents.ToArray();
for (int ctr = 0; ctr < names.Length; ctr++) {
var continent = arr[ctr];
- Console.WriteLine("{0}: Area: {1}, Population {2}",
+ Console.WriteLine("{0}: Area: {1}, Population {2}",
continent.Name, continent.Population,
continent.Area);
}
}
-
+
private static void PopulateContinents(Object obj)
{
String name = obj.ToString();
- lock(msg) {
+ lock(msg) {
msg += String.Format("Adding '{0}' to the list.\n", name);
}
var continent = new Continent();
@@ -65,8 +65,8 @@ private static void PopulateContinents(Object obj)
// Adding 'Europe' to the list.
// Adding 'North America' to the list.
// Adding 'South America' to the list.
-//
-//
+//
+//
// Africa: Area: 0, Population 0
// Antarctica: Area: 0, Population 0
// Asia: Area: 0, Population 0
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AttributeUsageAttribute.Inherited/cs/Inherited1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AttributeUsageAttribute.Inherited/cs/Inherited1.cs
index c1d1eb9ec7d..c7e23be0b62 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.AttributeUsageAttribute.Inherited/cs/Inherited1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.AttributeUsageAttribute.Inherited/cs/Inherited1.cs
@@ -48,7 +48,7 @@ public static void Main()
// The example displays the following output:
// DerivedA has Inherited attribute: True
// DerivedA.MemberA has Inherited attribute: True
-//
+//
// DerivedB has NotInherited attribute: False
// DerivedB.MemberB has NotInherited attribute: False
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Action.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Action.cs
index 121aa2a0b18..0f12a9adee8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Action.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Action.cs
@@ -5,7 +5,7 @@
public class Name
{
private string instanceName;
-
+
public Name(string name)
{
this.instanceName = name;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Anon.cs
index 98ce7b88c6b..7f1a04e4d03 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Anon.cs
@@ -5,7 +5,7 @@
public class Name
{
private string instanceName;
-
+
public Name(string name)
{
this.instanceName = name;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Delegate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Delegate.cs
index 51fa2ab3b32..00fc663f9c1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Delegate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Delegate.cs
@@ -7,7 +7,7 @@
public class Name
{
private string instanceName;
-
+
public Name(string name)
{
this.instanceName = name;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Lambda.cs
index f3450a1bc1a..0f7d46393b5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action/cs/Lambda.cs
@@ -5,7 +5,7 @@
public class Name
{
private string instanceName;
-
+
public Name(string name)
{
this.instanceName = name;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Action1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Action1.cs
index f24bf5ab82b..b0b74f2adef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Action1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Action1.cs
@@ -6,19 +6,19 @@ public class TestAction1
{
public static void Main()
{
- Action messageTarget;
-
+ Action messageTarget;
+
if (Environment.GetCommandLineArgs().Length > 1)
messageTarget = ShowWindowsMessage;
else
messageTarget = Console.WriteLine;
-
- messageTarget("Hello, World!");
- }
-
+
+ messageTarget("Hello, World!");
+ }
+
private static void ShowWindowsMessage(string message)
{
- MessageBox.Show(message);
+ MessageBox.Show(message);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Anon.cs
index 2c9232af578..44c829fda5e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Anon.cs
@@ -6,19 +6,19 @@ public class TestAnonMethod
{
public static void Main()
{
- Action messageTarget;
-
+ Action messageTarget;
+
if (Environment.GetCommandLineArgs().Length > 1)
messageTarget = delegate(string s) { ShowWindowsMessage(s); };
else
messageTarget = delegate(string s) { Console.WriteLine(s); };
-
+
messageTarget("Hello, World!");
}
-
+
private static void ShowWindowsMessage(string message)
{
- MessageBox.Show(message);
+ MessageBox.Show(message);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Delegate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Delegate.cs
index 0de23254ce0..fa8ac29acef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Delegate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Delegate.cs
@@ -8,19 +8,19 @@ public class TestCustomDelegate
{
public static void Main()
{
- DisplayMessage messageTarget;
-
+ DisplayMessage messageTarget;
+
if (Environment.GetCommandLineArgs().Length > 1)
messageTarget = ShowWindowsMessage;
else
messageTarget = Console.WriteLine;
-
- messageTarget("Hello, World!");
- }
-
+
+ messageTarget("Hello, World!");
+ }
+
private static void ShowWindowsMessage(string message)
{
- MessageBox.Show(message);
+ MessageBox.Show(message);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Lambda.cs
index 9089eeaff2d..ad546ad7f48 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~1/cs/Lambda.cs
@@ -6,19 +6,19 @@ public class TestLambdaExpression
{
public static void Main()
{
- Action messageTarget;
-
+ Action messageTarget;
+
if (Environment.GetCommandLineArgs().Length > 1)
- messageTarget = s => ShowWindowsMessage(s);
+ messageTarget = s => ShowWindowsMessage(s);
else
messageTarget = s => Console.WriteLine(s);
-
+
messageTarget("Hello, World!");
}
-
+
private static void ShowWindowsMessage(string message)
{
- MessageBox.Show(message);
+ MessageBox.Show(message);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Action2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Action2.cs
index 6faca06f029..0a7075082cb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Action2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Action2.cs
@@ -9,23 +9,23 @@ public static void Main()
string message1 = "The first line of a message.";
string message2 = "The second line of a message.";
Action concat;
-
+
if (Environment.GetCommandLineArgs().Length > 1)
concat = WriteToFile;
else
concat = WriteToConsole;
-
+
concat(message1, message2);
}
-
+
private static void WriteToConsole(string string1, string string2)
{
- Console.WriteLine("{0}\n{1}", string1, string2);
+ Console.WriteLine("{0}\n{1}", string1, string2);
}
private static void WriteToFile(string string1, string string2)
{
- StreamWriter writer = null;
+ StreamWriter writer = null;
try
{
writer = new StreamWriter(Environment.GetCommandLineArgs()[1], false);
@@ -38,7 +38,7 @@ private static void WriteToFile(string string1, string string2)
finally
{
if (writer != null) writer.Close();
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Anon.cs
index 23efa6e1de7..d087d946a1e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Anon.cs
@@ -9,23 +9,23 @@ public static void Main()
string message1 = "The first line of a message.";
string message2 = "The second line of a message.";
Action concat;
-
+
if (Environment.GetCommandLineArgs().Length > 1)
concat = delegate(string s1, string s2) { WriteToFile(s1, s2); };
else
concat = delegate(string s1, string s2) { WriteToConsole(s1, s2);} ;
-
+
concat(message1, message2);
}
-
+
private static void WriteToConsole(string string1, string string2)
{
- Console.WriteLine("{0}\n{1}", string1, string2);
+ Console.WriteLine("{0}\n{1}", string1, string2);
}
private static void WriteToFile(string string1, string string2)
{
- StreamWriter writer = null;
+ StreamWriter writer = null;
try
{
writer = new StreamWriter(Environment.GetCommandLineArgs()[1], false);
@@ -38,7 +38,7 @@ private static void WriteToFile(string string1, string string2)
finally
{
if (writer != null) writer.Close();
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Delegate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Delegate.cs
index ec23e1bc43c..4d9e8f02dd4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Delegate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Delegate.cs
@@ -11,23 +11,23 @@ public static void Main()
string message1 = "The first line of a message.";
string message2 = "The second line of a message.";
ConcatStrings concat;
-
+
if (Environment.GetCommandLineArgs().Length > 1)
concat = WriteToFile;
else
concat = WriteToConsole;
-
+
concat(message1, message2);
}
-
+
private static void WriteToConsole(string string1, string string2)
{
- Console.WriteLine("{0}\n{1}", string1, string2);
+ Console.WriteLine("{0}\n{1}", string1, string2);
}
private static void WriteToFile(string string1, string string2)
{
- StreamWriter writer = null;
+ StreamWriter writer = null;
try
{
writer = new StreamWriter(Environment.GetCommandLineArgs()[1], false);
@@ -40,7 +40,7 @@ private static void WriteToFile(string string1, string string2)
finally
{
if (writer != null) writer.Close();
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Lambda.cs
index 5758ceadd90..c4aa7048974 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~2/cs/Lambda.cs
@@ -9,23 +9,23 @@ public static void Main()
string message1 = "The first line of a message.";
string message2 = "The second line of a message.";
Action concat;
-
+
if (Environment.GetCommandLineArgs().Length > 1)
concat = (s1, s2) => WriteToFile(s1, s2);
else
concat = (s1, s2) => WriteToConsole(s1, s2);
-
+
concat(message1, message2);
}
-
+
private static void WriteToConsole(string string1, string string2)
{
- Console.WriteLine("{0}\n{1}", string1, string2);
+ Console.WriteLine("{0}\n{1}", string1, string2);
}
private static void WriteToFile(string string1, string string2)
{
- StreamWriter writer = null;
+ StreamWriter writer = null;
try
{
writer = new StreamWriter(Environment.GetCommandLineArgs()[1], false);
@@ -38,7 +38,7 @@ private static void WriteToFile(string string1, string string2)
finally
{
if (writer != null) writer.Close();
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Action3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Action3.cs
index 78e79aef4a4..65a408aa40d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Action3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Action3.cs
@@ -1,12 +1,12 @@
//
using System;
-
+
public class TestAction3
{
public static void Main()
{
string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth"};
- string[] copiedOrdinals = new string[ordinals.Length];
+ string[] copiedOrdinals = new string[ordinals.Length];
Action copyOperation = CopyStrings;
copyOperation(ordinals, copiedOrdinals, 3);
foreach (string ordinal in copiedOrdinals)
@@ -15,7 +15,7 @@ public static void Main()
private static void CopyStrings(string[] source, string[] target, int startPos)
{
- if (source.Length != target.Length)
+ if (source.Length != target.Length)
throw new IndexOutOfRangeException("The source and target arrays must have the same number of elements.");
for (int ctr = startPos; ctr <= source.Length - 1; ctr++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Anon.cs
index 9d4237e7797..ddca19e6e7f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Anon.cs
@@ -1,15 +1,15 @@
//
using System;
-
+
public class TestAnon
{
public static void Main()
{
string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth"};
- string[] copiedOrdinals = new string[ordinals.Length];
- Action copyOperation = delegate(string[] s1,
- string[] s2,
- int pos)
+ string[] copiedOrdinals = new string[ordinals.Length];
+ Action copyOperation = delegate(string[] s1,
+ string[] s2,
+ int pos)
{ CopyStrings(s1, s2, pos); };
copyOperation(ordinals, copiedOrdinals, 3);
foreach (string ordinal in copiedOrdinals)
@@ -18,7 +18,7 @@ public static void Main()
private static void CopyStrings(string[] source, string[] target, int startPos)
{
- if (source.Length != target.Length)
+ if (source.Length != target.Length)
throw new IndexOutOfRangeException("The source and target arrays must have the same number of elements.");
for (int ctr = startPos; ctr <= source.Length - 1; ctr++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Delegate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Delegate.cs
index 2ad72928839..ac4bca5880d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Delegate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Delegate.cs
@@ -1,16 +1,16 @@
//
using System;
-delegate void StringCopy(string[] stringArray1,
- string[] stringArray2,
+delegate void StringCopy(string[] stringArray1,
+ string[] stringArray2,
int indexToStart);
-
+
public class TestDelegate
{
public static void Main()
{
string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth"};
- string[] copiedOrdinals = new string[ordinals.Length];
+ string[] copiedOrdinals = new string[ordinals.Length];
StringCopy copyOperation = CopyStrings;
copyOperation(ordinals, copiedOrdinals, 3);
foreach (string ordinal in copiedOrdinals)
@@ -19,7 +19,7 @@ public static void Main()
private static void CopyStrings(string[] source, string[] target, int startPos)
{
- if (source.Length != target.Length)
+ if (source.Length != target.Length)
throw new IndexOutOfRangeException("The source and target arrays must have the same number of elements.");
for (int ctr = startPos; ctr <= source.Length - 1; ctr++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Lambda.cs
index 42f48680031..15b18b784ef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~3/cs/Lambda.cs
@@ -1,14 +1,14 @@
//
using System;
-
+
public class TestLambda
{
public static void Main()
{
string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth"};
- string[] copiedOrdinals = new string[ordinals.Length];
+ string[] copiedOrdinals = new string[ordinals.Length];
Action copyOperation = (s1, s2, pos) =>
- CopyStrings(s1, s2, pos);
+ CopyStrings(s1, s2, pos);
copyOperation(ordinals, copiedOrdinals, 3);
foreach (string ordinal in copiedOrdinals)
Console.WriteLine(ordinal == string.Empty ? "" : ordinal);
@@ -16,7 +16,7 @@ public static void Main()
private static void CopyStrings(string[] source, string[] target, int startPos)
{
- if (source.Length != target.Length)
+ if (source.Length != target.Length)
throw new IndexOutOfRangeException("The source and target arrays must have the same number of elements.");
for (int ctr = startPos; ctr <= source.Length - 1; ctr++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Action4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Action4.cs
index 37bedd59d9a..ae8842fd9cb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Action4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Action4.cs
@@ -5,19 +5,19 @@ public class TestAction4
{
public static void Main()
{
- string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth",
+ string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth",
"Sixth", "Seventh", "Eighth", "Ninth", "Tenth"};
- string[] copiedOrdinals = new string[ordinals.Length];
+ string[] copiedOrdinals = new string[ordinals.Length];
Action copyOperation = CopyStrings;
copyOperation(ordinals, copiedOrdinals, 3, 5);
foreach (string ordinal in copiedOrdinals)
Console.WriteLine(String.IsNullOrEmpty(ordinal) ? "" : ordinal);
}
- private static void CopyStrings(string[] source, string[] target,
+ private static void CopyStrings(string[] source, string[] target,
int startPos, int number)
{
- if (source.Length != target.Length)
+ if (source.Length != target.Length)
throw new IndexOutOfRangeException("The source and target arrays must have the same number of elements.");
for (int ctr = startPos; ctr <= startPos + number - 1; ctr++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Anon.cs
index 6685240400c..ceb409cae27 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Anon.cs
@@ -5,22 +5,22 @@ public class TestAnonymousMethod
{
public static void Main()
{
- string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth",
+ string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth",
"Sixth", "Seventh", "Eighth", "Ninth", "Tenth"};
- string[] copiedOrdinals = new string[ordinals.Length];
- Action copyOperation =
- delegate(string[] s1, string[] s2,
- int pos, int num)
- { CopyStrings(s1, s2, pos, num); };
+ string[] copiedOrdinals = new string[ordinals.Length];
+ Action copyOperation =
+ delegate(string[] s1, string[] s2,
+ int pos, int num)
+ { CopyStrings(s1, s2, pos, num); };
copyOperation(ordinals, copiedOrdinals, 3, 5);
foreach (string ordinal in copiedOrdinals)
Console.WriteLine(String.IsNullOrEmpty(ordinal) ? "" : ordinal);
}
- private static void CopyStrings(string[] source, string[] target,
+ private static void CopyStrings(string[] source, string[] target,
int startPos, int number)
{
- if (source.Length != target.Length)
+ if (source.Length != target.Length)
throw new IndexOutOfRangeException("The source and target arrays must have the same number of elements.");
for (int ctr = startPos; ctr <= startPos + number - 1; ctr++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Delegate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Delegate.cs
index d2eec880242..363816a88b3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Delegate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Delegate.cs
@@ -1,28 +1,28 @@
//
using System;
-delegate void StringCopy(string[] stringArray1,
- string[] stringArray2,
+delegate void StringCopy(string[] stringArray1,
+ string[] stringArray2,
int indexToStart,
int numberToCopy);
-
+
public class TestDelegate
{
public static void Main()
{
- string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth",
+ string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth",
"Sixth", "Seventh", "Eighth", "Ninth", "Tenth"};
- string[] copiedOrdinals = new string[ordinals.Length];
+ string[] copiedOrdinals = new string[ordinals.Length];
StringCopy copyOperation = CopyStrings;
copyOperation(ordinals, copiedOrdinals, 3, 5);
foreach (string ordinal in copiedOrdinals)
Console.WriteLine(String.IsNullOrEmpty(ordinal) ? "" : ordinal);
}
- private static void CopyStrings(string[] source, string[] target,
+ private static void CopyStrings(string[] source, string[] target,
int startPos, int number)
{
- if (source.Length != target.Length)
+ if (source.Length != target.Length)
throw new IndexOutOfRangeException("The source and target arrays must have the same number of elements.");
for (int ctr = startPos; ctr <= startPos + number - 1; ctr++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Lambda.cs
index a39d8c897aa..5d6f4acb72c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Action~4/cs/Lambda.cs
@@ -5,20 +5,20 @@ public class TestLambdaExpression
{
public static void Main()
{
- string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth",
+ string[] ordinals = {"First", "Second", "Third", "Fourth", "Fifth",
"Sixth", "Seventh", "Eighth", "Ninth", "Tenth"};
- string[] copiedOrdinals = new string[ordinals.Length];
+ string[] copiedOrdinals = new string[ordinals.Length];
Action copyOperation = (s1, s2, pos, num)
- => CopyStrings(s1, s2, pos, num);
+ => CopyStrings(s1, s2, pos, num);
copyOperation(ordinals, copiedOrdinals, 3, 5);
foreach (string ordinal in copiedOrdinals)
Console.WriteLine(String.IsNullOrEmpty(ordinal) ? "" : ordinal);
}
- private static void CopyStrings(string[] source, string[] target,
+ private static void CopyStrings(string[] source, string[] target,
int startPos, int number)
{
- if (source.Length != target.Length)
+ if (source.Length != target.Length)
throw new IndexOutOfRangeException("The source and target arrays must have the same number of elements.");
for (int ctr = startPos; ctr <= startPos + number - 1; ctr++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.AppDomain.IsDefaultAppDomain/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.AppDomain.IsDefaultAppDomain/CS/source.cs
index fa785dbc728..262332e12f4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.AppDomain.IsDefaultAppDomain/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.AppDomain.IsDefaultAppDomain/CS/source.cs
@@ -5,7 +5,7 @@
public class Example
{
// The following attribute indicates to the loader that assemblies
- // in the global assembly cache should be shared across multiple
+ // in the global assembly cache should be shared across multiple
// application domains.
[LoaderOptimizationAttribute( LoaderOptimization.MultiDomainHost)]
public static void Main()
@@ -20,7 +20,7 @@ public static void Main()
// This method has the same signature as the CrossAppDomainDelegate,
// so that it can be executed easily in the new application domain.
- //
+ //
public static void ShowDomainInfo()
{
AppDomain ad = AppDomain.CurrentDomain;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.AppDomainManager/CS/customAppDomainManager.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.AppDomainManager/CS/customAppDomainManager.cs
index e5102e1acd2..71fa5a255dd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.AppDomainManager/CS/customAppDomainManager.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.AppDomainManager/CS/customAppDomainManager.cs
@@ -1,7 +1,7 @@
//
-// To replace the default AppDomainManager, identify the
-// replacement assembly and replacement type in the
-// APPDOMAIN_MANAGER_ASM and APPDOMAIN_MANAGER_TYPE
+// To replace the default AppDomainManager, identify the
+// replacement assembly and replacement type in the
+// APPDOMAIN_MANAGER_ASM and APPDOMAIN_MANAGER_TYPE
// environment variables. For example:
// set APPDOMAIN_MANAGER_TYPE=library.TestAppDomainManager
// set APPDOMAIN_MANAGER_ASM=library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f1368f7b12a08d72
@@ -22,9 +22,9 @@
namespace MyNamespace
{
[GuidAttribute("F4D15099-3407-4A7E-A607-DEA440CF3891")]
- [SecurityPermissionAttribute(SecurityAction.LinkDemand,
+ [SecurityPermissionAttribute(SecurityAction.LinkDemand,
Flags = SecurityPermissionFlag.Infrastructure)]
- [SecurityPermissionAttribute(SecurityAction.InheritanceDemand,
+ [SecurityPermissionAttribute(SecurityAction.InheritanceDemand,
Flags = SecurityPermissionFlag.Infrastructure)]
public class MyAppDomainManager : AppDomainManager
{
@@ -35,7 +35,7 @@ public MyAppDomainManager()
Console.WriteLine(" My AppDomain Manager ");
mySecurityManager = AppDomain.CurrentDomain.CreateInstanceAndUnwrap(
"CustomSecurityManager, Version=1.0.0.3, Culture=neutral, " +
- "PublicKeyToken=5659fc598c2a503e",
+ "PublicKeyToken=5659fc598c2a503e",
"MyNamespace.MySecurityManager") as HostSecurityManager;
Console.WriteLine(" Custom Security Manager Created.");
}
@@ -45,7 +45,7 @@ public override void InitializeNewDomain(AppDomainSetup appDomainInfo)
{
Console.Write("Initialize new domain called: ");
Console.WriteLine(AppDomain.CurrentDomain.FriendlyName);
- InitializationFlags =
+ InitializationFlags =
AppDomainManagerInitializationOptions.RegisterWithHost;
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.AsReadOnly/CS/arrayasreadonly.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.AsReadOnly/CS/arrayasreadonly.cs
index 18d817d757a..7ef4baaaf4a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.AsReadOnly/CS/arrayasreadonly.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.AsReadOnly/CS/arrayasreadonly.cs
@@ -5,19 +5,19 @@
using System.Collections.Generic;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Create and initialize a new string array.
String[] myArr = { "The", "quick", "brown", "fox" };
-
+
// Display the values of the array.
Console.WriteLine( "The string array initially contains the following values:" );
PrintIndexAndValues( myArr );
// Create a read-only IList wrapper around the array.
IList myList = Array.AsReadOnly( myArr );
-
+
// Display the values of the read-only IList.
Console.WriteLine( "The read-only IList contains the following values:" );
PrintIndexAndValues( myList );
@@ -42,7 +42,7 @@ public static void Main() {
Console.WriteLine( "After changing the third element, the read-only IList contains the following values:" );
PrintIndexAndValues( myList );
}
-
+
public static void PrintIndexAndValues( String[] myArr ) {
for ( int i = 0; i < myArr.Length; i++ ) {
Console.WriteLine( " [{0}] : {1}", i, myArr[i] );
@@ -59,7 +59,7 @@ public static void PrintIndexAndValues( IList myList ) {
}
-/*
+/*
This code produces the following output.
The string array initially contains the following values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clear/cs/clearstruct1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clear/cs/clearstruct1.cs
index 5c24656cf5a..0c11e161923 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clear/cs/clearstruct1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clear/cs/clearstruct1.cs
@@ -5,17 +5,17 @@ public struct TimeZoneTime
{
private DateTimeOffset dt;
private TimeZoneInfo tz;
-
+
public TimeZoneTime(DateTimeOffset dateTime, TimeZoneInfo timeZone)
{
dt = dateTime;
tz = timeZone;
}
- public DateTimeOffset DateTime
+ public DateTimeOffset DateTime
{ get { return dt; } }
-
- public TimeZoneInfo TimeZone
+
+ public TimeZoneInfo TimeZone
{ get { return tz; } }
}
@@ -25,24 +25,24 @@ public static void Main()
{
// Declare an array with two elements.
TimeZoneTime[] timeZoneTimes = { new TimeZoneTime(DateTime.Now, TimeZoneInfo.Local),
- new TimeZoneTime(DateTime.Now, TimeZoneInfo.Utc) };
+ new TimeZoneTime(DateTime.Now, TimeZoneInfo.Utc) };
foreach (var timeZoneTime in timeZoneTimes)
- Console.WriteLine("{0}: {1:G}",
- timeZoneTime.TimeZone == null ? "" : timeZoneTime.TimeZone.ToString(),
+ Console.WriteLine("{0}: {1:G}",
+ timeZoneTime.TimeZone == null ? "" : timeZoneTime.TimeZone.ToString(),
timeZoneTime.DateTime);
Console.WriteLine();
-
+
Array.Clear(timeZoneTimes, 1, 1);
foreach (var timeZoneTime in timeZoneTimes)
- Console.WriteLine("{0}: {1:G}",
- timeZoneTime.TimeZone == null ? "" : timeZoneTime.TimeZone.ToString(),
+ Console.WriteLine("{0}: {1:G}",
+ timeZoneTime.TimeZone == null ? "" : timeZoneTime.TimeZone.ToString(),
timeZoneTime.DateTime);
}
}
// The example displays the following output:
// (UTC-08:00) Pacific Time (US & Canada): 1/20/2014 12:11:00 PM
// UTC: 1/20/2014 12:11:00 PM
-//
+//
// (UTC-08:00) Pacific Time (US & Canada): 1/20/2014 12:11:00 PM
// : 1/1/0001 12:00:00 AM
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clear/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clear/cs/example.cs
index c8fd4bbce16..a54e5c164eb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clear/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clear/cs/example.cs
@@ -86,34 +86,34 @@ public static void Main()
}
}
/* This code example produces the following output:
- *
+ *
* One dimension (Rank=1):
* 1 2 3 4 5 6 7 8 9
- *
+ *
* Array.Clear(numbers1, 2, 5)
* 1 2 0 0 0 0 0 8 9
- *
+ *
* Two dimensions (Rank=2):
* 1 2 3
* 4 5 6
* 7 8 9
- *
+ *
* Array.Clear(numbers2, 2, 5)
* 1 2 0
* 0 0 0
* 0 8 9
- *
+ *
* Three dimensions (Rank=3):
* 1 2
* 3 4
- *
+ *
* 5 6
* 7 8
- *
+ *
* Array.Clear(numbers3, 2, 5)
* 1 2
* 0 0
- *
+ *
* 0 0
* 0 8
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clone/CS/arrayclone.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clone/CS/arrayclone.cs
index a0220ff0bea..deffefb2cf4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clone/CS/arrayclone.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Clone/CS/arrayclone.cs
@@ -50,7 +50,7 @@ public static void PrintIndexAndValues( Array myArray ) {
}
-/*
+/*
This code produces the following output.
The original array contains the following values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Resize/CS/arrayresize.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Resize/CS/arrayresize.cs
index ed6fd5831ea..00bc9088f3e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Resize/CS/arrayresize.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Resize/CS/arrayresize.cs
@@ -3,16 +3,16 @@
//
using System;
-public class SamplesArray
+public class SamplesArray
{
public static void Main() {
-
+
// Create and initialize a new string array.
- String[] myArr = {"The", "quick", "brown", "fox", "jumps",
+ String[] myArr = {"The", "quick", "brown", "fox", "jumps",
"over", "the", "lazy", "dog"};
-
+
// Display the values of the array.
- Console.WriteLine(
+ Console.WriteLine(
"The string array initially contains the following values:");
PrintIndexAndValues(myArr);
@@ -34,7 +34,7 @@ public static void Main() {
}
public static void PrintIndexAndValues(String[] myArr) {
- for(int i = 0; i < myArr.Length; i++)
+ for(int i = 0; i < myArr.Length; i++)
{
Console.WriteLine(" [{0}] : {1}", i, myArr[i]);
}
@@ -42,7 +42,7 @@ public static void PrintIndexAndValues(String[] myArr) {
}
}
-/*
+/*
This code produces the following output.
The string array initially contains the following values:
@@ -56,7 +56,7 @@ This code produces the following output.
[7] : lazy
[8] : dog
-After resizing to a larger size,
+After resizing to a larger size,
the string array contains the following values:
[0] : The
[1] : quick
@@ -73,7 +73,7 @@ This code produces the following output.
[12] :
[13] :
-After resizing to a smaller size,
+After resizing to a smaller size,
the string array contains the following values:
[0] : The
[1] : quick
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Resize/CS/resizexd.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Resize/CS/resizexd.cs
index aa948ed6bdc..6ea7d96a81e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Resize/CS/resizexd.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Resize/CS/resizexd.cs
@@ -9,17 +9,17 @@ public static void Main()
for (int n1 = 0; n1 <= arr.GetUpperBound(0); n1++) {
arr[n1, 0] = n1;
arr[n1, 1] = n1 * 2;
- }
+ }
// Make a 2-D array larger in the first dimension.
arr = (int[,]) ResizeArray(arr, new int[] { 12, 2} );
- for (int ctr = 0; ctr <= arr.GetUpperBound(0); ctr++)
+ for (int ctr = 0; ctr <= arr.GetUpperBound(0); ctr++)
Console.WriteLine("{0}: {1}, {2}", ctr, arr[ctr, 0], arr[ctr, 1]);
Console.WriteLine();
// Make a 2-D array smaller in the first dimension.
arr = (int[,]) ResizeArray(arr, new int[] { 2, 2} );
- for (int ctr = 0; ctr <= arr.GetUpperBound(0); ctr++)
+ for (int ctr = 0; ctr <= arr.GetUpperBound(0); ctr++)
Console.WriteLine("{0}: {1}, {2}", ctr, arr[ctr, 0], arr[ctr, 1]);
}
@@ -27,13 +27,13 @@ private static Array ResizeArray(Array arr, int[] newSizes)
{
if (newSizes.Length != arr.Rank)
throw new ArgumentException("arr must have the same number of dimensions " +
- "as there are elements in newSizes", "newSizes");
+ "as there are elements in newSizes", "newSizes");
var temp = Array.CreateInstance(arr.GetType().GetElementType(), newSizes);
int length = arr.Length <= temp.Length ? arr.Length : temp.Length;
Array.ConstrainedCopy(arr, 0, temp, 0, length);
return temp;
- }
+ }
}
// The example displays the following output:
// 0: 0, 0
@@ -48,7 +48,7 @@ private static Array ResizeArray(Array arr, int[] newSizes)
// 9: 9, 18
// 10: 0, 0
// 11: 0, 0
-//
+//
// 0: 0, 0
// 1: 1, 2
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Sort/CS/arraysort.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Sort/CS/arraysort.cs
index ff58df33203..a5fcf9fd659 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Sort/CS/arraysort.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Sort/CS/arraysort.cs
@@ -5,29 +5,29 @@
using System;
using System.Collections;
-public class ReverseComparer : IComparer
+public class ReverseComparer : IComparer
{
// Call CaseInsensitiveComparer.Compare with the parameters reversed.
- public int Compare(Object x, Object y)
+ public int Compare(Object x, Object y)
{
return (new CaseInsensitiveComparer()).Compare(y, x );
}
}
-public class Example
+public class Example
{
- public static void Main()
+ public static void Main()
{
- // Create and initialize a new array.
- String[] words = { "The", "QUICK", "BROWN", "FOX", "jumps",
+ // Create and initialize a new array.
+ String[] words = { "The", "QUICK", "BROWN", "FOX", "jumps",
"over", "the", "lazy", "dog" };
// Instantiate the reverse comparer.
IComparer revComparer = new ReverseComparer();
-
+
// Display the values of the array.
Console.WriteLine( "The original order of elements in the array:" );
DisplayValues(words);
-
+
// Sort a section of the array using the default comparer.
Array.Sort(words, 1, 3);
Console.WriteLine( "After sorting elements 1-3 by using the default comparer:");
@@ -48,8 +48,8 @@ public static void Main()
Console.WriteLine( "After sorting the entire array using the reverse case-insensitive comparer:");
DisplayValues(words);
}
-
- public static void DisplayValues(String[] arr)
+
+ public static void DisplayValues(String[] arr)
{
for ( int i = arr.GetLowerBound(0); i <= arr.GetUpperBound(0);
i++ ) {
@@ -69,7 +69,7 @@ public static void DisplayValues(String[] arr)
// [6] : the
// [7] : lazy
// [8] : dog
-//
+//
// After sorting elements 1-3 by using the default comparer:
// [0] : The
// [1] : BROWN
@@ -80,7 +80,7 @@ public static void DisplayValues(String[] arr)
// [6] : the
// [7] : lazy
// [8] : dog
-//
+//
// After sorting elements 1-3 by using the reverse case-insensitive comparer:
// [0] : The
// [1] : QUICK
@@ -91,7 +91,7 @@ public static void DisplayValues(String[] arr)
// [6] : the
// [7] : lazy
// [8] : dog
-//
+//
// After sorting the entire array by using the default comparer:
// [0] : BROWN
// [1] : dog
@@ -102,7 +102,7 @@ public static void DisplayValues(String[] arr)
// [6] : QUICK
// [7] : the
// [8] : The
-//
+//
// After sorting the entire array using the reverse case-insensitive comparer:
// [0] : the
// [1] : The
@@ -112,5 +112,5 @@ public static void DisplayValues(String[] arr)
// [5] : jumps
// [6] : FOX
// [7] : dog
-// [8] : BROWN
+// [8] : BROWN
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Sort2/CS/arraysort2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Sort2/CS/arraysort2.cs
index cbe90f842a1..063983bb4c4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Sort2/CS/arraysort2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.Sort2/CS/arraysort2.cs
@@ -7,7 +7,7 @@
using System.Collections;
public class SamplesArray {
-
+
public class myReverserClass : IComparer {
// Calls CaseInsensitiveComparer.Compare with the parameters reversed.
@@ -17,16 +17,16 @@ int IComparer.Compare( Object x, Object y ) {
}
public static void Main() {
-
+
// Creates and initializes a new Array and a new custom comparer.
String[] myKeys = { "red", "GREEN", "YELLOW", "BLUE", "purple", "black", "orange" };
String[] myValues = { "strawberries", "PEARS", "LIMES", "BERRIES", "grapes", "olives", "cantaloupe" };
IComparer myComparer = new myReverserClass();
-
+
// Displays the values of the Array.
Console.WriteLine( "The Array initially contains the following values:" );
PrintKeysAndValues( myKeys, myValues );
-
+
// Sorts a section of the Array using the default comparer.
Array.Sort( myKeys, myValues, 1, 3 );
Console.WriteLine( "After sorting a section of the Array using the default comparer:" );
@@ -47,7 +47,7 @@ public static void Main() {
Console.WriteLine( "After sorting the entire Array using the reverse case-insensitive comparer:" );
PrintKeysAndValues( myKeys, myValues );
}
-
+
public static void PrintKeysAndValues( String[] myKeys, String[] myValues ) {
for ( int i = 0; i < myKeys.Length; i++ ) {
Console.WriteLine( " {0,-10}: {1}", myKeys[i], myValues[i] );
@@ -57,7 +57,7 @@ public static void PrintKeysAndValues( String[] myKeys, String[] myValues ) {
}
-/*
+/*
This code produces the following output.
The Array initially contains the following values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.SyncRoot/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.SyncRoot/cs/source.cs
index e9fd90d7e1c..68ee082c547 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.SyncRoot/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array.SyncRoot/cs/source.cs
@@ -6,7 +6,7 @@ public static void Main()
{
//
Array myArray = new int[] { 1, 2, 4 };
- lock(myArray.SyncRoot)
+ lock(myArray.SyncRoot)
{
foreach (Object item in myArray)
Console.WriteLine(item);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArraySegment/CS/arraysegment.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArraySegment/CS/arraysegment.cs
index 8be300d1fbd..6a4c8cc7875 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArraySegment/CS/arraysegment.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArraySegment/CS/arraysegment.cs
@@ -4,12 +4,12 @@
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Create and initialize a new string array.
String[] myArr = { "The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog" };
-
+
// Display the initial contents of the array.
Console.WriteLine( "The original array initially contains:" );
PrintIndexAndValues( myArr );
@@ -36,7 +36,7 @@ public static void Main() {
Console.WriteLine( "After the first array segment is modified, the second array segment now contains:" );
PrintIndexAndValues( myArrSegMid );
}
-
+
public static void PrintIndexAndValues( ArraySegment arrSeg ) {
for ( int i = arrSeg.Offset; i < (arrSeg.Offset + arrSeg.Count); i++ ) {
Console.WriteLine( " [{0}] : {1}", i, arrSeg.Array[i] );
@@ -53,7 +53,7 @@ public static void PrintIndexAndValues( String[] myArr ) {
}
-/*
+/*
This code produces the following output.
The original array initially contains:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArraySegment/CS/segmentexample.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArraySegment/CS/segmentexample.cs
index 31d4d3c464f..9d54f1b46ac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArraySegment/CS/segmentexample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArraySegment/CS/segmentexample.cs
@@ -6,7 +6,7 @@
public class Example
{
private const int segmentSize = 10;
-
+
public static async Task Main()
{
List tasks = new List();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArrayTypeMismatch/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArrayTypeMismatch/CS/class1.cs
index 18548118daf..ee08c8a3eb6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArrayTypeMismatch/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ArrayTypeMismatch/CS/class1.cs
@@ -5,53 +5,53 @@ namespace ArrayTypeMismatch
{
class Class1
{
- static void Main(string[] args)
+ static void Main(string[] args)
{
string[] names = {"Dog", "Cat", "Fish"};
Object[] objs = (Object[]) names;
- try
+ try
{
objs[2] = "Mouse";
- foreach (object animalName in objs)
+ foreach (object animalName in objs)
{
System.Console.WriteLine(animalName);
}
}
- catch (System.ArrayTypeMismatchException)
+ catch (System.ArrayTypeMismatchException)
{
// Not reached; "Mouse" is of the correct type.
System.Console.WriteLine("Exception Thrown.");
}
- try
+ try
{
Object obj = (Object) 13;
objs[2] = obj;
}
- catch (System.ArrayTypeMismatchException)
+ catch (System.ArrayTypeMismatchException)
{
// Always reached, 13 is not a string.
System.Console.WriteLine(
"New element is not of the correct type.");
}
-
- // Set objs to an array of objects instead of
+
+ // Set objs to an array of objects instead of
// an array of strings.
objs = new Object[3];
- try
+ try
{
objs[0] = (Object) "Turtle";
objs[1] = (Object) 12;
objs[2] = (Object) 2.341;
- foreach (object element in objs)
+ foreach (object element in objs)
{
System.Console.WriteLine(element);
}
}
- catch (System.ArrayTypeMismatchException)
+ catch (System.ArrayTypeMismatchException)
{
// ArrayTypeMismatchException is not thrown this time.
System.Console.WriteLine("Exception Thrown.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetEnumerator/CS/array_getenumerator.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetEnumerator/CS/array_getenumerator.cs
index 2d5a9d3d0e6..fafdec9de3e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetEnumerator/CS/array_getenumerator.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetEnumerator/CS/array_getenumerator.cs
@@ -4,9 +4,9 @@
using System;
public class SamplesArray {
-
+
public static void Main() {
-
+
// Creates and initializes a new Array.
String[] myArr = new String[10];
myArr[0] = "The";
@@ -18,7 +18,7 @@ public static void Main() {
myArr[6] = "the";
myArr[7] = "lazy";
myArr[8] = "dog";
-
+
// Displays the values of the Array.
int i = 0;
System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
@@ -29,7 +29,7 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
The Array contains the following values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs
index 536bd4e0ac2..5561bf3254e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Array_GetSetValue/CS/array_getsetvalue.cs
@@ -6,7 +6,7 @@
public class SamplesArray {
public static void Main() {
-
+
// Creates and initializes a one-dimensional array.
String[] myArr1 = new String[5];
@@ -39,7 +39,7 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
[3]: three
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.Equals/CS/equals.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.Equals/CS/equals.cs
index 9c7f96f0194..3d4e52718eb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.Equals/CS/equals.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.Equals/CS/equals.cs
@@ -41,7 +41,7 @@ public override string ToString( )
}
}
-public class TestClass
+public class TestClass
{
// Assign an ArgumentID attribute to each parameter.
// Assign an ArgumentUsage attribute to each parameter.
@@ -55,69 +55,69 @@ public void TestMethod(
{ }
}
-class AttributeEqualsDemo
+class AttributeEqualsDemo
{
// Create Attribute objects and compare them.
- static void Main()
+ static void Main()
{
- // Get the class type, and then get the MethodInfo object
+ // Get the class type, and then get the MethodInfo object
// for TestMethod to access its metadata.
Type clsType = typeof( TestClass );
MethodInfo mInfo = clsType.GetMethod("TestMethod");
// There will be two elements in pInfoArray, one for each parameter.
ParameterInfo[] pInfoArray = mInfo.GetParameters();
- if (pInfoArray != null)
+ if (pInfoArray != null)
{
// Create an instance of the argument usage attribute on strArray.
ArgumentUsageAttribute arrayUsageAttr1 = (ArgumentUsageAttribute)
- Attribute.GetCustomAttribute( pInfoArray[0],
+ Attribute.GetCustomAttribute( pInfoArray[0],
typeof(ArgumentUsageAttribute) );
- // Create another instance of the argument usage attribute
+ // Create another instance of the argument usage attribute
// on strArray.
ArgumentUsageAttribute arrayUsageAttr2 = (ArgumentUsageAttribute)
- Attribute.GetCustomAttribute( pInfoArray[0],
+ Attribute.GetCustomAttribute( pInfoArray[0],
typeof(ArgumentUsageAttribute) );
// Create an instance of the argument usage attribute on strList.
ArgumentUsageAttribute listUsageAttr = (ArgumentUsageAttribute)
- Attribute.GetCustomAttribute( pInfoArray[1],
+ Attribute.GetCustomAttribute( pInfoArray[1],
typeof(ArgumentUsageAttribute) );
// Create an instance of the argument ID attribute on strArray.
ArgumentIDAttribute arrayIDAttr1 = (ArgumentIDAttribute)
- Attribute.GetCustomAttribute( pInfoArray[0],
+ Attribute.GetCustomAttribute( pInfoArray[0],
typeof(ArgumentIDAttribute) );
// Create another instance of the argument ID attribute on strArray.
ArgumentIDAttribute arrayIDAttr2 = (ArgumentIDAttribute)
- Attribute.GetCustomAttribute( pInfoArray[0],
+ Attribute.GetCustomAttribute( pInfoArray[0],
typeof(ArgumentIDAttribute) );
// Create an instance of the argument ID attribute on strList.
ArgumentIDAttribute listIDAttr = (ArgumentIDAttribute)
- Attribute.GetCustomAttribute( pInfoArray[1],
+ Attribute.GetCustomAttribute( pInfoArray[1],
typeof(ArgumentIDAttribute) );
// Compare various pairs of attributes for equality.
Console.WriteLine("\nCompare a usage attribute instance to " +
"another instance of the same attribute:" );
- Console.WriteLine($" \"{arrayUsageAttr1}\" == \n" +
+ Console.WriteLine($" \"{arrayUsageAttr1}\" == \n" +
$" \"{arrayUsageAttr2}\"? {arrayUsageAttr1.Equals( arrayUsageAttr2)}");
Console.WriteLine("\nCompare a usage attribute to " +
"another usage attribute:" );
- Console.WriteLine($" \"{arrayUsageAttr1}\" == \n" +
+ Console.WriteLine($" \"{arrayUsageAttr1}\" == \n" +
$" \"{listUsageAttr}\"? {arrayUsageAttr1.Equals(listUsageAttr)}");
Console.WriteLine("\nCompare an ID attribute instance to " +
"another instance of the same attribute:" );
- Console.WriteLine($" \"{ arrayIDAttr1}\" == \n" +
+ Console.WriteLine($" \"{ arrayIDAttr1}\" == \n" +
$" \"{arrayIDAttr2}\"? {arrayIDAttr1.Equals(arrayIDAttr2)}");
Console.WriteLine("\nCompare an ID attribute to another ID attribute:" );
- Console.WriteLine($" \"{arrayIDAttr1}\" == \n" +
+ Console.WriteLine($" \"{arrayIDAttr1}\" == \n" +
$" \"{listIDAttr}\"? {arrayIDAttr1.Equals(listIDAttr)}");
}
else
@@ -130,15 +130,15 @@ The example displays the following output.
// Compare a usage attribute instance to another instance of the same attribute:
// "ArgumentUsageAttribute: Must pass an array here." ==
// "ArgumentUsageAttribute: Must pass an array here."? True
-//
+//
// Compare a usage attribute to another usage attribute:
// "ArgumentUsageAttribute: Must pass an array here." ==
// "ArgumentUsageAttribute: Can pass param list or array here."? False
-//
+//
// Compare an ID attribute instance to another instance of the same attribute:
// "ArgumentIDAttribute.22d1a176-4aca-427b-8230-0c1563e13187" ==
// "ArgumentIDAttribute.7fa94bba-c290-48e1-a0de-e22f6c1e64f1"? False
-//
+//
// Compare an ID attribute to another ID attribute:
// "ArgumentIDAttribute.22d1a176-4aca-427b-8230-0c1563e13187" ==
// "ArgumentIDAttribute.b9eea70d-9c0f-459e-a984-19c46b6c8789"? False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrparam.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrparam.cs
index a478012a424..f5b75b88f0b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrparam.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrparam.cs
@@ -3,9 +3,9 @@
using System;
using System.Reflection;
-namespace NDP_UE_CS
+namespace NDP_UE_CS
{
-//
+//
// Define a custom parameter attribute that takes a single message argument.
[AttributeUsage( AttributeTargets.Parameter )]
public class ArgumentUsageAttribute : Attribute
@@ -28,7 +28,7 @@ public string Message
}
//
- public class BaseClass
+ public class BaseClass
{
// Assign an ArgumentUsage attribute to the strArray parameter.
// Assign a ParamArray attribute to strList using the params keyword.
@@ -50,44 +50,44 @@ public override void TestMethod(
{ }
}
- class CustomParamDemo
+ class CustomParamDemo
{
- static void Main( )
+ static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of Attribute.GetCustomAttribute( Param" +
"eterInfo, Type )\ngenerates the following output." );
- // Get the class type, and then get the MethodInfo object
+ // Get the class type, and then get the MethodInfo object
// for TestMethod to access its metadata.
Type clsType = typeof( DerivedClass );
MethodInfo mInfo = clsType.GetMethod("TestMethod");
// Iterate through the ParameterInfo array for the method parameters.
ParameterInfo[] pInfoArray = mInfo.GetParameters();
- if (pInfoArray != null)
+ if (pInfoArray != null)
{
foreach( ParameterInfo paramInfo in pInfoArray )
{
// See if the ParamArray attribute is defined.
- bool isDef = Attribute.IsDefined(
+ bool isDef = Attribute.IsDefined(
paramInfo, typeof(ParamArrayAttribute));
if( isDef )
- Console.WriteLine(
+ Console.WriteLine(
"\nThe ParamArray attribute is defined " +
"for \nparameter {0} of method {1}.",
paramInfo.Name, mInfo.Name);
- // See if ParamUsageAttribute is defined.
+ // See if ParamUsageAttribute is defined.
// If so, display a message.
ArgumentUsageAttribute usageAttr = (ArgumentUsageAttribute)
- Attribute.GetCustomAttribute(
+ Attribute.GetCustomAttribute(
paramInfo, typeof(ArgumentUsageAttribute) );
if( usageAttr != null )
{
- Console.WriteLine(
+ Console.WriteLine(
"\nThe ArgumentUsage attribute is defined " +
"for \nparameter {0} of method {1}.",
paramInfo.Name, mInfo.Name );
@@ -99,7 +99,7 @@ static void Main( )
}
}
else
- Console.WriteLine(
+ Console.WriteLine(
"The parameters information could not " +
"be retrieved for method {0}.", mInfo.Name);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrprminh.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrprminh.cs
index caff7e81150..4af8307c583 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrprminh.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/CS/getcustattrprminh.cs
@@ -1,10 +1,10 @@
//
-// Example for the Attribute.GetCustomAttribute( ParameterInfo, Type, Boolean )
+// Example for the Attribute.GetCustomAttribute( ParameterInfo, Type, Boolean )
// method.
using System;
using System.Reflection;
-namespace NDP_UE_CS
+namespace NDP_UE_CS
{
// Define a custom parameter attribute that takes a single message argument.
[AttributeUsage( AttributeTargets.Parameter )]
@@ -27,7 +27,7 @@ public string Message
}
}
- public class BaseClass
+ public class BaseClass
{
// Assign an ArgumentUsage attribute to the strArray parameter.
// Assign a ParamArray attribute to strList using the params keyword.
@@ -49,22 +49,22 @@ public override void TestMethod(
{ }
}
- class CustomParamDemo
+ class CustomParamDemo
{
- static void Main( )
+ static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of Attribute.GetCustomAttribute( Parameter" +
"Info, Type, Boolean )\ngenerates the following output." );
- // Get the class type, and then get the MethodInfo object
+ // Get the class type, and then get the MethodInfo object
// for TestMethod to access its metadata.
Type clsType = typeof(DerivedClass);
MethodInfo mInfo = clsType.GetMethod("TestMethod");
// Iterate through the ParameterInfo array for the method parameters.
ParameterInfo[] pInfoArray = mInfo.GetParameters();
- if (pInfoArray != null)
+ if (pInfoArray != null)
{
DisplayParameterAttributes( mInfo, pInfoArray, false );
DisplayParameterAttributes( mInfo, pInfoArray, true );
@@ -77,16 +77,16 @@ static void Main( )
static void DisplayParameterAttributes( MethodInfo mInfo,
ParameterInfo[] pInfoArray, bool includeInherited )
{
- Console.WriteLine(
+ Console.WriteLine(
"\nParameter attribute information for method \"" +
- "{0}\"\nincludes inheritance from base class: {1}.",
+ "{0}\"\nincludes inheritance from base class: {1}.",
mInfo.Name, includeInherited ? "Yes" : "No" );
// Display the attribute information for the parameters.
foreach( ParameterInfo paramInfo in pInfoArray )
{
// See if the ParamArray attribute is defined.
- bool isDef = Attribute.IsDefined( paramInfo,
+ bool isDef = Attribute.IsDefined( paramInfo,
typeof(ParamArrayAttribute));
if( isDef )
@@ -95,16 +95,16 @@ static void DisplayParameterAttributes( MethodInfo mInfo,
"for \n parameter {0} of method {1}.",
paramInfo.Name, mInfo.Name);
- // See if ParamUsageAttribute is defined.
+ // See if ParamUsageAttribute is defined.
// If so, display a message.
ArgumentUsageAttribute usageAttr = (ArgumentUsageAttribute)
- Attribute.GetCustomAttribute( paramInfo,
+ Attribute.GetCustomAttribute( paramInfo,
typeof(ArgumentUsageAttribute),
includeInherited );
if( usageAttr != null )
{
- Console.WriteLine(
+ Console.WriteLine(
"\n The ArgumentUsage attribute is def" +
"ined for \n parameter {0} of method {1}.",
paramInfo.Name, mInfo.Name );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.TypeId/CS/typeid.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.TypeId/CS/typeid.cs
index adde3dfca61..183ed58384b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.TypeId/CS/typeid.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Attribute.TypeId/CS/typeid.cs
@@ -3,7 +3,7 @@
using System;
using System.Reflection;
-namespace NDP_UE_CS
+namespace NDP_UE_CS
{
// Define a custom parameter attribute that takes a single message argument.
[AttributeUsage( AttributeTargets.Parameter )]
@@ -40,7 +40,7 @@ public override string ToString( )
}
}
- public class TestClass
+ public class TestClass
{
// Assign an ArgumentUsage attribute to each parameter.
// Assign a ParamArray attribute to strList using the params keyword.
@@ -52,38 +52,38 @@ public void TestMethod(
{ }
}
- class AttributeTypeIdDemo
+ class AttributeTypeIdDemo
{
- static void ShowAttributeTypeIds( )
+ static void ShowAttributeTypeIds( )
{
- // Get the class type, and then get the MethodInfo object
+ // Get the class type, and then get the MethodInfo object
// for TestMethod to access its metadata.
Type clsType = typeof( TestClass );
MethodInfo mInfo = clsType.GetMethod("TestMethod");
// There will be two elements in pInfoArray, one for each parameter.
ParameterInfo[] pInfoArray = mInfo.GetParameters();
- if (pInfoArray != null)
+ if (pInfoArray != null)
{
// Create an instance of the param array attribute on strList.
ParamArrayAttribute listArrayAttr = (ParamArrayAttribute)
- Attribute.GetCustomAttribute( pInfoArray[1],
+ Attribute.GetCustomAttribute( pInfoArray[1],
typeof(ParamArrayAttribute) );
// Create an instance of the argument usage attribute on strArray.
ArgumentUsageAttribute arrayUsageAttr1 = (ArgumentUsageAttribute)
- Attribute.GetCustomAttribute( pInfoArray[0],
+ Attribute.GetCustomAttribute( pInfoArray[0],
typeof(ArgumentUsageAttribute) );
- // Create another instance of the argument usage attribute
+ // Create another instance of the argument usage attribute
// on strArray.
ArgumentUsageAttribute arrayUsageAttr2 = (ArgumentUsageAttribute)
- Attribute.GetCustomAttribute( pInfoArray[0],
+ Attribute.GetCustomAttribute( pInfoArray[0],
typeof(ArgumentUsageAttribute) );
// Create an instance of the argument usage attribute on strList.
ArgumentUsageAttribute listUsageAttr = (ArgumentUsageAttribute)
- Attribute.GetCustomAttribute( pInfoArray[1],
+ Attribute.GetCustomAttribute( pInfoArray[1],
typeof(ArgumentUsageAttribute) );
// Display the attributes and corresponding TypeId values.
@@ -101,12 +101,12 @@ static void ShowAttributeTypeIds( )
"not be retrieved for method {0}.", mInfo.Name );
}
- static void Main( )
+ static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the Attribute.TypeId property\n" +
"generates the following output." );
- Console.WriteLine(
+ Console.WriteLine(
"\nCreate instances from a derived Attribute " +
"class that implements TypeId, \nand then " +
"display the attributes and corresponding TypeId values:" );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/bitconv.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/bitconv.cs
index 70a4dc668ab..f7c563c098d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/bitconv.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/bitconv.cs
@@ -7,7 +7,7 @@ class BitConverterDemo
public static void Main( )
{
const string formatter = "{0,25}{1,30}";
-
+
double aDoubl = 0.1111111111111111111;
float aSingl = 0.1111111111111111111F;
long aLong = 1111111111111111111;
@@ -16,26 +16,26 @@ public static void Main( )
char aChar = '*';
bool aBool = true;
- Console.WriteLine(
+ Console.WriteLine(
"This example of methods of the BitConverter class" +
"\ngenerates the following output.\n" );
Console.WriteLine( formatter, "argument", "byte array" );
Console.WriteLine( formatter, "--------", "----------" );
// Convert values to Byte arrays and display them.
- Console.WriteLine( formatter, aDoubl,
+ Console.WriteLine( formatter, aDoubl,
BitConverter.ToString( BitConverter.GetBytes( aDoubl ) ) );
- Console.WriteLine( formatter, aSingl,
+ Console.WriteLine( formatter, aSingl,
BitConverter.ToString( BitConverter.GetBytes( aSingl ) ) );
- Console.WriteLine( formatter, aLong,
+ Console.WriteLine( formatter, aLong,
BitConverter.ToString( BitConverter.GetBytes( aLong ) ) );
- Console.WriteLine( formatter, anInt,
+ Console.WriteLine( formatter, anInt,
BitConverter.ToString( BitConverter.GetBytes( anInt ) ) );
- Console.WriteLine( formatter, aShort,
+ Console.WriteLine( formatter, aShort,
BitConverter.ToString( BitConverter.GetBytes( aShort ) ) );
- Console.WriteLine( formatter, aChar,
+ Console.WriteLine( formatter, aChar,
BitConverter.ToString( BitConverter.GetBytes( aChar ) ) );
- Console.WriteLine( formatter, aBool,
+ Console.WriteLine( formatter, aBool,
BitConverter.ToString( BitConverter.GetBytes( aBool ) ) );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/example1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/example1.cs
index 6ea04d951b5..8a2fcb4b92a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/example1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/example1.cs
@@ -6,16 +6,16 @@ public class Example
public static void Main()
{
int value = -16;
- Byte[] bytes = BitConverter.GetBytes(value);
-
+ Byte[] bytes = BitConverter.GetBytes(value);
+
// Convert bytes back to Int32.
int intValue = BitConverter.ToInt32(bytes, 0);
- Console.WriteLine("{0} = {1}: {2}",
- value, intValue,
+ Console.WriteLine("{0} = {1}: {2}",
+ value, intValue,
value.Equals(intValue) ? "Round-trips" : "Does not round-trip");
// Convert bytes to UInt32.
uint uintValue = BitConverter.ToUInt32(bytes, 0);
- Console.WriteLine("{0} = {1}: {2}", value, uintValue,
+ Console.WriteLine("{0} = {1}: {2}", value, uintValue,
value.Equals(uintValue) ? "Round-trips" : "Does not round-trip");
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/littleend.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/littleend.cs
index 9c4fc1e502d..f62c0ab5b63 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/littleend.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/littleend.cs
@@ -6,11 +6,11 @@ class LittleEndDemo
{
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.IsLittleEndian field " +
"generates \nthe following output when run on " +
"x86-class computers.\n");
- Console.WriteLine( "IsLittleEndian: {0}",
+ Console.WriteLine( "IsLittleEndian: {0}",
BitConverter.IsLittleEndian );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/networkorder1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/networkorder1.cs
index 8ae0d642331..215bc668c58 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/networkorder1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.Class/CS/networkorder1.cs
@@ -8,13 +8,13 @@ public static void Main()
int value = 12345678;
byte[] bytes = BitConverter.GetBytes(value);
Console.WriteLine(BitConverter.ToString(bytes));
-
+
if (BitConverter.IsLittleEndian)
- Array.Reverse(bytes);
+ Array.Reverse(bytes);
Console.WriteLine(BitConverter.ToString(bytes));
// Call method to send byte stream across machine boundaries.
-
+
// Receive byte stream from beyond machine boundaries.
Console.WriteLine(BitConverter.ToString(bytes));
if (BitConverter.IsLittleEndian)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CS/bitstodbl.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CS/bitstodbl.cs
index ce09e777b84..a63a56416ee 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CS/bitstodbl.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CS/bitstodbl.cs
@@ -5,7 +5,7 @@
class Int64BitsToDoubleDemo
{
const string formatter = "{0,20}{1,27:E16}";
-
+
// Reinterpret the long argument as a double.
public static void LongBitsToDouble( long argument )
{
@@ -13,20 +13,20 @@ public static void LongBitsToDouble( long argument )
doubleValue = BitConverter.Int64BitsToDouble( argument );
// Display the argument in hexadecimal.
- Console.WriteLine( formatter,
+ Console.WriteLine( formatter,
String.Format( "0x{0:X16}", argument ), doubleValue );
}
-
+
public static void Main( )
{
Console.WriteLine(
"This example of the BitConverter.Int64BitsToDouble( " +
"long ) \nmethod generates the following output.\n" );
- Console.WriteLine( formatter, "long argument",
+ Console.WriteLine( formatter, "long argument",
"double value" );
- Console.WriteLine( formatter, "-------------",
+ Console.WriteLine( formatter, "-------------",
"------------" );
-
+
// Convert long values and display the results.
LongBitsToDouble( 0 );
LongBitsToDouble( 0x3FF0000000000000 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CS/dbltobits.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CS/dbltobits.cs
index 09faf4cf31f..c9dd34af006 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CS/dbltobits.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CS/dbltobits.cs
@@ -5,7 +5,7 @@
class DoubleToInt64BitsDemo
{
const string formatter = "{0,25:E16}{1,23:X16}";
-
+
// Reinterpret the double argument as a long.
public static void DoubleToLongBits( double argument )
{
@@ -15,17 +15,17 @@ public static void DoubleToLongBits( double argument )
// Display the resulting long in hexadecimal.
Console.WriteLine( formatter, argument, longValue );
}
-
+
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.DoubleToInt64Bits( " +
"double ) \nmethod generates the following output.\n" );
- Console.WriteLine( formatter, "double argument",
+ Console.WriteLine( formatter, "double argument",
"hexadecimal value" );
- Console.WriteLine( formatter, "---------------",
+ Console.WriteLine( formatter, "---------------",
"-----------------" );
-
+
// Convert double values and display the results.
DoubleToLongBits( 1.0 );
DoubleToLongBits( 15.0 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytesbool.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytesbool.cs
index f1398afdd0d..cc8624ae7c9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytesbool.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytesbool.cs
@@ -11,15 +11,15 @@ public static void Main( )
// Display the value and its corresponding byte array.
Console.WriteLine("{0,10}{1,16}\n", "Boolean", "Bytes");
foreach (var value in values) {
- byte[] bytes = BitConverter.GetBytes(value);
- Console.WriteLine("{0,10}{1,16}", value,
+ byte[] bytes = BitConverter.GetBytes(value);
+ Console.WriteLine("{0,10}{1,16}", value,
BitConverter.ToString(bytes));
}
}
}
// The example displays the following output:
// Boolean Bytes
-//
+//
// True 01
// False 00
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/byteschar.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/byteschar.cs
index 290bae317a5..67cd94ea657 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/byteschar.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/byteschar.cs
@@ -5,23 +5,23 @@
class GetBytesCharDemo
{
const string formatter = "{0,10}{1,16}";
-
+
// Convert a char argument to a byte array and display it.
public static void GetBytesChar( char argument )
{
byte[ ] byteArray = BitConverter.GetBytes( argument );
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
BitConverter.ToString( byteArray ) );
}
-
+
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.GetBytes( char ) " +
"\nmethod generates the following output.\r\n" );
Console.WriteLine( formatter, "char", "byte array" );
Console.WriteLine( formatter, "----", "----------" );
-
+
// Convert char values and display the results.
GetBytesChar( '\0' );
GetBytesChar( ' ' );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytesdouble.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytesdouble.cs
index 263b716da70..99010935635 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytesdouble.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytesdouble.cs
@@ -5,23 +5,23 @@
class GetBytesDoubleDemo
{
const string formatter = "{0,25:E16}{1,30}";
-
+
// Convert a double argument to a byte array and display it.
public static void GetBytesDouble( double argument )
{
byte[ ] byteArray = BitConverter.GetBytes( argument );
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
BitConverter.ToString( byteArray ) );
}
-
+
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.GetBytes( double ) " +
"\nmethod generates the following output.\n" );
Console.WriteLine( formatter, "double", "byte array" );
Console.WriteLine( formatter, "------", "----------" );
-
+
// Convert double values and display the results.
GetBytesDouble( 0.0 );
GetBytesDouble( 1.0 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytessingle.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytessingle.cs
index 58386dfb256..ae3f5ad0b08 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytessingle.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CS/bytessingle.cs
@@ -5,23 +5,23 @@
class GetBytesSingleDemo
{
const string formatter = "{0,16:E7}{1,20}";
-
+
// Convert a float argument to a byte array and display it.
public static void GetBytesSingle( float argument )
{
byte[ ] byteArray = BitConverter.GetBytes( argument );
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
BitConverter.ToString( byteArray ) );
}
-
+
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.GetBytes( float ) " +
"\nmethod generates the following output.\n" );
Console.WriteLine( formatter, "float", "byte array" );
Console.WriteLine( formatter, "-----", "----------" );
-
+
// Convert float values and display the results.
GetBytesSingle( 0.0F );
GetBytesSingle( 1.0F );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint16.cs
index c9b46a29cd3..cd06639f40c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint16.cs
@@ -5,23 +5,23 @@
class GetBytesInt16Demo
{
const string formatter = "{0,10}{1,13}";
-
+
// Convert a short argument to a byte array and display it.
public static void GetBytesInt16( short argument )
{
byte[ ] byteArray = BitConverter.GetBytes( argument );
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
BitConverter.ToString( byteArray ) );
}
-
+
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.GetBytes( short ) " +
"\nmethod generates the following output.\n" );
Console.WriteLine( formatter, "short", "byte array" );
Console.WriteLine( formatter, "-----", "----------" );
-
+
// Convert short values and display the results.
GetBytesInt16( 0 );
GetBytesInt16( 15 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint32.cs
index d8711370f7f..2ec13f2ce36 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint32.cs
@@ -8,16 +8,16 @@ public static void Main( )
// Define an array of integers.
int[] values = { 0, 15, -15, 0x100000, -0x100000, 1000000000,
-1000000000, int.MinValue, int.MaxValue };
-
+
// Convert each integer to a byte array.
- Console.WriteLine("{0,16}{1,10}{2,17}", "Integer",
+ Console.WriteLine("{0,16}{1,10}{2,17}", "Integer",
"Endian", "Byte Array");
- Console.WriteLine("{0,16}{1,10}{2,17}", "---", "------",
+ Console.WriteLine("{0,16}{1,10}{2,17}", "---", "------",
"----------" );
foreach (var value in values) {
byte[] byteArray = BitConverter.GetBytes(value);
- Console.WriteLine("{0,16}{1,10}{2,17}", value,
- BitConverter.IsLittleEndian ? "Little" : " Big",
+ Console.WriteLine("{0,16}{1,10}{2,17}", value,
+ BitConverter.IsLittleEndian ? "Little" : " Big",
BitConverter.ToString(byteArray));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint64.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint64.cs
index 51ce5673df6..e1d003ed43d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CS/bytesint64.cs
@@ -7,22 +7,22 @@ public static void Main()
{
// Define an array of Int64 values.
long[] values = { 0, 0xFFFFFF, -0xFFFFFF, 1000000000, -1000000000,
- 0x100000000, -0x100000000, 0xAAAAAAAAAAAA,
- -0xAAAAAAAAAAAA, 1000000000000000000,
- -1000000000000000000, long.MinValue,
+ 0x100000000, -0x100000000, 0xAAAAAAAAAAAA,
+ -0xAAAAAAAAAAAA, 1000000000000000000,
+ -1000000000000000000, long.MinValue,
long.MaxValue };
-
+
Console.WriteLine( "{0,22}{1,10} {2,30}", "Int64", "Endian", "Byte Array");
Console.WriteLine( "{0,22}{1,10} {2,30}", "----", "------", "----------" );
-
+
foreach (var value in values) {
// Convert each Int64 value to a byte array.
byte[] byteArray = BitConverter.GetBytes(value);
// Display the result.
- Console.WriteLine("{0,22}{1,10}{2,30}", value,
- BitConverter.IsLittleEndian ? "Little" : "Big",
+ Console.WriteLine("{0,22}{1,10}{2,30}", value,
+ BitConverter.IsLittleEndian ? "Little" : "Big",
BitConverter.ToString(byteArray));
- }
+ }
}
}
// The example displays output like the following:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint16.cs
index aab73208aad..0a0a0f13b19 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint16.cs
@@ -5,23 +5,23 @@
class GetBytesUInt16Demo
{
const string formatter = "{0,10}{1,13}";
-
+
// Convert a ushort argument to a byte array and display it.
public static void GetBytesUInt16( ushort argument )
{
byte[ ] byteArray = BitConverter.GetBytes( argument );
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
BitConverter.ToString( byteArray ) );
}
-
+
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.GetBytes( ushort ) " +
"\nmethod generates the following output.\n" );
Console.WriteLine( formatter, "ushort", "byte array" );
Console.WriteLine( formatter, "------", "----------" );
-
+
// Convert ushort values and display the results.
GetBytesUInt16( 15 );
GetBytesUInt16( 1023 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint32.cs
index 39aabffe0e6..f9b2a9ef1b9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint32.cs
@@ -5,23 +5,23 @@
class GetBytesUInt32Demo
{
const string formatter = "{0,16}{1,20}";
-
+
// Convert a uint argument to a byte array and display it.
public static void GetBytesUInt32( uint argument )
{
byte[ ] byteArray = BitConverter.GetBytes( argument );
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
BitConverter.ToString( byteArray ) );
}
-
+
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.GetBytes( uint ) " +
"\nmethod generates the following output.\n" );
Console.WriteLine( formatter, "uint", "byte array" );
Console.WriteLine( formatter, "----", "----------" );
-
+
// Convert uint values and display the results.
GetBytesUInt32( 15 );
GetBytesUInt32( 1023 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint64.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint64.cs
index b3c7b8d38c9..1da99d127e5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CS/bytesuint64.cs
@@ -5,23 +5,23 @@
class GetBytesUInt64Demo
{
const string formatter = "{0,22}{1,30}";
-
+
// Convert a ulong argument to a byte array and display it.
public static void GetBytesUInt64( ulong argument )
{
byte[ ] byteArray = BitConverter.GetBytes( argument );
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
BitConverter.ToString( byteArray ) );
}
-
+
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.GetBytes( ulong ) " +
"\nmethod generates the following output.\n" );
Console.WriteLine( formatter, "ulong", "byte array" );
Console.WriteLine( formatter, "-----", "----------" );
-
+
// Convert ulong values and display the results.
GetBytesUInt64( 0xFFFFFF );
GetBytesUInt64( 1000000000 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToString/CS/batostring.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToString/CS/batostring.cs
index 3ad3beb83a5..9e5079a26e6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToString/CS/batostring.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToString/CS/batostring.cs
@@ -10,7 +10,7 @@ public static void WriteByteArray( byte[ ] bytes, string name )
const string underLine = "--------------------------------";
Console.WriteLine( name );
- Console.WriteLine( underLine.Substring( 0,
+ Console.WriteLine( underLine.Substring( 0,
Math.Min( name.Length, underLine.Length ) ) );
Console.WriteLine( BitConverter.ToString( bytes ) );
Console.WriteLine( );
@@ -26,11 +26,11 @@ public static void Main( )
0, 168, 3, 41, 4, 172, 32 };
byte[ ] arrayThree = {
- 15, 0, 0, 128, 16, 39, 240, 216, 241, 255,
+ 15, 0, 0, 128, 16, 39, 240, 216, 241, 255,
127 };
byte[ ] arrayFour = {
- 15, 0, 0, 0, 0, 16, 0, 255, 3, 0,
+ 15, 0, 0, 0, 0, 16, 0, 255, 3, 0,
0, 202, 154, 59, 255, 255, 255, 255, 127 };
Console.WriteLine( "This example of the " +
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToString/CS/batostringii.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToString/CS/batostringii.cs
index 487275e2495..4b95f9f961d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToString/CS/batostringii.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToString/CS/batostringii.cs
@@ -5,7 +5,7 @@
class BytesToStringDemo
{
// Display a byte array, using multiple lines if necessary.
- public static void WriteMultiLineByteArray( byte[ ] bytes,
+ public static void WriteMultiLineByteArray( byte[ ] bytes,
string name )
{
const int rowSize = 20;
@@ -13,12 +13,12 @@ public static void WriteMultiLineByteArray( byte[ ] bytes,
int iter;
Console.WriteLine( name );
- Console.WriteLine( underLine.Substring( 0,
+ Console.WriteLine( underLine.Substring( 0,
Math.Min( name.Length, underLine.Length ) ) );
for( iter = 0; iter < bytes.Length - rowSize; iter += rowSize )
{
- Console.Write(
+ Console.Write(
BitConverter.ToString( bytes, iter, rowSize ) );
Console.WriteLine( "-" );
}
@@ -30,32 +30,32 @@ public static void WriteMultiLineByteArray( byte[ ] bytes,
public static void Main( )
{
byte[ ] arrayOne = {
- 0, 0, 0, 0, 128, 63, 0, 0, 112, 65,
- 0, 255, 127, 71, 0, 0, 128, 59, 0, 0,
- 128, 47, 73, 70, 131, 5, 75, 6, 158, 63,
- 77, 6, 158, 63, 80, 6, 158, 63, 30, 55,
- 190, 121, 255, 255, 127, 255, 255, 127, 127, 1,
- 0, 0, 0, 192, 255, 0, 0, 128, 255, 0,
+ 0, 0, 0, 0, 128, 63, 0, 0, 112, 65,
+ 0, 255, 127, 71, 0, 0, 128, 59, 0, 0,
+ 128, 47, 73, 70, 131, 5, 75, 6, 158, 63,
+ 77, 6, 158, 63, 80, 6, 158, 63, 30, 55,
+ 190, 121, 255, 255, 127, 255, 255, 127, 127, 1,
+ 0, 0, 0, 192, 255, 0, 0, 128, 255, 0,
0, 128, 127 };
byte[ ] arrayTwo = {
- 255, 255, 255, 0, 0, 20, 0, 33, 0, 0,
- 0, 1, 0, 0, 0, 100, 167, 179, 182, 224,
- 13, 0, 202, 154, 59, 0, 143, 91, 0, 170,
- 170, 170, 170, 170, 170, 0, 0, 232, 137, 4,
- 35, 199, 138, 255, 232, 244, 255, 252, 205, 255,
+ 255, 255, 255, 0, 0, 20, 0, 33, 0, 0,
+ 0, 1, 0, 0, 0, 100, 167, 179, 182, 224,
+ 13, 0, 202, 154, 59, 0, 143, 91, 0, 170,
+ 170, 170, 170, 170, 170, 0, 0, 232, 137, 4,
+ 35, 199, 138, 255, 232, 244, 255, 252, 205, 255,
255, 129 };
byte[ ] arrayThree = {
- 0, 222, 0, 0, 0, 224, 111, 64, 0, 0,
- 224, 255, 255, 255, 239, 65, 0, 0, 131, 0,
- 0, 0, 112, 63, 0, 143, 0, 100, 0, 0,
- 240, 61, 223, 136, 30, 28, 254, 116, 170, 1,
- 250, 89, 140, 66, 202, 192, 243, 63, 251, 89,
- 140, 66, 202, 192, 243, 63, 252, 89, 140, 66,
- 202, 192, 243, 63, 82, 211, 187, 188, 232, 126,
- 255, 255, 255, 244, 255, 239, 127, 1, 0, 0,
- 0, 10, 17, 0, 0, 248, 255, 0, 88, 0,
+ 0, 222, 0, 0, 0, 224, 111, 64, 0, 0,
+ 224, 255, 255, 255, 239, 65, 0, 0, 131, 0,
+ 0, 0, 112, 63, 0, 143, 0, 100, 0, 0,
+ 240, 61, 223, 136, 30, 28, 254, 116, 170, 1,
+ 250, 89, 140, 66, 202, 192, 243, 63, 251, 89,
+ 140, 66, 202, 192, 243, 63, 252, 89, 140, 66,
+ 202, 192, 243, 63, 82, 211, 187, 188, 232, 126,
+ 255, 255, 255, 244, 255, 239, 127, 1, 0, 0,
+ 0, 10, 17, 0, 0, 248, 255, 0, 88, 0,
91, 0, 0, 240, 255, 0, 0, 240, 157 };
Console.WriteLine( "This example of the\n" +
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batobool.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batobool.cs
index ba1426e1355..8c9af4e8f4e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batobool.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batobool.cs
@@ -5,19 +5,19 @@ class Example
{
public static void Main( )
{
- // Define an array of byte values.
+ // Define an array of byte values.
byte[] bytes = { 0, 1, 2, 4, 8, 16, 32, 64, 128, 255 };
Console.WriteLine("{0,5}{1,16}{2,10}\n", "index", "array element", "bool" );
// Convert each array element to a Boolean value.
for (int index = 0; index < bytes.Length; index++)
- Console.WriteLine("{0,5}{1,16:X2}{2,10}", index, bytes[index],
+ Console.WriteLine("{0,5}{1,16:X2}{2,10}", index, bytes[index],
BitConverter.ToBoolean(bytes, index));
}
}
// The example displays the following output:
// index array element bool
-//
+//
// 0 00 False
// 1 01 True
// 2 02 True
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batochar.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batochar.cs
index 6c1d5ecf190..c7cc090d278 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batochar.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batochar.cs
@@ -5,23 +5,23 @@
class BytesToCharDemo
{
const string formatter = "{0,5}{1,17}{2,8}";
-
+
// Convert two byte array elements to a char and display it.
public static void BAToChar( byte[] bytes, int index )
{
char value = BitConverter.ToChar( bytes, index );
- Console.WriteLine( formatter, index,
+ Console.WriteLine( formatter, index,
BitConverter.ToString( bytes, index, 2 ), value );
}
-
+
public static void Main( )
{
byte[] byteArray = {
- 32, 0, 0, 42, 0, 65, 0, 125, 0,
+ 32, 0, 0, 42, 0, 65, 0, 125, 0,
197, 0, 168, 3, 41, 4, 172, 32 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.ToChar( byte[ ], " +
"int ) \nmethod generates the following output. It " +
"converts \nelements of a byte array to char values.\n" );
@@ -31,7 +31,7 @@ public static void Main( )
Console.WriteLine( );
Console.WriteLine( formatter, "index", "array elements", "char" );
Console.WriteLine( formatter, "-----", "--------------", "----" );
-
+
// Convert byte array elements to char values.
BAToChar( byteArray, 0 );
BAToChar( byteArray, 1 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batodouble.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batodouble.cs
index 98518542f08..14df21346c2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batodouble.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batodouble.cs
@@ -5,13 +5,13 @@
class BytesToDoubleDemo
{
const string formatter = "{0,5}{1,27}{2,27:E16}";
-
+
// Convert eight byte array elements to a double and display it.
public static void BAToDouble( byte[ ] bytes, int index )
{
double value = BitConverter.ToDouble( bytes, index );
- Console.WriteLine( formatter, index,
+ Console.WriteLine( formatter, index,
BitConverter.ToString( bytes, index, 8 ), value );
}
@@ -26,7 +26,7 @@ public static void WriteMultiLineByteArray( byte[ ] bytes )
for( iter = 0; iter < bytes.Length - rowSize; iter += rowSize )
{
- Console.Write(
+ Console.Write(
BitConverter.ToString( bytes, iter, rowSize ) );
Console.WriteLine( "-" );
}
@@ -38,32 +38,32 @@ public static void WriteMultiLineByteArray( byte[ ] bytes )
public static void Main( )
{
byte[ ] byteArray = {
- 0, 0, 0, 0, 0, 0, 0, 0, 240, 63,
- 0, 0, 0, 0, 0, 224, 111, 64, 0, 0,
- 224, 255, 255, 255, 239, 65, 0, 0, 0, 0,
- 0, 0, 112, 63, 0, 0, 0, 0, 0, 0,
- 240, 61, 223, 136, 30, 28, 254, 116, 170, 1,
- 250, 89, 140, 66, 202, 192, 243, 63, 251, 89,
- 140, 66, 202, 192, 243, 63, 252, 89, 140, 66,
- 202, 192, 243, 63, 82, 211, 187, 188, 232, 126,
- 61, 126, 255, 255, 255, 255, 255, 255, 239, 255,
- 255, 255, 255, 255, 255, 239, 127, 1, 0, 0,
- 0, 0, 0, 0, 0, 248, 255, 0, 0, 0,
- 0, 0, 0, 240, 255, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 240, 63,
+ 0, 0, 0, 0, 0, 224, 111, 64, 0, 0,
+ 224, 255, 255, 255, 239, 65, 0, 0, 0, 0,
+ 0, 0, 112, 63, 0, 0, 0, 0, 0, 0,
+ 240, 61, 223, 136, 30, 28, 254, 116, 170, 1,
+ 250, 89, 140, 66, 202, 192, 243, 63, 251, 89,
+ 140, 66, 202, 192, 243, 63, 252, 89, 140, 66,
+ 202, 192, 243, 63, 82, 211, 187, 188, 232, 126,
+ 61, 126, 255, 255, 255, 255, 255, 255, 239, 255,
+ 255, 255, 255, 255, 255, 239, 127, 1, 0, 0,
+ 0, 0, 0, 0, 0, 248, 255, 0, 0, 0,
+ 0, 0, 0, 240, 255, 0, 0, 0, 0, 0,
0, 240, 127 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.ToDouble( byte[ ], " +
"int ) \nmethod generates the following output. It " +
"converts elements \nof a byte array to double values.\n" );
WriteMultiLineByteArray( byteArray );
- Console.WriteLine( formatter, "index", "array elements",
+ Console.WriteLine( formatter, "index", "array elements",
"double" );
- Console.WriteLine( formatter, "-----", "--------------",
+ Console.WriteLine( formatter, "-----", "--------------",
"------" );
-
+
// Convert byte array elements to double values.
BAToDouble( byteArray, 0 );
BAToDouble( byteArray, 2 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batosingle.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batosingle.cs
index c2314afbea4..b13c4392987 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batosingle.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CS/batosingle.cs
@@ -5,13 +5,13 @@
class BytesToSingleDemo
{
const string formatter = "{0,5}{1,17}{2,18:E7}";
-
+
// Convert four byte array elements to a float and display it.
public static void BAToSingle( byte[ ] bytes, int index )
{
float value = BitConverter.ToSingle( bytes, index );
- Console.WriteLine( formatter, index,
+ Console.WriteLine( formatter, index,
BitConverter.ToString( bytes, index, 4 ), value );
}
@@ -26,7 +26,7 @@ public static void WriteMultiLineByteArray( byte[ ] bytes )
for( iter = 0; iter < bytes.Length - rowSize; iter += rowSize )
{
- Console.Write(
+ Console.Write(
BitConverter.ToString( bytes, iter, rowSize ) );
Console.WriteLine( "-" );
}
@@ -38,12 +38,12 @@ public static void WriteMultiLineByteArray( byte[ ] bytes )
public static void Main( )
{
byte[ ] byteArray = {
- 0, 0, 0, 0, 128, 63, 0, 0, 112, 65,
- 0, 255, 127, 71, 0, 0, 128, 59, 0, 0,
- 128, 47, 73, 70, 131, 5, 75, 6, 158, 63,
- 77, 6, 158, 63, 80, 6, 158, 63, 30, 55,
- 190, 121, 255, 255, 127, 255, 255, 127, 127, 1,
- 0, 0, 0, 192, 255, 0, 0, 128, 255, 0,
+ 0, 0, 0, 0, 128, 63, 0, 0, 112, 65,
+ 0, 255, 127, 71, 0, 0, 128, 59, 0, 0,
+ 128, 47, 73, 70, 131, 5, 75, 6, 158, 63,
+ 77, 6, 158, 63, 80, 6, 158, 63, 30, 55,
+ 190, 121, 255, 255, 127, 255, 255, 127, 127, 1,
+ 0, 0, 0, 192, 255, 0, 0, 128, 255, 0,
0, 128, 127 };
Console.WriteLine(
@@ -53,11 +53,11 @@ public static void Main( )
WriteMultiLineByteArray( byteArray );
- Console.WriteLine( formatter, "index", "array elements",
+ Console.WriteLine( formatter, "index", "array elements",
"float" );
- Console.WriteLine( formatter, "-----", "--------------",
+ Console.WriteLine( formatter, "-----", "--------------",
"-----" );
-
+
// Convert byte array elements to float values.
BAToSingle( byteArray, 0 );
BAToSingle( byteArray, 2 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.action.delegate/cs/delegate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.action.delegate/cs/delegate.cs
index 51fa2ab3b32..00fc663f9c1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.action.delegate/cs/delegate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.action.delegate/cs/delegate.cs
@@ -7,7 +7,7 @@
public class Name
{
private string instanceName;
-
+
public Name(string name)
{
this.instanceName = name;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/CreateInstance5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/CreateInstance5.cs
index 7e0451d3311..2b55ed2e9f1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/CreateInstance5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/CreateInstance5.cs
@@ -6,13 +6,13 @@ public class Example
public static void Main()
{
// Initialize array of characters from a to z.
- Char[] chars = new Char[26];
+ Char[] chars = new Char[26];
for (int ctr = 0; ctr < 26; ctr++)
chars[ctr] = (char) (ctr + 0x0061);
Object obj = Activator.CreateInstance(typeof(String),
new Object[] { chars, 13, 10 } );
- Console.WriteLine(obj);
+ Console.WriteLine(obj);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/createinstanceex1a.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/createinstanceex1a.cs
index 3d1ba1f3692..9b874825f85 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/createinstanceex1a.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/createinstanceex1a.cs
@@ -15,7 +15,7 @@ public static void Main()
prop.SetValue(p, "Samuel");
MethodInfo method = t.GetMethod("ToString");
- Object retVal = method.Invoke(p, null);
+ Object retVal = method.Invoke(p, null);
if (retVal != null)
Console.WriteLine(retVal);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/personinfo.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/personinfo.cs
index 871c16bdeb4..747615e120f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/personinfo.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.activator.createinstance/cs/personinfo.cs
@@ -4,19 +4,19 @@
public class Person
{
private string _name;
-
+
public Person()
{ }
-
+
public Person(string name)
{
this._name = name;
}
-
+
public string Name
{ get { return this._name; }
set { this._name = value; } }
-
+
public override string ToString()
{
return this._name;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.aggregateexception.class/cs/exception1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.aggregateexception.class/cs/exception1.cs
index 6384d0b26b2..3fabc7eb0d5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.aggregateexception.class/cs/exception1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.aggregateexception.class/cs/exception1.cs
@@ -22,7 +22,7 @@ static async Task Main(string[] args)
await task1;
}
catch (UnauthorizedAccessException ae)
- {
+ {
Console.WriteLine("Caught unauthorized access exception-await behavior");
}
catch (AggregateException ae)
@@ -40,10 +40,10 @@ static async Task Main(string[] args)
});
}
- Console.WriteLine("task1 Status: {0}{1}", task1.IsCompleted ? "Completed," : "",
+ Console.WriteLine("task1 Status: {0}{1}", task1.IsCompleted ? "Completed," : "",
task1.Status);
}
-
+
static string[] GetAllFiles(string str)
{
// Should throw an UnauthorizedAccessException exception.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.createinstancefrom_stringstring/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.createinstancefrom_stringstring/cs/example.cs
index a96e82008d1..fed2e516616 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.createinstancefrom_stringstring/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.createinstancefrom_stringstring/cs/example.cs
@@ -15,18 +15,18 @@ static void Main()
typeof(MarshalableExample).Assembly.GetName().Name + ".exe";
AppDomain ad = AppDomain.CreateDomain("MyDomain");
-
- System.Runtime.Remoting.ObjectHandle oh =
+
+ System.Runtime.Remoting.ObjectHandle oh =
ad.CreateInstanceFrom(assemblyPath, "MarshalableExample");
object obj = oh.Unwrap();
// Three ways to use the newly created object, depending on how
- // much is known about the type: Late bound, early bound through
+ // much is known about the type: Late bound, early bound through
// a mutually known interface, or early binding of a known type.
//
- obj.GetType().InvokeMember("Test",
- System.Reflection.BindingFlags.InvokeMethod,
+ obj.GetType().InvokeMember("Test",
+ System.Reflection.BindingFlags.InvokeMethod,
Type.DefaultBinder, obj, new object[] { "Hello" });
ITest it = (ITest) obj;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.firstchanceexception/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.firstchanceexception/cs/example.cs
index bbdabb80fd6..f19de3202f2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.firstchanceexception/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.firstchanceexception/cs/example.cs
@@ -29,7 +29,7 @@ static void Main()
}
catch (ArgumentException ex)
{
- Console.WriteLine("ArgumentException caught in {0}: {1}",
+ Console.WriteLine("ArgumentException caught in {0}: {1}",
AppDomain.CurrentDomain.FriendlyName, ex.Message);
}
}
@@ -57,7 +57,7 @@ public void Initialize(int count, int max)
// Create another application domain, until the maximum is reached.
// Field w remains null in the last application domain, as a signal
- // to TestException().
+ // to TestException().
if (count < max)
{
int next = count + 1;
@@ -85,7 +85,7 @@ public void TestException(bool handled)
}
catch (ArgumentException ex)
{
- Console.WriteLine("ArgumentException caught in {0}: {1}",
+ Console.WriteLine("ArgumentException caught in {0}: {1}",
AppDomain.CurrentDomain.FriendlyName, ex.Message);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.isfullytrusted/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.isfullytrusted/cs/example.cs
index 599edff8d53..d6cae139905 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.isfullytrusted/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.appdomain.isfullytrusted/cs/example.cs
@@ -1,6 +1,6 @@
//
using System;
-
+
namespace SimpleSandboxing
{
public class Worker : MarshalByRefObject
@@ -37,15 +37,15 @@ static AppDomain GetInternetSandbox()
System.Security.Policy.Evidence hostEvidence = new System.Security.Policy.Evidence();
hostEvidence.AddHostEvidence(new System.Security.Policy.Zone(
System.Security.SecurityZone.Internet));
- System.Security.PermissionSet pset =
+ System.Security.PermissionSet pset =
System.Security.SecurityManager.GetStandardSandbox(hostEvidence);
// Identify the folder to use for the sandbox.
AppDomainSetup ads = new AppDomainSetup();
ads.ApplicationBase = System.IO.Directory.GetCurrentDirectory();
-
+
// Create the sandboxed application domain.
- return AppDomain.CreateDomain("Sandbox", hostEvidence, ads, pset, null);
+ return AppDomain.CreateDomain("Sandbox", hostEvidence, ads, pset, null);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.find/cs/lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.find/cs/lambda.cs
index cd6c9244bb8..984c9a3569b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.find/cs/lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.find/cs/lambda.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
// Create an array of five Point structures.
- Point[] points = { new Point(100, 200),
- new Point(150, 250), new Point(250, 375),
+ Point[] points = { new Point(100, 200),
+ new Point(150, 250), new Point(250, 375),
new Point(275, 395), new Point(295, 450) };
- // Find the first Point structure for which X times Y
- // is greater than 100000.
+ // Find the first Point structure for which X times Y
+ // is greater than 100000.
Point first = Array.Find(points, p => p.X * p.Y > 100000);
// Display the first structure found.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.find/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.find/cs/source.cs
index 96d7f01aaf9..9b0d5db2e8c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.find/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.find/cs/source.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
// Create an array of five Point structures.
- Point[] points = { new Point(100, 200),
- new Point(150, 250), new Point(250, 375),
+ Point[] points = { new Point(100, 200),
+ new Point(150, 250), new Point(250, 375),
new Point(275, 395), new Point(295, 450) };
- // Find the first Point structure for which X times Y
- // is greater than 100000.
+ // Find the first Point structure for which X times Y
+ // is greater than 100000.
Point first = Array.Find(points, ProductGT10);
// Display the first structure found.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.findall/cs/findall.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.findall/cs/findall.cs
index 7a283d435f9..3cffcbc7a97 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.findall/cs/findall.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.findall/cs/findall.cs
@@ -10,8 +10,8 @@ public static void Main()
int[] values = GetArray(50, 0, 1000);
int lBound = 300;
int uBound = 600;
- int[] matchedItems = Array.FindAll(values, x =>
- x >= lBound && x <= uBound);
+ int[] matchedItems = Array.FindAll(values, x =>
+ x >= lBound && x <= uBound);
for (int ctr = 0; ctr < matchedItems.Length; ctr++) {
Console.Write("{0} ", matchedItems[ctr]);
if ((ctr + 1) % 12 == 0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.getupperbound/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.getupperbound/cs/source.cs
index 125944ca11b..000876fd0be 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.getupperbound/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.getupperbound/cs/source.cs
@@ -3,7 +3,7 @@
public class Example
{
- public static void Main()
+ public static void Main()
{
// Create a one-dimensional integer array.
int[] integers = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
@@ -17,15 +17,15 @@ public static void Main()
$"{(ctr < upper ? ", " : Environment.NewLine)}");
Console.WriteLine();
-
+
// Create a two-dimensional integer array.
- int[,] integers2d= { {2, 4}, {3, 9}, {4, 16}, {5, 25},
- {6, 36}, {7, 49}, {8, 64}, {9, 81} };
- // Get the number of dimensions.
- int rank = integers2d.Rank;
- Console.WriteLine($"Number of dimensions: {rank}");
+ int[,] integers2d= { {2, 4}, {3, 9}, {4, 16}, {5, 25},
+ {6, 36}, {7, 49}, {8, 64}, {9, 81} };
+ // Get the number of dimensions.
+ int rank = integers2d.Rank;
+ Console.WriteLine($"Number of dimensions: {rank}");
for (int ctr = 0; ctr < rank; ctr++)
- Console.WriteLine($" Dimension {ctr}: " +
+ Console.WriteLine($" Dimension {ctr}: " +
$"from {integers2d.GetLowerBound(ctr)} to {integers2d.GetUpperBound(ctr)}");
// Iterate the 2-dimensional array and display its values.
@@ -41,7 +41,7 @@ public static void Main()
// The example displays the following output:
// Elements from index 0 to 9:
// 2, 4, 6, 8, 10, 12, 14, 16, 18, 20
-//
+//
// Number of dimensions: 2
// Dimension 0: from 0 to 7
// Dimension 1: from 0 to 1
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.length/cs/length1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.length/cs/length1.cs
index 4b07702eb8e..35433303124 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.length/cs/length1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.length/cs/length1.cs
@@ -10,13 +10,13 @@ public static void Main()
ShowArrayInfo(array1d);
// Declare a two-dimensional string array
- String[,] array2d = { { "zero", "0" }, { "one", "1" },
+ String[,] array2d = { { "zero", "0" }, { "one", "1" },
{ "two", "2" }, { "three", "3"},
{ "four", "4" }, { "five", "5" } };
ShowArrayInfo(array2d);
- // Declare a three-dimensional integer array
- int[, ,] array3d = new int[,,] { { { 1, 2, 3 }, { 4, 5, 6 } },
+ // Declare a three-dimensional integer array
+ int[, ,] array3d = new int[,,] { { { 1, 2, 3 }, { 4, 5, 6 } },
{ { 7, 8, 9 }, { 10, 11, 12 } } };
ShowArrayInfo(array3d);
}
@@ -37,12 +37,12 @@ private static void ShowArrayInfo(Array arr)
// The example displays the following output:
// Length of Array: 4
// Number of Dimensions: 1
-//
+//
// Length of Array: 12
// Number of Dimensions: 2
// Dimension 1: 6
// Dimension 2: 2
-//
+//
// Length of Array: 12
// Number of Dimensions: 3
// Dimension 1: 2
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.rank/cs/rank1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.rank/cs/rank1.cs
index 88e58627a05..9036c850eea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.rank/cs/rank1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.rank/cs/rank1.cs
@@ -6,14 +6,14 @@ public class Example
public static void Main()
{
int[] array1 = new int[10];
- int[,] array2= new int[10,3];
- int[][] array3 = new int[10][];
-
- Console.WriteLine("{0}: {1} dimension(s)",
+ int[,] array2= new int[10,3];
+ int[][] array3 = new int[10][];
+
+ Console.WriteLine("{0}: {1} dimension(s)",
array1.ToString(), array1.Rank);
- Console.WriteLine("{0}: {1} dimension(s)",
+ Console.WriteLine("{0}: {1} dimension(s)",
array2.ToString(), array2.Rank);
- Console.WriteLine("{0}: {1} dimension(s)",
+ Console.WriteLine("{0}: {1} dimension(s)",
array3.ToString(), array3.Rank);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.reverse/cs/reversejagged.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.reverse/cs/reversejagged.cs
index 0357ac92194..8183b107711 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.reverse/cs/reversejagged.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.reverse/cs/reversejagged.cs
@@ -24,7 +24,7 @@ public static void Main()
Console.WriteLine();
}
Console.WriteLine();
-
+
Console.WriteLine("About to reverse array.\n");
Array.Reverse(months);
@@ -49,9 +49,9 @@ public static void Main()
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-//
+//
// About to reverse array.
-//
+//
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.trueforall/cs/trueforall1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.trueforall/cs/trueforall1.cs
index e8801b7ebc7..d1ab588df73 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.trueforall/cs/trueforall1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.trueforall/cs/trueforall1.cs
@@ -7,7 +7,7 @@ public static void Main()
{
String[] values = { "Y2K", "A2000", "DC2A6", "MMXIV", "0C3" };
if (Array.TrueForAll(values, value => {
- int s;
+ int s;
return Int32.TryParse(value.Substring(value.Length - 1), out s); }
))
Console.WriteLine("All elements end with an integer.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.trueforall/cs/trueforall2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.trueforall/cs/trueforall2.cs
index 31ca06ee6ea..3d9ba1f9751 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.trueforall/cs/trueforall2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.array.trueforall/cs/trueforall2.cs
@@ -12,14 +12,14 @@ public static void Main()
Console.WriteLine("All elements end with an integer.");
else
Console.WriteLine("Not all elements end with an integer.");
-
+
if (Array.TrueForAll(values2, EndsWithANumber))
Console.WriteLine("All elements end with an integer.");
else
Console.WriteLine("Not all elements end with an integer.");
}
- private static bool EndsWithANumber(String value)
+ private static bool EndsWithANumber(String value)
{
int s;
return Int32.TryParse(value.Substring(value.Length - 1), out s);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.arraysegment.class/cs/example1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.arraysegment.class/cs/example1.cs
index 3dcfd76d1b8..c62e2a3a4d6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.arraysegment.class/cs/example1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.arraysegment.class/cs/example1.cs
@@ -6,12 +6,12 @@ public class Example
{
public static void Main()
{
- String[] names = { "Adam", "Bruce", "Charles", "Daniel",
- "Ebenezer", "Francis", "Gilbert",
+ String[] names = { "Adam", "Bruce", "Charles", "Daniel",
+ "Ebenezer", "Francis", "Gilbert",
"Henry", "Irving", "John", "Karl",
"Lucian", "Michael" };
var partNames = new ArraySegment(names, 2, 5);
-
+
// Cast the ArraySegment object to an IList and enumerate it.
var list = (IList) partNames;
for (int ctr = 0; ctr <= list.Count - 1; ctr++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/condition1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/condition1.cs
index 368bc70ed69..f3dcb2bbec5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/condition1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/condition1.cs
@@ -11,14 +11,14 @@ public static void Main()
if (! filePath.Trim().EndsWith(@"\"))
filePath += @"\";
filePath += @"System32\Kernel32.dll";
-
+
try {
Assembly assem = Assembly.LoadFile(filePath);
}
catch (BadImageFormatException e) {
Console.WriteLine("Unable to load {0}.", filePath);
- Console.WriteLine(e.Message.Substring(0,
- e.Message.IndexOf(".") + 1));
+ Console.WriteLine(e.Message.Substring(0,
+ e.Message.IndexOf(".") + 1));
}
// The example displays an error message like the following:
// Unable to load C:\WINDOWS\System32\Kernel32.dll.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/loadstringlib.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/loadstringlib.cs
index 95370767dba..5d5868cd6f8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/loadstringlib.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/loadstringlib.cs
@@ -14,7 +14,7 @@ public static void Main()
Type stateInfoType = assem.GetType("StringLib");
// Get Display method.
MethodInfo mi = stateInfoType.GetMethod("ToProperCase");
- // Call the Display method.
+ // Call the Display method.
string properTitle = (string) mi.Invoke(null, new object[] { title } );
Console.WriteLine(properTitle);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/stringlib.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/stringlib.cs
index 0ed422330fc..c9c447f80eb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/stringlib.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.badimageformatexception.class/cs/stringlib.cs
@@ -5,11 +5,11 @@ public class StringLib
{
private string[] exceptionList = { "a", "an", "the", "in", "on", "of" };
private char[] separators = { ' ' };
-
+
public string ToProperCase(string title)
{
bool isException = false;
-
+
string[] words = title.Split( separators, StringSplitOptions.RemoveEmptyEntries);
string[] newWords = new string[words.Length];
@@ -25,16 +25,16 @@ public string ToProperCase(string title)
break;
}
}
-
+
if (! isException)
newWords[ctr] = words[ctr].Substring(0, 1).ToUpper() + words[ctr].Substring(1);
else
- newWords[ctr] = words[ctr];
+ newWords[ctr] = words[ctr];
}
return String.Join(" ", newWords);
}
}
// Attempting to load the StringLib.dll assembly produces the following output:
-// Unhandled Exception: System.BadImageFormatException:
+// Unhandled Exception: System.BadImageFormatException:
// The format of the file 'StringLib.dll' is invalid.
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.bitconverter.toint32/cs/toint32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.bitconverter.toint32/cs/toint32.cs
index d67cdb067f0..b2dc287bbb6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.bitconverter.toint32/cs/toint32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.bitconverter.toint32/cs/toint32.cs
@@ -13,12 +13,12 @@ public static void Main()
Byte[] bytes2 = BitConverter.GetBytes(Int64.MaxValue / 2);
Console.WriteLine("{0}--> 0x{1:X4} ({1:N0})", FormatBytes(bytes2),
BitConverter.ToInt32(bytes2, 4));
-
+
// Round-trip an integer value.
int original = (int) Math.Pow(16, 3);
Byte[] bytes3 = BitConverter.GetBytes(original);
int restored = BitConverter.ToInt32(bytes3, 0);
- Console.WriteLine("0x{0:X4} ({0:N0}) --> {1} --> 0x{2:X4} ({2:N0})", original,
+ Console.WriteLine("0x{0:X4} ({0:N0}) --> {1} --> 0x{2:X4} ({2:N0})", original,
FormatBytes(bytes3), restored);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.BaseURI Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.BaseURI Example/CS/source.cs
index 43216788405..21f345fae67 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.BaseURI Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.BaseURI Example/CS/source.cs
@@ -10,7 +10,7 @@ public static void Main()
//Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.Load("http://localhost/baseuri.xml");
-
+
//Display information on the attribute node. The value
//returned for BaseURI is 'http://localhost/baseuri.xml'.
XmlAttribute attr = doc.DocumentElement.Attributes[0];
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.CloneNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.CloneNode Example/CS/source.cs
index 2012ec09c5a..dda6256967f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.CloneNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.CloneNode Example/CS/source.cs
@@ -10,7 +10,7 @@ public static void Main()
//Create an XmlDocument.
XmlDocument doc = new XmlDocument();
doc.Load("2elems.xml");
-
+
//Create an attribute.
XmlAttribute attr;
attr = doc.CreateAttribute("bk","genre","urn:samples");
@@ -20,7 +20,7 @@ public static void Main()
XmlElement currNode = (XmlElement) doc.DocumentElement.FirstChild;
currNode.SetAttributeNode(attr);
- //An attribute cannot be added to two different elements.
+ //An attribute cannot be added to two different elements.
//You must clone the attribute and add it to the second book.
XmlAttribute attr2;
attr2 = (XmlAttribute) attr.CloneNode(true);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.Name Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.Name Example/CS/source.cs
index 115dad8b59c..aae4cf7370e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.Name Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.Name Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create an attribute collection.
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.NamespaceURI Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.NamespaceURI Example/CS/source.cs
index f8aab330d1d..23e53cc3686 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.NamespaceURI Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttribute.NamespaceURI Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create an attribute collection.
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Append Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Append Example/CS/source.cs
index cf81a686392..bf28cbf51a6 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Append Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Append Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create a new attribute.
XmlAttribute newAttr = doc.CreateAttribute("genre");
@@ -22,7 +22,7 @@ public static void Main(){
attrColl.Append(newAttr);
Console.WriteLine("Display the modified XML...\r\n");
- Console.WriteLine(doc.OuterXml);
+ Console.WriteLine(doc.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.CopyTo Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.CopyTo Example/CS/source.cs
index 39287ef37b2..215fd6d4967 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.CopyTo Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.CopyTo Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create an attribute collection.
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
@@ -25,7 +25,7 @@ public static void Main(){
Console.WriteLine("Display all the attributes in the array..");
foreach (XmlAttribute attr in array){
Console.WriteLine("{0} = {1}",attr.Name,attr.Value);
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.InsertAfter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.InsertAfter Example/CS/source.cs
index 44d95c517d8..591307199a8 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.InsertAfter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.InsertAfter Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create a new attribute.
XmlAttribute newAttr = doc.CreateAttribute("genre");
@@ -22,7 +22,7 @@ public static void Main(){
attrColl.InsertAfter(newAttr, attrColl[0]);
Console.WriteLine("Display the modified XML...\r\n");
- Console.WriteLine(doc.OuterXml);
+ Console.WriteLine(doc.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.InsertBefore Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.InsertBefore Example/CS/source.cs
index 842bbd8f2c8..7975c5ab537 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.InsertBefore Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.InsertBefore Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create a new attribute.
XmlAttribute newAttr = doc.CreateAttribute("genre");
@@ -22,7 +22,7 @@ public static void Main(){
attrColl.InsertBefore(newAttr, attrColl[0]);
Console.WriteLine("Display the modified XML...\r\n");
- Console.WriteLine(doc.OuterXml);
+ Console.WriteLine(doc.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Prepend Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Prepend Example/CS/source.cs
index e0e4063e9b3..bc442725468 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Prepend Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Prepend Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create a new attribute.
XmlAttribute newAttr = doc.CreateAttribute("genre");
@@ -22,7 +22,7 @@ public static void Main(){
attrColl.Prepend(newAttr);
Console.WriteLine("Display the modified XML...\r\n");
- Console.WriteLine(doc.OuterXml);
+ Console.WriteLine(doc.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Remove Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Remove Example/CS/source.cs
index a6219ab89a3..6e373380d71 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Remove Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.Remove Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create an attribute collection and remove an attribute
//from the collection.
@@ -18,7 +18,7 @@ public static void Main(){
attrColl.Remove(attrColl["genre"]);
Console.WriteLine("Display the modified XML...\r\n");
- Console.WriteLine(doc.OuterXml);
+ Console.WriteLine(doc.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.RemoveAll Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.RemoveAll Example/CS/source.cs
index 00ecb0d73e6..f3497a221a9 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.RemoveAll Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.RemoveAll Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create an attribute collection and remove all attributes
//from the collection.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.RemoveAt Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.RemoveAt Example/CS/source.cs
index 0720d1eea70..cfb57e4534d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.RemoveAt Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.RemoveAt Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create an attribute collection and remove an attribute
//from the collection.
@@ -18,7 +18,7 @@ public static void Main(){
attrColl.RemoveAt(0);
Console.WriteLine("Display the modified XML...\r\n");
- Console.WriteLine(doc.OuterXml);
+ Console.WriteLine(doc.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.SetNamedItem Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.SetNamedItem Example/CS/source.cs
index e07c88fbfee..033b3700b82 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.SetNamedItem Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.SetNamedItem Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
//Create a new attribute.
XmlAttribute newAttr = doc.CreateAttribute("genre");
@@ -22,7 +22,7 @@ public static void Main(){
attrColl.SetNamedItem(newAttr);
Console.WriteLine("Display the modified XML...\r\n");
- Console.WriteLine(doc.OuterXml);
+ Console.WriteLine(doc.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.this Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.this Example/CS/source.cs
index e0561866972..f9dd85cf592 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.this Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlAttributeCollection.this Example/CS/source.cs
@@ -6,13 +6,13 @@
public class Sample
{
public static void Main(){
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Pride And Prejudice" +
- "");
+ "");
- //Create an attribute collection.
+ //Create an attribute collection.
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
Console.WriteLine("Display all the attributes in the collection...\r\n");
@@ -21,7 +21,7 @@ public static void Main(){
Console.Write("{0} = ", attrColl[i].Name);
Console.Write("{0}", attrColl[i].Value);
Console.WriteLine();
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlConvert.ToString Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlConvert.ToString Example/CS/source.cs
index 9419b98382e..51e7ef7662d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlConvert.ToString Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlConvert.ToString Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Sample
public static void Main()
{
- //Define the order data. They will be converted to string
+ //Define the order data. They will be converted to string
//before being written out.
Int16 custID = 32632;
String orderID = "367A54";
@@ -28,7 +28,7 @@ public static void Main()
//Write the order time.
writer.WriteAttributeString("time", XmlConvert.ToString(orderDate, "HH:mm:ss"));
-
+
//Write the order data.
writer.WriteElementString("orderID", orderID);
writer.WriteElementString("custID", XmlConvert.ToString(custID));
@@ -36,9 +36,9 @@ public static void Main()
//Write the close tag for the root element
writer.WriteEndElement();
-
+
//Write the XML and close the writer
- writer.Close();
+ writer.Close();
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.CloneNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.CloneNode Example/CS/source.cs
index e6879fe963f..c58409f5a91 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.CloneNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.CloneNode Example/CS/source.cs
@@ -11,10 +11,10 @@ public static void Main()
{
DataSet dsNorthwind = new DataSet();
- //Create the connection string.
+ //Create the connection string.
String sConnect;
- sConnect="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind";
-
+ sConnect="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind";
+
//Create a connection object to connect to the northwind db.
SqlConnection nwconnect = new SqlConnection(sConnect);
@@ -28,14 +28,14 @@ public static void Main()
myDataAdapter.Fill(dsNorthwind,"Customers");
//Load the document with the DataSet.
- XmlDataDocument doc = new XmlDataDocument(dsNorthwind);
+ XmlDataDocument doc = new XmlDataDocument(dsNorthwind);
//Create a shallow clone of the XmlDataDocument. Note that although
//none of the child nodes were copied over, the cloned node does
//have the schema information.
XmlDataDocument clone = (XmlDataDocument) doc.CloneNode(false);
Console.WriteLine("Child count: {0}", clone.ChildNodes.Count);
- Console.WriteLine(clone.DataSet.GetXmlSchema());
+ Console.WriteLine(clone.DataSet.GetXmlSchema());
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.DataSet Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.DataSet Example/CS/source.cs
index 3ce343cd352..70100930646 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.DataSet Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.DataSet Example/CS/source.cs
@@ -11,14 +11,14 @@ public static void Main()
XmlDataDocument doc = new XmlDataDocument();
//Load the schema file.
- doc.DataSet.ReadXmlSchema("store.xsd");
+ doc.DataSet.ReadXmlSchema("store.xsd");
//Load the XML data.
doc.Load("2books.xml");
//Update the price on the first book using the DataSet methods.
DataTable books = doc.DataSet.Tables["book"];
- books.Rows[0]["price"] = "12.95";
+ books.Rows[0]["price"] = "12.95";
Console.WriteLine("Display the modified XML data...");
doc.Save(Console.Out);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.GetElementFromRow Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.GetElementFromRow Example/CS/source.cs
index fbd08f7a20e..bd0a7adcdaf 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.GetElementFromRow Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.GetElementFromRow Example/CS/source.cs
@@ -10,10 +10,10 @@ public static void Main()
{
DataSet dsNorthwind = new DataSet();
- //Create the connection string
+ //Create the connection string
String sConnect;
- sConnect="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind";
-
+ sConnect="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind";
+
//Create a connection object to connect to the northwind db.
SqlConnection nwconnect = new SqlConnection(sConnect);
@@ -27,12 +27,12 @@ public static void Main()
myDataAdapter.Fill(dsNorthwind,"Customers");
//Load the document with the DataSet.
- XmlDataDocument doc = new XmlDataDocument(dsNorthwind);
+ XmlDataDocument doc = new XmlDataDocument(dsNorthwind);
//Create an element representing the first customer record.
DataRow row = doc.DataSet.Tables[0].Rows[0];
XmlElement elem = doc.GetElementFromRow(row);
- Console.WriteLine(elem.OuterXml);
+ Console.WriteLine(elem.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.XmlDataDocument1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.XmlDataDocument1 Example/CS/source.cs
index 1597c6ce8b6..b7bf811a866 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.XmlDataDocument1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDataDocument.XmlDataDocument1 Example/CS/source.cs
@@ -10,10 +10,10 @@ public static void Main()
{
DataSet dsNorthwind = new DataSet();
- //Create the connection string.
+ //Create the connection string.
String sConnect;
- sConnect="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind";
-
+ sConnect="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind";
+
//Create a connection object to connect to the northwind db.
SqlConnection nwconnect = new SqlConnection(sConnect);
@@ -27,7 +27,7 @@ public static void Main()
myDataAdapter.Fill(dsNorthwind,"Customers");
//Load the document with the DataSet.
- XmlDataDocument doc = new XmlDataDocument(dsNorthwind);
+ XmlDataDocument doc = new XmlDataDocument(dsNorthwind);
//Display the XmlDataDocument.
doc.Save(Console.Out);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDeclaration.Encoding Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDeclaration.Encoding Example/CS/source.cs
index 17abe9fdd5c..b6df78c237e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDeclaration.Encoding Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDeclaration.Encoding Example/CS/source.cs
@@ -2,27 +2,27 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample {
public static void Main() {
-
+
// Create and load the XML document.
XmlDocument doc = new XmlDocument();
string xmlString = "Oberon's Legacy";
doc.Load(new StringReader(xmlString));
-
- // Create an XML declaration.
+
+ // Create an XML declaration.
XmlDeclaration xmldecl;
xmldecl = doc.CreateXmlDeclaration("1.0",null,null);
xmldecl.Encoding="UTF-8";
- xmldecl.Standalone="yes";
-
+ xmldecl.Standalone="yes";
+
// Add the new node to the document.
XmlElement root = doc.DocumentElement;
doc.InsertBefore(xmldecl, root);
-
- // Display the modified XML document
+
+ // Display the modified XML document
Console.WriteLine(doc.OuterXml);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDeclaration.Standalone Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDeclaration.Standalone Example/CS/source.cs
index 17abe9fdd5c..b6df78c237e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDeclaration.Standalone Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDeclaration.Standalone Example/CS/source.cs
@@ -2,27 +2,27 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample {
public static void Main() {
-
+
// Create and load the XML document.
XmlDocument doc = new XmlDocument();
string xmlString = "Oberon's Legacy";
doc.Load(new StringReader(xmlString));
-
- // Create an XML declaration.
+
+ // Create an XML declaration.
XmlDeclaration xmldecl;
xmldecl = doc.CreateXmlDeclaration("1.0",null,null);
xmldecl.Encoding="UTF-8";
- xmldecl.Standalone="yes";
-
+ xmldecl.Standalone="yes";
+
// Add the new node to the document.
XmlElement root = doc.DocumentElement;
doc.InsertBefore(xmldecl, root);
-
- // Display the modified XML document
+
+ // Display the modified XML document
Console.WriteLine(doc.OuterXml);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CloneNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CloneNode Example/CS/source.cs
index e51d69a61ef..b31611ed15a 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CloneNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CloneNode Example/CS/source.cs
@@ -13,12 +13,12 @@ public static void Main()
"Pride And Prejudice" +
"");
- //Create a deep clone. The cloned node
+ //Create a deep clone. The cloned node
//includes the child node.
XmlDocument deep = (XmlDocument) doc.CloneNode(true);
Console.WriteLine(deep.ChildNodes.Count);
- //Create a shallow clone. The cloned node does not
+ //Create a shallow clone. The cloned node does not
//include the child node.
XmlDocument shallow = (XmlDocument) doc.CloneNode(false);
Console.WriteLine(shallow.Name + shallow.OuterXml);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateAttribute Example/CS/source.cs
index 76ee2856d93..98817b22316 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateAttribute Example/CS/source.cs
@@ -15,11 +15,11 @@ public static void Main()
//Create an attribute.
XmlAttribute attr = doc.CreateAttribute("publisher");
attr.Value = "WorldWide Publishing";
-
- //Add the new node to the document.
+
+ //Add the new node to the document.
doc.DocumentElement.SetAttributeNode(attr);
-
- Console.WriteLine("Display the modified XML...");
+
+ Console.WriteLine("Display the modified XML...");
doc.Save(Console.Out);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateCDataSection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateCDataSection Example/CS/source.cs
index caafb56a319..39b771f139b 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateCDataSection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateCDataSection Example/CS/source.cs
@@ -14,13 +14,13 @@ public static void Main()
//Create a CData section.
XmlCDataSection CData;
- CData = doc.CreateCDataSection("All Jane Austen novels 25% off starting 3/23!");
+ CData = doc.CreateCDataSection("All Jane Austen novels 25% off starting 3/23!");
//Add the new node to the document.
XmlElement root = doc.DocumentElement;
- root.AppendChild(CData);
-
- Console.WriteLine("Display the modified XML...");
+ root.AppendChild(CData);
+
+ Console.WriteLine("Display the modified XML...");
doc.Save(Console.Out);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/CS/source.cs
index 56f7d65256a..8542224249c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/CS/source.cs
@@ -20,7 +20,7 @@ public static void Main()
XmlElement root = doc.DocumentElement;
doc.InsertBefore(newComment, root);
- Console.WriteLine("Display the modified XML...");
+ Console.WriteLine("Display the modified XML...");
doc.Save(Console.Out);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/CS/source.cs
index 47a37170a9c..45349c957bd 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/CS/source.cs
@@ -13,7 +13,7 @@ public static void Main()
//Create a document fragment.
XmlDocumentFragment docFrag = doc.CreateDocumentFragment();
-
+
//Set the contents of the document fragment.
docFrag.InnerXml ="widget";
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/CS/source.cs
index 9b75b208dad..eb5264cc28b 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/CS/source.cs
@@ -10,13 +10,13 @@ public static void Main()
//Create the XmlDocument.
XmlDocument doc = new XmlDocument();
- //Create a document type node and
+ //Create a document type node and
//add it to the document.
XmlDocumentType doctype;
doctype = doc.CreateDocumentType("book", null, null, "");
doc.AppendChild(doctype);
- //Create the root element and
+ //Create the root element and
//add it to the document.
doc.AppendChild(doc.CreateElement("book"));
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/CS/source.cs
index bfcbf87eecf..58aa9b31a78 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/CS/source.cs
@@ -13,16 +13,16 @@ public static void Main()
"" +
"Pride And Prejudice" +
"" +
- "");
+ "");
- //Create an entity reference node. The child count should be 0
+ //Create an entity reference node. The child count should be 0
//since the node has not been expanded.
XmlEntityReference entityref = doc.CreateEntityReference("h");
- Console.WriteLine(entityref.ChildNodes.Count );
+ Console.WriteLine(entityref.ChildNodes.Count );
//After the node has been added to the document, its parent node
//is set and the entity reference node is expanded. It now has a child
- //node containing the entity replacement text.
+ //node containing the entity replacement text.
doc.DocumentElement.LastChild.AppendChild(entityref);
Console.WriteLine(entityref.FirstChild.InnerText);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/CS/source.cs
index 93765697e31..bd597a62833 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/CS/source.cs
@@ -16,8 +16,8 @@ public static void Main()
//Create a new node and add it to the document.
XmlNode elem = doc.CreateNode(XmlNodeType.Element, "price", null);
elem.InnerText = "19.95";
- doc.DocumentElement.AppendChild(elem);
-
+ doc.DocumentElement.AppendChild(elem);
+
Console.WriteLine("Display the modified XML...");
doc.Save(Console.Out);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode1 Example/CS/source.cs
index fdd6a3a2816..8e5062489e7 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode1 Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Xml;
-
+
public class Sample {
public static void Main() {
@@ -10,16 +10,16 @@ public static void Main() {
doc.LoadXml("" +
" Oberon's Legacy" +
" 5.95" +
- "");
-
+ "");
+
// Create a new element node.
- XmlNode newElem = doc.CreateNode("element", "pages", "");
+ XmlNode newElem = doc.CreateNode("element", "pages", "");
newElem.InnerText = "290";
-
+
Console.WriteLine("Add the new element to the document...");
XmlElement root = doc.DocumentElement;
root.AppendChild(newElem);
-
+
Console.WriteLine("Display the modified XML document...");
Console.WriteLine(doc.OuterXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/CS/source.cs
index 9ae84a4970b..1b056b90cd2 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/CS/source.cs
@@ -1,11 +1,11 @@
//
using System;
using System.Xml;
-
+
public class Sample {
public static void Main() {
-
+
// Create a new document containing information about a book
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
@@ -26,7 +26,7 @@ public static void Main() {
// Display the modified XML document
Console.WriteLine(doc.OuterXml);
- //Output:
+ //Output:
// Oberon's Legacy5.951-861001-57-5
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/CreationEndpoint2/CS/CreationEndpoint.cs b/samples/snippets/csharp/VS_Snippets_Misc/CreationEndpoint2/CS/CreationEndpoint.cs
index d9cab533ea3..ce2d9b0106d 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/CreationEndpoint2/CS/CreationEndpoint.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/CreationEndpoint2/CS/CreationEndpoint.cs
@@ -23,7 +23,7 @@ public CreationEndpoint(Binding binding, EndpointAddress address)
{
}
- public CreationEndpoint():this (GetDefaultBinding(),
+ public CreationEndpoint():this (GetDefaultBinding(),
new EndpointAddress(new Uri(DefaultBaseUri, new Uri(Guid.NewGuid().ToString(), UriKind.Relative))))
{
}
@@ -33,7 +33,7 @@ static Uri DefaultBaseUri
get
{
if (defaultBaseUri == null)
- {
+ {
defaultBaseUri = new Uri(string.Format(CultureInfo.InvariantCulture, "net.pipe://localhost/workflowCreationEndpoint/{0}/{1}",
Process.GetCurrentProcess().Id,
AppDomain.CurrentDomain.Id));
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/Cryptography.XML.EncryptedDocument.DecryptDocument-SuperEncryption/CS/sample.cs b/samples/snippets/csharp/VS_Snippets_Misc/Cryptography.XML.EncryptedDocument.DecryptDocument-SuperEncryption/CS/sample.cs
index 7f37b7cfa10..deee958c520 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/Cryptography.XML.EncryptedDocument.DecryptDocument-SuperEncryption/CS/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/Cryptography.XML.EncryptedDocument.DecryptDocument-SuperEncryption/CS/sample.cs
@@ -12,7 +12,7 @@ static void Main(string[] args)
//
public static void Decrypt(XmlDocument Doc, RSA Alg, string KeyName)
{
- // Check the arguments.
+ // Check the arguments.
if (Doc == null)
throw new ArgumentNullException("Doc");
if (Alg == null)
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/IO.FileInfo.MoveTo/CS/Program.cs b/samples/snippets/csharp/VS_Snippets_Misc/IO.FileInfo.MoveTo/CS/Program.cs
index adc7e29e00e..2b09a8c9795 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/IO.FileInfo.MoveTo/CS/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/IO.FileInfo.MoveTo/CS/Program.cs
@@ -10,24 +10,24 @@
using System.Text.RegularExpressions;
using System.Xml;
-namespace Microsoft.Samples.MoveTo.CS
+namespace Microsoft.Samples.MoveTo.CS
{
- class Program
+ class Program
{
private static string sourcePath = Environment.GetFolderPath
- (Environment.SpecialFolder.MyDocuments) +
+ (Environment.SpecialFolder.MyDocuments) +
@"\FileInfoTestDirectory\MoveFrom\FromFile.xml";
private static string destPath = Environment.GetFolderPath
- (Environment.SpecialFolder.MyDocuments) +
+ (Environment.SpecialFolder.MyDocuments) +
@"\FileInfoTestDirectory\DestFile.xml";
//
// The main entry point for the application.
//
- [STAThread()] static void Main ()
+ [STAThread()] static void Main ()
{
- // Change Console properties to make it obvious that
+ // Change Console properties to make it obvious that
// the application is starting.
Console.Clear();
// Move it to the upper left corner of the screen.
@@ -58,9 +58,9 @@ class Program
//
// Moves the supplied FileInfo instance to destPath.
//
- private static void MoveFile(FileInfo fInfo)
+ private static void MoveFile(FileInfo fInfo)
{
- try
+ try
{
fInfo.MoveTo(destPath);
Console.WriteLine("File moved to ");
@@ -70,38 +70,38 @@ private static void MoveFile(FileInfo fInfo)
}
}
//
- // Ensures that the test directories
+ // Ensures that the test directories
// and the file FromFile.xml all exist.
- //
- private static void EnsureSourceFileExists()
+ //
+ private static void EnsureSourceFileExists()
{
FileInfo fInfo = new FileInfo(sourcePath);
string dirPath = fInfo.Directory.FullName;
- if (!Directory.Exists(dirPath))
+ if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
}
- if (File.Exists(destPath))
+ if (File.Exists(destPath))
{
File.Delete(destPath);
}
Console.Write("Creating file ");
Console.Write(fInfo.FullName);
Console.WriteLine(".");
- try
+ try
{
- if (!fInfo.Exists)
+ if (!fInfo.Exists)
{
Console.WriteLine("Adding data to the file.");
WriteFileContent(10);
Console.WriteLine("Successfully created the file.");
}
- }
- catch (Exception ex)
+ }
+ catch (Exception ex)
{
DisplayException(ex);
- }
- finally
+ }
+ finally
{
dirPath = null;
}
@@ -109,7 +109,7 @@ private static void EnsureSourceFileExists()
//
// Creates and saves an Xml file to sourcePath.
//
- private static void WriteFileContent(int totalElements)
+ private static void WriteFileContent(int totalElements)
{
XmlDocument doc = new XmlDocument();
doc.PreserveWhitespace = true;
@@ -119,7 +119,7 @@ private static void WriteFileContent(int totalElements)
root.AppendChild(doc.CreateWhitespace("\r\n"));
int index = 0;
XmlElement elem;
- while (index < totalElements)
+ while (index < totalElements)
{
elem = doc.CreateElement("MyElement");
@@ -143,11 +143,11 @@ private static void WriteFileContent(int totalElements)
// Displays FullName, CreationTime, and LastWriteTime of the supplied
// FileInfo instance, then displays the text of the file.
//
- private static void DisplayFileProperties(FileInfo fInfo)
+ private static void DisplayFileProperties(FileInfo fInfo)
{
Console.WriteLine("The FileInfo instance shows these property values.");
StreamReader reader = null;
- try
+ try
{
Console.Write("FullName: ");
Console.WriteLine(fInfo.FullName);
@@ -159,19 +159,19 @@ private static void DisplayFileProperties(FileInfo fInfo)
Console.WriteLine("File contents:");
Console.WriteLine();
reader = new StreamReader(fInfo.FullName);
- while (!reader.EndOfStream)
+ while (!reader.EndOfStream)
{
Console.WriteLine(reader.ReadLine());
}
Console.WriteLine();
- }
- catch (Exception ex)
+ }
+ catch (Exception ex)
{
DisplayException(ex);
- }
- finally
+ }
+ finally
{
- if (reader != null)
+ if (reader != null)
{
reader.Close();
}
@@ -181,20 +181,20 @@ private static void DisplayFileProperties(FileInfo fInfo)
//
// Deletes the test directory and all its files and subdirectories.
//
- private static void DeleteFiles()
+ private static void DeleteFiles()
{
- try
+ try
{
DirectoryInfo dInfo = new DirectoryInfo(Environment.GetFolderPath
(Environment.SpecialFolder.MyDocuments) + "\\FileInfoTestDirectory");
- if (dInfo.Exists)
+ if (dInfo.Exists)
{
dInfo.Delete(true);
Console.WriteLine("Successfully deleted directories and files.");
}
dInfo = null;
- }
- catch (Exception ex)
+ }
+ catch (Exception ex)
{
DisplayException(ex);
}
@@ -203,7 +203,7 @@ private static void DeleteFiles()
// Displays information about the supplied Exception. This
// code is not suitable for production applications.
//
- private static void DisplayException(Exception ex)
+ private static void DisplayException(Exception ex)
{
StringBuilder sb = new StringBuilder();
sb.Append("An exception of type \"");
@@ -217,13 +217,13 @@ private static void DisplayException(Exception ex)
string[] argList;
Match matchObj;
int y, K;
- for(int x = 0; x < L; x++)
+ for(int x = 0; x < L; x++)
{
matchObj = matchCol[x];
sb.Append(matchObj.Result("\r\n\r\n$1 $2$3$4$5"));
argList = matchObj.Groups[6].Value.Split(new char[] { ',' });
K = argList.Length;
- for (y = 0; y < K; y++)
+ for (y = 0; y < K; y++)
{
sb.Append("\r\n ");
sb.Append(argList[y].Trim().Replace(" ", " "));
@@ -231,7 +231,7 @@ private static void DisplayException(Exception ex)
}
sb.Remove(sb.Length - 1, 1);
sb.Append("\r\n)");
- if (0 < matchObj.Groups[8].Length)
+ if (0 < matchObj.Groups[8].Length)
{
sb.Append(matchObj.Result("\r\n$10\r\nline $12"));
}
@@ -244,7 +244,7 @@ private static void DisplayException(Exception ex)
}
}
}
-//This code produces output similar to the following;
+//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
// Welcome.
@@ -304,9 +304,9 @@ private static void DisplayException(Exception ex)
// FullName: C:\Documents and Settings\MYComputer\My Documents\FileInfoTestDirectory\DestFile.xml
// CreationTime: 4/18/2006 1:24:19 PM
// LastWriteTime: 4/18/2006 1:24:19 PM
-//
+//
// File contents:
-//
+//
//
//
//
@@ -340,7 +340,7 @@ private static void DisplayException(Exception ex)
// MyElement at position 9.
//
//
-//
+//
// Preparing to delete directories.
// Successfully deleted directories and files.
// Press the ENTER key to close this application.
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/ObjectManager/CS/ObjectManager.cs b/samples/snippets/csharp/VS_Snippets_Misc/ObjectManager/CS/ObjectManager.cs
index 738d480b62f..4ea0afd2549 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/ObjectManager/CS/ObjectManager.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/ObjectManager/CS/ObjectManager.cs
@@ -33,7 +33,7 @@ public void Reset() {
// Return the enumeration's current object.
public Object Current { get { return m_current; } }
-
+
// Walk the reference of the passed-in object.
private void Schedule(Object toSchedule) {
if (toSchedule == null) return;
@@ -92,7 +92,7 @@ static void Main() {
Int64 num = 0;
foreach (Object o in ow) {
// Display each object's type and value as a string.
- Console.WriteLine("Object #{0}: Type={1}, Value's string={2}",
+ Console.WriteLine("Object #{0}: Type={1}, Value's string={2}",
num++, o.GetType(), o.ToString());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/default.aspx.designer.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/default.aspx.designer.cs
index 92c1f317fff..d3e9eb4da97 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/default.aspx.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/default.aspx.designer.cs
@@ -3,15 +3,15 @@
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
+// the code is regenerated.
//
//------------------------------------------------------------------------------
namespace NorthwindService {
-
-
+
+
public partial class _Default {
-
+
///
/// form1 control.
///
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/iupdatable.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/iupdatable.cs
index fbea2c19d38..59f31f80c89 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/iupdatable.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/iupdatable.cs
@@ -96,7 +96,7 @@ void IUpdatable.SaveChanges()
// "The save changes functionality is not supported by this in-memory provider");
}
- // Returns the actual instance of the resource represented
+ // Returns the actual instance of the resource represented
// by the resource object.
object IUpdatable.ResolveResource(object resource)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.designer.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.designer.cs
index 0e3baf8e477..6e3a4e26765 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.designer.cs
@@ -27,14 +27,14 @@
namespace NorthwindModel
{
#region Contexts
-
+
///
/// No Metadata Documentation available.
///
public partial class NorthwindEntities : ObjectContext
{
#region Constructors
-
+
///
/// Initializes a new NorthwindEntities object using the connection string found in the 'NorthwindEntities' section of the application configuration file.
///
@@ -43,7 +43,7 @@ public NorthwindEntities() : base("name=NorthwindEntities", "NorthwindEntities")
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
///
/// Initialize a new NorthwindEntities object.
///
@@ -52,7 +52,7 @@ public NorthwindEntities(string connectionString) : base(connectionString, "Nort
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
///
/// Initialize a new NorthwindEntities object.
///
@@ -61,17 +61,17 @@ public NorthwindEntities(EntityConnection connection) : base(connection, "Northw
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
#endregion
-
+
#region Partial Methods
-
+
partial void OnContextCreated();
-
+
#endregion
-
+
#region ObjectSet Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -87,7 +87,7 @@ public ObjectSet Customers
}
}
private ObjectSet _Customers;
-
+
///
/// No Metadata Documentation available.
///
@@ -103,7 +103,7 @@ public ObjectSet Order_Details
}
}
private ObjectSet _Order_Details;
-
+
///
/// No Metadata Documentation available.
///
@@ -119,7 +119,7 @@ public ObjectSet Orders
}
}
private ObjectSet _Orders;
-
+
///
/// No Metadata Documentation available.
///
@@ -138,7 +138,7 @@ public ObjectSet Products
#endregion
#region AddTo Methods
-
+
///
/// Deprecated Method for adding a new object to the Customers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -146,7 +146,7 @@ public void AddToCustomers(Customer customer)
{
base.AddObject("Customers", customer);
}
-
+
///
/// Deprecated Method for adding a new object to the Order_Details EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -154,7 +154,7 @@ public void AddToOrder_Details(Order_Detail order_Detail)
{
base.AddObject("Order_Details", order_Detail);
}
-
+
///
/// Deprecated Method for adding a new object to the Orders EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -162,7 +162,7 @@ public void AddToOrders(Order order)
{
base.AddObject("Orders", order);
}
-
+
///
/// Deprecated Method for adding a new object to the Products EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -173,12 +173,12 @@ public void AddToProducts(Product product)
#endregion
}
-
+
#endregion
-
+
#region Entities
-
+
///
/// No Metadata Documentation available.
///
@@ -188,7 +188,7 @@ public void AddToProducts(Product product)
public partial class Customer : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Customer object.
///
@@ -204,7 +204,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -231,7 +231,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _CustomerID;
partial void OnCustomerIDChanging(global::System.String value);
partial void OnCustomerIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -255,7 +255,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _ContactName;
partial void OnContactNameChanging(global::System.String value);
partial void OnContactNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -279,7 +279,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _CompanyName;
partial void OnCompanyNameChanging(global::System.String value);
partial void OnCompanyNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -303,7 +303,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _ContactTitle;
partial void OnContactTitleChanging(global::System.String value);
partial void OnContactTitleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -327,7 +327,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _Address;
partial void OnAddressChanging(global::System.String value);
partial void OnAddressChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -351,7 +351,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _City;
partial void OnCityChanging(global::System.String value);
partial void OnCityChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -375,7 +375,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _Region;
partial void OnRegionChanging(global::System.String value);
partial void OnRegionChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -399,7 +399,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _PostalCode;
partial void OnPostalCodeChanging(global::System.String value);
partial void OnPostalCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -423,7 +423,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _Country;
partial void OnCountryChanging(global::System.String value);
partial void OnCountryChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -447,7 +447,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _Phone;
partial void OnPhoneChanging(global::System.String value);
partial void OnPhoneChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -473,9 +473,9 @@ public static Customer CreateCustomer(global::System.String customerID, global::
partial void OnFaxChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -500,7 +500,7 @@ public EntityCollection Orders
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -510,7 +510,7 @@ public EntityCollection Orders
public partial class Order : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Order object.
///
@@ -524,7 +524,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -551,7 +551,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.Int32 _OrderID;
partial void OnOrderIDChanging(global::System.Int32 value);
partial void OnOrderIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -575,7 +575,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _CustomerID;
partial void OnCustomerIDChanging(global::System.String value);
partial void OnCustomerIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -599,7 +599,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _EmployeeID;
partial void OnEmployeeIDChanging(Nullable value);
partial void OnEmployeeIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -623,7 +623,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _OrderDate;
partial void OnOrderDateChanging(Nullable value);
partial void OnOrderDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -647,7 +647,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _RequiredDate;
partial void OnRequiredDateChanging(Nullable value);
partial void OnRequiredDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -671,7 +671,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _ShippedDate;
partial void OnShippedDateChanging(Nullable value);
partial void OnShippedDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -695,7 +695,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _ShipVia;
partial void OnShipViaChanging(Nullable value);
partial void OnShipViaChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -719,7 +719,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _Freight;
partial void OnFreightChanging(Nullable value);
partial void OnFreightChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -743,7 +743,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipName;
partial void OnShipNameChanging(global::System.String value);
partial void OnShipNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -767,7 +767,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipAddress;
partial void OnShipAddressChanging(global::System.String value);
partial void OnShipAddressChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -791,7 +791,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipCity;
partial void OnShipCityChanging(global::System.String value);
partial void OnShipCityChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -815,7 +815,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipRegion;
partial void OnShipRegionChanging(global::System.String value);
partial void OnShipRegionChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -839,7 +839,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipPostalCode;
partial void OnShipPostalCodeChanging(global::System.String value);
partial void OnShipPostalCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -865,9 +865,9 @@ public static Order CreateOrder(global::System.Int32 orderID)
partial void OnShipCountryChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -905,7 +905,7 @@ public EntityReference CustomerReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -930,7 +930,7 @@ public EntityCollection Order_Details
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -940,7 +940,7 @@ public EntityCollection Order_Details
public partial class Order_Detail : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Order_Detail object.
///
@@ -962,7 +962,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -989,7 +989,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
private global::System.Int32 _OrderID;
partial void OnOrderIDChanging(global::System.Int32 value);
partial void OnOrderIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1016,7 +1016,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
private global::System.Int32 _ProductID;
partial void OnProductIDChanging(global::System.Int32 value);
partial void OnProductIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1040,7 +1040,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
private global::System.Decimal _UnitPrice;
partial void OnUnitPriceChanging(global::System.Decimal value);
partial void OnUnitPriceChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1064,7 +1064,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
private global::System.Int16 _Quantity;
partial void OnQuantityChanging(global::System.Int16 value);
partial void OnQuantityChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1090,9 +1090,9 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
partial void OnDiscountChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1130,7 +1130,7 @@ public EntityReference OrderReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1171,7 +1171,7 @@ public EntityReference ProductReference
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1181,7 +1181,7 @@ public EntityReference ProductReference
public partial class Product : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Product object.
///
@@ -1199,7 +1199,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1226,7 +1226,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Int32 _ProductID;
partial void OnProductIDChanging(global::System.Int32 value);
partial void OnProductIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1250,7 +1250,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _ProductName;
partial void OnProductNameChanging(global::System.String value);
partial void OnProductNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1274,7 +1274,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _UnitsInStock;
partial void OnUnitsInStockChanging(Nullable value);
partial void OnUnitsInStockChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1298,7 +1298,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _ReorderLevel;
partial void OnReorderLevelChanging(Nullable value);
partial void OnReorderLevelChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1322,7 +1322,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _SupplierID;
partial void OnSupplierIDChanging(Nullable value);
partial void OnSupplierIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1346,7 +1346,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _CategoryID;
partial void OnCategoryIDChanging(Nullable value);
partial void OnCategoryIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1370,7 +1370,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _QuantityPerUnit;
partial void OnQuantityPerUnitChanging(global::System.String value);
partial void OnQuantityPerUnitChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1394,7 +1394,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _UnitPrice;
partial void OnUnitPriceChanging(Nullable value);
partial void OnUnitPriceChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1418,7 +1418,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _UnitsOnOrder;
partial void OnUnitsOnOrderChanging(Nullable value);
partial void OnUnitsOnOrderChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1444,9 +1444,9 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
partial void OnDiscontinuedChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1473,5 +1473,5 @@ public EntityCollection Order_Details
}
#endregion
-
+
}
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.objects.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.objects.cs
index a08a5e02258..d7f993b5548 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.objects.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.objects.cs
@@ -17,7 +17,7 @@
// Generation date: 7/20/2009 11:57:04 PM
namespace NorthwindService
{
-
+
///
/// There are no comments for NorthwindEntities in the schema.
///
@@ -26,7 +26,7 @@ public partial class NorthwindEntities : global::System.Data.Objects.ObjectConte
///
/// Initializes a new NorthwindEntities object using the connection string found in the 'NorthwindEntities' section of the application configuration file.
///
- public NorthwindEntities() :
+ public NorthwindEntities() :
base("name=NorthwindEntities", "NorthwindEntities")
{
this.OnContextCreated();
@@ -34,7 +34,7 @@ public NorthwindEntities() :
///
/// Initialize a new NorthwindEntities object.
///
- public NorthwindEntities(string connectionString) :
+ public NorthwindEntities(string connectionString) :
base(connectionString, "NorthwindEntities")
{
this.OnContextCreated();
@@ -42,7 +42,7 @@ public NorthwindEntities(string connectionString) :
///
/// Initialize a new NorthwindEntities object.
///
- public NorthwindEntities(global::System.Data.EntityClient.EntityConnection connection) :
+ public NorthwindEntities(global::System.Data.EntityClient.EntityConnection connection) :
base(connection, "NorthwindEntities")
{
this.OnContextCreated();
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.svc.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.svc.cs
index 6ce5eb711bc..f596ec92ca0 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.svc.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/northwind.svc.cs
@@ -7,7 +7,7 @@
namespace NorthwindService
{
- [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
+ [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class Northwind : DataService
{
// This method is called only once to initialize service-wide policies.
@@ -16,7 +16,7 @@ public static void InitializeService(DataServiceConfiguration config)
// TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
// Examples:
config.SetEntitySetAccessRule("*", EntitySetRights.All);
- config.DataServiceBehavior.MaxProtocolVersion =
+ config.DataServiceBehavior.MaxProtocolVersion =
System.Data.Services.Common.DataServiceProtocolVersion.V2;
// config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/orderitems.svc.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/orderitems.svc.cs
index b8219c1ba84..994778e48d2 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/orderitems.svc.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_custom_feeds/cs/orderitems.svc.cs
@@ -8,11 +8,11 @@
namespace CustomDataService
{
//
- [EntityPropertyMappingAttribute("Customer",
+ [EntityPropertyMappingAttribute("Customer",
SyndicationItemProperty.AuthorName,
SyndicationTextContentKind.Plaintext, true)]
- [EntityPropertyMapping("OrderId",
- SyndicationItemProperty.Title,
+ [EntityPropertyMapping("OrderId",
+ SyndicationItemProperty.Title,
SyndicationTextContentKind.Plaintext, false)]
[DataServiceKeyAttribute("OrderId")]
public class Order
@@ -74,7 +74,7 @@ public static void InitializeService(DataServiceConfiguration
config.SetEntitySetAccessRule("Items",
EntitySetRights.AllRead |
EntitySetRights.AllWrite);
- config.DataServiceBehavior.MaxProtocolVersion =
+ config.DataServiceBehavior.MaxProtocolVersion =
DataServiceProtocolVersion.V2;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/clientcredentials.xaml.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/clientcredentials.xaml.cs
index e7e9ef41e85..2f7bd5a7575 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/clientcredentials.xaml.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/clientcredentials.xaml.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using System.Linq;
using System.Net;
@@ -37,10 +37,10 @@ private void ClientCredentials_Loaded(object sender, RoutedEventArgs e)
LoginWindow login = new LoginWindow();
login.ShowDialog();
- if (login.DialogResult == true
+ if (login.DialogResult == true
&& login.userNameBox.Text != string.Empty
&& login.passwordBox.SecurePassword.Length != 0)
- {
+ {
// Instantiate the context.
context =
new NorthwindEntities(serviceUri);
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders.designer.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders.designer.cs
index 87bcccc7b2e..9b1c41df570 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders.designer.cs
@@ -33,17 +33,17 @@ private void InitializeComponent()
this.customersComboBox = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.ordersDataGridView)).BeginInit();
this.SuspendLayout();
- //
+ //
// ordersDataGridView
- //
+ //
this.ordersDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.ordersDataGridView.Location = new System.Drawing.Point(29, 131);
this.ordersDataGridView.Name = "ordersDataGridView";
this.ordersDataGridView.Size = new System.Drawing.Size(570, 237);
this.ordersDataGridView.TabIndex = 11;
- //
+ //
// button1
- //
+ //
this.button1.Location = new System.Drawing.Point(-290, -186);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(100, 23);
@@ -51,18 +51,18 @@ private void InitializeComponent()
this.button1.Text = "Save";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
- //
+ //
// customersComboBox
- //
+ //
this.customersComboBox.FormattingEnabled = true;
this.customersComboBox.Location = new System.Drawing.Point(68, 31);
this.customersComboBox.Name = "customersComboBox";
this.customersComboBox.Size = new System.Drawing.Size(121, 21);
this.customersComboBox.TabIndex = 13;
this.customersComboBox.SelectedIndexChanged += new System.EventHandler(this.customersComboBox_SelectedIndexChanged);
- //
+ //
// CustomerOrders
- //
+ //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(642, 388);
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders2.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders2.cs
index 4f06fe8b365..6f5ec23f9f3 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders2.cs
@@ -30,7 +30,7 @@ private void CustomerOrders_Load(object sender, EventArgs e)
//
// Create a new collection that contains all customers and related orders.
- DataServiceCollection trackedCustomers =
+ DataServiceCollection trackedCustomers =
new DataServiceCollection(context.Customers.Expand("Orders"));
//
try
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders2.designer.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders2.designer.cs
index d1ad5bd204f..6222025294e 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders2.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorders2.designer.cs
@@ -65,103 +65,103 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.ordersBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ordersDataGridView)).BeginInit();
this.SuspendLayout();
- //
+ //
// companyNameLabel
- //
+ //
companyNameLabel.AutoSize = true;
companyNameLabel.Location = new System.Drawing.Point(42, 40);
companyNameLabel.Name = "companyNameLabel";
companyNameLabel.Size = new System.Drawing.Size(85, 13);
companyNameLabel.TabIndex = 1;
companyNameLabel.Text = "Company Name:";
- //
+ //
// contactNameLabel
- //
+ //
contactNameLabel.AutoSize = true;
contactNameLabel.Location = new System.Drawing.Point(49, 66);
contactNameLabel.Name = "contactNameLabel";
contactNameLabel.Size = new System.Drawing.Size(78, 13);
contactNameLabel.TabIndex = 3;
contactNameLabel.Text = "Contact Name:";
- //
+ //
// contactTitleLabel
- //
+ //
contactTitleLabel.AutoSize = true;
contactTitleLabel.Location = new System.Drawing.Point(57, 92);
contactTitleLabel.Name = "contactTitleLabel";
contactTitleLabel.Size = new System.Drawing.Size(70, 13);
contactTitleLabel.TabIndex = 5;
contactTitleLabel.Text = "Contact Title:";
- //
+ //
// phoneLabel
- //
+ //
phoneLabel.AutoSize = true;
phoneLabel.Location = new System.Drawing.Point(282, 40);
phoneLabel.Name = "phoneLabel";
phoneLabel.Size = new System.Drawing.Size(41, 13);
phoneLabel.TabIndex = 7;
phoneLabel.Text = "Phone:";
- //
+ //
// faxLabel
- //
+ //
faxLabel.AutoSize = true;
faxLabel.Location = new System.Drawing.Point(296, 66);
faxLabel.Name = "faxLabel";
faxLabel.Size = new System.Drawing.Size(27, 13);
faxLabel.TabIndex = 9;
faxLabel.Text = "Fax:";
- //
+ //
// customersBindingSource
- //
+ //
this.customersBindingSource.DataSource = typeof(Northwind.Customer);
- //
+ //
// companyNameTextBox
- //
+ //
this.companyNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.customersBindingSource, "CompanyName", true));
this.companyNameTextBox.Location = new System.Drawing.Point(133, 37);
this.companyNameTextBox.Name = "companyNameTextBox";
this.companyNameTextBox.Size = new System.Drawing.Size(100, 20);
this.companyNameTextBox.TabIndex = 2;
- //
+ //
// contactNameTextBox
- //
+ //
this.contactNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.customersBindingSource, "ContactName", true));
this.contactNameTextBox.Location = new System.Drawing.Point(133, 63);
this.contactNameTextBox.Name = "contactNameTextBox";
this.contactNameTextBox.Size = new System.Drawing.Size(100, 20);
this.contactNameTextBox.TabIndex = 4;
- //
+ //
// contactTitleTextBox
- //
+ //
this.contactTitleTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.customersBindingSource, "ContactTitle", true));
this.contactTitleTextBox.Location = new System.Drawing.Point(133, 89);
this.contactTitleTextBox.Name = "contactTitleTextBox";
this.contactTitleTextBox.Size = new System.Drawing.Size(100, 20);
this.contactTitleTextBox.TabIndex = 6;
- //
+ //
// phoneTextBox
- //
+ //
this.phoneTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.customersBindingSource, "Phone", true));
this.phoneTextBox.Location = new System.Drawing.Point(329, 37);
this.phoneTextBox.Name = "phoneTextBox";
this.phoneTextBox.Size = new System.Drawing.Size(100, 20);
this.phoneTextBox.TabIndex = 8;
- //
+ //
// faxTextBox
- //
+ //
this.faxTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.customersBindingSource, "Fax", true));
this.faxTextBox.Location = new System.Drawing.Point(329, 63);
this.faxTextBox.Name = "faxTextBox";
this.faxTextBox.Size = new System.Drawing.Size(100, 20);
this.faxTextBox.TabIndex = 10;
- //
+ //
// ordersBindingSource
- //
+ //
this.ordersBindingSource.DataMember = "Orders";
this.ordersBindingSource.DataSource = this.customersBindingSource;
- //
+ //
// ordersDataGridView
- //
+ //
this.ordersDataGridView.AutoGenerateColumns = false;
this.ordersDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.ordersDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
@@ -182,81 +182,81 @@ private void InitializeComponent()
this.ordersDataGridView.Name = "ordersDataGridView";
this.ordersDataGridView.Size = new System.Drawing.Size(570, 237);
this.ordersDataGridView.TabIndex = 11;
- //
+ //
// dataGridViewTextBoxColumn1
- //
+ //
this.dataGridViewTextBoxColumn1.DataPropertyName = "OrderID";
this.dataGridViewTextBoxColumn1.HeaderText = "OrderID";
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
- //
+ //
// dataGridViewTextBoxColumn2
- //
+ //
this.dataGridViewTextBoxColumn2.DataPropertyName = "OrderDate";
this.dataGridViewTextBoxColumn2.HeaderText = "OrderDate";
this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
- //
+ //
// dataGridViewTextBoxColumn3
- //
+ //
this.dataGridViewTextBoxColumn3.DataPropertyName = "RequiredDate";
this.dataGridViewTextBoxColumn3.HeaderText = "RequiredDate";
this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
- //
+ //
// dataGridViewTextBoxColumn4
- //
+ //
this.dataGridViewTextBoxColumn4.DataPropertyName = "ShippedDate";
this.dataGridViewTextBoxColumn4.HeaderText = "ShippedDate";
this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
- //
+ //
// dataGridViewTextBoxColumn5
- //
+ //
this.dataGridViewTextBoxColumn5.DataPropertyName = "Freight";
this.dataGridViewTextBoxColumn5.HeaderText = "Freight";
this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
- //
+ //
// dataGridViewTextBoxColumn6
- //
+ //
this.dataGridViewTextBoxColumn6.DataPropertyName = "ShipName";
this.dataGridViewTextBoxColumn6.HeaderText = "ShipName";
this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
- //
+ //
// dataGridViewTextBoxColumn7
- //
+ //
this.dataGridViewTextBoxColumn7.DataPropertyName = "ShipAddress";
this.dataGridViewTextBoxColumn7.HeaderText = "ShipAddress";
this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
- //
+ //
// dataGridViewTextBoxColumn8
- //
+ //
this.dataGridViewTextBoxColumn8.DataPropertyName = "ShipCity";
this.dataGridViewTextBoxColumn8.HeaderText = "ShipCity";
this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
- //
+ //
// dataGridViewTextBoxColumn9
- //
+ //
this.dataGridViewTextBoxColumn9.DataPropertyName = "ShipRegion";
this.dataGridViewTextBoxColumn9.HeaderText = "ShipRegion";
this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
- //
+ //
// dataGridViewTextBoxColumn10
- //
+ //
this.dataGridViewTextBoxColumn10.DataPropertyName = "ShipPostalCode";
this.dataGridViewTextBoxColumn10.HeaderText = "ShipPostalCode";
this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
- //
+ //
// dataGridViewTextBoxColumn11
- //
+ //
this.dataGridViewTextBoxColumn11.DataPropertyName = "ShipCountry";
this.dataGridViewTextBoxColumn11.HeaderText = "ShipCountry";
this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
- //
+ //
// dataGridViewTextBoxColumn12
- //
+ //
this.dataGridViewTextBoxColumn12.DataPropertyName = "Customers";
this.dataGridViewTextBoxColumn12.HeaderText = "Customers";
this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
- //
+ //
// button1
- //
+ //
this.button1.Location = new System.Drawing.Point(329, 92);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(100, 23);
@@ -264,9 +264,9 @@ private void InitializeComponent()
this.button1.Text = "Save";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
- //
+ //
// comboBox1
- //
+ //
this.comboBox1.DataSource = this.customersBindingSource;
this.comboBox1.DisplayMember = "CustomerID";
this.comboBox1.FormattingEnabled = true;
@@ -275,9 +275,9 @@ private void InitializeComponent()
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 13;
this.comboBox1.ValueMember = "CustomerID";
- //
+ //
// CustomerOrders
- //
+ //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(642, 388);
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerordersasync.xaml.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerordersasync.xaml.cs
index d8b289632d1..9e11e400972 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerordersasync.xaml.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerordersasync.xaml.cs
@@ -26,7 +26,7 @@ public partial class CustomerOrdersAsync : Window
private NorthwindEntities context;
private DataServiceCollection customerBinding;
private const string customerCountry = "Germany";
-
+
// Change this URI to the service URI for your implementation.
private const string svcUri = "http://localhost:12345/Northwind.svc/";
@@ -49,7 +49,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
try
{
- // Begin asynchronously saving changes using the
+ // Begin asynchronously saving changes using the
// specified handler and query object state.
query.BeginExecute(OnQueryCompleted, query);
}
@@ -70,11 +70,11 @@ private void OnQueryCompleted(IAsyncResult result)
{
try
{
- // Instantiate the binding collection using the
+ // Instantiate the binding collection using the
// results of the query execution.
customerBinding = new DataServiceCollection(
query.EndExecute(result));
-
+
// Bind the collection to the root element of the UI.
this.LayoutRoot.DataContext = customerBinding;
}
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderscustom.xaml.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderscustom.xaml.cs
index 7d8b61aa84a..787e466b169 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderscustom.xaml.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderscustom.xaml.cs
@@ -44,8 +44,8 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
select cust;
// Create a new collection for binding based on the LINQ query.
- trackedCustomers = new DataServiceCollection(customerQuery,
- TrackingMode.AutoChangeTracking,"Customers",
+ trackedCustomers = new DataServiceCollection(customerQuery,
+ TrackingMode.AutoChangeTracking,"Customers",
OnPropertyChanged, OnCollectionChanged);
// Bind the root StackPanel element to the collection;
@@ -100,7 +100,7 @@ private bool OnCollectionChanged(
return false;
}
}
- else
+ else
{
// Use the default behavior.
return false;
@@ -111,19 +111,19 @@ private bool OnCollectionChanged(
// Method that is called when the PropertyChanged event is handled.
private bool OnPropertyChanged(EntityChangedParams entityChangedInfo)
{
- // Validate a changed order to ensure that changes are not made
+ // Validate a changed order to ensure that changes are not made
// after the order ships.
- if ((entityChangedInfo.Entity.GetType() == typeof(Order)) &&
+ if ((entityChangedInfo.Entity.GetType() == typeof(Order)) &&
((Order)(entityChangedInfo.Entity)).ShippedDate < DateTime.Today)
{
throw new ApplicationException(string.Format(
"The order {0} cannot be changed because it shipped on {1}.",
- ((Order)(entityChangedInfo.Entity)).OrderID,
+ ((Order)(entityChangedInfo.Entity)).OrderID,
((Order)(entityChangedInfo.Entity)).ShippedDate));
}
return false;
}
-
+
private void deleteButton_Click(object sender, RoutedEventArgs e)
{
if (customerIDComboBox.SelectedItem != null)
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf.xaml.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf.xaml.cs
index fac1e35ed2b..ef58e3009da 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf.xaml.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf.xaml.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf3.xaml.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf3.xaml.cs
index d692223d996..84808882615 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf3.xaml.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf3.xaml.cs
@@ -40,11 +40,11 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
var customerQuery = from cust in context.Customers
where cust.Country == customerCountry
select cust;
-
+
//
// Create a new collection for binding based on the LINQ query.
trackedCustomers = new DataServiceCollection(customerQuery);
-
+
// Load all pages of the response at once.
while (trackedCustomers.Continuation != null)
{
@@ -66,10 +66,10 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
MessageBox.Show("The following error occurred:\n" + ex.ToString());
}
}
-
+
private void customerIDComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
- Customer selectedCustomer =
+ Customer selectedCustomer =
this.customerIDComboBox.SelectedItem as Customer;
try
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/northwind.cs
index faceac81740..0379bdefa8d 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/northwind.cs
@@ -12,7 +12,7 @@
// Generation date: 9/27/2009 7:48:05 PM
namespace NorthwindModel
{
-
+
///
/// There are no comments for NorthwindEntities in the schema.
///
@@ -22,7 +22,7 @@ public partial class NorthwindEntities : global::System.Data.Services.Client.Dat
/// Initialize a new NorthwindEntities object.
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]
- public NorthwindEntities(global::System.Uri serviceRoot) :
+ public NorthwindEntities(global::System.Uri serviceRoot) :
base(serviceRoot)
{
this.OnContextCreated();
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/northwind1.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/northwind1.cs
index 91e2a311560..6bef418623b 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/northwind1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/northwind1.cs
@@ -12,7 +12,7 @@
// Generation date: 7/31/2009 1:23:06 AM
namespace NorthwindModel
{
-
+
///
/// There are no comments for NorthwindEntities in the schema.
///
@@ -21,7 +21,7 @@ public partial class NorthwindEntities : global::System.Data.Services.Client.Dat
///
/// Initialize a new NorthwindEntities object.
///
- public NorthwindEntities(global::System.Uri serviceRoot) :
+ public NorthwindEntities(global::System.Uri serviceRoot) :
base(serviceRoot)
{
this.OnContextCreated();
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/salesorders.xaml.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/salesorders.xaml.cs
index 1e1219d509c..635eb61905e 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/salesorders.xaml.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/salesorders.xaml.cs
@@ -51,13 +51,13 @@ private void OrdersForm_Loaded(object sender, RoutedEventArgs e)
// Instantiate the DataServiceContext.
context = new NorthwindEntities(svcUri);
- // Define a query that returns Orders and
+ // Define a query that returns Orders and
// Order_Details for a specific customer.
var ordersQuery = from o in context.Orders.Expand("Order_Details")
where o.Customer.CustomerID == customerId
select o;
- // Create an DataServiceCollection based on
+ // Create an DataServiceCollection based on
// execution of the query for Orders.
DataServiceCollection customerOrders =
new DataServiceCollection(ordersQuery);
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs
index e117d5a4543..eebdcd69571 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs
@@ -10,7 +10,7 @@
namespace NorthwindClient
{
-
+
public class Source
{
public static Uri svcUri = new Uri("http://glengatest4-vm1/Northwind/Northwind.svc/");
@@ -22,7 +22,7 @@ public static void GetAllCustomers()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- //
+ //
// Define a new query for Customers.
DataServiceQuery query = context.Customers;
//
@@ -96,7 +96,7 @@ public static void GetAllCustomersQuery()
// Define a new query for Customers.
DataServiceQuery query = context.CreateQuery("Customers");
-
+
try
{
// Enumerate over the query result.
@@ -143,7 +143,7 @@ public static void BeginExecuteCustomersQuery()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- // Define the query to execute asynchronously that returns
+ // Define the query to execute asynchronously that returns
// all customers with their respective orders.
DataServiceQuery query = (DataServiceQuery)(from cust in context.Customers.Expand("Orders")
where cust.CustomerID == "ALFKI"
@@ -166,7 +166,7 @@ public static void BeginExecuteCustomersQuery()
private static void OnCustomersQueryComplete(IAsyncResult result)
{
// Get the original query from the result.
- DataServiceQuery query =
+ DataServiceQuery query =
result as DataServiceQuery;
foreach (Customer customer in query.EndExecute(result))
@@ -178,7 +178,7 @@ private static void OnCustomersQueryComplete(IAsyncResult result)
order.OrderID, order.Freight);
}
}
- }
+ }
//
public static void LoadRelatedOrderCustomer()
{
@@ -197,7 +197,7 @@ public static void LoadRelatedOrderCustomer()
//
// Write out customer and order information.
- Console.WriteLine("Customer: {0} - Order ID: {1}",
+ Console.WriteLine("Customer: {0} - Order ID: {1}",
order.Customer.CompanyName, order.OrderID);
}
}
@@ -294,7 +294,7 @@ public static void AddQueryOptions()
// Enumerate over the results of the query.
foreach (Order order in selectedOrders)
{
- Console.WriteLine("Order ID: {0} - Ship Date: {1} - Freight: {2}",
+ Console.WriteLine("Order ID: {0} - Ship Date: {1} - Freight: {2}",
order.OrderID, order.ShippedDate, order.Freight);
}
}
@@ -317,7 +317,7 @@ public static void AddQueryOptionsLinq()
//
var selectedOrders = from o in context.Orders
where o.Freight > 30
- orderby o.ShippedDate descending
+ orderby o.ShippedDate descending
select o;
//
@@ -357,7 +357,7 @@ public static void AddQueryOptionsLinqExpression()
foreach (Order currentOrder in selectedOrders)
{
Console.WriteLine("Order ID: {0} - Ship Date: {1} - Freight: {2}",
- currentOrder.OrderID, currentOrder.ShippedDate,
+ currentOrder.OrderID, currentOrder.ShippedDate,
currentOrder.Freight);
}
}
@@ -406,21 +406,21 @@ public static void BatchQuery()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- // Create the separate query URI's, one that returns
+ // Create the separate query URI's, one that returns
// a single customer and another that returns all Products.
- Uri customerUri = new Uri(svcUri.AbsoluteUri +
+ Uri customerUri = new Uri(svcUri.AbsoluteUri +
"/Customers('" + customerId + "')/?$expand=Orders");
Uri productsUri = new Uri(svcUri.AbsoluteUri +
"/Products");
// Create the query requests.
- DataServiceRequest customerQuery =
+ DataServiceRequest customerQuery =
new DataServiceRequest(customerUri);
DataServiceRequest productsQuery =
new DataServiceRequest(productsUri);
// Add the query requests to a batch request array.
- DataServiceRequest[] batchRequests =
+ DataServiceRequest[] batchRequests =
new DataServiceRequest[]{customerQuery, productsQuery};
DataServiceResponse batchResponse;
@@ -433,7 +433,7 @@ public static void BatchQuery()
if (batchResponse.IsBatchResponse)
{
// Parse the batchResponse.BatchHeaders.
- }
+ }
// Enumerate over the results of the query.
foreach (QueryOperationResponse response in batchResponse)
{
@@ -500,9 +500,9 @@ public static void AttachObject()
NorthwindEntities context = new NorthwindEntities(svcUri);
// Define an existing customer to attach, including the key.
- Customer customer =
+ Customer customer =
Customer.CreateCustomer("ALFKI", "Alfreds Futterkiste");
-
+
// Set current property values.
customer.Address = "Obere Str. 57";
customer.City = "Berlin";
@@ -524,7 +524,7 @@ public static void AttachObject()
// Send updates to the data service.
context.SaveChanges();
- //
+ //
}
catch (DataServiceClientException ex)
{
@@ -538,7 +538,7 @@ public static void AddProduct()
//
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
-
+
//
// Create the new product.
Product newProduct =
@@ -555,7 +555,7 @@ public static void AddProduct()
//
// Add the new product to the Products entity set.
context.AddToProducts(newProduct);
- //
+ //
// Send the insert to the data service.
DataServiceResponse response = context.SaveChanges();
@@ -603,7 +603,7 @@ public static void ModifyCustomer()
var customerToChange = (from customer in context.Customers
where customer.CustomerID == customerId
select customer).Single();
-
+
// Change some property values.
customerToChange.CompanyName = "Alfreds Futterkiste";
customerToChange.ContactName = "Maria Anders";
@@ -614,7 +614,7 @@ public static void ModifyCustomer()
//
// Mark the customer as updated.
context.UpdateObject(customerToChange);
- //
+ //
// Send the update to the data service.
context.SaveChanges();
@@ -650,16 +650,16 @@ public static void DeleteProduct()
where product.ProductID == productID
select product).Single();
- //
- // Mark the product for deletion.
+ //
+ // Mark the product for deletion.
context.DeleteObject(deletedProduct);
- //
+ //
// Send the delete to the data service.
context.SaveChanges();
}
// Handle the error that occurs when the delete operation fails,
- // which can happen when there are entities with existing
+ // which can happen when there are entities with existing
// relationships to the product being deleted.
catch (DataServiceRequestException ex)
{
@@ -691,7 +691,7 @@ public static void AddOrderDetailToOrder()
where customer.CustomerID == customerId
select customer).Single();
- // Get the first order.
+ // Get the first order.
Order order = cust.Orders.FirstOrDefault();
// Create a new order detail for the specific product.
@@ -740,7 +740,7 @@ public static void AddOrderDetailToOrder()
"An error occurred when saving changes.", ex);
}
- // Handle any errors that may occur during insert, such as
+ // Handle any errors that may occur during insert, such as
// a constraint violation.
catch (DataServiceRequestException ex)
{
@@ -755,7 +755,7 @@ public static void AddOrderDetailToOrder()
context.SaveChanges();
}
}
-
+
public static void AddOrderDetailToOrderAuto()
{
//
@@ -779,7 +779,7 @@ public static void AddOrderDetailToOrderAuto()
where customer.CustomerID == customerId
select customer).Single();
- // Get the first order.
+ // Get the first order.
Order order = cust.Orders.FirstOrDefault();
// Create a new order detail for the specific product.
@@ -798,7 +798,7 @@ public static void AddOrderDetailToOrderAuto()
newItem.Order = order;
newItem.Product = selectedProduct;
//
-
+
// Send the changes to the data service.
DataServiceResponse response = context.SaveChanges();
@@ -816,7 +816,7 @@ public static void AddOrderDetailToOrderAuto()
if (addedItem != null)
{
- Console.WriteLine("New {0} item added to order {1}.",
+ Console.WriteLine("New {0} item added to order {1}.",
addedItem.Product.ProductName, addedItem.OrderID.ToString());
}
}
@@ -829,7 +829,7 @@ public static void AddOrderDetailToOrderAuto()
"An error occurred when saving changes.", ex);
}
- // Handle any errors that may occur during insert, such as
+ // Handle any errors that may occur during insert, such as
// a constraint violation.
catch (DataServiceRequestException ex)
{
@@ -849,15 +849,15 @@ public static void CountAllCustomersValueOnly()
//
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
-
+
// Define a new query for Customers.
DataServiceQuery query = context.Customers;
-
+
try
- {
+ {
// Execute the query to just return the value of all customers in the set.
int totalCount = query.Count();
-
+
// Retrieve the total count from the response.
Console.WriteLine("There are {0} customers in total.", totalCount);
}
@@ -873,19 +873,19 @@ public static void CountAllCustomers()
//
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
-
- //
+
+ //
// Define a new query for Customers that includes the total count.
DataServiceQuery query = context.Customers.IncludeTotalCount();
//
try
- {
- //
+ {
+ //
// Execute the query for all customers and get the response object.
- QueryOperationResponse response =
+ QueryOperationResponse response =
query.Execute() as QueryOperationResponse;
- //
+ //
// Retrieve the total count from the response.
Console.WriteLine("There are a total of {0} customers.", response.TotalCount);
@@ -909,16 +909,16 @@ public static void GetCustomersPaged()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
DataServiceQueryContinuation token = null;
- int pageCount = 0;
+ int pageCount = 0;
try
- {
+ {
// Execute the query for all customers and get the response object.
QueryOperationResponse response =
context.Customers.Execute() as QueryOperationResponse;
//
- // With a paged response from the service, use a do...while loop
+ // With a paged response from the service, use a do...while loop
// to enumerate the results before getting the next link.
do
{
@@ -968,7 +968,7 @@ public static void GetCustomersPagedNested()
context.Customers.AddQueryOption("$expand", "Orders")
.Execute() as QueryOperationResponse;
- // With a paged response from the service, use a do...while loop
+ // With a paged response from the service, use a do...while loop
// to enumerate the results before getting the next link.
do
{
@@ -989,7 +989,7 @@ public static void GetCustomersPagedNested()
Console.WriteLine("\tCustomer Name: {0}", c.CompanyName);
Console.WriteLine("\tOrders Page {0}:", ++innerPageCount);
// Get the next link for the collection of related Orders.
- DataServiceQueryContinuation nextOrdersLink =
+ DataServiceQueryContinuation nextOrdersLink =
response.GetContinuation(c.Orders);
//
@@ -1026,18 +1026,18 @@ public static void SelectCustomerAddress()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- //
- // Define an anonymous LINQ query that projects the Customers type into
+ //
+ // Define an anonymous LINQ query that projects the Customers type into
// a CustomerAddress type that contains only address properties.
- //
+ //
var query = from c in context.Customers
where c.Country == "Germany"
- select new CustomerAddress {
- CustomerID = c.CustomerID,
- Address = c.Address,
- City = c.City,
+ select new CustomerAddress {
+ CustomerID = c.CustomerID,
+ Address = c.Address,
+ City = c.City,
Region = c.Region,
- PostalCode = c.PostalCode,
+ PostalCode = c.PostalCode,
Country = c.Country};
//
//
@@ -1053,8 +1053,8 @@ public static void SelectCustomerAddress()
// Write out the current values.
Console.WriteLine("Customer ID: {0} \r\nStreet: {1} "
- + "\r\nCity: {2} \r\nState: {3} \r\nZip Code: {4} \r\nCountry: {5}",
- item.CustomerID, item.Address, item.City, item.Region,
+ + "\r\nCity: {2} \r\nState: {3} \r\nZip Code: {4} \r\nCountry: {5}",
+ item.CustomerID, item.Address, item.City, item.Region,
item.PostalCode, item.Country);
}
@@ -1074,17 +1074,17 @@ public static void SelectCustomerAddressNonEntity()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- // Define an anonymous LINQ query that projects the Customers type into
+ // Define an anonymous LINQ query that projects the Customers type into
// a CustomerAddress type that contains only address properties.
var query = from c in context.Customers
where c.Country == "Germany"
select new CustomerAddressNonEntity
{
- CompanyName = c.CompanyName,
+ CompanyName = c.CompanyName,
Address = c.Address,
- City = c.City,
+ City = c.City,
Region = c.Region,
- PostalCode = c.PostalCode,
+ PostalCode = c.PostalCode,
Country = c.Country
};
@@ -1099,7 +1099,7 @@ public static void SelectCustomerAddressNonEntity()
+ "\nCity: {2} \nState: {3} \nZip Code: {4} \nCountry: {5}",
item.CompanyName, item.Address, item.City, item.Region,
item.PostalCode, item.Country);
- }
+ }
}
catch (DataServiceQueryException ex)
{
@@ -1113,17 +1113,17 @@ public static void ProjectWithConstructor()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- // Define an anonymous LINQ query that projects the Customers type into
+ // Define an anonymous LINQ query that projects the Customers type into
// a CustomerAddress type that contains only address properties.
- //
+ //
var query = from c in context.Customers
where c.Country == "Germany"
select new CustomerAddress(
- c.CustomerID,
- c.Address,
- c.City,
+ c.CustomerID,
+ c.Address,
+ c.City,
c.Region,
- c.PostalCode,
+ c.PostalCode,
c.Country);
//
@@ -1150,15 +1150,15 @@ public static void ProjectWithTransform()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- // Define an anonymous LINQ query that projects the Customers type into
+ // Define an anonymous LINQ query that projects the Customers type into
// a CustomerAddress type and tries to create a new Address string by
// concatenating other properties.
- //
+ //
var query = from c in context.Customers
where c.Country == "Germany"
select new CustomerAddress
{
- CustomerID = c.CustomerID,
+ CustomerID = c.CustomerID,
Address = "Full address:" + c.Address + ", " +
c.City + ", " + c.Region + " " + c.PostalCode,
City = c.City,
@@ -1191,9 +1191,9 @@ public static void ProjectWithConvertion()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- // Define an anonymous LINQ query that projects the Customers type into
+ // Define an anonymous LINQ query that projects the Customers type into
// a CustomerAddress type that contains only address properties.
- //
+ //
var query = from c in context.Customers
where c.Country == "Germany"
select new CustomerAddress
@@ -1235,7 +1235,7 @@ public static void LinqQueryPrecedence()
//
var ordersQuery = (from o in context.Orders
where o.ShippedDate < DateTime.Today
- orderby o.OrderDate descending, o.CustomerID
+ orderby o.OrderDate descending, o.CustomerID
select o).Skip(10).Take(10);
//
@@ -1405,7 +1405,7 @@ public static void LinqOrderByClause()
// Define a query for orders with a Freight value greater than 30.
//
var sortedCustomers = from c in context.Customers
- orderby c.CompanyName ascending,
+ orderby c.CompanyName ascending,
c.PostalCode descending
select c;
//
@@ -1497,7 +1497,7 @@ public static void LinqSkipTakeMethod()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- // Define a query that returns 25 orders after skipping the
+ // Define a query that returns 25 orders after skipping the
// first 50 orders returned by the query.
//
var pagedOrders = (from o in context.Orders
@@ -1530,7 +1530,7 @@ public static void ExplicitQuerySkipTakeMethod()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
- // Define a query that returns 25 orders after skipping the
+ // Define a query that returns 25 orders after skipping the
// first 50 orders returned by the query.
//
var pagedOrders = context.Orders
@@ -1608,12 +1608,12 @@ public static void LinqSelectMethod()
var projectedQuery = context.Customers.Where(c => c.Country == "Germany")
.Select(c => new CustomerAddress
{
- CustomerID = c.CustomerID,
+ CustomerID = c.CustomerID,
Address = c.Address,
City = c.City,
Region = c.Region,
PostalCode = c.PostalCode,
- Country = c.Country});
+ Country = c.Country});
//
try
@@ -1715,7 +1715,7 @@ public static void LinqQueryExpandMethod()
}
//
}
- #endregion
+ #endregion
public static void LinqQueryClientEval()
{
//
@@ -1726,7 +1726,7 @@ public static void LinqQueryClientEval()
int basePrice = 100;
decimal discount = .10M;
- // Define a query that returns products based on a
+ // Define a query that returns products based on a
// calculation that is determined on the client.
var productsQuery = from p in context.Products
where p.UnitPrice >
@@ -1763,8 +1763,8 @@ public static void RegisterHeadersQuery()
// Register to handle the SendingRequest event.
// Note: If this must be done for every request to the data service, consider
- // registering for this event by overriding the OnContextCreated partial method in
- // the entity container, in this case NorthwindEntities.
+ // registering for this event by overriding the OnContextCreated partial method in
+ // the entity container, in this case NorthwindEntities.
context.SendingRequest += new EventHandler(OnSendingRequest);
// Define a query for orders with a Freight value greater than 30.
@@ -1802,9 +1802,9 @@ private static void OnSendingRequest(object sender, SendingRequestEventArgs e)
// // Create the DataServiceContext using the service URI.
// NorthwindEntities context = new NorthwindEntities(svcUri);
- // // Define an anonymous LINQ query that projects the Products type,
+ // // Define an anonymous LINQ query that projects the Products type,
// // checking for relationships that return a null reference.
- // //
+ // //
// var query = from p in context.Products
// where (p.Discontinued == false && p.ProductID > 77)
// select new Product
@@ -1829,7 +1829,7 @@ private static void OnSendingRequest(object sender, SendingRequestEventArgs e)
// // Enumerate over the query result, which is executed implicitly.
// foreach (var item in query)
// {
-
+
// // Write out the current values.
// Console.WriteLine("Product ID: {0}/nUnits on order: {1}",
// item.ProductID, item.UnitsOnOrder);
@@ -1852,7 +1852,7 @@ public static void CallServiceOperationIQueryable()
// Define the service operation query parameter.
string city = "London";
- // Define the query URI to access the service operation with specific
+ // Define the query URI to access the service operation with specific
// query options relative to the service URI.
string queryString = string.Format("GetOrdersByCity?city='{0}'", city)
+ "&$orderby=ShippedDate desc"
@@ -1897,7 +1897,7 @@ public static void CallServiceOperationCreateQuery()
NorthwindEntities context = new NorthwindEntities(svcUri2);
// Use the CreateQuery method to create a query that accessess
- // the service operation passing a single parameter.
+ // the service operation passing a single parameter.
var query = context.CreateQuery("GetOrdersByCity")
.AddQueryOption("city", string.Format("'{0}'", city))
.Expand("Order_Details");
@@ -1928,7 +1928,7 @@ public static void CallServiceOperationCreateQuery()
public static void CallServiceOperationSingleEntity()
{
//
- // Define the query URI to access the service operation,
+ // Define the query URI to access the service operation,
// relative to the service URI.
string queryString = "GetNewestOrder";
@@ -1958,7 +1958,7 @@ Order order
public static void CallServiceOperationEnumString()
{
//
- // Define the query URI to access the service operation,
+ // Define the query URI to access the service operation,
// relative to the service URI.
string queryString = "GetCustomerNames";
@@ -1970,7 +1970,7 @@ public static void CallServiceOperationEnumString()
// Execute a service operation that returns only the newest single order.
IEnumerable customerNames
= context.Execute(new Uri(queryString, UriKind.Relative));
-
+
foreach (string name in customerNames)
{
// Write out order information.
@@ -1989,7 +1989,7 @@ IEnumerable customerNames
public static void CallServiceOperationSingleInt()
{
//
- // Define the query URI to access the service operation,
+ // Define the query URI to access the service operation,
// relative to the service URI.
string queryString = "CountOpenOrders";
@@ -1998,7 +1998,7 @@ public static void CallServiceOperationSingleInt()
try
{
- // Execute a service operation that returns the integer
+ // Execute a service operation that returns the integer
// count of open orders.
int numOrders
= (context.Execute(new Uri(queryString, UriKind.Relative)))
@@ -2020,7 +2020,7 @@ int numOrders
public static void CallServiceOperationVoid()
{
//
- // Define the query URI to access the service operation,
+ // Define the query URI to access the service operation,
// relative to the service URI.
string queryString = "ReturnsNoData";
@@ -2051,14 +2051,14 @@ public static void CallServiceOperationQueryAsync()
NorthwindEntities context = new NorthwindEntities(svcUri2);
// Use the CreateQuery method to create a query that accessess
- // the service operation passing a single parameter.
+ // the service operation passing a single parameter.
var query = context.CreateQuery("GetOrdersByCity")
.AddQueryOption("city", string.Format("'{0}'", city))
.Expand("Order_Details");
- // Execute the service operation that returns
+ // Execute the service operation that returns
// all orders for the specified city.
- var results =
+ var results =
query.BeginExecute(OnAsyncQueryExecutionComplete, query);
//
}
@@ -2068,7 +2068,7 @@ private static void OnAsyncQueryExecutionComplete(IAsyncResult result)
{
// Get the query back from the stored state.
var query = result.AsyncState as DataServiceQuery;
-
+
try
{
// Complete the exection and write out the results.
@@ -2090,7 +2090,7 @@ private static void OnAsyncQueryExecutionComplete(IAsyncResult result)
Console.WriteLine(response.Error.Message);
}
}
- //
+ //
public static void CallServiceOperationAsync()
{
@@ -2098,7 +2098,7 @@ public static void CallServiceOperationAsync()
// Define the service operation query parameter.
string city = "London";
- // Define the query URI to access the service operation with specific
+ // Define the query URI to access the service operation with specific
// query options relative to the service URI.
string queryString = string.Format("GetOrdersByCity?city='{0}'", city)
+ "&$orderby=ShippedDate desc"
@@ -2107,20 +2107,20 @@ public static void CallServiceOperationAsync()
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri2);
- // Execute the service operation that returns
+ // Execute the service operation that returns
// all orders for the specified city.
var results = context.BeginExecute(
new Uri(queryString, UriKind.Relative),
OnAsyncExecutionComplete, context);
//
}
-
+
//
private static void OnAsyncExecutionComplete(IAsyncResult result)
{
// Get the context back from the stored state.
var context = result.AsyncState as NorthwindEntities;
-
+
try
{
// Complete the exection and write out the results.
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_quickstart_service/cs/default.aspx.designer.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_quickstart_service/cs/default.aspx.designer.cs
index 148d682de7c..01e8bd70a14 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_quickstart_service/cs/default.aspx.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_quickstart_service/cs/default.aspx.designer.cs
@@ -9,10 +9,10 @@
//------------------------------------------------------------------------------
namespace NorthwindService {
-
-
+
+
public partial class _Default {
-
+
///
/// form1 control.
///
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/astoria_quickstart_service/cs/northwind.designer.cs b/samples/snippets/csharp/VS_Snippets_Misc/astoria_quickstart_service/cs/northwind.designer.cs
index a0f623d970c..c9d2b416057 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/astoria_quickstart_service/cs/northwind.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/astoria_quickstart_service/cs/northwind.designer.cs
@@ -35,14 +35,14 @@
namespace NorthwindService
{
#region Contexts
-
+
///
/// No Metadata Documentation available.
///
public partial class NorthwindEntities : ObjectContext
{
#region Constructors
-
+
///
/// Initializes a new NorthwindEntities object using the connection string found in the 'NorthwindEntities' section of the application configuration file.
///
@@ -51,7 +51,7 @@ public NorthwindEntities() : base("name=NorthwindEntities", "NorthwindEntities")
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
///
/// Initialize a new NorthwindEntities object.
///
@@ -60,7 +60,7 @@ public NorthwindEntities(string connectionString) : base(connectionString, "Nort
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
///
/// Initialize a new NorthwindEntities object.
///
@@ -69,17 +69,17 @@ public NorthwindEntities(EntityConnection connection) : base(connection, "Northw
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
#endregion
-
+
#region Partial Methods
-
+
partial void OnContextCreated();
-
+
#endregion
-
+
#region ObjectSet Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -95,7 +95,7 @@ public ObjectSet Categories
}
}
private ObjectSet _Categories;
-
+
///
/// No Metadata Documentation available.
///
@@ -111,7 +111,7 @@ public ObjectSet CustomerDemographics
}
}
private ObjectSet _CustomerDemographics;
-
+
///
/// No Metadata Documentation available.
///
@@ -127,7 +127,7 @@ public ObjectSet Customers
}
}
private ObjectSet _Customers;
-
+
///
/// No Metadata Documentation available.
///
@@ -143,7 +143,7 @@ public ObjectSet Employees
}
}
private ObjectSet _Employees;
-
+
///
/// No Metadata Documentation available.
///
@@ -159,7 +159,7 @@ public ObjectSet Order_Details
}
}
private ObjectSet _Order_Details;
-
+
///
/// No Metadata Documentation available.
///
@@ -175,7 +175,7 @@ public ObjectSet Orders
}
}
private ObjectSet _Orders;
-
+
///
/// No Metadata Documentation available.
///
@@ -191,7 +191,7 @@ public ObjectSet Products
}
}
private ObjectSet _Products;
-
+
///
/// No Metadata Documentation available.
///
@@ -207,7 +207,7 @@ public ObjectSet Regions
}
}
private ObjectSet _Regions;
-
+
///
/// No Metadata Documentation available.
///
@@ -223,7 +223,7 @@ public ObjectSet Suppliers
}
}
private ObjectSet _Suppliers;
-
+
///
/// No Metadata Documentation available.
///
@@ -239,7 +239,7 @@ public ObjectSet Shippers
}
}
private ObjectSet _Shippers;
-
+
///
/// No Metadata Documentation available.
///
@@ -258,7 +258,7 @@ public ObjectSet Territories
#endregion
#region AddTo Methods
-
+
///
/// Deprecated Method for adding a new object to the Categories EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -266,7 +266,7 @@ public void AddToCategories(Category category)
{
base.AddObject("Categories", category);
}
-
+
///
/// Deprecated Method for adding a new object to the CustomerDemographics EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -274,7 +274,7 @@ public void AddToCustomerDemographics(CustomerDemographic customerDemographic)
{
base.AddObject("CustomerDemographics", customerDemographic);
}
-
+
///
/// Deprecated Method for adding a new object to the Customers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -282,7 +282,7 @@ public void AddToCustomers(Customer customer)
{
base.AddObject("Customers", customer);
}
-
+
///
/// Deprecated Method for adding a new object to the Employees EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -290,7 +290,7 @@ public void AddToEmployees(Employee employee)
{
base.AddObject("Employees", employee);
}
-
+
///
/// Deprecated Method for adding a new object to the Order_Details EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -298,7 +298,7 @@ public void AddToOrder_Details(Order_Detail order_Detail)
{
base.AddObject("Order_Details", order_Detail);
}
-
+
///
/// Deprecated Method for adding a new object to the Orders EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -306,7 +306,7 @@ public void AddToOrders(Order order)
{
base.AddObject("Orders", order);
}
-
+
///
/// Deprecated Method for adding a new object to the Products EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -314,7 +314,7 @@ public void AddToProducts(Product product)
{
base.AddObject("Products", product);
}
-
+
///
/// Deprecated Method for adding a new object to the Regions EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -322,7 +322,7 @@ public void AddToRegions(Region region)
{
base.AddObject("Regions", region);
}
-
+
///
/// Deprecated Method for adding a new object to the Suppliers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -330,7 +330,7 @@ public void AddToSuppliers(Supplier supplier)
{
base.AddObject("Suppliers", supplier);
}
-
+
///
/// Deprecated Method for adding a new object to the Shippers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -338,7 +338,7 @@ public void AddToShippers(Shipper shipper)
{
base.AddObject("Shippers", shipper);
}
-
+
///
/// Deprecated Method for adding a new object to the Territories EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -349,12 +349,12 @@ public void AddToTerritories(Territory territory)
#endregion
}
-
+
#endregion
-
+
#region Entities
-
+
///
/// No Metadata Documentation available.
///
@@ -364,7 +364,7 @@ public void AddToTerritories(Territory territory)
public partial class Category : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Category object.
///
@@ -380,7 +380,7 @@ public static Category CreateCategory(global::System.Int32 categoryID, global::S
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -407,7 +407,7 @@ public static Category CreateCategory(global::System.Int32 categoryID, global::S
private global::System.Int32 _CategoryID;
partial void OnCategoryIDChanging(global::System.Int32 value);
partial void OnCategoryIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -431,7 +431,7 @@ public static Category CreateCategory(global::System.Int32 categoryID, global::S
private global::System.String _CategoryName;
partial void OnCategoryNameChanging(global::System.String value);
partial void OnCategoryNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -455,7 +455,7 @@ public static Category CreateCategory(global::System.Int32 categoryID, global::S
private global::System.String _Description;
partial void OnDescriptionChanging(global::System.String value);
partial void OnDescriptionChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -481,9 +481,9 @@ public static Category CreateCategory(global::System.Int32 categoryID, global::S
partial void OnPictureChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -508,7 +508,7 @@ public EntityCollection Products
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -518,7 +518,7 @@ public EntityCollection Products
public partial class Customer : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Customer object.
///
@@ -534,7 +534,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -561,7 +561,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _CustomerID;
partial void OnCustomerIDChanging(global::System.String value);
partial void OnCustomerIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -585,7 +585,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _CompanyName;
partial void OnCompanyNameChanging(global::System.String value);
partial void OnCompanyNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -609,7 +609,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _ContactName;
partial void OnContactNameChanging(global::System.String value);
partial void OnContactNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -633,7 +633,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _ContactTitle;
partial void OnContactTitleChanging(global::System.String value);
partial void OnContactTitleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -657,7 +657,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _Address;
partial void OnAddressChanging(global::System.String value);
partial void OnAddressChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -681,7 +681,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _City;
partial void OnCityChanging(global::System.String value);
partial void OnCityChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -705,7 +705,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _Region;
partial void OnRegionChanging(global::System.String value);
partial void OnRegionChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -729,7 +729,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _PostalCode;
partial void OnPostalCodeChanging(global::System.String value);
partial void OnPostalCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -753,7 +753,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _Country;
partial void OnCountryChanging(global::System.String value);
partial void OnCountryChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -777,7 +777,7 @@ public static Customer CreateCustomer(global::System.String customerID, global::
private global::System.String _Phone;
partial void OnPhoneChanging(global::System.String value);
partial void OnPhoneChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -803,9 +803,9 @@ public static Customer CreateCustomer(global::System.String customerID, global::
partial void OnFaxChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -827,7 +827,7 @@ public EntityCollection Orders
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -852,7 +852,7 @@ public EntityCollection CustomerDemographics
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -862,7 +862,7 @@ public EntityCollection CustomerDemographics
public partial class CustomerDemographic : EntityObject
{
#region Factory Method
-
+
///
/// Create a new CustomerDemographic object.
///
@@ -876,7 +876,7 @@ public static CustomerDemographic CreateCustomerDemographic(global::System.Strin
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -903,7 +903,7 @@ public static CustomerDemographic CreateCustomerDemographic(global::System.Strin
private global::System.String _CustomerTypeID;
partial void OnCustomerTypeIDChanging(global::System.String value);
partial void OnCustomerTypeIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -929,9 +929,9 @@ public static CustomerDemographic CreateCustomerDemographic(global::System.Strin
partial void OnCustomerDescChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -956,7 +956,7 @@ public EntityCollection Customers
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -966,7 +966,7 @@ public EntityCollection Customers
public partial class Employee : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Employee object.
///
@@ -984,7 +984,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1011,7 +1011,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.Int32 _EmployeeID;
partial void OnEmployeeIDChanging(global::System.Int32 value);
partial void OnEmployeeIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1035,7 +1035,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _LastName;
partial void OnLastNameChanging(global::System.String value);
partial void OnLastNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1059,7 +1059,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _FirstName;
partial void OnFirstNameChanging(global::System.String value);
partial void OnFirstNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1083,7 +1083,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _Title;
partial void OnTitleChanging(global::System.String value);
partial void OnTitleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1107,7 +1107,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _TitleOfCourtesy;
partial void OnTitleOfCourtesyChanging(global::System.String value);
partial void OnTitleOfCourtesyChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1131,7 +1131,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private Nullable _BirthDate;
partial void OnBirthDateChanging(Nullable value);
partial void OnBirthDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1155,7 +1155,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private Nullable _HireDate;
partial void OnHireDateChanging(Nullable value);
partial void OnHireDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1179,7 +1179,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _Address;
partial void OnAddressChanging(global::System.String value);
partial void OnAddressChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1203,7 +1203,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _City;
partial void OnCityChanging(global::System.String value);
partial void OnCityChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1227,7 +1227,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _Region;
partial void OnRegionChanging(global::System.String value);
partial void OnRegionChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1251,7 +1251,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _PostalCode;
partial void OnPostalCodeChanging(global::System.String value);
partial void OnPostalCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1275,7 +1275,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _Country;
partial void OnCountryChanging(global::System.String value);
partial void OnCountryChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1299,7 +1299,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _HomePhone;
partial void OnHomePhoneChanging(global::System.String value);
partial void OnHomePhoneChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1323,7 +1323,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _Extension;
partial void OnExtensionChanging(global::System.String value);
partial void OnExtensionChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1347,7 +1347,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.Byte[] _Photo;
partial void OnPhotoChanging(global::System.Byte[] value);
partial void OnPhotoChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1371,7 +1371,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private global::System.String _Notes;
partial void OnNotesChanging(global::System.String value);
partial void OnNotesChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1395,7 +1395,7 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
private Nullable _ReportsTo;
partial void OnReportsToChanging(Nullable value);
partial void OnReportsToChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1421,9 +1421,9 @@ public static Employee CreateEmployee(global::System.Int32 employeeID, global::S
partial void OnPhotoPathChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1445,7 +1445,7 @@ public EntityCollection Employees1
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1483,7 +1483,7 @@ public EntityReference Employee1Reference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1505,7 +1505,7 @@ public EntityCollection Orders
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1530,7 +1530,7 @@ public EntityCollection Territories
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1540,7 +1540,7 @@ public EntityCollection Territories
public partial class Order : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Order object.
///
@@ -1554,7 +1554,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1581,7 +1581,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.Int32 _OrderID;
partial void OnOrderIDChanging(global::System.Int32 value);
partial void OnOrderIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1605,7 +1605,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _CustomerID;
partial void OnCustomerIDChanging(global::System.String value);
partial void OnCustomerIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1629,7 +1629,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _EmployeeID;
partial void OnEmployeeIDChanging(Nullable value);
partial void OnEmployeeIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1653,7 +1653,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _OrderDate;
partial void OnOrderDateChanging(Nullable value);
partial void OnOrderDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1677,7 +1677,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _RequiredDate;
partial void OnRequiredDateChanging(Nullable value);
partial void OnRequiredDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1701,7 +1701,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _ShippedDate;
partial void OnShippedDateChanging(Nullable value);
partial void OnShippedDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1725,7 +1725,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _ShipVia;
partial void OnShipViaChanging(Nullable value);
partial void OnShipViaChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1749,7 +1749,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private Nullable _Freight;
partial void OnFreightChanging(Nullable value);
partial void OnFreightChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1773,7 +1773,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipName;
partial void OnShipNameChanging(global::System.String value);
partial void OnShipNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1797,7 +1797,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipAddress;
partial void OnShipAddressChanging(global::System.String value);
partial void OnShipAddressChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1821,7 +1821,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipCity;
partial void OnShipCityChanging(global::System.String value);
partial void OnShipCityChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1845,7 +1845,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipRegion;
partial void OnShipRegionChanging(global::System.String value);
partial void OnShipRegionChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1869,7 +1869,7 @@ public static Order CreateOrder(global::System.Int32 orderID)
private global::System.String _ShipPostalCode;
partial void OnShipPostalCodeChanging(global::System.String value);
partial void OnShipPostalCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1895,9 +1895,9 @@ public static Order CreateOrder(global::System.Int32 orderID)
partial void OnShipCountryChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1935,7 +1935,7 @@ public EntityReference CustomerReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1973,7 +1973,7 @@ public EntityReference EmployeeReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1995,7 +1995,7 @@ public EntityCollection Order_Details
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -2036,7 +2036,7 @@ public EntityReference ShipperReference
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -2046,7 +2046,7 @@ public EntityReference ShipperReference
public partial class Order_Detail : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Order_Detail object.
///
@@ -2068,7 +2068,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -2095,7 +2095,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
private global::System.Int32 _OrderID;
partial void OnOrderIDChanging(global::System.Int32 value);
partial void OnOrderIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2122,7 +2122,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
private global::System.Int32 _ProductID;
partial void OnProductIDChanging(global::System.Int32 value);
partial void OnProductIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2146,7 +2146,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
private global::System.Decimal _UnitPrice;
partial void OnUnitPriceChanging(global::System.Decimal value);
partial void OnUnitPriceChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2170,7 +2170,7 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
private global::System.Int16 _Quantity;
partial void OnQuantityChanging(global::System.Int16 value);
partial void OnQuantityChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2196,9 +2196,9 @@ public static Order_Detail CreateOrder_Detail(global::System.Int32 orderID, glob
partial void OnDiscountChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -2236,7 +2236,7 @@ public EntityReference OrderReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -2277,7 +2277,7 @@ public EntityReference ProductReference
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -2287,7 +2287,7 @@ public EntityReference ProductReference
public partial class Product : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Product object.
///
@@ -2305,7 +2305,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -2332,7 +2332,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Int32 _ProductID;
partial void OnProductIDChanging(global::System.Int32 value);
partial void OnProductIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2356,7 +2356,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _ProductName;
partial void OnProductNameChanging(global::System.String value);
partial void OnProductNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2380,7 +2380,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _SupplierID;
partial void OnSupplierIDChanging(Nullable value);
partial void OnSupplierIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2404,7 +2404,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _CategoryID;
partial void OnCategoryIDChanging(Nullable