diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IsDefaultAttribute/CS/defattr.cs b/samples/snippets/csharp/VS_Snippets_CLR/IsDefaultAttribute/CS/defattr.cs
index a639a4ff825..ddb7351a66e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IsDefaultAttribute/CS/defattr.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IsDefaultAttribute/CS/defattr.cs
@@ -2,10 +2,10 @@
using System;
using System.Reflection;
-namespace DefAttrCS
+namespace DefAttrCS
{
// An enumeration of animals. Start at 1 (0 = uninitialized).
- public enum Animal
+ public enum Animal
{
// Pets.
Dog = 1,
@@ -14,16 +14,16 @@ public enum Animal
}
// A custom attribute to allow a target to have a pet.
- public class AnimalTypeAttribute : Attribute
+ public class AnimalTypeAttribute : Attribute
{
// The constructor is called when the attribute is set.
- public AnimalTypeAttribute(Animal pet)
+ public AnimalTypeAttribute(Animal pet)
{
thePet = pet;
}
// Provide a default constructor and make Dog the default.
- public AnimalTypeAttribute()
+ public AnimalTypeAttribute()
{
thePet = Animal.Dog;
}
@@ -32,14 +32,14 @@ public AnimalTypeAttribute()
protected Animal thePet;
// .. and show a copy to the outside world.
- public Animal Pet
+ public Animal Pet
{
get { return thePet; }
set { thePet = Pet; }
}
// Override IsDefaultAttribute to return the correct response.
- public override bool IsDefaultAttribute()
+ public override bool IsDefaultAttribute()
{
if (thePet == Animal.Dog)
return true;
@@ -48,7 +48,7 @@ public override bool IsDefaultAttribute()
}
}
- public class TestClass
+ public class TestClass
{
// Use the default constructor.
[AnimalType]
@@ -56,22 +56,22 @@ public void Method1()
{}
}
- class DemoClass
+ class DemoClass
{
- static void Main(string[] args)
+ static void Main(string[] args)
{
// Get the class type to access its metadata.
Type clsType = typeof(TestClass);
// Get type information for the method.
MethodInfo mInfo = clsType.GetMethod("Method1");
// Get the AnimalType attribute for the method.
- AnimalTypeAttribute atAttr =
+ AnimalTypeAttribute atAttr =
(AnimalTypeAttribute)Attribute.GetCustomAttribute(mInfo,
typeof(AnimalTypeAttribute));
// Check to see if the default attribute is applied.
Console.WriteLine("The attribute {0} for method {1} in class {2}",
- atAttr.Pet, mInfo.Name, clsType.Name);
- Console.WriteLine("{0} the default for the AnimalType attribute.",
+ atAttr.Pet, mInfo.Name, clsType.Name);
+ Console.WriteLine("{0} the default for the AnimalType attribute.",
atAttr.IsDefaultAttribute() ? "is" : "is not");
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id1.cs b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id1.cs
index 920366daab7..f2da4104514 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id1.cs
@@ -17,7 +17,7 @@ static void Main(string[] args)
// Store the assembly's name.
String assyName = assy.GetName().Name;
// See if the Assembly Description is defined.
- bool isdef = Attribute.IsDefined(assy,
+ bool isdef = Attribute.IsDefined(assy,
typeof(AssemblyDescriptionAttribute));
if (isdef)
{
@@ -25,16 +25,16 @@ static void Main(string[] args)
Console.WriteLine("The AssemblyDescription attribute " +
"is defined for assembly {0}.", assyName);
// Get the description attribute itself.
- AssemblyDescriptionAttribute adAttr =
+ AssemblyDescriptionAttribute adAttr =
(AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(
assy, typeof(AssemblyDescriptionAttribute));
// Display the description.
if (adAttr != null)
- Console.WriteLine("The description is \"{0}\".",
+ Console.WriteLine("The description is \"{0}\".",
adAttr.Description);
else
Console.WriteLine("The description could not " +
- "be retrieved.");
+ "be retrieved.");
}
else
Console.WriteLine("The AssemblyDescription attribute is not " +
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id2.cs b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id2.cs
index 9a7c3352084..c5f3a6fa60a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id2.cs
@@ -13,7 +13,7 @@ static void Main(string[] args)
// Get the class type to access its metadata.
Type clsType = typeof(DemoClass);
// See if the Debuggable attribute is defined for this module.
- bool isDef = Attribute.IsDefined(clsType.Module,
+ bool isDef = Attribute.IsDefined(clsType.Module,
typeof(DebuggableAttribute));
// Display the result.
Console.WriteLine("The Debuggable attribute {0} " +
@@ -25,7 +25,7 @@ static void Main(string[] args)
{
// Retrieve the attribute itself.
DebuggableAttribute dbgAttr = (DebuggableAttribute)
- Attribute.GetCustomAttribute(clsType.Module,
+ Attribute.GetCustomAttribute(clsType.Module,
typeof(DebuggableAttribute));
if (dbgAttr != null)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id3.cs b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id3.cs
index f0100a2df77..f91e787c7a5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id3.cs
@@ -3,17 +3,17 @@
using System.Reflection;
using System.Runtime.InteropServices;
-namespace IsDef3CS
+namespace IsDef3CS
{
// Assign a Guid attribute to a class.
[Guid("BF235B41-52D1-46cc-9C55-046793DB363F")]
- public class TestClass
+ public class TestClass
{
}
- public class DemoClass
+ public class DemoClass
{
- static void Main(string[] args)
+ static void Main(string[] args)
{
// Get the class type to access its metadata.
Type clsType = typeof(TestClass);
@@ -23,15 +23,15 @@ static void Main(string[] args)
Console.WriteLine("The Guid attribute {0} defined for class {1}.",
isDef ? "is" : "is not", clsType.Name);
// If it's defined, display the GUID.
- if (isDef)
+ if (isDef)
{
- GuidAttribute guidAttr =
- (GuidAttribute)Attribute.GetCustomAttribute(clsType,
+ GuidAttribute guidAttr =
+ (GuidAttribute)Attribute.GetCustomAttribute(clsType,
typeof(GuidAttribute));
if (guidAttr != null)
Console.WriteLine("GUID: {" + guidAttr.Value + "}.");
else
- Console.WriteLine("The Guid attribute could " +
+ Console.WriteLine("The Guid attribute could " +
"not be retrieved.");
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id4.cs b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id4.cs
index 49a9babf68d..b878e8a2976 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id4.cs
@@ -2,9 +2,9 @@
using System;
using System.Reflection;
-namespace IsDef4CS
+namespace IsDef4CS
{
- public class TestClass
+ public class TestClass
{
// Assign the Obsolete attribute to a method.
[Obsolete("This method is obsolete. Use Method2 instead.")]
@@ -14,9 +14,9 @@ public void Method2()
{}
}
- public class DemoClass
+ public class DemoClass
{
- static void Main(string[] args)
+ static void Main(string[] args)
{
// Get the class type to access its metadata.
Type clsType = typeof(TestClass);
@@ -28,10 +28,10 @@ static void Main(string[] args)
Console.WriteLine("The Obsolete Attribute {0} defined for {1} of class {2}.",
isDef ? "is" : "is not", mInfo.Name, clsType.Name);
// If it's defined, display the attribute's message.
- if (isDef)
+ if (isDef)
{
- ObsoleteAttribute obsAttr =
- (ObsoleteAttribute)Attribute.GetCustomAttribute(
+ ObsoleteAttribute obsAttr =
+ (ObsoleteAttribute)Attribute.GetCustomAttribute(
mInfo, typeof(ObsoleteAttribute));
if (obsAttr != null)
Console.WriteLine("The message is: \"{0}\".",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id5.cs b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id5.cs
index 5fa26be1ff7..1bce8793ae8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IsDefined/CS/id5.cs
@@ -2,18 +2,18 @@
using System;
using System.Reflection;
-namespace IsDef5CS
+namespace IsDef5CS
{
- public class TestClass
+ public class TestClass
{
// Assign a ParamArray attribute to the parameter using the keyword.
public void Method1(params String[] args)
{}
}
- public class DemoClass
+ public class DemoClass
{
- static void Main(string[] args)
+ static void Main(string[] args)
{
// Get the class type to access its metadata.
Type clsType = typeof(TestClass);
@@ -21,16 +21,16 @@ static void Main(string[] args)
MethodInfo mInfo = clsType.GetMethod("Method1");
// Get the ParameterInfo array for the method parameters.
ParameterInfo[] pInfo = mInfo.GetParameters();
- if (pInfo != null)
+ if (pInfo != null)
{
// See if the ParamArray attribute is defined.
- bool isDef = Attribute.IsDefined(pInfo[0],
+ bool isDef = Attribute.IsDefined(pInfo[0],
typeof(ParamArrayAttribute));
// Display the result.
Console.WriteLine("The ParamArray attribute {0} defined for " +
"parameter {1} of method {2}.",
isDef ? "is" : "is not",
- pInfo[0].Name,
+ pInfo[0].Name,
mInfo.Name);
}
else
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/IsolatedStoragePermissionAttribute/CS/IsolatedStoragePermissionAttribute.cs b/samples/snippets/csharp/VS_Snippets_CLR/IsolatedStoragePermissionAttribute/CS/IsolatedStoragePermissionAttribute.cs
index 5d57c959e2b..1a4f6233e3f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/IsolatedStoragePermissionAttribute/CS/IsolatedStoragePermissionAttribute.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/IsolatedStoragePermissionAttribute/CS/IsolatedStoragePermissionAttribute.cs
@@ -1,14 +1,14 @@
-//Types:System.Security.Permissions.IsolatedStorageContainment (enum)
-//Types:System.Security.Permissions.IsolatedStoragePermissionAttribute
-//Types:System.Security.Permissions.SecurityAction
+//Types:System.Security.Permissions.IsolatedStorageContainment (enum)
+//Types:System.Security.Permissions.IsolatedStoragePermissionAttribute
+//Types:System.Security.Permissions.SecurityAction
//
using System;
using System.Security.Permissions;
using System.IO.IsolatedStorage;
using System.IO;
-// Notify the CLR to only grant IsolatedStorageFilePermission to called methods.
-// This restricts the called methods to working only with storage files that are isolated
+// Notify the CLR to only grant IsolatedStorageFilePermission to called methods.
+// This restricts the called methods to working only with storage files that are isolated
// by user and assembly.
[IsolatedStorageFilePermission(SecurityAction.PermitOnly, UsageAllowed = IsolatedStorageContainment.AssemblyIsolationByUser)]
public sealed class App
@@ -20,7 +20,7 @@ static void Main()
private static void WriteIsolatedStorage()
{
// Attempt to create a storage file that is isolated by user and assembly.
- // IsolatedStorageFilePermission granted to the attribute at the top of this file
+ // IsolatedStorageFilePermission granted to the attribute at the top of this file
// allows CLR to load this assembly and execution of this statement.
using (Stream s = new IsolatedStorageFileStream("AssemblyData", FileMode.Create, IsolatedStorageFile.GetUserStoreForAssembly()))
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollection/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollection/cs/source.cs
index a9dcef277c0..bdee61f6908 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollection/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollection/cs/source.cs
@@ -4,23 +4,23 @@
using System.Collections.ObjectModel;
// This class represents a very simple keyed list of OrderItems,
-// inheriting most of its behavior from the KeyedCollection and
+// inheriting most of its behavior from the KeyedCollection and
// Collection classes. The immediate base class is the constructed
// type KeyedCollection. When you inherit
-// from KeyedCollection, the second generic type argument is the
+// from KeyedCollection, the second generic type argument is the
// type that you want to store in the collection -- in this case
// OrderItem. The first type argument is the type that you want
-// to use as a key. Its values must be calculated from OrderItem;
+// to use as a key. Its values must be calculated from OrderItem;
// in this case it is the int field PartNumber, so SimpleOrder
// inherits KeyedCollection.
//
public class SimpleOrder : KeyedCollection
{
-
+
// This is the only method that absolutely must be overridden,
// because without it the KeyedCollection cannot extract the
- // keys from the items. The input parameter type is the
- // second generic type argument, in this case OrderItem, and
+ // keys from the items. The input parameter type is the
+ // second generic type argument, in this case OrderItem, and
// the return value type is the first generic type argument,
// in this case int.
//
@@ -32,7 +32,7 @@ protected override int GetKeyForItem(OrderItem item)
}
public class Demo
-{
+{
public static void Main()
{
SimpleOrder weekly = new SimpleOrder();
@@ -43,18 +43,18 @@ public static void Main()
weekly.Add(new OrderItem(110072675, "Sprocket", 27, 5.3));
weekly.Add(new OrderItem(101030411, "Motor", 10, 237.5));
weekly.Add(new OrderItem(110072684, "Gear", 175, 5.17));
-
+
Display(weekly);
-
- // The Contains method of KeyedCollection takes the key,
+
+ // The Contains method of KeyedCollection takes the key,
// type, in this case int.
//
- Console.WriteLine("\nContains(101030411): {0}",
+ Console.WriteLine("\nContains(101030411): {0}",
weekly.Contains(101030411));
// The default Item property of KeyedCollection takes a key.
//
- Console.WriteLine("\nweekly[101030411].Description: {0}",
+ Console.WriteLine("\nweekly[101030411].Description: {0}",
weekly[101030411].Description);
// The Remove method of KeyedCollection takes a key.
@@ -63,7 +63,7 @@ public static void Main()
weekly.Remove(101030411);
Display(weekly);
- // The Insert method, inherited from Collection, takes an
+ // The Insert method, inherited from Collection, takes an
// index and an OrderItem.
//
Console.WriteLine("\nInsert(2, New OrderItem(...))");
@@ -72,9 +72,9 @@ public static void Main()
// The default Item property is overloaded. One overload comes
// from KeyedCollection; that overload
- // is read-only, and takes Integer because it retrieves by key.
- // The other overload comes from Collection, the
- // base class of KeyedCollection; it
+ // is read-only, and takes Integer because it retrieves by key.
+ // The other overload comes from Collection, the
+ // base class of KeyedCollection; it
// retrieves by index, so it also takes an Integer. The compiler
// uses the most-derived overload, from KeyedCollection, so the
// only way to access SimpleOrder by index is to cast it to
@@ -82,17 +82,17 @@ public static void Main()
// as a key, and KeyNotFoundException is thrown.
//
Collection coweekly = weekly;
- Console.WriteLine("\ncoweekly[2].Description: {0}",
+ Console.WriteLine("\ncoweekly[2].Description: {0}",
coweekly[2].Description);
-
+
Console.WriteLine("\ncoweekly[2] = new OrderItem(...)");
coweekly[2] = new OrderItem(127700026, "Crank", 27, 5.98);
OrderItem temp = coweekly[2];
- // The IndexOf method inherited from Collection
+ // The IndexOf method inherited from Collection
// takes an OrderItem instead of a key
- //
+ //
Console.WriteLine("\nIndexOf(temp): {0}", weekly.IndexOf(temp));
// The inherited Remove method also takes an OrderItem.
@@ -105,7 +105,7 @@ public static void Main()
weekly.RemoveAt(0);
Display(weekly);
}
-
+
private static void Display(SimpleOrder order)
{
Console.WriteLine();
@@ -116,43 +116,43 @@ private static void Display(SimpleOrder order)
}
}
-// This class represents a simple line item in an order. All the
+// This class represents a simple line item in an order. All the
// values are immutable except quantity.
-//
+//
public class OrderItem
{
public readonly int PartNumber;
public readonly string Description;
public readonly double UnitPrice;
-
+
private int _quantity = 0;
-
- public OrderItem(int partNumber, string description,
+
+ public OrderItem(int partNumber, string description,
int quantity, double unitPrice)
{
this.PartNumber = partNumber;
this.Description = description;
this.Quantity = quantity;
this.UnitPrice = unitPrice;
- }
-
- public int Quantity
+ }
+
+ public int Quantity
{
get { return _quantity; }
set
{
if (value<0)
throw new ArgumentException("Quantity cannot be negative.");
-
+
_quantity = value;
}
}
-
+
public override string ToString()
{
return String.Format(
- "{0,9} {1,6} {2,-12} at {3,8:#,###.00} = {4,10:###,###.00}",
- PartNumber, _quantity, Description, UnitPrice,
+ "{0,9} {1,6} {2,-12} at {3,8:#,###.00} = {4,10:###,###.00}",
+ PartNumber, _quantity, Description, UnitPrice,
UnitPrice * _quantity);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollection2/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollection2/cs/source.cs
index 08fcc2a8195..a3f2bfc36d4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollection2/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollection2/cs/source.cs
@@ -4,8 +4,8 @@
using System.Collections.ObjectModel;
// This class derives from KeyedCollection and shows how to override
-// the protected ClearItems, InsertItem, RemoveItem, and SetItem
-// methods in order to change the behavior of the default Item
+// the protected ClearItems, InsertItem, RemoveItem, and SetItem
+// methods in order to change the behavior of the default Item
// property and the Add, Clear, Insert, and Remove methods. The
// class implements a Changed event, which is raised by all the
// protected methods.
@@ -13,7 +13,7 @@
// SimpleOrder is a collection of OrderItem objects, and its key
// is the PartNumber field of OrderItem. PartNumber is an Integer,
// so SimpleOrder inherits KeyedCollection.
-// (Note that the key of OrderItem cannot be changed; if it could
+// (Note that the key of OrderItem cannot be changed; if it could
// be changed, SimpleOrder would have to override ChangeItemKey.)
//
public class SimpleOrder : KeyedCollection
@@ -22,14 +22,14 @@ public class SimpleOrder : KeyedCollection
// This parameterless constructor calls the base class constructor
// that specifies a dictionary threshold of 0, so that the internal
- // dictionary is created as soon as an item is added to the
+ // dictionary is created as soon as an item is added to the
// collection.
//
public SimpleOrder() : base(null, 0) {}
-
+
// This is the only method that absolutely must be overridden,
// because without it the KeyedCollection cannot extract the
- // keys from the items.
+ // keys from the items.
//
protected override int GetKeyForItem(OrderItem item)
{
@@ -102,7 +102,7 @@ public class SimpleOrderChangedEventArgs : EventArgs
public ChangeType ChangeType { get { return _changeType; }}
public OrderItem ReplacedWith { get { return _replacedWith; }}
- public SimpleOrderChangedEventArgs(ChangeType change,
+ public SimpleOrderChangedEventArgs(ChangeType change,
OrderItem item, OrderItem replacement)
{
_changeType = change;
@@ -113,18 +113,18 @@ public SimpleOrderChangedEventArgs(ChangeType change,
public enum ChangeType
{
- Added,
- Removed,
- Replaced,
+ Added,
+ Removed,
+ Replaced,
Cleared
};
public class Demo
-{
+{
public static void Main()
{
SimpleOrder weekly = new SimpleOrder();
- weekly.Changed += new
+ weekly.Changed += new
EventHandler(ChangedHandler);
// The Add method, inherited from Collection, takes OrderItem.
@@ -135,16 +135,16 @@ public static void Main()
weekly.Add(new OrderItem(110072684, "Gear", 175, 5.17));
Display(weekly);
-
+
// The Contains method of KeyedCollection takes TKey.
//
- Console.WriteLine("\nContains(101030411): {0}",
+ Console.WriteLine("\nContains(101030411): {0}",
weekly.Contains(101030411));
// The default Item property of KeyedCollection takes the key
// type, Integer. The property is read-only.
//
- Console.WriteLine("\nweekly[101030411].Description: {0}",
+ Console.WriteLine("\nweekly[101030411].Description: {0}",
weekly[101030411].Description);
// The Remove method of KeyedCollection takes a key.
@@ -152,17 +152,17 @@ public static void Main()
Console.WriteLine("\nRemove(101030411)");
weekly.Remove(101030411);
- // The Insert method, inherited from Collection, takes an
+ // The Insert method, inherited from Collection, takes an
// index and an OrderItem.
//
Console.WriteLine("\nInsert(2, new OrderItem(...))");
weekly.Insert(2, new OrderItem(111033401, "Nut", 10, .5));
-
+
// The default Item property is overloaded. One overload comes
// from KeyedCollection; that overload
- // is read-only, and takes Integer because it retrieves by key.
- // The other overload comes from Collection, the
- // base class of KeyedCollection; it
+ // is read-only, and takes Integer because it retrieves by key.
+ // The other overload comes from Collection, the
+ // base class of KeyedCollection; it
// retrieves by index, so it also takes an Integer. The compiler
// uses the most-derived overload, from KeyedCollection, so the
// only way to access SimpleOrder by index is to cast it to
@@ -170,17 +170,17 @@ public static void Main()
// as a key, and KeyNotFoundException is thrown.
//
Collection coweekly = weekly;
- Console.WriteLine("\ncoweekly[2].Description: {0}",
+ Console.WriteLine("\ncoweekly[2].Description: {0}",
coweekly[2].Description);
-
+
Console.WriteLine("\ncoweekly[2] = new OrderItem(...)");
coweekly[2] = new OrderItem(127700026, "Crank", 27, 5.98);
OrderItem temp = coweekly[2];
- // The IndexOf method, inherited from Collection,
+ // The IndexOf method, inherited from Collection,
// takes an OrderItem instead of a key.
- //
+ //
Console.WriteLine("\nIndexOf(temp): {0}", weekly.IndexOf(temp));
// The inherited Remove method also takes an OrderItem.
@@ -193,8 +193,8 @@ public static void Main()
// Increase the quantity for a line item.
Console.WriteLine("\ncoweekly(1) = New OrderItem(...)");
- coweekly[1] = new OrderItem(coweekly[1].PartNumber,
- coweekly[1].Description, coweekly[1].Quantity + 1000,
+ coweekly[1] = new OrderItem(coweekly[1].PartNumber,
+ coweekly[1].Description, coweekly[1].Quantity + 1000,
coweekly[1].UnitPrice);
Display(weekly);
@@ -202,7 +202,7 @@ public static void Main()
Console.WriteLine();
weekly.Clear();
}
-
+
private static void Display(SimpleOrder order)
{
Console.WriteLine();
@@ -212,7 +212,7 @@ private static void Display(SimpleOrder order)
}
}
- private static void ChangedHandler(object source,
+ private static void ChangedHandler(object source,
SimpleOrderChangedEventArgs e)
{
@@ -223,8 +223,8 @@ private static void ChangedHandler(object source,
OrderItem replacement = e.ReplacedWith;
Console.WriteLine("{0} (quantity {1}) was replaced " +
- "by {2}, (quantity {3}).", item.Description,
- item.Quantity, replacement.Description,
+ "by {2}, (quantity {3}).", item.Description,
+ item.Quantity, replacement.Description,
replacement.Quantity);
}
else if(e.ChangeType == ChangeType.Cleared)
@@ -233,28 +233,28 @@ private static void ChangedHandler(object source,
}
else
{
- Console.WriteLine("{0} (quantity {1}) was {2}.",
+ Console.WriteLine("{0} (quantity {1}) was {2}.",
item.Description, item.Quantity, e.ChangeType);
}
}
}
-// This class represents a simple line item in an order. All the
+// This class represents a simple line item in an order. All the
// values are immutable except quantity.
-//
+//
public class OrderItem
{
private int _partNumber;
private string _description;
private double _unitPrice;
private int _quantity;
-
+
public int PartNumber { get { return _partNumber; }}
public string Description { get { return _description; }}
public double UnitPrice { get { return _unitPrice; }}
public int Quantity { get { return _quantity; }}
-
- public OrderItem(int partNumber, string description, int quantity,
+
+ public OrderItem(int partNumber, string description, int quantity,
double unitPrice)
{
_partNumber = partNumber;
@@ -262,12 +262,12 @@ public OrderItem(int partNumber, string description, int quantity,
_quantity = quantity;
_unitPrice = unitPrice;
}
-
+
public override string ToString()
{
return String.Format(
- "{0,9} {1,6} {2,-12} at {3,8:#,###.00} = {4,10:###,###.00}",
- PartNumber, _quantity, Description, UnitPrice,
+ "{0,9} {1,6} {2,-12} at {3,8:#,###.00} = {4,10:###,###.00}",
+ PartNumber, _quantity, Description, UnitPrice,
UnitPrice * _quantity);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollectionMutable/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollectionMutable/cs/source.cs
index bbb905baae4..7cb02d98695 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollectionMutable/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/KeyedCollectionMutable/cs/source.cs
@@ -4,9 +4,9 @@
using System.Collections.ObjectModel;
// This class demonstrates one way to use the ChangeItemKey
-// method to store objects with keys that can be changed. The
+// method to store objects with keys that can be changed. The
// ChangeItemKey method is used to keep the internal lookup
-// Dictionary in sync with the keys of the stored objects.
+// Dictionary in sync with the keys of the stored objects.
//
// MutableKeys stores MutableKey objects, which have an Integer
// Key property that can be set. Therefore, MutableKeys inherits
@@ -14,13 +14,13 @@
//
public class MutableKeys : KeyedCollection
{
- // This parameterless constructor delegates to the base class
+ // This parameterless constructor delegates to the base class
// constructor that specifies a dictionary threshold. A
// threshold of 0 means the internal Dictionary is created
// the first time an object is added.
//
public MutableKeys() : base(null, 0) {}
-
+
protected override int GetKeyForItem(MutableKey item)
{
// The key is MutableKey.Key.
@@ -29,7 +29,7 @@ protected override int GetKeyForItem(MutableKey item)
protected override void InsertItem(int index, MutableKey newItem)
{
- if (newItem.Collection != null)
+ if (newItem.Collection != null)
throw new ArgumentException("The item already belongs to a collection.");
base.InsertItem(index, newItem);
@@ -40,7 +40,7 @@ protected override void SetItem(int index, MutableKey newItem)
{
MutableKey replaced = Items[index];
- if (newItem.Collection != null)
+ if (newItem.Collection != null)
throw new ArgumentException("The item already belongs to a collection.");
base.SetItem(index, newItem);
@@ -62,7 +62,7 @@ protected override void ClearItems()
{
mk.Collection = null;
}
-
+
base.ClearItems();
}
@@ -70,7 +70,7 @@ internal void ChangeKey(MutableKey item, int newKey)
{
base.ChangeItemKey(item, newKey);
}
-
+
public void Dump()
{
Console.WriteLine("\nDUMP:");
@@ -111,7 +111,7 @@ public static void Main()
mkeys.Add(new MutableKey(110072675, "Sprocket"));
mkeys.Dump();
-
+
Console.WriteLine("\nCreate and insert a new item:");
MutableKey test = new MutableKey(110072684, "Gear");
mkeys.Insert(1, test);
@@ -145,7 +145,7 @@ public static void Main()
mkeys.Dump();
}
-
+
private static void Display(MutableKeys order)
{
Console.WriteLine();
@@ -157,7 +157,7 @@ private static void Display(MutableKeys order)
}
// This class has a key that can be changed.
-//
+//
public class MutableKey
{
@@ -166,12 +166,12 @@ public MutableKey(int newKey, string newValue)
_key = newKey;
Value = newValue;
} //New
-
+
public string Value;
internal MutableKeys Collection;
-
+
private int _key;
- public int Key
+ public int Key
{
get
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/LCIDConversionAttributeSample2/CS/lcidattrsample.cs b/samples/snippets/csharp/VS_Snippets_CLR/LCIDConversionAttributeSample2/CS/lcidattrsample.cs
index 72670874906..7accf2327fe 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/LCIDConversionAttributeSample2/CS/lcidattrsample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/LCIDConversionAttributeSample2/CS/lcidattrsample.cs
@@ -1,5 +1,5 @@
namespace LCIDConversion
-{
+{
//
using System;
using System.Runtime.InteropServices;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/LayoutKind/CS/layoutkind.cs b/samples/snippets/csharp/VS_Snippets_CLR/LayoutKind/CS/layoutkind.cs
index ff51b17b50b..ec800a9ff89 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/LayoutKind/CS/layoutkind.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/LayoutKind/CS/layoutkind.cs
@@ -1,7 +1,7 @@
/*
System.Runtime.InteropServices.LayoutKind.Sequential
System.Runtime.InteropServices.LayoutKind.Explicit
-
+
The program shows a managed declaration of the PtInRect function and defines Point
structure with sequential layout and Rect structure with explicit layout. The PtInRect
checks the point lies within the rectangle or not.
@@ -19,20 +19,20 @@ enum Bool
True
};
[StructLayout(LayoutKind.Sequential)]
- public struct Point
+ public struct Point
{
public int x;
public int y;
- }
+ }
[StructLayout(LayoutKind.Explicit)]
- public struct Rect
+ public struct Rect
{
[FieldOffset(0)] public int left;
[FieldOffset(4)] public int top;
[FieldOffset(8)] public int right;
[FieldOffset(12)] public int bottom;
- }
+ }
internal static class NativeMethods
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/List`1_ConvertAll/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/List`1_ConvertAll/cs/source.cs
index afd2ddf3bc7..bd14f3e27a2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/List`1_ConvertAll/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/List`1_ConvertAll/cs/source.cs
@@ -19,7 +19,7 @@ public static void Main()
Console.WriteLine(p);
}
- List lp = lpf.ConvertAll(
+ List lp = lpf.ConvertAll(
new Converter(PointFToPoint));
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/List`1_FindEtAl/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/List`1_FindEtAl/cs/source.cs
index e5c1595a4b4..586966f94e0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/List`1_FindEtAl/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/List`1_FindEtAl/cs/source.cs
@@ -26,7 +26,7 @@ public static void Main()
Console.WriteLine("\nTrueForAll(EndsWithSaurus): {0}",
dinosaurs.TrueForAll(EndsWithSaurus));
- Console.WriteLine("\nFind(EndsWithSaurus): {0}",
+ Console.WriteLine("\nFind(EndsWithSaurus): {0}",
dinosaurs.Find(EndsWithSaurus));
Console.WriteLine("\nFindLast(EndsWithSaurus): {0}",
@@ -41,7 +41,7 @@ public static void Main()
}
Console.WriteLine(
- "\n{0} elements removed by RemoveAll(EndsWithSaurus).",
+ "\n{0} elements removed by RemoveAll(EndsWithSaurus).",
dinosaurs.RemoveAll(EndsWithSaurus));
Console.WriteLine("\nList now contains:");
@@ -50,7 +50,7 @@ public static void Main()
Console.WriteLine(dinosaur);
}
- Console.WriteLine("\nExists(EndsWithSaurus): {0}",
+ Console.WriteLine("\nExists(EndsWithSaurus): {0}",
dinosaurs.Exists(EndsWithSaurus));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/List`1_IndexOf/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/List`1_IndexOf/cs/source.cs
index d6c59822b60..7c17e556b74 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/List`1_IndexOf/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/List`1_IndexOf/cs/source.cs
@@ -22,13 +22,13 @@ public static void Main()
Console.WriteLine(dinosaur);
}
- Console.WriteLine("\nIndexOf(\"Tyrannosaurus\"): {0}",
+ Console.WriteLine("\nIndexOf(\"Tyrannosaurus\"): {0}",
dinosaurs.IndexOf("Tyrannosaurus"));
- Console.WriteLine("\nIndexOf(\"Tyrannosaurus\", 3): {0}",
+ Console.WriteLine("\nIndexOf(\"Tyrannosaurus\", 3): {0}",
dinosaurs.IndexOf("Tyrannosaurus", 3));
- Console.WriteLine("\nIndexOf(\"Tyrannosaurus\", 2, 2): {0}",
+ Console.WriteLine("\nIndexOf(\"Tyrannosaurus\", 2, 2): {0}",
dinosaurs.IndexOf("Tyrannosaurus", 2, 2));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/List`1_LastIndexOf/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/List`1_LastIndexOf/cs/source.cs
index 61831c1fc88..3d93a97e77e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/List`1_LastIndexOf/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/List`1_LastIndexOf/cs/source.cs
@@ -22,13 +22,13 @@ public static void Main()
Console.WriteLine(dinosaur);
}
- Console.WriteLine("\nLastIndexOf(\"Tyrannosaurus\"): {0}",
+ Console.WriteLine("\nLastIndexOf(\"Tyrannosaurus\"): {0}",
dinosaurs.LastIndexOf("Tyrannosaurus"));
- Console.WriteLine("\nLastIndexOf(\"Tyrannosaurus\", 3): {0}",
+ Console.WriteLine("\nLastIndexOf(\"Tyrannosaurus\", 3): {0}",
dinosaurs.LastIndexOf("Tyrannosaurus", 3));
- Console.WriteLine("\nLastIndexOf(\"Tyrannosaurus\", 4, 4): {0}",
+ Console.WriteLine("\nLastIndexOf(\"Tyrannosaurus\", 4, 4): {0}",
dinosaurs.LastIndexOf("Tyrannosaurus", 4, 4));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/List`1_Ranges/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/List`1_Ranges/cs/source.cs
index 6e7dddab73c..e45e8117988 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/List`1_Ranges/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/List`1_Ranges/cs/source.cs
@@ -6,8 +6,8 @@ public class Example
{
public static void Main()
{
- string[] input = { "Brachiosaurus",
- "Amargasaurus",
+ string[] input = { "Brachiosaurus",
+ "Amargasaurus",
"Mamenchisaurus" };
List dinosaurs = new List(input);
@@ -38,8 +38,8 @@ public static void Main()
Console.WriteLine(dinosaur);
}
- input = new string[] { "Tyrannosaurus",
- "Deinonychus",
+ input = new string[] { "Tyrannosaurus",
+ "Deinonychus",
"Velociraptor"};
Console.WriteLine("\nInsertRange(3, input)");
@@ -53,7 +53,7 @@ public static void Main()
Console.WriteLine("\noutput = dinosaurs.GetRange(2, 3).ToArray()");
string[] output = dinosaurs.GetRange(2, 3).ToArray();
-
+
Console.WriteLine();
foreach( string dinosaur in output )
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortComparison/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortComparison/cs/source.cs
index 11b889cf52e..035709fd891 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortComparison/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortComparison/cs/source.cs
@@ -11,13 +11,13 @@ private static int CompareDinosByLength(string x, string y)
if (y == null)
{
// If x is null and y is null, they're
- // equal.
+ // equal.
return 0;
}
else
{
// If x is null and y is not null, y
- // is greater.
+ // is greater.
return -1;
}
}
@@ -32,7 +32,7 @@ private static int CompareDinosByLength(string x, string y)
}
else
{
- // ...and y is not null, compare the
+ // ...and y is not null, compare the
// lengths of the two strings.
//
int retval = x.Length.CompareTo(y.Length);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearch/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearch/cs/source.cs
index 6e27d47b6df..004a83eca7e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearch/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearch/cs/source.cs
@@ -57,7 +57,7 @@ public static void Main()
/* This code example produces the following output:
Initial list:
-
+
Pachycephalosaurus
Amargasaurus
Mamenchisaurus
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearchComparer/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearchComparer/cs/source.cs
index d0ec670212e..99c8601c95a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearchComparer/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearchComparer/cs/source.cs
@@ -11,13 +11,13 @@ public int Compare(string x, string y)
if (y == null)
{
// If x is null and y is null, they're
- // equal.
+ // equal.
return 0;
}
else
{
// If x is null and y is not null, y
- // is greater.
+ // is greater.
return -1;
}
}
@@ -32,7 +32,7 @@ public int Compare(string x, string y)
}
else
{
- // ...and y is not null, compare the
+ // ...and y is not null, compare the
// lengths of the two strings.
//
int retval = x.Length.CompareTo(y.Length);
@@ -86,7 +86,7 @@ public static void Main()
Display(dinosaurs);
}
- private static void SearchAndInsert(List list,
+ private static void SearchAndInsert(List list,
string insert, DinoComparer dc)
{
Console.WriteLine("\nBinarySearch and Insert \"{0}\":", insert);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearchComparerRange/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearchComparerRange/cs/source.cs
index 0b70d758aae..f059ed19af4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearchComparerRange/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/List`1_SortSearchComparerRange/cs/source.cs
@@ -11,13 +11,13 @@ public int Compare(string x, string y)
if (y == null)
{
// If x is null and y is null, they're
- // equal.
+ // equal.
return 0;
}
else
{
// If x is null and y is not null, y
- // is greater.
+ // is greater.
return -1;
}
}
@@ -32,7 +32,7 @@ public int Compare(string x, string y)
}
else
{
- // ...and y is not null, compare the
+ // ...and y is not null, compare the
// lengths of the two strings.
//
int retval = x.Length.CompareTo(y.Length);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/LocalBuilder_Sample_SetLocalSymInfo/CS/localbuilder_sample_4.cs b/samples/snippets/csharp/VS_Snippets_CLR/LocalBuilder_Sample_SetLocalSymInfo/CS/localbuilder_sample_4.cs
index f22efe02b97..c7e0695f6ba 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/LocalBuilder_Sample_SetLocalSymInfo/CS/localbuilder_sample_4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/LocalBuilder_Sample_SetLocalSymInfo/CS/localbuilder_sample_4.cs
@@ -28,28 +28,28 @@ public static void Main()
AssemblyName myAssemblyName = new AssemblyName();
myAssemblyName.Name = "SampleAssembly";
- AssemblyBuilder myAssembly =
- Thread.GetDomain().DefineDynamicAssembly(myAssemblyName,
+ AssemblyBuilder myAssembly =
+ Thread.GetDomain().DefineDynamicAssembly(myAssemblyName,
AssemblyBuilderAccess.RunAndSave);
// Create a module. For a single-file assembly the module
// name is usually the same as the assembly name.
- ModuleBuilder myModule =
- myAssembly.DefineDynamicModule(myAssemblyName.Name,
+ ModuleBuilder myModule =
+ myAssembly.DefineDynamicModule(myAssemblyName.Name,
myAssemblyName.Name + ".dll", true);
// Define a public class 'Example'.
- TypeBuilder myTypeBuilder =
+ TypeBuilder myTypeBuilder =
myModule.DefineType("Example", TypeAttributes.Public);
// Create the 'Function1' public method, which takes an integer
// and returns a string.
MethodBuilder myMethod = myTypeBuilder.DefineMethod("Function1",
- MethodAttributes.Public | MethodAttributes.Static,
+ MethodAttributes.Public | MethodAttributes.Static,
typeof(String), new Type[] { typeof(int) });
// Generate IL for 'Function1'. The function body demonstrates
- // assigning an argument to a local variable, assigning a
+ // assigning an argument to a local variable, assigning a
// constant string to a local variable, and putting the contents
// of local variables on the stack.
ILGenerator myMethodIL = myMethod.GetILGenerator();
@@ -83,7 +83,7 @@ public static void Main()
Console.WriteLine( "'{0}' is created.", myAssemblyName.Name + ".dll" );
// Invoke 'Function1' method of 'Example', passing the value 42.
- Object myObject2 = myType1.InvokeMember("Function1",
+ Object myObject2 = myType1.InvokeMember("Function1",
BindingFlags.InvokeMethod, null, null, new Object[] { 42 });
Console.WriteLine("Example.Function1 returned: {0}", myObject2);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/MAC3DES/CS/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/MAC3DES/CS/program.cs
index db71659f1f7..a3f5ab2e24c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/MAC3DES/CS/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/MAC3DES/CS/program.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 (MACTripleDES hmac = new MACTripleDES(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/MakeXxxGenericTypeParameterBuilder/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/MakeXxxGenericTypeParameterBuilder/CS/source.cs
index 00ffa85330d..4360207fae7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/MakeXxxGenericTypeParameterBuilder/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/MakeXxxGenericTypeParameterBuilder/CS/source.cs
@@ -13,28 +13,28 @@ public static void Main()
// AssemblyBuilderAccess.Save is specified.
//
AppDomain myDomain = AppDomain.CurrentDomain;
- AssemblyName myAsmName = new
+ AssemblyName myAsmName = new
AssemblyName("MakeXxxGenericTypeParameterExample");
AssemblyBuilder myAssembly = myDomain.DefineDynamicAssembly(
myAsmName, AssemblyBuilderAccess.Save);
// An assembly is made up of executable modules. For a single-
- // module assembly, the module name and file name are the same
- // as the assembly name.
+ // module assembly, the module name and file name are the same
+ // as the assembly name.
//
ModuleBuilder myModule = myAssembly.DefineDynamicModule(
myAsmName.Name, myAsmName.Name + ".dll");
// Define the sample type.
- TypeBuilder myType = myModule.DefineType("Sample",
+ TypeBuilder myType = myModule.DefineType("Sample",
TypeAttributes.Public | TypeAttributes.Abstract);
// Make the sample type a generic type, by defining a type
// parameter T. All type parameters are defined at the same
// time, by passing an array containing the type parameter
- // names.
+ // names.
string[] typeParamNames = {"T"};
- GenericTypeParameterBuilder[] typeParams =
+ GenericTypeParameterBuilder[] typeParams =
myType.DefineGenericParameters(typeParamNames);
// Define a method that takes a ByRef argument of type T, a
@@ -42,7 +42,7 @@ public static void Main()
// method returns a two-dimensional array of type T.
//
// To create this method, you need Type objects that represent the
- // parameter types and the return type. Use the MakeByRefType,
+ // parameter types and the return type. Use the MakeByRefType,
// MakePointerType, and MakeArrayType methods to create the Type
// objects, using the generic type parameter T.
//
@@ -61,14 +61,14 @@ public static void Main()
// the TestMethod method.
//
MethodBuilder myMethodBuilder = myType.DefineMethod(
- "TestMethod",
+ "TestMethod",
MethodAttributes.Abstract | MethodAttributes.Virtual
- | MethodAttributes.Public,
- twoDimArrayType,
+ | MethodAttributes.Public,
+ twoDimArrayType,
parameterTypes);
- // Create the type and save the assembly. For a single-file
- // assembly, there is only one module to store the manifest
+ // Create the type and save the assembly. For a single-file
+ // assembly, there is only one module to store the manifest
// information in.
//
myType.CreateType();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/MakeXxxTypeBuilder/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/MakeXxxTypeBuilder/CS/source.cs
index c5ee9c08058..e29dbba2c81 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/MakeXxxTypeBuilder/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/MakeXxxTypeBuilder/CS/source.cs
@@ -15,20 +15,20 @@ public static void Main()
AppDomain myDomain = AppDomain.CurrentDomain;
AssemblyName myAsmName = new AssemblyName("MakeXxxTypeExample");
AssemblyBuilder myAssembly = myDomain.DefineDynamicAssembly(
- myAsmName,
+ myAsmName,
AssemblyBuilderAccess.Save);
// An assembly is made up of executable modules. For a single-
- // module assembly, the module name and file name are the same
- // as the assembly name.
+ // module assembly, the module name and file name are the same
+ // as the assembly name.
//
ModuleBuilder myModule = myAssembly.DefineDynamicModule(
- myAsmName.Name,
+ myAsmName.Name,
myAsmName.Name + ".dll");
// Define the sample type.
TypeBuilder myType = myModule.DefineType(
- "Sample",
+ "Sample",
TypeAttributes.Public | TypeAttributes.Abstract);
// Define a method that takes a ref argument of type Sample,
@@ -36,7 +36,7 @@ public static void Main()
// method returns a two-dimensional array of Sample objects.
//
// To create this method, you need Type objects that represent the
- // parameter types and the return type. Use the MakeByRefType,
+ // parameter types and the return type. Use the MakeByRefType,
// MakePointerType, and MakeArrayType methods to create the Type
// objects.
//
@@ -49,20 +49,20 @@ public static void Main()
Type[] parameterTypes = {byRefMyType, pointerMyType, arrayMyType};
// Define the abstract Test method. After you have compiled
- // and run this code example code, you can use ildasm.exe
+ // and run this code example code, you can use ildasm.exe
// to open MakeXxxTypeExample.dll, examine the Sample type,
// and verify the parameter types and return type of the
// TestMethod method.
//
MethodBuilder myMethodBuilder = myType.DefineMethod(
- "TestMethod",
- MethodAttributes.Abstract | MethodAttributes.Virtual
+ "TestMethod",
+ MethodAttributes.Abstract | MethodAttributes.Virtual
| MethodAttributes.Public,
twoDimArrayMyType,
parameterTypes);
- // Create the type and save the assembly. For a single-file
- // assembly, there is only one module to store the manifest
+ // Create the type and save the assembly. For a single-file
+ // assembly, there is only one module to store the manifest
// information in.
//
myType.CreateType();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Marshal/CS/Marshal.cs b/samples/snippets/csharp/VS_Snippets_CLR/Marshal/CS/Marshal.cs
index 5c0932fba82..93a38fa374a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Marshal/CS/Marshal.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Marshal/CS/Marshal.cs
@@ -13,48 +13,48 @@ public sealed class App
{
static void Main()
{
- //
+ //
// Demonstrate the use of public static fields of the Marshal class.
Console.WriteLine("SystemDefaultCharSize={0}, SystemMaxDBCSCharSize={1}",
Marshal.SystemDefaultCharSize, Marshal.SystemMaxDBCSCharSize);
//
- //
+ //
// Demonstrate the use of the SizeOf method of the Marshal class.
- Console.WriteLine("Number of bytes needed by a Point object: {0}",
+ Console.WriteLine("Number of bytes needed by a Point object: {0}",
Marshal.SizeOf(typeof(Point)));
Point p = new Point();
Console.WriteLine("Number of bytes needed by a Point object: {0}",
Marshal.SizeOf(p));
//
-
+
//
- // Demonstrate how to call GlobalAlloc and
+ // Demonstrate how to call GlobalAlloc and
// GlobalFree using the Marshal class.
IntPtr hglobal = Marshal.AllocHGlobal(100);
Marshal.FreeHGlobal(hglobal);
//
//
- // Demonstrate how to use the Marshal class to get the Win32 error
+ // Demonstrate how to use the Marshal class to get the Win32 error
// code when a Win32 method fails.
Boolean f = CloseHandle(new IntPtr(-1));
if (!f)
{
- Console.WriteLine("CloseHandle call failed with an error code of: {0}",
+ Console.WriteLine("CloseHandle call failed with an error code of: {0}",
Marshal.GetLastWin32Error());
- }
+ }
}
- // This is a platform invoke prototype. SetLastError is true, which allows
- // the GetLastWin32Error method of the Marshal class to work correctly.
+ // This is a platform invoke prototype. SetLastError is true, which allows
+ // the GetLastWin32Error method of the Marshal class to work correctly.
[DllImport("Kernel32", ExactSpelling = true, SetLastError = true)]
static extern Boolean CloseHandle(IntPtr h);
//
}
// This code produces the following output.
-//
+//
// SystemDefaultCharSize=2, SystemMaxDBCSCharSize=1
// Number of bytes needed by a Point object: 8
// Number of bytes needed by a Point object: 8
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Match/CS/match.cs b/samples/snippets/csharp/VS_Snippets_CLR/Match/CS/match.cs
index a58aecfa8ef..f8f0a056c56 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Match/CS/match.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Match/CS/match.cs
@@ -4,27 +4,27 @@
// A custom attribute to allow multiple authors per method.
[AttributeUsage(AttributeTargets.Method)]
-public class AuthorsAttribute : Attribute
+public class AuthorsAttribute : Attribute
{
protected List _authors;
- public AuthorsAttribute(params string[] names)
+ public AuthorsAttribute(params string[] names)
{
_authors = new List(names);
}
- public List Authors
+ public List Authors
{
get { return _authors; }
}
// Determine if the object is a match to this one.
- public override bool Match(object obj)
+ public override bool Match(object obj)
{
// Return false if obj is null or not an AuthorsAttribute.
AuthorsAttribute authors2 = obj as AuthorsAttribute;
if (authors2 == null) return false;
-
+
// Return true if obj and this instance are the same object reference.
if (Object.ReferenceEquals(this, authors2))
return true;
@@ -32,10 +32,10 @@ public override bool Match(object obj)
// Return false if obj and this instance have different numbers of authors
if (_authors.Count != authors2._authors.Count)
return false;
-
+
bool matches = false;
- foreach (var author in _authors)
- {
+ foreach (var author in _authors)
+ {
for (int ctr = 0; ctr < authors2._authors.Count; ctr++)
{
if (author == authors2._authors[ctr])
@@ -86,21 +86,21 @@ public void Method4()
{}
}
-class Example
+class Example
{
- static void Main()
+ static void Main()
{
// Get the type for TestClass to access its metadata.
Type clsType = typeof(TestClass);
// Iterate through each method of the class.
AuthorsAttribute authors = null;
- foreach(var method in clsType.GetMethods())
+ foreach(var method in clsType.GetMethods())
{
// Check each method for the Authors attribute.
- AuthorsAttribute authAttr = (AuthorsAttribute) Attribute.GetCustomAttribute(method,
+ AuthorsAttribute authAttr = (AuthorsAttribute) Attribute.GetCustomAttribute(method,
typeof(AuthorsAttribute));
- if (authAttr != null)
+ if (authAttr != null)
{
// Display the authors.
Console.WriteLine($"{clsType.Name}.{method.Name} was authored by {authAttr}.");
@@ -112,7 +112,7 @@ static void Main()
Console.WriteLine();
continue;
}
-
+
// Compare first authors with the authors of this method.
if (authors.Match(authAttr))
{
@@ -128,13 +128,13 @@ static void Main()
}
// The example displays the following output:
// TestClass.Method1 was authored by Leo Tolstoy, John Milton.
-//
+//
// TestClass.Method2 was authored by Anonymous.
// Leo Tolstoy, John Milton <> Anonymous
-//
+//
// TestClass.Method3 was authored by Leo Tolstoy, John Milton, Nathaniel Hawthorne.
// Leo Tolstoy, John Milton <> Leo Tolstoy, John Milton, Nathaniel Hawthorne
-//
+//
// TestClass.Method4 was authored by John Milton, Leo Tolstoy.
// TestClass.Method1 was also authored by the same team.
// Leo Tolstoy, John Milton <> John Milton, Leo Tolstoy
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/MemoryFailPoint/CS/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/MemoryFailPoint/CS/program.cs
index 0fe0332383f..6d310709acd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/MemoryFailPoint/CS/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/MemoryFailPoint/CS/program.cs
@@ -75,10 +75,10 @@ static void Main()
}
catch (InsufficientMemoryException e)
{
- // MemoryFailPoint threw an exception, handle by sleeping for a while, then
+ // MemoryFailPoint threw an exception, handle by sleeping for a while, then
// continue processing the queue.
Console.WriteLine("Expected InsufficientMemoryException thrown. Message: " + e.Message);
- // We could optionally sleep until a running worker thread
+ // We could optionally sleep until a running worker thread
// has finished, like this: threads[joinCount++].Join();
Thread.Sleep(1000);
}
@@ -138,7 +138,7 @@ static void ThreadMethod(Object o)
Console.WriteLine("Unexpected OutOfMemory exception thrown: " + oom);
}
- // Do work here, possibly taking a lock if this app needs
+ // Do work here, possibly taking a lock if this app needs
// synchronization between worker threads and/or the main thread.
// Keep the thread alive for awhile to simulate a running thread.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/MethodBody/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/MethodBody/CS/source.cs
index e9847f54666..6393ad64aea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/MethodBody/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/MethodBody/CS/source.cs
@@ -23,11 +23,11 @@ public static void Main()
MethodBody mb = mi.GetMethodBody();
Console.WriteLine("\r\nMethod: {0}", mi);
- // Display the general information included in the
+ // Display the general information included in the
// MethodBody object.
- Console.WriteLine(" Local variables are initialized: {0}",
+ Console.WriteLine(" Local variables are initialized: {0}",
mb.InitLocals);
- Console.WriteLine(" Maximum number of items on the operand stack: {0}",
+ Console.WriteLine(" Maximum number of items on the operand stack: {0}",
mb.MaxStackSize);
//
//
@@ -49,18 +49,18 @@ public static void Main()
Console.WriteLine(ehc.Flags.ToString());
// The FilterOffset property is meaningful only for Filter
- // clauses. The CatchType property is not meaningful for
- // Filter or Finally clauses.
+ // clauses. The CatchType property is not meaningful for
+ // Filter or Finally clauses.
switch (ehc.Flags)
{
case ExceptionHandlingClauseOptions.Filter:
- Console.WriteLine(" Filter Offset: {0}",
+ Console.WriteLine(" Filter Offset: {0}",
ehc.FilterOffset);
break;
case ExceptionHandlingClauseOptions.Finally:
break;
default:
- Console.WriteLine(" Type of exception: {0}",
+ Console.WriteLine(" Type of exception: {0}",
ehc.CatchType);
break;
}
@@ -79,14 +79,14 @@ public static void Main()
public void MethodBodyExample(object arg)
{
// Define some local variables. In addition to these variables,
- // the local variable list includes the variables scoped to
+ // the local variable list includes the variables scoped to
// the catch clauses.
int var1 = 42;
string var2 = "Forty-two";
try
{
- // Depending on the input value, throw an ArgumentException or
+ // Depending on the input value, throw an ArgumentException or
// an ArgumentNullException to test the Catch clauses.
if (arg == null)
{
@@ -95,12 +95,12 @@ public void MethodBodyExample(object arg)
if (arg.GetType() == typeof(string))
{
throw new ArgumentException("The argument cannot be a string.");
- }
+ }
}
// This filter clause selects only exceptions that derive
- // from the ArgumentException class.
- // Other exceptions, including ArgumentException itself,
+ // from the ArgumentException class.
+ // Other exceptions, including ArgumentException itself,
// are not handled by this filter clause.
catch (ArgumentException ex) when (ex.GetType().IsSubclassOf(typeof(ArgumentException)))
{
@@ -111,9 +111,9 @@ public void MethodBodyExample(object arg)
// any other class derived from Exception.
catch(Exception ex)
{
- Console.WriteLine("Ordinary exception-handling clause caught: {0}",
+ Console.WriteLine("Ordinary exception-handling clause caught: {0}",
ex.GetType());
- }
+ }
finally
{
var1 = 3033;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/MethodBuilder.MakeGenericMethod/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/MethodBuilder.MakeGenericMethod/cs/source.cs
index a67c1021f07..fc35521b1eb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/MethodBuilder.MakeGenericMethod/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/MethodBuilder.MakeGenericMethod/cs/source.cs
@@ -9,11 +9,11 @@ public static void Main()
{
// Define a transient dynamic assembly (only to run, not
// to save) with one module and a type "Test".
- //
+ //
AssemblyName aName = new AssemblyName("MyDynamic");
- AssemblyBuilder ab =
+ AssemblyBuilder ab =
AppDomain.CurrentDomain.DefineDynamicAssembly(
- aName,
+ aName,
AssemblyBuilderAccess.Run);
ModuleBuilder mb = ab.DefineDynamicModule(aName.Name);
TypeBuilder tb = mb.DefineType("Test");
@@ -21,12 +21,12 @@ public static void Main()
// Add a public static method "M" to Test, and make it a
// generic method with one type parameter named "T").
//
- MethodBuilder meb = tb.DefineMethod("M",
+ MethodBuilder meb = tb.DefineMethod("M",
MethodAttributes.Public | MethodAttributes.Static);
- GenericTypeParameterBuilder[] typeParams =
+ GenericTypeParameterBuilder[] typeParams =
meb.DefineGenericParameters(new string[] { "T" });
- // Give the method one parameter, of type T, and a
+ // Give the method one parameter, of type T, and a
// return type of T.
meb.SetParameters(typeParams);
meb.SetReturnType(typeParams[0]);
@@ -36,7 +36,7 @@ public static void Main()
// does not yet have a body, and the enclosing type is not
// created.
MethodInfo mi = meb.MakeGenericMethod(typeof(string));
- // Note that this is actually a subclass of MethodInfo,
+ // Note that this is actually a subclass of MethodInfo,
// which has rather limited capabilities -- for
// example, you cannot reflect on its parameters.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/MethodBuilderClass_TypeSample/CS/methodbuilderclass.cs b/samples/snippets/csharp/VS_Snippets_CLR/MethodBuilderClass_TypeSample/CS/methodbuilderclass.cs
index d219c953d01..dd5dbc2558f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/MethodBuilderClass_TypeSample/CS/methodbuilderclass.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/MethodBuilderClass_TypeSample/CS/methodbuilderclass.cs
@@ -36,7 +36,7 @@ public static void Main()
// Define a public string field named 'myField'.
FieldBuilder myField = myTypeBuilder.DefineField("MyDynamicField",
typeof(String), FieldAttributes.Public);
-
+
// Define the dynamic method 'MyDynamicMethod'.
MethodBuilder myMethodBuilder = myTypeBuilder.DefineMethod("MyDynamicMethod",
MethodAttributes.Private, typeof(int), new Type[] {});
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/MethodInfo.Generics/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/MethodInfo.Generics/CS/source.cs
index c99ae653654..c65df69dfcd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/MethodInfo.Generics/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/MethodInfo.Generics/CS/source.cs
@@ -28,7 +28,7 @@ public static void Main()
DisplayGenericMethodInfo(mi);
- // Assign the int type to the type parameter of the Example
+ // Assign the int type to the type parameter of the Example
// method.
//
MethodInfo miConstructed = mi.MakeGenericMethod(typeof(int));
@@ -52,23 +52,23 @@ public static void Main()
miDef == mi);
//
}
-
+
private static void DisplayGenericMethodInfo(MethodInfo mi)
{
Console.WriteLine("\r\n{0}", mi);
//
- Console.WriteLine("\tIs this a generic method definition? {0}",
+ Console.WriteLine("\tIs this a generic method definition? {0}",
mi.IsGenericMethodDefinition);
//
//
- Console.WriteLine("\tIs it a generic method? {0}",
+ Console.WriteLine("\tIs it a generic method? {0}",
mi.IsGenericMethod);
//
//
- Console.WriteLine("\tDoes it have unassigned generic parameters? {0}",
+ Console.WriteLine("\tDoes it have unassigned generic parameters? {0}",
mi.ContainsGenericParameters);
//
@@ -79,7 +79,7 @@ private static void DisplayGenericMethodInfo(MethodInfo mi)
{
Type[] typeArguments = mi.GetGenericArguments();
- Console.WriteLine("\tList type arguments ({0}):",
+ Console.WriteLine("\tList type arguments ({0}):",
typeArguments.Length);
foreach (Type tParam in typeArguments)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.Registry.GetSet/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.Registry.GetSet/CS/source.cs
index 468ddc33285..da1e00238be 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.Registry.GetSet/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.Registry.GetSet/CS/source.cs
@@ -27,7 +27,7 @@ public static void Main()
Registry.SetValue(keyName, "TestExpand2", "My path: %path%",
RegistryValueKind.ExpandString);
- // Arrays of strings are stored automatically as
+ // Arrays of strings are stored automatically as
// MultiString. Similarly, arrays of Byte are stored
// automatically as Binary.
string[] strings = {"One", "Two", "Three"};
@@ -35,12 +35,12 @@ public static void Main()
// Your default value is returned if the name/value pair
// does not exist.
- string noSuch = (string) Registry.GetValue(keyName,
+ string noSuch = (string) Registry.GetValue(keyName,
"NoSuchName",
"Return this default if NoSuchName does not exist.");
Console.WriteLine("\r\nNoSuchName: {0}", noSuch);
- // Retrieve the int and long values, specifying
+ // Retrieve the int and long values, specifying
// numeric default values in case the name/value pairs
// do not exist. The int value is retrieved from the
// default (nameless) name/value pair for the key.
@@ -51,7 +51,7 @@ public static void Main()
Console.WriteLine("TestLong: {0}", tLong);
// When retrieving a MultiString value, you can specify
- // an array for the default return value.
+ // an array for the default return value.
string[] tArray = (string[]) Registry.GetValue(keyName,
"TestArray",
new string[] {"Default if TestArray does not exist."});
@@ -63,7 +63,7 @@ public static void Main()
// A string with embedded environment variables is not
// expanded if it was stored as an ordinary string.
string tExpand = (string) Registry.GetValue(keyName,
- "TestExpand",
+ "TestExpand",
"Default if TestExpand does not exist.");
Console.WriteLine("TestExpand: {0}", tExpand);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey.OpenRemoteBaseKey/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey.OpenRemoteBaseKey/CS/source.cs
index a33db10d74b..86f84357fed 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey.OpenRemoteBaseKey/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey.OpenRemoteBaseKey/CS/source.cs
@@ -11,7 +11,7 @@ static void Main(string[] args)
RegistryKey environmentKey;
string remoteName;
- // Check that an argument was specified when the
+ // Check that an argument was specified when the
// program was invoked.
if(args.Length == 0)
{
@@ -27,7 +27,7 @@ static void Main(string[] args)
try
{
- // Open HKEY_CURRENT_USER\Environment
+ // Open HKEY_CURRENT_USER\Environment
// on a remote computer.
environmentKey = RegistryKey.OpenRemoteBaseKey(
RegistryHive.CurrentUser, remoteName).OpenSubKey(
@@ -35,18 +35,18 @@ static void Main(string[] args)
}
catch(IOException e)
{
- Console.WriteLine("{0}: {1}",
+ Console.WriteLine("{0}: {1}",
e.GetType().Name, e.Message);
return;
}
// Print the values.
- Console.WriteLine("\nThere are {0} values for {1}.",
- environmentKey.ValueCount.ToString(),
+ Console.WriteLine("\nThere are {0} values for {1}.",
+ environmentKey.ValueCount.ToString(),
environmentKey.Name);
foreach(string valueName in environmentKey.GetValueNames())
{
- Console.WriteLine("{0,-20}: {1}", valueName,
+ Console.WriteLine("{0,-20}: {1}", valueName,
environmentKey.GetValue(valueName).ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey.SetValue1/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey.SetValue1/CS/source.cs
index 397dc021448..95dfaf1d7d3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey.SetValue1/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey.SetValue1/CS/source.cs
@@ -43,7 +43,7 @@ public static void Main()
}
Console.WriteLine();
break;
-
+
case RegistryValueKind.Binary :
byte[] bytes = (byte[]) rk.GetValue(s);
Console.Write("\r\n {0} ({1}) = {2:X2}", s, rvk, bytes[0]);
@@ -54,7 +54,7 @@ public static void Main()
}
Console.WriteLine();
break;
-
+
default :
Console.WriteLine("\r\n {0} ({1}) = {2}", s, rvk, rk.GetValue(s));
break;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CS/source.cs
index b9ce1466e50..557119e6bea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CS/source.cs
@@ -8,11 +8,11 @@ class RegKey
static void Main()
{
// Create a subkey named Test9999 under HKEY_CURRENT_USER.
- RegistryKey test9999 =
+ RegistryKey test9999 =
Registry.CurrentUser.CreateSubKey("Test9999");
// Create two subkeys under HKEY_CURRENT_USER\Test9999. The
// keys are disposed when execution exits the using statement.
- using(RegistryKey
+ using(RegistryKey
testName = test9999.CreateSubKey("TestName"),
testSettings = test9999.CreateSubKey("TestSettings"))
{
@@ -24,18 +24,18 @@ static void Main()
//
// Print the information from the Test9999 subkey.
- Console.WriteLine("There are {0} subkeys under {1}.",
+ Console.WriteLine("There are {0} subkeys under {1}.",
test9999.SubKeyCount.ToString(), test9999.Name);
foreach(string subKeyName in test9999.GetSubKeyNames())
{
- using(RegistryKey
+ using(RegistryKey
tempKey = test9999.OpenSubKey(subKeyName))
{
- Console.WriteLine("\nThere are {0} values for {1}.",
+ Console.WriteLine("\nThere are {0} values for {1}.",
tempKey.ValueCount.ToString(), tempKey.Name);
foreach(string valueName in tempKey.GetValueNames())
{
- Console.WriteLine("{0,-8}: {1}", valueName,
+ Console.WriteLine("{0,-8}: {1}", valueName,
tempKey.GetValue(valueName).ToString());
}
}
@@ -43,7 +43,7 @@ static void Main()
//
//
- using(RegistryKey
+ using(RegistryKey
testSettings = test9999.OpenSubKey("TestSettings", true))
{
// Delete the ID value.
@@ -61,12 +61,12 @@ static void Main()
if(Char.ToUpper(Convert.ToChar(Console.Read())) == 'Y')
{
Registry.CurrentUser.DeleteSubKeyTree("Test9999");
- Console.WriteLine("\nRegistry key {0} deleted.",
+ Console.WriteLine("\nRegistry key {0} deleted.",
test9999.Name);
}
else
{
- Console.WriteLine("\nRegistry key {0} closed.",
+ Console.WriteLine("\nRegistry key {0} closed.",
test9999.ToString());
test9999.Close();
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryValueKind/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryValueKind/CS/source.cs
index fff321a364b..66161799134 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryValueKind/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.RegistryValueKind/CS/source.cs
@@ -12,7 +12,7 @@ public static void Main()
// Create name/value pairs.
- // This overload supports QWord (long) values.
+ // This overload supports QWord (long) values.
rk.SetValue("QuadWordValue", 42, RegistryValueKind.QWord);
// The following SetValue calls have the same effect as using the
@@ -46,7 +46,7 @@ public static void Main()
}
Console.WriteLine();
break;
-
+
case RegistryValueKind.Binary :
byte[] bytes = (byte[]) rk.GetValue(s);
Console.Write("\r\n {0} ({1}) =", s, rvk);
@@ -57,7 +57,7 @@ public static void Main()
}
Console.WriteLine();
break;
-
+
default :
Console.WriteLine("\r\n {0} ({1}) = {2}", s, rvk, rk.GetValue(s));
break;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeFileHandle.ctor/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeFileHandle.ctor/cs/sample.cs
index a33e32a1e1f..5c7fc11ecbb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeFileHandle.ctor/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeFileHandle.ctor/cs/sample.cs
@@ -61,7 +61,7 @@ public void Load(string Path)
handleValue = new SafeFileHandle(ptr, true);
// If the handle is invalid,
- // get the last Win32 error
+ // get the last Win32 error
// and throw a Win32Exception.
if (handleValue.IsInvalid)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeFileHandle/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeFileHandle/cs/sample.cs
index b59a48a1190..93cb311ac35 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeFileHandle/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeFileHandle/cs/sample.cs
@@ -22,7 +22,7 @@ static void Main()
}
}
-class UnmanagedFileLoader
+class UnmanagedFileLoader
{
public const short FILE_ATTRIBUTE_NORMAL = 0x80;
@@ -59,7 +59,7 @@ public void Load(string Path)
handleValue = CreateFile(Path, GENERIC_WRITE, 0, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);
// If the handle is invalid,
- // get the last Win32 error
+ // get the last Win32 error
// and throw a Win32Exception.
if (handleValue.IsInvalid)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeWaitHandle-ctor/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeWaitHandle-ctor/cs/sample.cs
index e5957e40796..062170998a5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeWaitHandle-ctor/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeWaitHandle-ctor/cs/sample.cs
@@ -31,7 +31,7 @@ static void Main()
}
}
-class UnmanagedMutex
+class UnmanagedMutex
{
// Use interop to call the CreateMutex function.
@@ -66,7 +66,7 @@ public void Create()
handleValue = new SafeWaitHandle(ptr, true);
// If the handle is invalid,
- // get the last Win32 error
+ // get the last Win32 error
// and throw a Win32Exception.
if (handleValue.IsInvalid)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeWaitHandle/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeWaitHandle/cs/sample.cs
index 6582101272a..c97b29ddd15 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeWaitHandle/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Microsoft.Win32.SafeHandles.SafeWaitHandle/cs/sample.cs
@@ -31,7 +31,7 @@ static void Main()
}
}
-class UnmanagedMutex
+class UnmanagedMutex
{
// Use interop to call the CreateMutex function.
@@ -67,7 +67,7 @@ public void Create()
true, nameValue);
// If the handle is invalid,
- // get the last Win32 error
+ // get the last Win32 error
// and throw a Win32Exception.
if (handleValue.IsInvalid)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Module.MethodResolve/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Module.MethodResolve/cs/source.cs
index 1b12cf81f37..64c76e93157 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Module.MethodResolve/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Module.MethodResolve/cs/source.cs
@@ -7,15 +7,15 @@ namespace ResolveMethodExample
// Metadata tokens for the MethodRefs that are to be resolved.
// If you change this program, some or all of these metadata tokens might
// change. The new token values can be discovered by compiling the example
- // and examining the assembly with Ildasm.exe, using the /TOKENS option.
- // Recompile the program after correcting the token values.
+ // and examining the assembly with Ildasm.exe, using the /TOKENS option.
+ // Recompile the program after correcting the token values.
enum Tokens
{
Case1 = 0x2b000001,
Case2 = 0x0A000006,
Case3 = 0x2b000002,
Case4 = 0x06000006,
- Case5 = 0x2b000002
+ Case5 = 0x2b000002
}
class G1
@@ -28,31 +28,31 @@ class G2
{
public void GM2 (Tg2 param1, Tgm2 param2)
{
- // Case 1: A generic method call that depends on its generic
+ // Case 1: A generic method call that depends on its generic
// context, because it uses the type parameters of the enclosing
- // generic type G2 and the enclosing generic method GM2. The token
+ // generic type G2 and the enclosing generic method GM2. The token
// for the MethodSpec is Tokens.Case1.
G1 g = new G1();
g.GM1(param1, param2);
- // Case 2: A non-generic method call that depends on its generic
+ // Case 2: A non-generic method call that depends on its generic
// context, because it uses the type parameter of the enclosing
// generic type G2. The token for the MemberRef is Tokens.Case2.
g.M1(param1);
- // Case 3: A generic method call that does not depend on its generic
+ // Case 3: A generic method call that does not depend on its generic
// context, because it does not use type parameters of the enclosing
// generic type or method. The token for the MethodSpec is Tokens.Case3.
G1 gi = new G1();
gi.GM1
}
-
+
public AssemblyBuilder MyAssembly
{
get
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineEnum/CS/modulebuilder_defineenum.cs b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineEnum/CS/modulebuilder_defineenum.cs
index b5f6aecf23e..63fa7d30de7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineEnum/CS/modulebuilder_defineenum.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineEnum/CS/modulebuilder_defineenum.cs
@@ -9,21 +9,21 @@ public static void Main()
{
// Get the current application domain for the current thread.
AppDomain currentDomain = AppDomain.CurrentDomain;
-
- // Create a dynamic assembly in the current application domain,
+
+ // Create a dynamic assembly in the current application domain,
// and allow it to be executed and saved to disk.
AssemblyName aName = new AssemblyName("TempAssembly");
AssemblyBuilder ab = currentDomain.DefineDynamicAssembly(
aName, AssemblyBuilderAccess.RunAndSave);
-
+
// Define a dynamic module in "TempAssembly" assembly. For a single-
// module assembly, the module has the same name as the assembly.
ModuleBuilder mb = ab.DefineDynamicModule(aName.Name, aName.Name + ".dll");
-
- // Define a public enumeration with the name "Elevation" and an
+
+ // Define a public enumeration with the name "Elevation" and an
// underlying type of Integer.
EnumBuilder eb = mb.DefineEnum("Elevation", TypeAttributes.Public, typeof(int));
-
+
// Define two members, "High" and "Low".
eb.DefineLiteral("Low", 0);
eb.DefineLiteral("High", 1);
@@ -42,6 +42,6 @@ public static void Main()
/* This code example produces the following output:
Elevation.Low = 0
-Elevation.High = 1
+Elevation.High = 1
*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineInitializedData/CS/modulebuilder_defineinitializeddata.cs b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineInitializedData/CS/modulebuilder_defineinitializeddata.cs
index b5dad5b1290..db0f3566288 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineInitializedData/CS/modulebuilder_defineinitializeddata.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineInitializedData/CS/modulebuilder_defineinitializeddata.cs
@@ -1,9 +1,9 @@
// System.Reflection.Emit.ModuleBuilder.DefineInitializedData
/*
-The following example demonstrates the 'DefineInitializedData' method of
+The following example demonstrates the 'DefineInitializedData' method of
'ModuleBuilder' class.
-A dynamic assembly with a module in it is created in 'CodeGenerator' class.
+A dynamic assembly with a module in it is created in 'CodeGenerator' class.
A initialized data field is created using 'DefineInitializedData'
method for creating the initialized data.
*/
@@ -29,7 +29,7 @@ public CodeGenerator()
myAssemblyName.Name = "TempAssembly";
// Define a dynamic assembly in the 'currentDomain'.
- myAssemblyBuilder =
+ myAssemblyBuilder =
currentDomain.DefineDynamicAssembly
(myAssemblyName, AssemblyBuilderAccess.Run);
@@ -37,7 +37,7 @@ public CodeGenerator()
myModuleBuilder = myAssemblyBuilder.DefineDynamicModule("TempModule");
// Define the initialized data field in the .sdata section of the PE file.
- FieldBuilder myFieldBuilder =
+ FieldBuilder myFieldBuilder =
myModuleBuilder.DefineInitializedData("MyField",new byte[]{01,00,01},
FieldAttributes.Static|FieldAttributes.Public);
myModuleBuilder.CreateGlobalFunctions();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefinePInvokeMethod1/CS/modulebuilder_definepinvokemethod1.cs b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefinePInvokeMethod1/CS/modulebuilder_definepinvokemethod1.cs
index 487c0f1e5fb..3d690e1a60c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefinePInvokeMethod1/CS/modulebuilder_definepinvokemethod1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefinePInvokeMethod1/CS/modulebuilder_definepinvokemethod1.cs
@@ -22,12 +22,12 @@ static void Main()
AssemblyName myAssemblyName = new AssemblyName("TempAssembly");
// Define a dynamic assembly in the current application domain.
- AssemblyBuilder myAssemblyBuilder =
+ AssemblyBuilder myAssemblyBuilder =
AppDomain.CurrentDomain.DefineDynamicAssembly(
myAssemblyName, AssemblyBuilderAccess.Run);
// Define a dynamic module in "TempAssembly" assembly.
- ModuleBuilder myModuleBuilder =
+ ModuleBuilder myModuleBuilder =
myAssemblyBuilder.DefineDynamicModule("TempModule");
Type[] paramTypes = { typeof(int), typeof(string), typeof(string), typeof(int) };
@@ -42,7 +42,7 @@ static void Main()
paramTypes,
CallingConvention.Winapi,
CharSet.Ansi);
-
+
// Add PreserveSig to the method implementation flags. NOTE: If this line
// is commented out, the return value will be zero when the method is
// invoked.
@@ -57,7 +57,7 @@ static void Main()
MethodInfo pinvokeMethod = myModuleBuilder.GetMethod("MessageBoxA");
Console.WriteLine("Testing module-level PInvoke method created with DefinePInvokeMethod...");
- Console.WriteLine("Message box returned: {0}",
+ Console.WriteLine("Message box returned: {0}",
pinvokeMethod.Invoke(null, arguments));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineResource1/CS/modulebuilder_defineresource1.cs b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineResource1/CS/modulebuilder_defineresource1.cs
index 3fe6f948f75..47a9674a616 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineResource1/CS/modulebuilder_defineresource1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineResource1/CS/modulebuilder_defineresource1.cs
@@ -4,7 +4,7 @@
The following example demonstrates the 'DefineResource(String,String)' method
of 'ModuleBuilder' class.
A dynamic assembly with a module in it is created in 'CodeGenerator' class.
-Then a managed resource is defined in the module using the 'DefineResource'
+Then a managed resource is defined in the module using the 'DefineResource'
method.
*/
//
@@ -24,15 +24,15 @@ public CodeGenerator()
myAssemblyName.Name = "TempAssembly";
// Define 'TempAssembly' assembly in the current application domain.
- AssemblyBuilder myAssemblyBuilder =
+ AssemblyBuilder myAssemblyBuilder =
currentDomain.DefineDynamicAssembly
(myAssemblyName, AssemblyBuilderAccess.RunAndSave);
// Define 'TempModule' module in 'TempAssembly' assembly.
- ModuleBuilder myModuleBuilder =
+ ModuleBuilder myModuleBuilder =
myAssemblyBuilder.DefineDynamicModule("TempModule",
"TempModule.netmodule",true);
// Define the managed embedded resource, 'MyResource' in 'TempModule'.
- IResourceWriter myResourceWriter =
+ IResourceWriter myResourceWriter =
myModuleBuilder.DefineResource("MyResource.resource","Description");
// Add resources to the resource writer.
myResourceWriter.AddResource("String 1", "First String");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineResource2/CS/modulebuilder_defineresource2.cs b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineResource2/CS/modulebuilder_defineresource2.cs
index 91c9b7a8bc6..28457463b7d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineResource2/CS/modulebuilder_defineresource2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_DefineResource2/CS/modulebuilder_defineresource2.cs
@@ -1,6 +1,6 @@
// System.Reflection.Emit.ModuleBuilder.DefineResource(String,String,ResourceAttributes)
/*
-The following example demonstrates the 'DefineResource(String,String,ResourceAttributes)'
+The following example demonstrates the 'DefineResource(String,String,ResourceAttributes)'
method of 'ModuleBuilder' class.
A dynamic assembly with a module in it is created in 'CodeGenerator' class.
Then a managed resource is defined in the module using the 'DefineResource' method.
@@ -22,16 +22,16 @@ public CodeGenerator()
myAssemblyName.Name = "TempAssembly";
// Define 'TempAssembly' assembly in the current application domain.
- AssemblyBuilder myAssemblyBuilder =
+ AssemblyBuilder myAssemblyBuilder =
currentDomain.DefineDynamicAssembly
(myAssemblyName, AssemblyBuilderAccess.RunAndSave);
// Define 'TempModule' module in 'TempAssembly' assembly.
- ModuleBuilder myModuleBuilder =
+ ModuleBuilder myModuleBuilder =
myAssemblyBuilder.DefineDynamicModule("TempModule",
"TempModule.netmodule",true);
// Define the managed embedded resource, 'MyResource' in 'TempModule'
// with the specified attribute.
- IResourceWriter writer =
+ IResourceWriter writer =
myModuleBuilder.DefineResource("MyResource.resource",
"Description",ResourceAttributes.Public);
// Add resources to the resource writer.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_GetArrayMethod/CS/modulebuilder_getarraymethod.cs b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_GetArrayMethod/CS/modulebuilder_getarraymethod.cs
index 5174781acb9..6435faefb2d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_GetArrayMethod/CS/modulebuilder_getarraymethod.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ModuleBuilder_GetArrayMethod/CS/modulebuilder_getarraymethod.cs
@@ -3,10 +3,10 @@
/*
The following example demonstrates 'GetArrayMethod' and 'GetArrayMethodToken'
methods of 'ModuleBuilder' class.
-A dynamic assembly with a module having a runtime class, 'TempClass' is created.
-This class defines a method, 'SortArray', which sorts the elements of the array
-passed to it.The 'GetArrayMethod' method is used to obtain the 'MethodInfo' object
-corresponding to the 'Sort' method of the 'Array' .The token used to identify the 'Sort'
+A dynamic assembly with a module having a runtime class, 'TempClass' is created.
+This class defines a method, 'SortArray', which sorts the elements of the array
+passed to it.The 'GetArrayMethod' method is used to obtain the 'MethodInfo' object
+corresponding to the 'Sort' method of the 'Array' .The token used to identify the 'Sort'
method in dynamic module is displayed using 'GetArrayMethodToken' method.
*/
using System;
@@ -18,7 +18,7 @@ internal class CodeGenerator
{
AssemblyBuilder myAssemblyBuilder;
internal CodeGenerator()
- {
+ {
AppDomain myCurrentDomain = AppDomain.CurrentDomain;
AssemblyName myAssemblyName = new AssemblyName();
myAssemblyName.Name = "TempAssembly";
@@ -35,7 +35,7 @@ internal CodeGenerator()
("TempClass",TypeAttributes.Public);
Type[] paramArray = {typeof(Array)};
// Add 'SortArray' method to the class, with the given signature.
- MethodBuilder myMethod = myTypeBuilder.DefineMethod("SortArray",
+ MethodBuilder myMethod = myTypeBuilder.DefineMethod("SortArray",
MethodAttributes.Public,typeof(Array),paramArray);
Type[] myArrayClass = new Type[1];
@@ -92,7 +92,7 @@ public static void Main()
Console.WriteLine("Array element {0} : {1} ",i,arrayToSort[i]);
}
object[] arguments = {arrayToSort};
- Console.WriteLine("Invoking our dynamically "
+ Console.WriteLine("Invoking our dynamically "
+ "created SortArray method...");
object myOutput=sortArray.Invoke(myObject, arguments);
String[] mySortedArray=(String[])myOutput;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/MonitorExmpl2/CS/monitor2.cs b/samples/snippets/csharp/VS_Snippets_CLR/MonitorExmpl2/CS/monitor2.cs
index d6af7e6d034..8aa9cb46d0e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/MonitorExmpl2/CS/monitor2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/MonitorExmpl2/CS/monitor2.cs
@@ -31,7 +31,7 @@ public void Enqueue(T qValue)
//
//
- // Try to add an element to the queue: Add the element to the queue
+ // Try to add an element to the queue: Add the element to the queue
// only if the lock is immediately available.
public bool TryEnqueue(T qValue)
{
@@ -57,7 +57,7 @@ public bool TryEnqueue(T qValue)
//
//
- // Try to add an element to the queue: Add the element to the queue
+ // Try to add an element to the queue: Add the element to the queue
// only if the lock becomes available during the specified time
// interval.
public bool TryEnqueue(T qValue, int waitTime)
@@ -213,7 +213,7 @@ private static void ThreadProc(object state)
}
else if (how < 48)
{
- // Even a very small wait significantly increases the success
+ // Even a very small wait significantly increases the success
// rate of the conditional enqueue operation.
if (q.TryEnqueue(what, 10))
{
@@ -240,12 +240,12 @@ private static void ThreadProc(object state)
{
result[(int)ThreadResultIndex.RemoveCt] += 1;
result[(int)ThreadResultIndex.RemovedCt] += q.Remove(what);
- }
+ }
}
results[threadNum] = result;
- if (0 == Interlocked.Decrement(ref threadsRunning))
+ if (0 == Interlocked.Decrement(ref threadsRunning))
{
StringBuilder sb = new StringBuilder(
" Thread 1 Thread 2 Thread 3 Total\n");
@@ -269,26 +269,26 @@ private static void ThreadProc(object state)
}
private static string[] titles = {
- "Enqueue ",
- "TryEnqueue succeeded ",
- "TryEnqueue failed ",
- "TryEnqueue(T, wait) succeeded ",
- "TryEnqueue(T, wait) failed ",
- "Dequeue attempts ",
- "Dequeue exceptions ",
- "Remove operations ",
+ "Enqueue ",
+ "TryEnqueue succeeded ",
+ "TryEnqueue failed ",
+ "TryEnqueue(T, wait) succeeded ",
+ "TryEnqueue(T, wait) failed ",
+ "Dequeue attempts ",
+ "Dequeue exceptions ",
+ "Remove operations ",
"Queue elements removed "};
private enum ThreadResultIndex
{
- EnqueueCt,
- TryEnqueueSucceedCt,
- TryEnqueueFailCt,
- TryEnqueueWaitSucceedCt,
- TryEnqueueWaitFailCt,
- DequeueCt,
- DequeueExCt,
- RemoveCt,
+ EnqueueCt,
+ TryEnqueueSucceedCt,
+ TryEnqueueFailCt,
+ TryEnqueueWaitSucceedCt,
+ TryEnqueueWaitFailCt,
+ DequeueCt,
+ DequeueExCt,
+ RemoveCt,
RemovedCt
};
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Multicast Delegate Introduction/CS/delegatestring.cs b/samples/snippets/csharp/VS_Snippets_CLR/Multicast Delegate Introduction/CS/delegatestring.cs
index aba07ec3fbd..4210fa3917a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Multicast Delegate Introduction/CS/delegatestring.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Multicast Delegate Introduction/CS/delegatestring.cs
@@ -4,47 +4,47 @@
class StringContainer
{
- // Define a delegate to handle string display.
+ // Define a delegate to handle string display.
public delegate void CheckAndDisplayDelegate(string str);
- // A generic list object that holds the strings.
+ // A generic list object that holds the strings.
private List container = new List();
- // A method that adds strings to the collection.
- public void AddString(string str)
+ // A method that adds strings to the collection.
+ public void AddString(string str)
{
container.Add(str);
}
- // Iterate through the strings and invoke the method(s) that the delegate points to.
- public void DisplayAllQualified(CheckAndDisplayDelegate displayDelegate)
+ // Iterate through the strings and invoke the method(s) that the delegate points to.
+ public void DisplayAllQualified(CheckAndDisplayDelegate displayDelegate)
{
foreach (var str in container) {
displayDelegate(str);
}
}
- }
+ }
-// This class defines some methods to display strings.
+// This class defines some methods to display strings.
class StringExtensions
{
- // Display a string if it starts with a consonant.
- public static void ConStart(string str)
+ // Display a string if it starts with a consonant.
+ public static void ConStart(string str)
{
if (!(str[0]=='a'||str[0]=='e'||str[0]=='i'||str[0]=='o'||str[0]=='u'))
Console.WriteLine(str);
}
// Display a string if it starts with a vowel.
- public static void VowelStart(string str)
+ public static void VowelStart(string str)
{
if ((str[0]=='a'||str[0]=='e'||str[0]=='i'||str[0]=='o'||str[0]=='u'))
Console.WriteLine(str);
}
}
-// Demonstrate the use of delegates, including the Remove and
-// Combine methods to create and modify delegate combinations.
+// Demonstrate the use of delegates, including the Remove and
+// Combine methods to create and modify delegate combinations.
class Test
{
static public void Main()
@@ -62,14 +62,14 @@ static public void Main()
StringContainer.CheckAndDisplayDelegate conStart = StringExtensions.ConStart;
StringContainer.CheckAndDisplayDelegate vowelStart = StringExtensions.VowelStart;
- // Get the list of all delegates assigned to this MulticastDelegate instance.
+ // Get the list of all delegates assigned to this MulticastDelegate instance.
Delegate[] delegateList = conStart.GetInvocationList();
Console.WriteLine("conStart contains {0} delegate(s).", delegateList.Length);
delegateList = vowelStart.GetInvocationList();
Console.WriteLine("vowelStart contains {0} delegate(s).\n", delegateList.Length);
- // Determine whether the delegates are System.Multicast delegates.
- if (conStart is System.MulticastDelegate && vowelStart is System.MulticastDelegate)
+ // Determine whether the delegates are System.Multicast delegates.
+ if (conStart is System.MulticastDelegate && vowelStart is System.MulticastDelegate)
Console.WriteLine("conStart and vowelStart are derived from MulticastDelegate.\n");
// Execute the two delegates.
@@ -79,9 +79,9 @@ static public void Main()
Console.WriteLine("Executing the vowelStart delegate:");
container.DisplayAllQualified(vowelStart);
Console.WriteLine();
-
+
// Create a new MulticastDelegate and call Combine to add two delegates.
- StringContainer.CheckAndDisplayDelegate multipleDelegates =
+ StringContainer.CheckAndDisplayDelegate multipleDelegates =
(StringContainer.CheckAndDisplayDelegate) Delegate.Combine(conStart, vowelStart);
// How many delegates does multipleDelegates contain?
@@ -105,22 +105,22 @@ static public void Main()
// The example displays the following output:
// conStart contains 1 delegate(s).
// vowelStart contains 1 delegate(s).
-//
+//
// conStart and vowelStart are derived from MulticastDelegate.
-//
+//
// Executing the conStart delegate:
// This
// multicast
// delegate
-//
+//
// Executing the vowelStart delegate:
// is
// a
// example
-//
-//
+//
+//
// multipleDelegates contains 2 delegates.
-//
+//
// Executing the multipleDelegate delegate.
// This
// is
@@ -128,7 +128,7 @@ static public void Main()
// multicast
// delegate
// example
-//
+//
// Executing the multipleDelegate delegate with two conStart delegates:
// This
// This
@@ -136,4 +136,4 @@ static public void Main()
// multicast
// delegate
// delegate
-//
+//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/NumberDecimalDigits/CS/numberdecimaldigits.cs b/samples/snippets/csharp/VS_Snippets_CLR/NumberDecimalDigits/CS/numberdecimaldigits.cs
index bcbd7959049..8b39345dceb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/NumberDecimalDigits/CS/numberdecimaldigits.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/NumberDecimalDigits/CS/numberdecimaldigits.cs
@@ -22,11 +22,11 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
-1,234.00
-1,234.0000
*/
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/NumberDecimalSeparator/CS/numberdecimalseparator.cs b/samples/snippets/csharp/VS_Snippets_CLR/NumberDecimalSeparator/CS/numberdecimalseparator.cs
index 837a73f060c..6f8bb6723d5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/NumberDecimalSeparator/CS/numberdecimalseparator.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/NumberDecimalSeparator/CS/numberdecimalseparator.cs
@@ -22,11 +22,11 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
123,456,789.00
123,456,789 00
*/
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/NumberFormatInfo/CS/NumberFormatInfo.cs b/samples/snippets/csharp/VS_Snippets_CLR/NumberFormatInfo/CS/NumberFormatInfo.cs
index 4549e6baa68..c83e79e87a8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/NumberFormatInfo/CS/NumberFormatInfo.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/NumberFormatInfo/CS/NumberFormatInfo.cs
@@ -4,18 +4,18 @@
using System.Globalization;
using System.Text;
-public sealed class App
+public sealed class App
{
- static void Main()
+ static void Main()
{
StringBuilder sb = new StringBuilder();
// Loop through all the specific cultures known to the CLR.
- foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
+ foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{
// Only show the currency symbols for cultures that speak English.
if (ci.TwoLetterISOLanguageName != "en") continue;
-
+
//
// Display the culture name and currency symbol.
NumberFormatInfo nfi = ci.NumberFormat;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSeparator/CS/numbergroupseparator.cs b/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSeparator/CS/numbergroupseparator.cs
index fc1b4068613..23243e2a762 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSeparator/CS/numbergroupseparator.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSeparator/CS/numbergroupseparator.cs
@@ -22,11 +22,11 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
123,456,789.00
123 456 789.00
*/
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSizes/CS/numbergroupsizes.cs b/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSizes/CS/numbergroupsizes.cs
index 78596230817..d0eea6b1c5e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSizes/CS/numbergroupsizes.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/NumberGroupSizes/CS/numbergroupsizes.cs
@@ -26,12 +26,12 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
123,456,789,012,345.00
12,3456,7890,123,45.00
1234567890,123,45.00
*/
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/NumberStyles/CS/NumberStyles.cs b/samples/snippets/csharp/VS_Snippets_CLR/NumberStyles/CS/NumberStyles.cs
index c4bb65ac117..2714f2dd0d8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/NumberStyles/CS/NumberStyles.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/NumberStyles/CS/NumberStyles.cs
@@ -4,9 +4,9 @@
using System.Text;
using System.Globalization;
-public sealed class App
+public sealed class App
{
- static void Main()
+ static void Main()
{
// Parse the string as a hex value and display the value as a decimal.
String num = "A";
@@ -15,7 +15,7 @@ static void Main()
// Parse the string, allowing a leading sign, and ignoring leading and trailing white spaces.
num = " -45 ";
- val = int.Parse(num, NumberStyles.AllowLeadingSign |
+ val = int.Parse(num, NumberStyles.AllowLeadingSign |
NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite);
Console.WriteLine("'{0}' parsed to an int is '{1}'.", num, val);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ObfuscateAssemblyAttribute/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/ObfuscateAssemblyAttribute/cs/source.cs
index 65bd326e7a8..a94042b4c67 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ObfuscateAssemblyAttribute/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ObfuscateAssemblyAttribute/cs/source.cs
@@ -2,7 +2,7 @@
using System;
using System.Reflection;
-[assembly: ObfuscateAssemblyAttribute(true,
+[assembly: ObfuscateAssemblyAttribute(true,
StripAfterObfuscation=false)]
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ObfuscationAttribute/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/ObfuscationAttribute/cs/source.cs
index 5917b105f84..b2f9f652338 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ObfuscationAttribute/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ObfuscationAttribute/cs/source.cs
@@ -23,9 +23,9 @@ public void MethodB() {}
}
// Exclude this type from obfuscation, but do not apply that
-// exclusion to members. The default value of the Exclude
-// property is true, so it is not necessary to specify
-// Exclude=true, although spelling it out makes your intent
+// exclusion to members. The default value of the Exclude
+// property is true, so it is not necessary to specify
+// Exclude=true, although spelling it out makes your intent
// clearer.
//
//
@@ -35,17 +35,17 @@ public class Type2
//
// The exclusion of the type is not applied to its members,
- // however in order to mark the member with the "default"
+ // however in order to mark the member with the "default"
// feature it is necessary to specify Exclude=false,
// because the default value of Exclude is true. The tool
// should not strip this attribute after obfuscation.
//
- [ObfuscationAttribute(Exclude=false, Feature="default",
+ [ObfuscationAttribute(Exclude=false, Feature="default",
StripAfterObfuscation=false)]
public void MethodA() {}
//
- // This member is marked for obfuscation, because the
+ // This member is marked for obfuscation, because the
// exclusion of the type is not applied to its members.
public void MethodB() {}
}
@@ -60,7 +60,7 @@ public static void Main()
{
// Display the ObfuscateAssemblyAttribute properties
- // for the assembly.
+ // for the assembly.
Assembly assem = typeof(Test).Assembly;
object[] assemAttrs = assem.GetCustomAttributes(
typeof(ObfuscateAssemblyAttribute), false);
@@ -94,7 +94,7 @@ public static void Main()
foreach( Attribute a in mAttrs )
{
- ShowObfuscation(((ObfuscationAttribute) a),
+ ShowObfuscation(((ObfuscationAttribute) a),
t.Name + "." + m.Name);
}
}
@@ -106,7 +106,7 @@ private static void ShowObfuscateAssembly(
ObfuscateAssemblyAttribute ob)
{
Console.WriteLine("\r\nObfuscateAssemblyAttribute properties:");
- Console.WriteLine(" AssemblyIsPrivate: {0}",
+ Console.WriteLine(" AssemblyIsPrivate: {0}",
ob.AssemblyIsPrivate);
Console.WriteLine(" StripAfterObfuscation: {0}",
ob.StripAfterObfuscation);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ObjDispEx/CS/objdispexc.cs b/samples/snippets/csharp/VS_Snippets_CLR/ObjDispEx/CS/objdispexc.cs
index 9c32d5880fb..040caa751d1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ObjDispEx/CS/objdispexc.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ObjDispEx/CS/objdispexc.cs
@@ -2,17 +2,17 @@
using System;
using System.IO;
-public class ObjectDisposedExceptionTest
+public class ObjectDisposedExceptionTest
{
public static void Main()
- {
+ {
MemoryStream ms = new MemoryStream(16);
ms.Close();
- try
+ try
{
ms.ReadByte();
- }
- catch (ObjectDisposedException e)
+ }
+ catch (ObjectDisposedException e)
{
Console.WriteLine("Caught: {0}", e.Message);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ObjectModel.Collection/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/ObjectModel.Collection/cs/source.cs
index 799abd2f1db..9b3596cccc5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ObjectModel.Collection/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ObjectModel.Collection/cs/source.cs
@@ -16,11 +16,11 @@ public static void Main()
Console.WriteLine("{0} dinosaurs:", dinosaurs.Count);
Display(dinosaurs);
-
- Console.WriteLine("\nIndexOf(\"Muttaburrasaurus\"): {0}",
+
+ Console.WriteLine("\nIndexOf(\"Muttaburrasaurus\"): {0}",
dinosaurs.IndexOf("Muttaburrasaurus"));
- Console.WriteLine("\nContains(\"Caudipteryx\"): {0}",
+ Console.WriteLine("\nContains(\"Caudipteryx\"): {0}",
dinosaurs.Contains("Caudipteryx"));
Console.WriteLine("\nInsert(2, \"Nanotyrannus\")");
@@ -45,7 +45,7 @@ public static void Main()
dinosaurs.Clear();
Console.WriteLine("Count: {0}", dinosaurs.Count);
}
-
+
private static void Display(Collection cs)
{
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ObjectModel.CollectionInherited/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/ObjectModel.CollectionInherited/cs/source.cs
index e515b10f40e..bca6e6469a1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ObjectModel.CollectionInherited/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ObjectModel.CollectionInherited/cs/source.cs
@@ -66,7 +66,7 @@ public class DinosaursChangedEventArgs : EventArgs
public readonly ChangeType ChangeType;
public readonly string ReplacedWith;
- public DinosaursChangedEventArgs(ChangeType change, string item,
+ public DinosaursChangedEventArgs(ChangeType change, string item,
string replacement)
{
ChangeType = change;
@@ -77,9 +77,9 @@ public DinosaursChangedEventArgs(ChangeType change, string item,
public enum ChangeType
{
- Added,
- Removed,
- Replaced,
+ Added,
+ Removed,
+ Replaced,
Cleared
};
@@ -89,7 +89,7 @@ public static void Main()
{
Dinosaurs dinosaurs = new Dinosaurs();
- dinosaurs.Changed += ChangedHandler;
+ dinosaurs.Changed += ChangedHandler;
dinosaurs.Add("Psitticosaurus");
dinosaurs.Add("Caudipteryx");
@@ -97,11 +97,11 @@ public static void Main()
dinosaurs.Add("Muttaburrasaurus");
Display(dinosaurs);
-
- Console.WriteLine("\nIndexOf(\"Muttaburrasaurus\"): {0}",
+
+ Console.WriteLine("\nIndexOf(\"Muttaburrasaurus\"): {0}",
dinosaurs.IndexOf("Muttaburrasaurus"));
- Console.WriteLine("\nContains(\"Caudipteryx\"): {0}",
+ Console.WriteLine("\nContains(\"Caudipteryx\"): {0}",
dinosaurs.Contains("Caudipteryx"));
Console.WriteLine("\nInsert(2, \"Nanotyrannus\")");
@@ -120,7 +120,7 @@ public static void Main()
Display(dinosaurs);
}
-
+
private static void Display(Collection cs)
{
Console.WriteLine();
@@ -130,13 +130,13 @@ private static void Display(Collection cs)
}
}
- private static void ChangedHandler(object source,
+ private static void ChangedHandler(object source,
DinosaursChangedEventArgs e)
{
if (e.ChangeType==ChangeType.Replaced)
{
- Console.WriteLine("{0} was replaced with {1}", e.ChangedItem,
+ Console.WriteLine("{0} was replaced with {1}", e.ChangedItem,
e.ReplacedWith);
}
else if(e.ChangeType==ChangeType.Cleared)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ObjectX/CS/ObjectX.cs b/samples/snippets/csharp/VS_Snippets_CLR/ObjectX/CS/ObjectX.cs
index 48c3d060896..e86083f6f65 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ObjectX/CS/ObjectX.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ObjectX/CS/ObjectX.cs
@@ -7,14 +7,14 @@ class Point
{
public int x, y;
- public Point(int x, int y)
+ public Point(int x, int y)
{
this.x = x;
this.y = y;
}
-
+
//
- public override bool Equals(object obj)
+ public override bool Equals(object obj)
{
// If this and obj do not refer to the same type, then they are not equal.
if (obj.GetType() != this.GetType()) return false;
@@ -27,7 +27,7 @@ public override bool Equals(object obj)
//
// Return the XOR of the x and y fields.
- public override int GetHashCode()
+ public override int GetHashCode()
{
return x ^ y;
}
@@ -35,7 +35,7 @@ public override int GetHashCode()
//
// Return the point's value as a string.
- public override String ToString()
+ public override String ToString()
{
return $"({x}, {y})";
}
@@ -43,7 +43,7 @@ public override String ToString()
//
// Return a copy of this point object by making a simple field copy.
- public Point Copy()
+ public Point Copy()
{
return (Point) this.MemberwiseClone();
}
@@ -52,7 +52,7 @@ public Point Copy()
public sealed class App
{
- static void Main()
+ static void Main()
{
// Construct a Point object.
var p1 = new Point(1,2);
@@ -72,11 +72,11 @@ static void Main()
// The line below displays true because p1 and p2 refer to two different objects that have the same value.
Console.WriteLine(Object.Equals(p1, p2));
//
-
+
// The line below displays true because p1 and p3 refer to one object.
Console.WriteLine(Object.ReferenceEquals(p1, p3));
-
- //
+
+ //
// The line below displays: p1's value is: (1, 2)
Console.WriteLine($"p1's value is: {p1.ToString()}");
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ObsoleteAttribute/CS/obsoleteattributeex1.cs b/samples/snippets/csharp/VS_Snippets_CLR/ObsoleteAttribute/CS/obsoleteattributeex1.cs
index 39ac6cb22f2..ab7275a2040 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ObsoleteAttribute/CS/obsoleteattributeex1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ObsoleteAttribute/CS/obsoleteattributeex1.cs
@@ -5,35 +5,35 @@
public class Example
{
// Mark OldProperty As Obsolete.
- [ObsoleteAttribute("This property is obsolete. Use NewProperty instead.", false)]
+ [ObsoleteAttribute("This property is obsolete. Use NewProperty instead.", false)]
public static string OldProperty
{ get { return "The old property value."; } }
-
+
public static string NewProperty
{ get { return "The new property value."; } }
// Mark CallOldMethod As Obsolete.
- [ObsoleteAttribute("This method is obsolete. Call CallNewMethod instead.", true)]
+ [ObsoleteAttribute("This method is obsolete. Call CallNewMethod instead.", true)]
public static string CallOldMethod()
{
return "You have called CallOldMethod.";
}
-
- public static string CallNewMethod()
- {
+
+ public static string CallNewMethod()
+ {
return "You have called CallNewMethod.";
- }
+ }
public static void Main()
- {
+ {
Console.WriteLine(OldProperty);
Console.WriteLine();
Console.WriteLine(CallOldMethod());
- }
+ }
}
// The attempt to compile this example produces output like the following output:
-// Example.cs(31,25): error CS0619: 'Example.CallOldMethod()' is obsolete:
+// Example.cs(31,25): error CS0619: 'Example.CallOldMethod()' is obsolete:
// 'This method is obsolete. Call CallNewMethod instead.'
-// Example.cs(29,25): warning CS0618: 'Example.OldProperty' is obsolete:
+// Example.cs(29,25): warning CS0618: 'Example.OldProperty' is obsolete:
// 'This property is obsolete. Use NewProperty instead.'
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/OperatingSystem.ServicePack/CS/sp.cs b/samples/snippets/csharp/VS_Snippets_CLR/OperatingSystem.ServicePack/CS/sp.cs
index 307e354b809..efeab81fc37 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/OperatingSystem.ServicePack/CS/sp.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/OperatingSystem.ServicePack/CS/sp.cs
@@ -2,9 +2,9 @@
// This example demonstrates the OperatingSystem.ServicePack property.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
OperatingSystem os = Environment.OSVersion;
String sp = os.ServicePack;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/OperatingSystem.VersionString/CS/osvs.cs b/samples/snippets/csharp/VS_Snippets_CLR/OperatingSystem.VersionString/CS/osvs.cs
index bc9441a205e..8c58538cf3d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/OperatingSystem.VersionString/CS/osvs.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/OperatingSystem.VersionString/CS/osvs.cs
@@ -2,9 +2,9 @@
// This example demonstrates the VersionString property.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
OperatingSystem os = Environment.OSVersion;
// Display the value of OperatingSystem.VersionString. By default, this is
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_Attributes1/CS/parameterinfo_attributes1.cs b/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_Attributes1/CS/parameterinfo_attributes1.cs
index cbb01fadbeb..3cd6f1f4c2c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_Attributes1/CS/parameterinfo_attributes1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_Attributes1/CS/parameterinfo_attributes1.cs
@@ -14,24 +14,24 @@ public int MyMethod( int i, out short j, ref long k)
{
j = 2;
return 0;
- }
+ }
}
public class ParameterInfo_Attributes
-{
+{
public static void Main()
{
- // Get the type.
+ // Get the type.
Type myType = typeof(MyClass1);
// Get the method named 'MyMethod' from the type.
MethodBase myMethodBase = myType.GetMethod("MyMethod");
// Get the parameters associated with the method.
ParameterInfo[] myParameters = myMethodBase.GetParameters();
- Console.WriteLine("\nThe method {0} has the {1} parameters :",
+ Console.WriteLine("\nThe method {0} has the {1} parameters :",
"ParameterInfo_Example.MyMethod", myParameters.Length);
// Print the attributes associated with each of the parameters.
for(int i = 0; i < myParameters.Length; i++)
- Console.WriteLine("\tThe {0} parameter has the attribute : {1}",
+ Console.WriteLine("\tThe {0} parameter has the attribute : {1}",
i + 1, myParameters[i].Attributes);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_GetCustomAttribute_IsDefined/CS/parameterinfo_getcustomattribute_isdefined.cs b/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_GetCustomAttribute_IsDefined/CS/parameterinfo_getcustomattribute_isdefined.cs
index 8b3bd675870..488b1619064 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_GetCustomAttribute_IsDefined/CS/parameterinfo_getcustomattribute_isdefined.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_GetCustomAttribute_IsDefined/CS/parameterinfo_getcustomattribute_isdefined.cs
@@ -11,9 +11,9 @@ public MyAttribute(string name)
{
myName = name;
}
- public string Name
+ public string Name
{
- get
+ get
{
return myName;
}
@@ -29,7 +29,7 @@ public MyDerivedAttribute(string name) : base(name) {}
// Define a class with a method that has three parameters. Apply
// MyAttribute to one parameter, MyDerivedAttribute to another, and
-// no attributes to the third.
+// no attributes to the third.
public class MyClass1
{
public void MyMethod(
@@ -43,7 +43,7 @@ public void MyMethod(
}
}
-public class MemberInfo_GetCustomAttributes
+public class MemberInfo_GetCustomAttributes
{
public static void Main()
{
@@ -65,12 +65,12 @@ public static void Main()
{
if (pi.IsDefined(typeof(MyAttribute), false))
{
- Console.WriteLine("Parameter {0}, name = {1}, type = {2}",
+ Console.WriteLine("Parameter {0}, name = {1}, type = {2}",
pi.Position, pi.Name, pi.ParameterType);
}
}
}
- }
+ }
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_GetCustomAttributes/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_GetCustomAttributes/CS/source.cs
index 5762d1ea9c0..943956c20ae 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_GetCustomAttributes/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_GetCustomAttributes/CS/source.cs
@@ -11,17 +11,17 @@ public MyAttribute(string name)
{
myName = name;
}
- public string Name
+ public string Name
{
- get
+ get
{
return myName;
}
}
}
-// Define a class which has a custom attribute associated with one of the
-// parameters of a method.
+// Define a class which has a custom attribute associated with one of the
+// parameters of a method.
public class MyClass1
{
public void MyMethod(
@@ -32,7 +32,7 @@ public void MyMethod(
}
}
-public class MemberInfo_GetCustomAttributes
+public class MemberInfo_GetCustomAttributes
{
public static void Main()
{
@@ -54,10 +54,10 @@ public static void Main()
{
// Get the attributes of type 'MyAttribute' for each parameter.
Object[] myAttributes = myParameters[j].GetCustomAttributes(typeof(MyAttribute), false);
-
+
if (myAttributes.Length > 0)
{
- Console.WriteLine("Parameter {0}, name = {1}, type = {2} has attributes: ",
+ Console.WriteLine("Parameter {0}, name = {1}, type = {2} has attributes: ",
myParameters[j].Position, myParameters[j].Name, myParameters[j].ParameterType);
for(int k = 0; k < myAttributes.Length; k++)
{
@@ -66,7 +66,7 @@ public static void Main()
}
}
}
- }
+ }
}
}
/* This code example produces the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_IsIn_IsOut_IsOptional/CS/parameterinfo_isin_isout_isoptional.cs b/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_IsIn_IsOut_IsOptional/CS/parameterinfo_isin_isout_isoptional.cs
index 1a77e63eca2..d810e3248ec 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_IsIn_IsOut_IsOptional/CS/parameterinfo_isin_isout_isoptional.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ParameterInfo_IsIn_IsOut_IsOptional/CS/parameterinfo_isin_isout_isoptional.cs
@@ -5,9 +5,9 @@
/*
The following program creates a dynamic assembly named 'MyAssembly', defines a
module named 'MyModule' within the assembly. It defines a type called 'MyType'
- within the module and also defines a static method named 'MyMethod' for the
+ within the module and also defines a static method named 'MyMethod' for the
type. This dynamic assembly is then queried for the type defined within it and
- then the attributes of all the parameters of the method named 'MyMethod' is
+ then the attributes of all the parameters of the method named 'MyMethod' is
displayed.
*/
@@ -73,13 +73,13 @@ public static void Main()
MethodBase myMethodBase = myType.GetMethod("MyMethod");
// Get the parameters associated with the method.
ParameterInfo[] myParameters = myMethodBase.GetParameters();
- Console.WriteLine("\nThe method {0} has the {1} parameters :",
+ Console.WriteLine("\nThe method {0} has the {1} parameters :",
myMethodBase, myParameters.Length);
// Print the IN, OUT and OPTIONAL attributes associated with each of the parameters.
for(int i = 0; i < myParameters.Length; i++)
{
if(myParameters[i].IsIn)
- Console.WriteLine("\tThe {0} parameter has the In attribute",
+ Console.WriteLine("\tThe {0} parameter has the In attribute",
i + 1);
if(myParameters[i].IsOptional)
Console.WriteLine("\tThe {0} parameter has the Optional attribute",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ParseMethod/cs/Default.aspx.cs b/samples/snippets/csharp/VS_Snippets_CLR/ParseMethod/cs/Default.aspx.cs
index 8f76f539dd8..fc1b6a33139 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ParseMethod/cs/Default.aspx.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ParseMethod/cs/Default.aspx.cs
@@ -21,7 +21,7 @@ protected void OkToSingle_Click(object sender, EventArgs e)
{
string locale;
float number;
- CultureInfo culture;
+ CultureInfo culture;
// Return if string is empty
if (String.IsNullOrEmpty(this.inputNumber.Text))
@@ -32,11 +32,11 @@ protected void OkToSingle_Click(object sender, EventArgs e)
return;
locale = Request.UserLanguages[0];
if (String.IsNullOrEmpty(locale))
- return;
+ return;
// Instantiate CultureInfo object for the user's locale
culture = new CultureInfo(locale);
-
+
// Convert user input from a string to a number
try
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Path Class/CS/path class.cs b/samples/snippets/csharp/VS_Snippets_CLR/Path Class/CS/path class.cs
index 3ed8e1652a0..44dfffbdd48 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Path Class/CS/path class.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Path Class/CS/path class.cs
@@ -2,26 +2,26 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
string path1 = @"c:\temp\MyTest.txt";
string path2 = @"c:\temp\MyTest";
string path3 = @"temp";
- if (Path.HasExtension(path1))
+ if (Path.HasExtension(path1))
{
Console.WriteLine("{0} has an extension.", path1);
}
- if (!Path.HasExtension(path2))
+ if (!Path.HasExtension(path2))
{
Console.WriteLine("{0} has no extension.", path2);
}
- if (!Path.IsPathRooted(path3))
+ if (!Path.IsPathRooted(path3))
{
Console.WriteLine("The string {0} contains no root information.", path3);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PercentDecimalDigits/CS/percentdecimaldigits.cs b/samples/snippets/csharp/VS_Snippets_CLR/PercentDecimalDigits/CS/percentdecimaldigits.cs
index eccfd1e36f4..c4e4e867297 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PercentDecimalDigits/CS/percentdecimaldigits.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PercentDecimalDigits/CS/percentdecimaldigits.cs
@@ -22,11 +22,11 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
12.34 %
12.3400 %
*/
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PercentDecimalSeparator/CS/percentdecimalseparator.cs b/samples/snippets/csharp/VS_Snippets_CLR/PercentDecimalSeparator/CS/percentdecimalseparator.cs
index 75b77819c3f..70981cb52db 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PercentDecimalSeparator/CS/percentdecimalseparator.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PercentDecimalSeparator/CS/percentdecimalseparator.cs
@@ -22,11 +22,11 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
12.34 %
12 34 %
*/
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PercentGroupSeparator/CS/percentgroupseparator.cs b/samples/snippets/csharp/VS_Snippets_CLR/PercentGroupSeparator/CS/percentgroupseparator.cs
index b6d2530664c..441b7105820 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PercentGroupSeparator/CS/percentgroupseparator.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PercentGroupSeparator/CS/percentgroupseparator.cs
@@ -22,11 +22,11 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
123,456.78 %
123 456.78 %
*/
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PercentGroupSizes/CS/percentgroupsizes.cs b/samples/snippets/csharp/VS_Snippets_CLR/PercentGroupSizes/CS/percentgroupsizes.cs
index b03e11dcab1..3156cc566cc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PercentGroupSizes/CS/percentgroupsizes.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PercentGroupSizes/CS/percentgroupsizes.cs
@@ -26,12 +26,12 @@ public static void Main() {
}
-/*
+/*
This code produces the following output.
12,345,678,901,234,600.00 %
1234,5678,9012,346,00.00 %
123456789012,346,00.00 %
*/
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerfCounter/CS/perfcounter.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerfCounter/CS/perfcounter.cs
index b17c6c9b9bf..301708c9810 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerfCounter/CS/perfcounter.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerfCounter/CS/perfcounter.cs
@@ -37,7 +37,7 @@ protected override void Dispose( bool disposing )
{
if( disposing )
{
- if (components != null)
+ if (components != null)
{
components.Dispose();
}
@@ -52,9 +52,9 @@ protected override void Dispose( bool disposing )
///
private void InitializeComponent()
{
- //
+ //
// Form1
- //
+ //
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Name = "Form1";
@@ -67,7 +67,7 @@ private void InitializeComponent()
/// The main entry point for the application.
///
[STAThread]
- static void Main()
+ static void Main()
{
Application.Run(new Form1());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterInstaller/CS/performancecounterinstaller.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterInstaller/CS/performancecounterinstaller.cs
index 441e2baf327..3ed3d363ccc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterInstaller/CS/performancecounterinstaller.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterInstaller/CS/performancecounterinstaller.cs
@@ -4,7 +4,7 @@ The following example demonstrates 'PerformanceCounterInstaller' class.
A class is inherited from 'Installer' having 'RunInstallerAttribute' set to true.
A new instance of 'PerformanceCounterInstaller' is created and its 'CategoryName'
is set. Then this instance is added to 'InstallerCollection'.
-Note:
+Note:
1)To run this example use the following command:
InstallUtil.exe PerformanceCounterInstaller.exe
2)To uninstall the perfomance counter use the following command:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.AverageCounter64/CS/averagecount32.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.AverageCounter64/CS/averagecount32.cs
index 57bed4a25a0..8225743db17 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.AverageCounter64/CS/averagecount32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.AverageCounter64/CS/averagecount32.cs
@@ -12,7 +12,7 @@ public class App {
public static void Main()
{
-
+
ArrayList samplesList = new ArrayList();
// If the category does not exist, create the category and exit.
@@ -29,7 +29,7 @@ public static void Main()
private static bool SetupCategory()
{
- if ( !PerformanceCounterCategory.Exists("AverageCounter64SampleCategory") )
+ if ( !PerformanceCounterCategory.Exists("AverageCounter64SampleCategory") )
{
CounterCreationDataCollection counterDataCollection = new CounterCreationDataCollection();
@@ -65,14 +65,14 @@ private static void CreateCounters()
// Create the counters.
//
- avgCounter64Sample = new PerformanceCounter("AverageCounter64SampleCategory",
- "AverageCounter64Sample",
+ avgCounter64Sample = new PerformanceCounter("AverageCounter64SampleCategory",
+ "AverageCounter64Sample",
false);
//
- avgCounter64SampleBase = new PerformanceCounter("AverageCounter64SampleCategory",
- "AverageCounter64SampleBase",
+ avgCounter64SampleBase = new PerformanceCounter("AverageCounter64SampleCategory",
+ "AverageCounter64SampleBase",
false);
avgCounter64Sample.RawValue=0;
@@ -85,7 +85,7 @@ private static void CollectSamples(ArrayList samplesList)
Random r = new Random( DateTime.Now.Millisecond );
// Loop for the samples.
- for (int j = 0; j < 100; j++)
+ for (int j = 0; j < 100; j++)
{
int value = r.Next(1, 10);
@@ -95,7 +95,7 @@ private static void CollectSamples(ArrayList samplesList)
avgCounter64SampleBase.Increment();
- if ((j % 10) == 9)
+ if ((j % 10) == 9)
{
OutputSample(avgCounter64Sample.NextSample());
samplesList.Add( avgCounter64Sample.NextSample() );
@@ -124,7 +124,7 @@ private static void CalculateResults(ArrayList samplesList)
(CounterSample)samplesList[i+1]) );
// Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
+ Console.WriteLine("My computed counter value = " +
MyComputeCounterValue((CounterSample)samplesList[i],
(CounterSample)samplesList[i+1]) );
}
@@ -132,17 +132,17 @@ private static void CalculateResults(ArrayList samplesList)
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
// Description - This counter type shows how many items are processed, on average,
- // during an operation. Counters of this type display a ratio of the items
- // processed (such as bytes sent) to the number of operations completed. The
- // ratio is calculated by comparing the number of items processed during the
- // last interval to the number of operations completed during the last interval.
+ // during an operation. Counters of this type display a ratio of the items
+ // processed (such as bytes sent) to the number of operations completed. The
+ // ratio is calculated by comparing the number of items processed during the
+ // last interval to the number of operations completed during the last interval.
// Generic type - Average
- // Formula - (N1 - N0) / (D1 - D0), where the numerator (N) represents the number
- // of items processed during the last sample interval and the denominator (D)
- // represents the number of operations completed during the last two sample
- // intervals.
- // Average (Nx - N0) / (Dx - D0)
- // Example PhysicalDisk\ Avg. Disk Bytes/Transfer
+ // Formula - (N1 - N0) / (D1 - D0), where the numerator (N) represents the number
+ // of items processed during the last sample interval and the denominator (D)
+ // represents the number of operations completed during the last two sample
+ // intervals.
+ // Average (Nx - N0) / (Dx - D0)
+ // Example PhysicalDisk\ Avg. Disk Bytes/Transfer
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.AverageTimer32/CS/averagetimer32.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.AverageTimer32/CS/averagetimer32.cs
index 51850a69846..ae9f1f025d1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.AverageTimer32/CS/averagetimer32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.AverageTimer32/CS/averagetimer32.cs
@@ -12,8 +12,8 @@
using System.Collections.Specialized;
using System.Diagnostics;
using System.Runtime.InteropServices;
-
-public class App
+
+public class App
{
private static PerformanceCounter PC;
@@ -35,7 +35,7 @@ public static void Main()
private static bool SetupCategory()
{
- if ( !PerformanceCounterCategory.Exists("AverageTimer32SampleCategory") )
+ if ( !PerformanceCounterCategory.Exists("AverageTimer32SampleCategory") )
{
CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
@@ -45,7 +45,7 @@ private static bool SetupCategory()
averageTimer32.CounterType = PerformanceCounterType.AverageTimer32;
averageTimer32.CounterName = "AverageTimer32Sample";
CCDC.Add(averageTimer32);
-
+
// Add the base counter.
CounterCreationData averageTimer32Base = new CounterCreationData();
averageTimer32Base.CounterType = PerformanceCounterType.AverageBase;
@@ -53,8 +53,8 @@ private static bool SetupCategory()
CCDC.Add(averageTimer32Base);
// Create the category.
- PerformanceCounterCategory.Create("AverageTimer32SampleCategory",
- "Demonstrates usage of the AverageTimer32 performance counter type",
+ PerformanceCounterCategory.Create("AverageTimer32SampleCategory",
+ "Demonstrates usage of the AverageTimer32 performance counter type",
CCDC);
return(true);
@@ -69,12 +69,12 @@ private static bool SetupCategory()
private static void CreateCounters()
{
// Create the counters.
- PC = new PerformanceCounter("AverageTimer32SampleCategory",
- "AverageTimer32Sample",
+ PC = new PerformanceCounter("AverageTimer32SampleCategory",
+ "AverageTimer32Sample",
false);
- BPC = new PerformanceCounter("AverageTimer32SampleCategory",
- "AverageTimer32SampleBase",
+ BPC = new PerformanceCounter("AverageTimer32SampleCategory",
+ "AverageTimer32SampleBase",
false);
PC.RawValue = 0;
@@ -90,7 +90,7 @@ private static void CollectSamples(ArrayList samplesList)
// Loop for the samples.
for (int i = 0; i < 10; i++) {
-
+
QueryPerformanceCounter(out perfTime);
PC.RawValue = perfTime;
@@ -102,7 +102,7 @@ private static void CollectSamples(ArrayList samplesList)
}
}
-
+
private static void CalculateResults(ArrayList samplesList)
{
for(int i = 0; i < (samplesList.Count - 1); i++)
@@ -112,12 +112,12 @@ private static void CalculateResults(ArrayList samplesList)
OutputSample( (CounterSample)samplesList[i+1] );
// Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
+ Console.WriteLine(".NET computed counter value = " +
CounterSample.Calculate((CounterSample)samplesList[i],
(CounterSample)samplesList[i+1]) );
// Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
+ Console.WriteLine("My computed counter value = " +
MyComputeCounterValue((CounterSample)samplesList[i],
(CounterSample)samplesList[i+1]) );
@@ -128,26 +128,26 @@ private static void CalculateResults(ArrayList samplesList)
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
// PERF_AVERAGE_TIMER
- // Description - This counter type measures the time it takes, on
+ // Description - This counter type measures the time it takes, on
// average, to complete a process or operation. Counters of this
- // type display a ratio of the total elapsed time of the sample
+ // type display a ratio of the total elapsed time of the sample
// interval to the number of processes or operations completed
- // during that time. This counter type measures time in ticks
+ // during that time. This counter type measures time in ticks
// of the system clock. The F variable represents the number of
// ticks per second. The value of F is factored into the equation
// so that the result can be displayed in seconds.
- //
+ //
// Generic type - Average
- //
+ //
// Formula - ((N1 - N0) / F) / (D1 - D0), where the numerator (N)
- // represents the number of ticks counted during the last
- // sample interval, F represents the frequency of the ticks,
+ // represents the number of ticks counted during the last
+ // sample interval, F represents the frequency of the ticks,
// and the denominator (D) represents the number of operations
// completed during the last sample interval.
- //
+ //
// Average - ((Nx - N0) / F) / (Dx - D0)
- //
- // Example - PhysicalDisk\ Avg. Disk sec/Transfer
+ //
+ // Example - PhysicalDisk\ Avg. Disk sec/Transfer
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
{
@@ -244,8 +244,8 @@ private static bool SetupCategory()
CCDC.Add(averageTimer32Base);
// Create the category.
- PerformanceCounterCategory.Create(categoryName,
- "Demonstrates usage of the AverageTimer32 performance counter type",
+ PerformanceCounterCategory.Create(categoryName,
+ "Demonstrates usage of the AverageTimer32 performance counter type",
PerformanceCounterCategoryType.SingleInstance, CCDC);
Console.WriteLine("Category created - " + categoryName);
@@ -316,26 +316,26 @@ private static void CalculateResults(ArrayList samplesList)
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
// PERF_AVERAGE_TIMER
- // Description - This counter type measures the time it takes, on
+ // Description - This counter type measures the time it takes, on
// average, to complete a process or operation. Counters of this
- // type display a ratio of the total elapsed time of the sample
+ // type display a ratio of the total elapsed time of the sample
// interval to the number of processes or operations completed
- // during that time. This counter type measures time in ticks
+ // during that time. This counter type measures time in ticks
// of the system clock. The F variable represents the number of
// ticks per second. The value of F is factored into the equation
// so that the result can be displayed in seconds.
- //
+ //
// Generic type - Average
- //
+ //
// Formula - ((N1 - N0) / F) / (D1 - D0), where the numerator (N)
- // represents the number of ticks counted during the last
- // sample interval, F represents the frequency of the ticks,
+ // represents the number of ticks counted during the last
+ // sample interval, F represents the frequency of the ticks,
// and the denominator (D) represents the number of operations
// completed during the last sample interval.
- //
+ //
// Average - ((Nx - N0) / F) / (Dx - D0)
- //
- // Example - PhysicalDisk\ Avg. Disk sec/Transfer
+ //
+ // Example - PhysicalDisk\ Avg. Disk sec/Transfer
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//+++++++
private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.ElapsedTime/CS/elapsedtime.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.ElapsedTime/CS/elapsedtime.cs
index 1da5bce0515..dd7022e674e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.ElapsedTime/CS/elapsedtime.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.ElapsedTime/CS/elapsedtime.cs
@@ -12,7 +12,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
-public class App
+public class App
{
private static PerformanceCounter PC;
@@ -29,7 +29,7 @@ public static void Main()
private static bool SetupCategory()
{
- if ( !PerformanceCounterCategory.Exists("ElapsedTimeSampleCategory") )
+ if ( !PerformanceCounterCategory.Exists("ElapsedTimeSampleCategory") )
{
CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
@@ -38,11 +38,11 @@ private static bool SetupCategory()
CounterCreationData ETimeData = new CounterCreationData();
ETimeData.CounterType = PerformanceCounterType.ElapsedTime;
ETimeData.CounterName = "ElapsedTimeSample";
- CCDC.Add(ETimeData);
+ CCDC.Add(ETimeData);
// Create the category.
- PerformanceCounterCategory.Create("ElapsedTimeSampleCategory",
- "Demonstrates usage of the ElapsedTime performance counter type.",
+ PerformanceCounterCategory.Create("ElapsedTimeSampleCategory",
+ "Demonstrates usage of the ElapsedTime performance counter type.",
CCDC);
return(true);
@@ -57,10 +57,10 @@ private static bool SetupCategory()
private static void CreateCounters()
{
// Create the counter.
- PC = new PerformanceCounter("ElapsedTimeSampleCategory",
- "ElapsedTimeSample",
+ PC = new PerformanceCounter("ElapsedTimeSampleCategory",
+ "ElapsedTimeSample",
false);
-
+
}
private static void CollectSamples(ArrayList samplesList)
@@ -75,10 +75,10 @@ private static void CollectSamples(ArrayList samplesList)
Start = DateTime.Now;
// Loop for the samples.
- for (int j = 0; j < 1000; j++)
+ for (int j = 0; j < 1000; j++)
{
// Output the values.
- if ((j % 10) == 9)
+ if ((j % 10) == 9)
{
Console.WriteLine("NextValue() = " + PC.NextValue().ToString());
Console.WriteLine("Actual elapsed time = " + DateTime.Now.Subtract(Start).ToString());
@@ -133,7 +133,7 @@ private static void OutputSample(CounterSample s)
using System.Diagnostics;
using System.Runtime.InteropServices;
-public class App
+public class App
{
public static void Main()
@@ -151,7 +151,7 @@ public static void CollectSamples()
// There is a latency time to enable the counters, they should be created
// prior to executing the application that uses the counters.
// Execute this sample a second time to use the category.
- if ( !PerformanceCounterCategory.Exists(categoryName) )
+ if ( !PerformanceCounterCategory.Exists(categoryName) )
{
CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
@@ -160,7 +160,7 @@ public static void CollectSamples()
CounterCreationData ETimeData = new CounterCreationData();
ETimeData.CounterType = PerformanceCounterType.ElapsedTime;
ETimeData.CounterName = counterName;
- CCDC.Add(ETimeData);
+ CCDC.Add(ETimeData);
// Create the category.
PerformanceCounterCategory.Create(categoryName,
@@ -172,12 +172,12 @@ public static void CollectSamples()
else
{
Console.WriteLine("Category exists - {0}", categoryName);
- }
+ }
//
// Create the performance counter.
- PerformanceCounter PC = new PerformanceCounter(categoryName,
- counterName,
+ PerformanceCounter PC = new PerformanceCounter(categoryName,
+ counterName,
false);
// Initialize the counter.
PC.RawValue = Stopwatch.GetTimestamp();
@@ -186,10 +186,10 @@ public static void CollectSamples()
DateTime Start = DateTime.Now;
// Loop for the samples.
- for (int j = 0; j < 100; j++)
+ for (int j = 0; j < 100; j++)
{
// Output the values.
- if ((j % 10) == 9)
+ if ((j % 10) == 9)
{
Console.WriteLine("NextValue() = " + PC.NextValue().ToString());
Console.WriteLine("Actual elapsed time = " + DateTime.Now.Subtract(Start).ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.NumberOfItems32/CS/numberofitems32.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.NumberOfItems32/CS/numberofitems32.cs
index 6a5ccd8d485..8722da6b5c6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.NumberOfItems32/CS/numberofitems32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.NumberOfItems32/CS/numberofitems32.cs
@@ -27,7 +27,7 @@ public static void Main()
private static bool SetupCategory()
{
- if ( !PerformanceCounterCategory.Exists("NumberOfItems32SampleCategory") )
+ if ( !PerformanceCounterCategory.Exists("NumberOfItems32SampleCategory") )
{
CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
@@ -55,8 +55,8 @@ private static bool SetupCategory()
private static void CreateCounters()
{
// Create the counter.
- PC = new PerformanceCounter("NumberOfItems32SampleCategory",
- "NumberOfItems32Sample",
+ PC = new PerformanceCounter("NumberOfItems32SampleCategory",
+ "NumberOfItems32Sample",
false);
PC.RawValue=0;
@@ -68,15 +68,15 @@ private static void CollectSamples(ArrayList samplesList)
Random r = new Random( DateTime.Now.Millisecond );
// Loop for the samples.
- for (int j = 0; j < 100; j++)
+ for (int j = 0; j < 100; j++)
{
-
+
int value = r.Next(1, 10);
Console.Write(j + " = " + value);
PC.IncrementBy(value);
- if ((j % 10) == 9)
+ if ((j % 10) == 9)
{
OutputSample(PC.NextSample());
samplesList.Add( PC.NextSample() );
@@ -99,12 +99,12 @@ private static void CalculateResults(ArrayList samplesList)
OutputSample( (CounterSample)samplesList[i+1] );
// Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
+ Console.WriteLine(".NET computed counter value = " +
CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
(CounterSample)samplesList[i+1]) );
// Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
+ Console.WriteLine("My computed counter value = " +
MyComputeCounterValue((CounterSample)samplesList[i],
(CounterSample)samplesList[i+1]) );
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.NumberOfItems64/CS/numberofitems64.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.NumberOfItems64/CS/numberofitems64.cs
index ffa899bb38b..ed541e00d6d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.NumberOfItems64/CS/numberofitems64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.NumberOfItems64/CS/numberofitems64.cs
@@ -27,7 +27,7 @@ public static void Main()
private static bool SetupCategory()
{
- if ( !PerformanceCounterCategory.Exists("NumberOfItems64SampleCategory") )
+ if ( !PerformanceCounterCategory.Exists("NumberOfItems64SampleCategory") )
{
CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
@@ -54,8 +54,8 @@ private static bool SetupCategory()
private static void CreateCounters()
{
// Create the counters.
- PC = new PerformanceCounter("NumberOfItems64SampleCategory",
- "NumberOfItems64Sample",
+ PC = new PerformanceCounter("NumberOfItems64SampleCategory",
+ "NumberOfItems64Sample",
false);
PC.RawValue=0;
@@ -67,15 +67,15 @@ private static void CollectSamples(ArrayList samplesList)
Random r = new Random( DateTime.Now.Millisecond );
// Loop for the samples.
- for (int j = 0; j < 100; j++)
+ for (int j = 0; j < 100; j++)
{
-
+
int value = r.Next(1, 10);
Console.Write(j + " = " + value);
PC.IncrementBy(value);
- if ((j % 10) == 9)
+ if ((j % 10) == 9)
{
OutputSample(PC.NextSample());
samplesList.Add( PC.NextSample() );
@@ -98,12 +98,12 @@ private static void CalculateResults(ArrayList samplesList)
OutputSample( (CounterSample)samplesList[i+1] );
// Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
+ Console.WriteLine(".NET computed counter value = " +
CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
(CounterSample)samplesList[i+1]) );
// Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
+ Console.WriteLine("My computed counter value = " +
MyComputeCounterValue((CounterSample)samplesList[i],
(CounterSample)samplesList[i+1]) );
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RateOfCountsPerSecond/CS/rateofcountspersecond32.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RateOfCountsPerSecond/CS/rateofcountspersecond32.cs
index 543b1a28308..91e3c316d6c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RateOfCountsPerSecond/CS/rateofcountspersecond32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RateOfCountsPerSecond/CS/rateofcountspersecond32.cs
@@ -4,7 +4,7 @@
using System.Collections.Specialized;
using System.Diagnostics;
-public class App
+public class App
{
private static PerformanceCounter PC;
@@ -27,7 +27,7 @@ public static void Main()
private static bool SetupCategory()
{
- if ( !PerformanceCounterCategory.Exists("RateOfCountsPerSecond32SampleCategory") )
+ if ( !PerformanceCounterCategory.Exists("RateOfCountsPerSecond32SampleCategory") )
{
CounterCreationDataCollection CCDC = new CounterCreationDataCollection();
@@ -37,11 +37,11 @@ private static bool SetupCategory()
rateOfCounts32.CounterType = PerformanceCounterType.RateOfCountsPerSecond32;
rateOfCounts32.CounterName = "RateOfCountsPerSecond32Sample";
CCDC.Add(rateOfCounts32);
-
+
// Create the category.
- PerformanceCounterCategory.Create("RateOfCountsPerSecond32SampleCategory",
+ PerformanceCounterCategory.Create("RateOfCountsPerSecond32SampleCategory",
"Demonstrates usage of the RateOfCountsPerSecond32 performance counter type.",
- PerformanceCounterCategoryType.SingleInstance, CCDC);
+ PerformanceCounterCategoryType.SingleInstance, CCDC);
return(true);
}
else
@@ -54,8 +54,8 @@ private static bool SetupCategory()
private static void CreateCounters()
{
// Create the counter.
- PC = new PerformanceCounter("RateOfCountsPerSecond32SampleCategory",
- "RateOfCountsPerSecond32Sample",
+ PC = new PerformanceCounter("RateOfCountsPerSecond32SampleCategory",
+ "RateOfCountsPerSecond32Sample",
false);
PC.RawValue=0;
@@ -70,14 +70,14 @@ private static void CollectSamples(ArrayList samplesList)
PC.NextSample();
// Loop for the samples.
- for (int j = 0; j < 100; j++)
+ for (int j = 0; j < 100; j++)
{
-
+
int value = r.Next(1, 10);
PC.IncrementBy(value);
Console.Write(j + " = " + value);
- if ((j % 10) == 9)
+ if ((j % 10) == 9)
{
Console.WriteLine("; NextValue() = " + PC.NextValue().ToString());
OutputSample(PC.NextSample());
@@ -101,12 +101,12 @@ private static void CalculateResults(ArrayList samplesList)
OutputSample( (CounterSample)samplesList[i+1] );
// Use .NET to calculate the counter value.
- Console.WriteLine(".NET computed counter value = " +
+ Console.WriteLine(".NET computed counter value = " +
CounterSampleCalculator.ComputeCounterValue((CounterSample)samplesList[i],
(CounterSample)samplesList[i+1]) );
// Calculate the counter value manually.
- Console.WriteLine("My computed counter value = " +
+ Console.WriteLine("My computed counter value = " +
MyComputeCounterValue((CounterSample)samplesList[i],
(CounterSample)samplesList[i+1]) );
}
@@ -127,9 +127,9 @@ private static void CalculateResults(ArrayList samplesList)
// (D) represents the number of ticks elapsed during the last sample
// interval, and F is the frequency of the ticks.
//
- // Average - (Nx - N0) / ((Dx - D0) / F)
+ // Average - (Nx - N0) / ((Dx - D0) / F)
//
- // Example - System\ File Read Operations/sec
+ // Example - System\ File Read Operations/sec
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RateOfCountsPerSecond64/CS/rateofcountspersecond64.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RateOfCountsPerSecond64/CS/rateofcountspersecond64.cs
index ea670d738da..b6135344eb0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RateOfCountsPerSecond64/CS/rateofcountspersecond64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RateOfCountsPerSecond64/CS/rateofcountspersecond64.cs
@@ -127,9 +127,9 @@ private static void CalculateResults(ArrayList samplesList)
// (D) represents the number of ticks elapsed during the last sample
// interval, and F is the frequency of the ticks.
//
- // Average - (Nx - N0) / ((Dx - D0) / F)
+ // Average - (Nx - N0) / ((Dx - D0) / F)
//
- // Example - System\ File Read Operations/sec
+ // Example - System\ File Read Operations/sec
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RawFraction/CS/rawfraction.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RawFraction/CS/rawfraction.cs
index 956e9b1d282..5a45294cd91 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RawFraction/CS/rawfraction.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.RawFraction/CS/rawfraction.cs
@@ -88,7 +88,7 @@ private static void CollectSamples(ArrayList samplesList)
int value = r.Next(1, 10);
Console.Write(j + " = " + value);
- // Increment the base every time, because the counter measures the number
+ // Increment the base every time, because the counter measures the number
// of high hits (raw fraction value) against all the hits (base value).
BPC.Increment();
@@ -133,14 +133,14 @@ private static void CalculateResults(ArrayList samplesList)
// Formula from MSDN -
// Description - This counter type shows the ratio of a subset to its set as a percentage.
// For example, it compares the number of bytes in use on a disk to the
- // total number of bytes on the disk. Counters of this type display the
+ // total number of bytes on the disk. Counters of this type display the
// current percentage only, not an average over time.
//
- // Generic type - Instantaneous, Percentage
+ // Generic type - Instantaneous, Percentage
// Formula - (N0 / D0), where D represents a measured attribute and N represents one
// component of that attribute.
//
- // Average - SUM (N / D) /x
+ // Average - SUM (N / D) /x
// Example - Paging File\% Usage Peak
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
private static Single MyComputeCounterValue(CounterSample rfSample)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.SampleFraction/CS/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.SampleFraction/CS/program.cs
index e9ca71e364f..028fc4cb659 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.SampleFraction/CS/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PerformanceCounterType.SampleFraction/CS/program.cs
@@ -4,7 +4,7 @@
using System.Collections.Specialized;
using System.Diagnostics;
-// Provides a SampleFraction counter to measure the percentage of the user processor
+// Provides a SampleFraction counter to measure the percentage of the user processor
// time for this process to total processor time for the process.
public class App
{
@@ -124,8 +124,8 @@ private static void CalculateResults(ArrayList samplesList)
}
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
- // Description - This counter type provides A percentage counter that shows the
- // average ratio of user proccessor time to total processor time during the last
+ // Description - This counter type provides A percentage counter that shows the
+ // average ratio of user proccessor time to total processor time during the last
// two sample intervals.
//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++//++++++++
private static Single MyComputeCounterValue(CounterSample s0, CounterSample s1)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Permission/CS/Permission.cs b/samples/snippets/csharp/VS_Snippets_CLR/Permission/CS/Permission.cs
index 7cea3e159b4..65dd3e31891 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Permission/CS/Permission.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Permission/CS/Permission.cs
@@ -34,7 +34,7 @@ public SoundPermission(PermissionState state)
m_specifiedAsUnrestricted = (state == PermissionState.Unrestricted);
}
- // This constructor creates and initializes a permission with specific access.
+ // This constructor creates and initializes a permission with specific access.
public SoundPermission(SoundPermissionState flags)
{
if (!Enum.IsDefined(typeof(SoundPermissionState), flags))
@@ -56,7 +56,7 @@ private SoundPermission VerifyTypeMatch(IPermission target)
return (SoundPermission)target;
}
- // This is the Private Clone helper method.
+ // This is the Private Clone helper method.
private SoundPermission Clone(Boolean specifiedAsUnrestricted, SoundPermissionState flags)
{
SoundPermission soundPerm = (SoundPermission)Clone();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Process.Start_instance/CS/processstart.cs b/samples/snippets/csharp/VS_Snippets_CLR/Process.Start_instance/CS/processstart.cs
index 214f9f0a08f..96bdc15fdaf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Process.Start_instance/CS/processstart.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Process.Start_instance/CS/processstart.cs
@@ -18,8 +18,8 @@ public static void Main()
myProcess.StartInfo.FileName = "C:\\HelloWorld.exe";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
- // This code assumes the process you are starting will terminate itself.
- // Given that is is started without a window so you cannot terminate it
+ // This code assumes the process you are starting will terminate itself.
+ // Given that is is started without a window so you cannot terminate it
// on the desktop, it must terminate itself or you can do it programmatically
// from this application using the Kill method.
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Process.Start_static/CS/processstartstatic2.cs b/samples/snippets/csharp/VS_Snippets_CLR/Process.Start_static/CS/processstartstatic2.cs
index f4966b57145..911fc524cc7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Process.Start_static/CS/processstartstatic2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Process.Start_static/CS/processstartstatic2.cs
@@ -19,7 +19,7 @@ static void Main()
// Start with one argument.
// Output of ArgsEcho:
- // [0]=/a
+ // [0]=/a
startInfo.Arguments = "/a";
Process.Start(startInfo);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule/CS/processmodule.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule/CS/processmodule.cs
index 2d89ee44144..0ecebd2713e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule/CS/processmodule.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule/CS/processmodule.cs
@@ -1,7 +1,7 @@
// System.Diagnostics.ProcessModule
-/* The following program demonstrates the use of 'ProcessModule' class.
- It creates a notepad, gets the 'MainModule' and all other modules of
+/* The following program demonstrates the use of 'ProcessModule' class.
+ It creates a notepad, gets the 'MainModule' and all other modules of
the process 'notepad.exe', displays some of the properties of each modules.
*/
using System;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_BaseAddress/CS/processmodule_baseaddress.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_BaseAddress/CS/processmodule_baseaddress.cs
index ccc7a54af3f..32e204dfda1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_BaseAddress/CS/processmodule_baseaddress.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_BaseAddress/CS/processmodule_baseaddress.cs
@@ -1,7 +1,7 @@
// System.Diagnostics.ProcessModule.BaseAddress
-/* The following program demonstrates the use of 'BaseAddress' property of
- 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
+/* The following program demonstrates the use of 'BaseAddress' property of
+ 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
all other modules of the process 'notepad.exe', displays 'BaseAddress'
for all the modules and the main module.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_EntryPoint/CS/processmodule_entrypoint.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_EntryPoint/CS/processmodule_entrypoint.cs
index e4eeb510c7e..a4023d64448 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_EntryPoint/CS/processmodule_entrypoint.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_EntryPoint/CS/processmodule_entrypoint.cs
@@ -1,7 +1,7 @@
// System.Diagnostics.ProcessModule.EntryPointAddress
-/* The following program demonstrates the use of 'EntryPointAddress' property of
- 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
+/* The following program demonstrates the use of 'EntryPointAddress' property of
+ 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
all other modules of the process 'notepad.exe', displays 'EntryPointAddress'
for all the modules and the main module.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_FileName/CS/processmodule_filename.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_FileName/CS/processmodule_filename.cs
index 6233cc3b027..726d46c4b99 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_FileName/CS/processmodule_filename.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_FileName/CS/processmodule_filename.cs
@@ -1,7 +1,7 @@
// System.Diagnostics.ProcessModule.FileName
-/* The following program demonstrates the use of 'FileName' property of
- 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
+/* The following program demonstrates the use of 'FileName' property of
+ 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
all other modules of the process 'notepad.exe', displays 'FileName'
for all the modules and the main module.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_FileVersionInfo/CS/processmodule_fileversioninfo.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_FileVersionInfo/CS/processmodule_fileversioninfo.cs
index 9f1dcbd404d..208420332ef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_FileVersionInfo/CS/processmodule_fileversioninfo.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_FileVersionInfo/CS/processmodule_fileversioninfo.cs
@@ -1,7 +1,7 @@
// System.Diagnostics.ProcessModule.FileVersionInfo
-/* The following program demonstrates the use of 'FileVersionInfo' property of
- 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
+/* The following program demonstrates the use of 'FileVersionInfo' property of
+ 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
all other modules of the process 'notepad.exe', displays 'FileVersionInfo'
for all the modules and the main module.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ModuleMemorySize/CS/processmodule_modulememorysize.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ModuleMemorySize/CS/processmodule_modulememorysize.cs
index 3a3f7f9d921..9d315360b8c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ModuleMemorySize/CS/processmodule_modulememorysize.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ModuleMemorySize/CS/processmodule_modulememorysize.cs
@@ -1,7 +1,7 @@
// System.Diagnostics.ProcessModule.ModuleMemorySize
-/* The following program demonstrates the use of 'ModuleMemorySize' property of
- 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
+/* The following program demonstrates the use of 'ModuleMemorySize' property of
+ 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
all other modules of the process 'notepad.exe', displays 'ModuleMemorySize'
for all the modules and the main module.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ModuleName/CS/processmodule_modulename.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ModuleName/CS/processmodule_modulename.cs
index daf1fc20bf3..9e951dc8674 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ModuleName/CS/processmodule_modulename.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ModuleName/CS/processmodule_modulename.cs
@@ -1,7 +1,7 @@
// System.Diagnostics.ProcessModule.ModuleName
-/* The following program demonstrates the use of 'ModuleName' property of
- 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
+/* The following program demonstrates the use of 'ModuleName' property of
+ 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
all other modules of the process 'notepad.exe', displays 'ModuleName'
for all the modules and the main module.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ToString/CS/processmodule_tostring.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ToString/CS/processmodule_tostring.cs
index d3662590c3c..08f66468f4d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ToString/CS/processmodule_tostring.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessModule_ToString/CS/processmodule_tostring.cs
@@ -1,7 +1,7 @@
// System.Diagnostics.ProcessModule.ToString
-/* The following program demonstrates the use of 'ToString' property of
- 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
+/* The following program demonstrates the use of 'ToString' property of
+ 'ProcessModule' class. It creates a notepad, gets the 'MainModule' and
all other modules of the process 'notepad.exe', displays 'ToString'
for all the modules and the main module.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessOneStream/CS/stdstr.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessOneStream/CS/stdstr.cs
index 4a8410cf21f..aeeb9574995 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessOneStream/CS/stdstr.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessOneStream/CS/stdstr.cs
@@ -3,13 +3,13 @@
public class Snippet
{
- static void Main()
+ static void Main()
{
- //
+ //
// Run "csc.exe /r:System.dll /out:sample.exe stdstr.cs". UseShellExecute is false because we're specifying
// an executable directly and in this case depending on it being in a PATH folder. By setting
// RedirectStandardOutput to true, the output of csc.exe is directed to the Process.StandardOutput stream
- // which is then displayed in this console window directly.
+ // which is then displayed in this console window directly.
using (Process compiler = new Process())
{
compiler.StartInfo.FileName = "csc.exe";
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProcessVerbs_Diagnostics/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProcessVerbs_Diagnostics/CS/source.cs
index 9f6ae7471b9..c67d250b403 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProcessVerbs_Diagnostics/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProcessVerbs_Diagnostics/CS/source.cs
@@ -76,7 +76,7 @@ static void Main()
}
catch (InvalidOperationException)
{
- // Catch this exception if the process exits quickly,
+ // Catch this exception if the process exits quickly,
// and the properties are not accessible.
Console.WriteLine($"Unable to start '{fileName}' with verb {verbToUse}");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Process_GetProcessesByName2_2/CS/process_getprocessesbyname2_2.cs b/samples/snippets/csharp/VS_Snippets_CLR/Process_GetProcessesByName2_2/CS/process_getprocessesbyname2_2.cs
index e0e998b919d..24d3b75dcb8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Process_GetProcessesByName2_2/CS/process_getprocessesbyname2_2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Process_GetProcessesByName2_2/CS/process_getprocessesbyname2_2.cs
@@ -1,10 +1,10 @@
// System.Diagnostics.Process.GetProcessesByName(String, String)
// System.Diagnostics.Process.MachineName
-/*
+/*
The following program demonstrates the method 'GetProcessesByName(String, String)'
and property 'MachineName' of class 'Process'.
- It reads the remote computer name from commandline and gets all the notepad
+ It reads the remote computer name from commandline and gets all the notepad
processes by name on remote computer and displays its properties to console.
*/
//
@@ -59,5 +59,5 @@ public static void Main(string[] args)
}
}
}
-//
-//
+//
+//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Process_StandardInput/CS/process_standardinput.cs b/samples/snippets/csharp/VS_Snippets_CLR/Process_StandardInput/CS/process_standardinput.cs
index 7090f12b7bc..ce02abab3a9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Process_StandardInput/CS/process_standardinput.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Process_StandardInput/CS/process_standardinput.cs
@@ -3,7 +3,7 @@
//
// The following example illustrates how to redirect the StandardInput
// stream of a process. The example starts the sort command with
-// redirected input. It then prompts the user for text, and passes
+// redirected input. It then prompts the user for text, and passes
// that to the sort command by means of the redirected input stream.
// The sort command results are displayed to the user on the console.
@@ -34,7 +34,7 @@ static void Main()
StreamWriter myStreamWriter = myProcess.StandardInput;
- // Prompt the user for input text lines to sort.
+ // Prompt the user for input text lines to sort.
// Write each line to the StandardInput stream of
// the sort command.
String inputText;
@@ -64,7 +64,7 @@ static void Main()
// End the input stream to the sort command.
// When the stream closes, the sort command
- // writes the sorted text lines to the
+ // writes the sorted text lines to the
// console.
myStreamWriter.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Process_StandardOutput/CS/process_standardoutput.cs b/samples/snippets/csharp/VS_Snippets_CLR/Process_StandardOutput/CS/process_standardoutput.cs
index 06fcad13086..63c6f8f648b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Process_StandardOutput/CS/process_standardoutput.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Process_StandardOutput/CS/process_standardoutput.cs
@@ -13,7 +13,7 @@ public static void Main()
process.StartInfo.RedirectStandardOutput = true;
process.Start();
- // Synchronously read the standard output of the spawned process.
+ // Synchronously read the standard output of the spawned process.
StreamReader reader = process.StandardOutput;
string output = reader.ReadToEnd();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Process_SynchronizingObject/CS/process_synchronizingobject.cs b/samples/snippets/csharp/VS_Snippets_CLR/Process_SynchronizingObject/CS/process_synchronizingobject.cs
index be714284e02..c49c99dc17e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Process_SynchronizingObject/CS/process_synchronizingobject.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Process_SynchronizingObject/CS/process_synchronizingobject.cs
@@ -3,7 +3,7 @@
The following example demonstrates the property 'SynchronizingObject'
of 'Process' class.
-It starts a process 'mspaint.exe' on button click.
+It starts a process 'mspaint.exe' on button click.
It attaches 'MyProcessExited' method of 'MyButton' class as EventHandler to
'Exited' event of the process.
*/
@@ -22,7 +22,7 @@ public Form1()
{
InitializeComponent();
}
-
+
protected override void Dispose(bool disposing)
{
if (disposing)
@@ -32,7 +32,7 @@ protected override void Dispose(bool disposing)
components.Dispose();
}
}
-
+
base.Dispose(disposing);
}
@@ -41,18 +41,18 @@ private void InitializeComponent()
{
this.button1 = new process_SynchronizingObject.MyButton();
this.SuspendLayout();
- //
+ //
// button1
- //
+ //
this.button1.Location = new System.Drawing.Point(40, 80);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(168, 32);
this.button1.TabIndex = 0;
this.button1.Text = "Click Me";
this.button1.Click += new System.EventHandler(this.button1_Click);
- //
+ //
// Form1
- //
+ //
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ProgIdAttribute_Value/CS/progidattribute_value.cs b/samples/snippets/csharp/VS_Snippets_CLR/ProgIdAttribute_Value/CS/progidattribute_value.cs
index eacc9da075b..b4c3456cdb5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ProgIdAttribute_Value/CS/progidattribute_value.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ProgIdAttribute_Value/CS/progidattribute_value.cs
@@ -1,6 +1,6 @@
/*
System.Runtime.InteropServices.ProgIdAttribute.Value
-
+
The program shows MyClass as a COM class with prog id 'InteropSample.MyClass'.
It get all attributes of MyClass by calling GetAttributes method of TypeDescriptor
then prints the 'Value' property of 'ProgIdAttribute' class.
@@ -10,7 +10,7 @@ then prints the 'Value' property of 'ProgIdAttribute' class.
using System.Runtime.InteropServices;
namespace InteropSample
-{
+{
//
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ProgId("InteropSample.MyClass")]
@@ -20,7 +20,7 @@ public MyClass() {}
}
class TestApplication
- {
+ {
public static void Main()
{
try
@@ -29,7 +29,7 @@ public static void Main()
attributes = TypeDescriptor.GetAttributes(typeof(MyClass));
ProgIdAttribute progIdAttributeObj = (ProgIdAttribute)attributes[typeof(ProgIdAttribute)];
Console.WriteLine("ProgIdAttribute's value is set to : " + progIdAttributeObj.Value);
- }
+ }
catch(Exception e)
{
Console.WriteLine("Exception : " + e.Message);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PropertyInfo.SetValue/cs/Example.cs b/samples/snippets/csharp/VS_Snippets_CLR/PropertyInfo.SetValue/cs/Example.cs
index 06c1c79650a..f63dc20d17f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PropertyInfo.SetValue/cs/Example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PropertyInfo.SetValue/cs/Example.cs
@@ -7,7 +7,7 @@
class Example
{
private static int _staticProperty = 41;
- public static int StaticProperty
+ public static int StaticProperty
{
get
{
@@ -20,7 +20,7 @@ public static int StaticProperty
}
private int _instanceProperty = 42;
- public int InstanceProperty
+ public int InstanceProperty
{
get
{
@@ -32,13 +32,13 @@ public int InstanceProperty
}
}
- private Dictionary _indexedInstanceProperty =
+ private Dictionary _indexedInstanceProperty =
new Dictionary();
// By default, the indexer is named Item, and that name must be used
// to search for the property. In this example, the indexer is given
// a different name by using the IndexerNameAttribute attribute.
[IndexerNameAttribute("IndexedInstanceProperty")]
- public string this[int key]
+ public string this[int key]
{
get
{
@@ -74,25 +74,25 @@ public string this[int key]
public static void Main()
{
- Console.WriteLine("Initial value of class-level property: {0}",
+ Console.WriteLine("Initial value of class-level property: {0}",
Example.StaticProperty);
PropertyInfo piShared = typeof(Example).GetProperty("StaticProperty");
piShared.SetValue(null, 76, null);
-
- Console.WriteLine("Final value of class-level property: {0}",
+
+ Console.WriteLine("Final value of class-level property: {0}",
Example.StaticProperty);
Example exam = new Example();
- Console.WriteLine("\nInitial value of instance property: {0}",
+ Console.WriteLine("\nInitial value of instance property: {0}",
exam.InstanceProperty);
- PropertyInfo piInstance =
+ PropertyInfo piInstance =
typeof(Example).GetProperty("InstanceProperty");
piInstance.SetValue(exam, 37, null);
-
- Console.WriteLine("Final value of instance property: {0}",
+
+ Console.WriteLine("Final value of instance property: {0}",
exam.InstanceProperty);
exam[17] = "String number 17";
@@ -100,22 +100,22 @@ public static void Main()
exam[9] = "String number 9";
Console.WriteLine(
- "\nInitial value of indexed instance property(17): '{0}'",
+ "\nInitial value of indexed instance property(17): '{0}'",
exam[17]);
// By default, the indexer is named Item, and that name must be used
// to search for the property. In this example, the indexer is given
// a different name by using the IndexerNameAttribute attribute.
- PropertyInfo piIndexedInstance =
+ PropertyInfo piIndexedInstance =
typeof(Example).GetProperty("IndexedInstanceProperty");
piIndexedInstance.SetValue(
- exam,
- "New value for string number 17",
+ exam,
+ "New value for string number 17",
new object[] { (int) 17 });
-
+
Console.WriteLine(
- "Final value of indexed instance property(17): '{0}'",
- exam[17]);
+ "Final value of indexed instance property(17): '{0}'",
+ exam[17]);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/PropertyInfo.SetValue/cs/example2.cs b/samples/snippets/csharp/VS_Snippets_CLR/PropertyInfo.SetValue/cs/example2.cs
index 74e8d961f18..1b05af67aca 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/PropertyInfo.SetValue/cs/example2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/PropertyInfo.SetValue/cs/example2.cs
@@ -32,20 +32,20 @@ public static void Main()
// Change the static property value.
PropertyInfo piShared = examType.GetProperty("StaticProperty");
piShared.SetValue(null, 76);
-
+
Console.WriteLine("New value of static property: {0}",
Example.StaticProperty);
// Create an instance of the Example class.
Example exam = new Example();
- Console.WriteLine("\nInitial value of instance property: {0}",
+ Console.WriteLine("\nInitial value of instance property: {0}",
exam.InstanceProperty);
// Change the instance property value.
PropertyInfo piInstance = examType.GetProperty("InstanceProperty");
piInstance.SetValue(exam, 37);
-
+
Console.WriteLine("New value of instance property: {0}",
exam.InstanceProperty);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ReadTextFile/CS/readtextfile.cs b/samples/snippets/csharp/VS_Snippets_CLR/ReadTextFile/CS/readtextfile.cs
index d6a7d2e5b0a..7968c95b8a1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ReadTextFile/CS/readtextfile.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ReadTextFile/CS/readtextfile.cs
@@ -2,26 +2,26 @@
using System;
using System.IO;
-class Test
+class Test
{
- public static void Main()
+ public static void Main()
{
- try
+ try
{
// Create an instance of StreamReader to read from a file.
// The using statement also closes the StreamReader.
- using (StreamReader sr = new StreamReader("TestFile.txt"))
+ using (StreamReader sr = new StreamReader("TestFile.txt"))
{
string line;
- // Read and display lines from the file until the end of
+ // Read and display lines from the file until the end of
// the file is reached.
- while ((line = sr.ReadLine()) != null)
+ while ((line = sr.ReadLine()) != null)
{
Console.WriteLine(line);
}
}
}
- catch (Exception e)
+ catch (Exception e)
{
// Let the user know what went wrong.
Console.WriteLine("The file could not be read:");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Recursive file finder/CS/directorylisting.cs b/samples/snippets/csharp/VS_Snippets_CLR/Recursive file finder/CS/directorylisting.cs
index 9423a4ff913..bbdccde73e8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Recursive file finder/CS/directorylisting.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Recursive file finder/CS/directorylisting.cs
@@ -1,37 +1,37 @@
-//
+//
// For Directory.GetFiles and Directory.GetDirectories
-//
+//
// For File.Exists, Directory.Exists
using System;
using System.IO;
using System.Collections;
-public class RecursiveFileProcessor
+public class RecursiveFileProcessor
{
- public static void Main(string[] args)
+ public static void Main(string[] args)
{
- foreach(string path in args)
+ foreach(string path in args)
{
- if(File.Exists(path))
+ if(File.Exists(path))
{
// This path is a file
- ProcessFile(path);
- }
- else if(Directory.Exists(path))
+ ProcessFile(path);
+ }
+ else if(Directory.Exists(path))
{
// This path is a directory
ProcessDirectory(path);
}
- else
+ else
{
Console.WriteLine("{0} is not a valid file or directory.", path);
- }
- }
+ }
+ }
}
- // Process all files in the directory passed in, recurse on any directories
+ // Process all files in the directory passed in, recurse on any directories
// that are found, and process the files they contain.
- public static void ProcessDirectory(string targetDirectory)
+ public static void ProcessDirectory(string targetDirectory)
{
// Process the list of files found in the directory.
string [] fileEntries = Directory.GetFiles(targetDirectory);
@@ -43,11 +43,11 @@ public static void ProcessDirectory(string targetDirectory)
foreach(string subdirectory in subdirectoryEntries)
ProcessDirectory(subdirectory);
}
-
+
// Insert logic for processing found files here.
- public static void ProcessFile(string path)
+ public static void ProcessFile(string path)
{
- Console.WriteLine("Processed file '{0}'.", path);
+ Console.WriteLine("Processed file '{0}'.", path);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.All/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.All/CS/source.cs
index 7a423790c33..a031c0f8bbd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.All/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.All/CS/source.cs
@@ -7,7 +7,7 @@
public class Test
{
// Declare a delegate type that can be used to execute the completed
- // dynamic method.
+ // dynamic method.
private delegate int HelloDelegate(string msg, int ret);
public static void Main()
@@ -21,9 +21,9 @@ public static void Main()
// of Integer, and two parameters whose types are specified by
// the array helloArgs. Create the method in the module that
// defines the String class.
- DynamicMethod hello = new DynamicMethod("Hello",
- typeof(int),
- helloArgs,
+ DynamicMethod hello = new DynamicMethod("Hello",
+ typeof(int),
+ helloArgs,
typeof(string).Module);
//
@@ -32,7 +32,7 @@ public static void Main()
Type[] writeStringArgs = {typeof(string)};
// Get the overload of Console.WriteLine that has one
// String parameter.
- MethodInfo writeString = typeof(Console).GetMethod("WriteLine",
+ MethodInfo writeString = typeof(Console).GetMethod("WriteLine",
writeStringArgs);
// Get an ILGenerator and emit a body for the dynamic method,
@@ -52,7 +52,7 @@ public static void Main()
//
// Add parameter information to the dynamic method. (This is not
// necessary, but can be useful for debugging.) For each parameter,
- // identified by position, supply the parameter attributes and a
+ // identified by position, supply the parameter attributes and a
// parameter name.
hello.DefineParameter(1, ParameterAttributes.In, "message");
hello.DefineParameter(2, ParameterAttributes.In, "valueToReturn");
@@ -62,7 +62,7 @@ public static void Main()
// Create a delegate that represents the dynamic method. This
// action completes the method. Any further attempts to
// change the method are ignored.
- HelloDelegate hi =
+ HelloDelegate hi =
(HelloDelegate) hello.CreateDelegate(typeof(HelloDelegate));
// Use the delegate to execute the dynamic method.
@@ -89,13 +89,13 @@ public static void Main()
Console.WriteLine("\r\n ----- Display information about the dynamic method -----");
//
- // Display MethodAttributes for the dynamic method, set when
+ // Display MethodAttributes for the dynamic method, set when
// the dynamic method was created.
Console.WriteLine("\r\nMethod Attributes: {0}", hello.Attributes);
//
//
- // Display the calling convention of the dynamic method, set when the
+ // Display the calling convention of the dynamic method, set when the
// dynamic method was created.
Console.WriteLine("\r\nCalling convention: {0}", hello.CallingConvention);
//
@@ -203,7 +203,7 @@ public static void Main()
Console.WriteLine("\r\nParameters: name, type, ParameterAttributes");
foreach( ParameterInfo p in parameters )
{
- Console.WriteLine("\t{0}, {1}, {2}",
+ Console.WriteLine("\t{0}, {1}, {2}",
p.Name, p.ParameterType, p.Attributes);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.ClosedOver/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.ClosedOver/cs/source.cs
index 1764a89a143..ed735e8b2e1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.ClosedOver/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.ClosedOver/cs/source.cs
@@ -17,13 +17,13 @@ public Example(int id)
public class DerivedFromExample : Example
{
- public DerivedFromExample(int id) : base(id) {}
+ public DerivedFromExample(int id) : base(id) {}
}
// Two delegates are declared: UseLikeInstance treats the dynamic
// method as if it were an instance method, and UseLikeStatic
// treats the dynamic method in the ordinary fashion.
-//
+//
public delegate int UseLikeInstance(int newID);
public delegate int UseLikeStatic(Example ex, int newID);
@@ -33,9 +33,9 @@ public static void Main()
{
// This dynamic method changes the private id field. It has
// no name; it returns the old id value (return type int);
- // it takes two parameters, an instance of Example and
- // an int that is the new value of id; and it is declared
- // with Example as the owner type, so it can access all
+ // it takes two parameters, an instance of Example and
+ // an int that is the new value of id; and it is declared
+ // with Example as the owner type, so it can access all
// members, public and private.
//
DynamicMethod changeID = new DynamicMethod(
@@ -50,22 +50,22 @@ public static void Main()
"id",
BindingFlags.NonPublic | BindingFlags.Instance
);
-
+
ILGenerator ilg = changeID.GetILGenerator();
- // Push the current value of the id field onto the
+ // Push the current value of the id field onto the
// evaluation stack. It's an instance field, so load the
// instance of Example before accessing the field.
ilg.Emit(OpCodes.Ldarg_0);
ilg.Emit(OpCodes.Ldfld, fid);
- // Load the instance of Example again, load the new value
- // of id, and store the new field value.
+ // Load the instance of Example again, load the new value
+ // of id, and store the new field value.
ilg.Emit(OpCodes.Ldarg_0);
ilg.Emit(OpCodes.Ldarg_1);
ilg.Emit(OpCodes.Stfld, fid);
- // The original value of the id field is now the only
+ // The original value of the id field is now the only
// thing on the stack, so return from the call.
ilg.Emit(OpCodes.Ret);
@@ -73,7 +73,7 @@ public static void Main()
// way, as a static method that takes an instance of
// Example and an int.
//
- UseLikeStatic uls =
+ UseLikeStatic uls =
(UseLikeStatic) changeID.CreateDelegate(
typeof(UseLikeStatic)
);
@@ -82,12 +82,12 @@ public static void Main()
//
Example ex = new Example(42);
- // Create a delegate that is bound to the instance of
- // of Example. This is possible because the first
- // parameter of changeID is of type Example. The
+ // Create a delegate that is bound to the instance of
+ // of Example. This is possible because the first
+ // parameter of changeID is of type Example. The
// delegate has all the parameters of changeID except
// the first.
- UseLikeInstance uli =
+ UseLikeInstance uli =
(UseLikeInstance) changeID.CreateDelegate(
typeof(UseLikeInstance),
ex
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.ctor1/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.ctor1/CS/source.cs
index a19d420bbdd..05c8e25a6d2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.ctor1/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Reflection.DynamicMethod.ctor1/CS/source.cs
@@ -7,7 +7,7 @@
public class Test
{
// Declare a delegate that will be used to execute the completed
- // dynamic method.
+ // dynamic method.
private delegate int HelloInvoker(string msg, int ret);
public static void Main()
@@ -21,9 +21,9 @@ public static void Main()
// of int, and two parameters whose types are specified by the
// array helloArgs. Create the method in the module that
// defines the Test class.
- DynamicMethod hello = new DynamicMethod("Hello",
- typeof(int),
- helloArgs,
+ DynamicMethod hello = new DynamicMethod("Hello",
+ typeof(int),
+ helloArgs,
typeof(Test).Module);
//
@@ -32,7 +32,7 @@ public static void Main()
Type[] writeStringArgs = {typeof(string)};
// Get the overload of Console.WriteLine that has one
// String parameter.
- MethodInfo writeString =
+ MethodInfo writeString =
typeof(Console).GetMethod("WriteLine", writeStringArgs);
// Get an ILGenerator and emit a body for the dynamic method.
@@ -51,7 +51,7 @@ public static void Main()
// Create a delegate that represents the dynamic method. This
// action completes the method, and any further attempts to
// change the method will cause an exception.
- HelloInvoker hi =
+ HelloInvoker hi =
(HelloInvoker) hello.CreateDelegate(typeof(HelloInvoker));
//
@@ -65,7 +65,7 @@ public static void Main()
retval = hi("\r\nHi, Mom!", 5280);
Console.WriteLine("Executing delegate hi(\"Hi, Mom!\", 5280) returned {0}",
retval);
-
+
//
// Create an array of arguments to use with the Invoke method.
object[] invokeArgs = {"\r\nHello, World!", 42};
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Reflection/CS/Reflection.cs b/samples/snippets/csharp/VS_Snippets_CLR/Reflection/CS/Reflection.cs
index b01537a2f56..dcda40464ff 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Reflection/CS/Reflection.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Reflection/CS/Reflection.cs
@@ -6,7 +6,7 @@ class Module1
{
public static void Main()
{
- // This variable holds the amount of indenting that
+ // This variable holds the amount of indenting that
// should be used when displaying each line of information.
Int32 indent = 0;
//
@@ -16,7 +16,7 @@ public static void Main()
Display(indent+1, "Codebase={0}", a.CodeBase);
// Display the set of assemblies our assemblies reference.
-
+
Display(indent, "Referenced assemblies:");
foreach (AssemblyName an in a.GetReferencedAssemblies() )
{
@@ -24,7 +24,7 @@ public static void Main()
}
//
Display(indent, "");
-
+
// Display information about each assembly loading into this AppDomain.
foreach (Assembly b in AppDomain.CurrentDomain.GetAssemblies())
{
@@ -37,7 +37,7 @@ public static void Main()
}
// Display information about each type exported from this assembly.
-
+
indent += 1;
foreach ( Type t in b.GetExportedTypes() )
{
@@ -45,7 +45,7 @@ public static void Main()
Display(indent, "Type: {0}", t);
// For each type, show its members & their custom attributes.
-
+
indent += 1;
foreach (MemberInfo mi in t.GetMembers() )
{
@@ -53,7 +53,7 @@ public static void Main()
DisplayAttributes(indent, mi);
// If the member is a method, display information about its parameters.
-
+
if (mi.MemberType==MemberTypes.Method)
{
foreach ( ParameterInfo pi in ((MethodInfo) mi).GetParameters() )
@@ -93,7 +93,7 @@ public static void DisplayAttributes(Int32 indent, MemberInfo mi)
}
// Display a formatted string indented by the specified amount.
- public static void Display(Int32 indent, string format, params object[] param)
+ public static void Display(Int32 indent, string format, params object[] param)
{
Console.Write(new string(' ', indent*2));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Regex_Words/CS/words.cs b/samples/snippets/csharp/VS_Snippets_CLR/Regex_Words/CS/words.cs
index 35f5bac8423..603b7b8b1d6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Regex_Words/CS/words.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Regex_Words/CS/words.cs
@@ -14,9 +14,9 @@ public static void Main ()
RegexOptions.Compiled | RegexOptions.IgnoreCase);
//
- // Define a test string.
+ // Define a test string.
string text = "The the quick brown fox fox jumps over the lazy dog dog.";
-
+
//
// Find matches.
MatchCollection matches = rx.Matches(text);
@@ -24,8 +24,8 @@ public static void Main ()
//
// Report the number of matches found.
- Console.WriteLine("{0} matches found in:\n {1}",
- matches.Count,
+ Console.WriteLine("{0} matches found in:\n {1}",
+ matches.Count,
text);
//
@@ -34,12 +34,12 @@ public static void Main ()
foreach (Match match in matches)
{
GroupCollection groups = match.Groups;
- Console.WriteLine("'{0}' repeated at positions {1} and {2}",
- groups["word"].Value,
- groups[0].Index,
+ Console.WriteLine("'{0}' repeated at positions {1} and {2}",
+ groups["word"].Value,
+ groups[0].Index,
groups[1].Index);
}
-//
+//
}
}
// The example produces the following output to the console:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/RegistryKey.OpenSubKey/CS/opensubkey.cs b/samples/snippets/csharp/VS_Snippets_CLR/RegistryKey.OpenSubKey/CS/opensubkey.cs
index fc84163fc51..67702eed056 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/RegistryKey.OpenSubKey/CS/opensubkey.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/RegistryKey.OpenSubKey/CS/opensubkey.cs
@@ -12,8 +12,8 @@ public static void Main()
RegistryKey rk = Registry.CurrentUser.CreateSubKey("RegistryOpenSubKeyExample");
rk.Close();
- // Obtain an instance of RegistryKey for the CurrentUser registry
- // root.
+ // Obtain an instance of RegistryKey for the CurrentUser registry
+ // root.
RegistryKey rkCurrentUser = Registry.CurrentUser;
// Obtain the test key (read-only) and display it.
@@ -22,7 +22,7 @@ public static void Main()
rkTest.Close();
rkCurrentUser.Close();
- // Obtain the test key in one step, using the CurrentUser registry
+ // Obtain the test key in one step, using the CurrentUser registry
// root.
rkTest = Registry.CurrentUser.OpenSubKey("RegistryOpenSubKeyExample");
Console.WriteLine("Test key: {0}", rkTest);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/RegistryKey.OpenSubKey_PermCheck/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/RegistryKey.OpenSubKey_PermCheck/cs/source.cs
index f49dc2fdba6..81c56288a03 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/RegistryKey.OpenSubKey_PermCheck/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/RegistryKey.OpenSubKey_PermCheck/cs/source.cs
@@ -25,7 +25,7 @@ public static void Main()
// On the default setting, security is checked every time
// a key/value pair is read.
rk = cu.OpenSubKey(testKey, RegistryKeyPermissionCheck.Default);
-
+
s.Start();
for (int i = 0; i < LIMIT; i++)
{
@@ -37,10 +37,10 @@ public static void Main()
s.Reset();
- // When the key is opened with ReadSubTree, security is
+ // When the key is opened with ReadSubTree, security is
// not checked when the values are read.
rk = cu.OpenSubKey(testKey, RegistryKeyPermissionCheck.ReadSubTree);
-
+
s.Start();
for (int i = 0; i < LIMIT; i++)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/RegistrySecurity101/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/RegistrySecurity101/CS/source.cs
index e0511ac88a3..8d2600da3ac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/RegistrySecurity101/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/RegistrySecurity101/CS/source.cs
@@ -32,28 +32,28 @@ public static void Main()
// Allow the current user to read and delete the key.
//
- rs.AddAccessRule(new RegistryAccessRule(user,
- RegistryRights.ReadKey | RegistryRights.Delete,
- InheritanceFlags.None,
- PropagationFlags.None,
+ rs.AddAccessRule(new RegistryAccessRule(user,
+ RegistryRights.ReadKey | RegistryRights.Delete,
+ InheritanceFlags.None,
+ PropagationFlags.None,
AccessControlType.Allow));
// Prevent the current user from writing or changing the
// permission set of the key. Note that if Delete permission
// were not allowed in the previous access rule, denying
- // WriteKey permission would prevent the user from deleting the
+ // WriteKey permission would prevent the user from deleting the
// key.
- rs.AddAccessRule(new RegistryAccessRule(user,
- RegistryRights.WriteKey | RegistryRights.ChangePermissions,
- InheritanceFlags.None,
- PropagationFlags.None,
+ rs.AddAccessRule(new RegistryAccessRule(user,
+ RegistryRights.WriteKey | RegistryRights.ChangePermissions,
+ InheritanceFlags.None,
+ PropagationFlags.None,
AccessControlType.Deny));
// Create the example key with registry security.
RegistryKey rk = null;
try
{
- rk = Registry.CurrentUser.CreateSubKey("RegistryRightsExample",
+ rk = Registry.CurrentUser.CreateSubKey("RegistryRightsExample",
RegistryKeyPermissionCheck.Default, rs);
Console.WriteLine("\r\nExample key created.");
rk.SetValue("ValueName", "StringValue");
@@ -67,7 +67,7 @@ public static void Main()
rk = Registry.CurrentUser;
RegistryKey rk2;
-
+
// Open the key with read access.
rk2 = rk.OpenSubKey("RegistryRightsExample", false);
Console.WriteLine("\r\nRetrieved value: {0}", rk2.GetValue("ValueName"));
@@ -89,10 +89,10 @@ public static void Main()
try
{
rs = new RegistrySecurity();
- rs.AddAccessRule(new RegistryAccessRule(user,
- RegistryRights.WriteKey,
- InheritanceFlags.None,
- PropagationFlags.None,
+ rs.AddAccessRule(new RegistryAccessRule(user,
+ RegistryRights.WriteKey,
+ InheritanceFlags.None,
+ PropagationFlags.None,
AccessControlType.Allow));
rk2 = rk.OpenSubKey("RegistryRightsExample", false);
rk2.SetAccessControl(rs);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/RegistryValueOptions/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/RegistryValueOptions/CS/source.cs
index aa83d0ea0a3..1a828a794d3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/RegistryValueOptions/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/RegistryValueOptions/CS/source.cs
@@ -9,16 +9,16 @@ public static void Main()
{
// Delete and recreate the test key.
Registry.CurrentUser.DeleteSubKey("RegistryValueOptionsExample", false);
- RegistryKey rk =
+ RegistryKey rk =
Registry.CurrentUser.CreateSubKey("RegistryValueOptionsExample");
// Add a value that contains an environment variable.
rk.SetValue("ExpandValue", "The path is %PATH%", RegistryValueKind.ExpandString);
- // Retrieve the value, first without expanding the environment
+ // Retrieve the value, first without expanding the environment
// variable and then expanding it.
- Console.WriteLine("Unexpanded: \"{0}\"",
- rk.GetValue("ExpandValue", "No Value",
+ Console.WriteLine("Unexpanded: \"{0}\"",
+ rk.GetValue("ExpandValue", "No Value",
RegistryValueOptions.DoNotExpandEnvironmentNames));
Console.WriteLine("Expanded: \"{0}\"", rk.GetValue("ExpandValue"));
} //Main
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/RemotingServices.SetObjectUriForMarshal/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/RemotingServices.SetObjectUriForMarshal/CS/source.cs
index 17fd70099ca..8a2592d18af 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/RemotingServices.SetObjectUriForMarshal/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/RemotingServices.SetObjectUriForMarshal/CS/source.cs
@@ -8,10 +8,10 @@ public class SetObjectUriForMarshalTest {
class TestClass : MarshalByRefObject {
}
- [SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.RemotingConfiguration)]
+ [SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.RemotingConfiguration)]
public static void Main() {
- TestClass obj = new TestClass();
+ TestClass obj = new TestClass();
RemotingServices.SetObjectUriForMarshal(obj, "testUri");
RemotingServices.Marshal(obj);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ResourceManager_Class/cs/rmc.cs b/samples/snippets/csharp/VS_Snippets_CLR/ResourceManager_Class/cs/rmc.cs
index 779fbce3e58..4aa3bdf6f4d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ResourceManager_Class/cs/rmc.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ResourceManager_Class/cs/rmc.cs
@@ -5,23 +5,23 @@
using System.Threading;
using System.Globalization;
-class Example
+class Example
{
- public static void Main()
+ public static void Main()
{
string day;
string year;
string holiday;
string celebrate = "{0} will occur on {1} in {2}.\n";
- // Create a resource manager.
- ResourceManager rm = new ResourceManager("rmc",
+ // Create a resource manager.
+ ResourceManager rm = new ResourceManager("rmc",
typeof(Example).Assembly);
Console.WriteLine("Obtain resources using the current UI culture.");
- // Get the resource strings for the day, year, and holiday
- // using the current UI culture.
+ // Get the resource strings for the day, year, and holiday
+ // using the current UI culture.
day = rm.GetString("day");
year = rm.GetString("year");
holiday = rm.GetString("holiday");
@@ -32,27 +32,27 @@ public static void Main()
Console.WriteLine("Obtain resources using the es-MX culture.");
- // Get the resource strings for the day, year, and holiday
- // using the specified culture.
+ // Get the resource strings for the day, year, and holiday
+ // using the specified culture.
day = rm.GetString("day", ci);
year = rm.GetString("year", ci);
holiday = rm.GetString("holiday", ci);
// ---------------------------------------------------------------
-// Alternatively, comment the preceding 3 code statements and
+// Alternatively, comment the preceding 3 code statements and
// uncomment the following 4 code statements:
// ----------------------------------------------------------------
// Set the current UI culture to "es-MX" (Spanish-Mexico).
// Thread.CurrentThread.CurrentUICulture = ci;
-// Get the resource strings for the day, year, and holiday
-// using the current UI culture. Use those strings to
-// display a message.
+// Get the resource strings for the day, year, and holiday
+// using the current UI culture. Use those strings to
+// display a message.
// day = rm.GetString("day");
// year = rm.GetString("year");
// holiday = rm.GetString("holiday");
// ---------------------------------------------------------------
-// Regardless of the alternative that you choose, display a message
+// Regardless of the alternative that you choose, display a message
// using the retrieved resource strings.
Console.WriteLine(celebrate, holiday, day, year);
}
@@ -62,7 +62,7 @@ public static void Main()
Obtain resources using the current UI culture.
"5th of May" will occur on Friday in 2006.
-
+
Obtain resources using the es-MX culture.
"Cinco de Mayo" will occur on Viernes in 2006.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ResourcePermissionBase/CS/resourcepermissionbase.cs b/samples/snippets/csharp/VS_Snippets_CLR/ResourcePermissionBase/CS/resourcepermissionbase.cs
index 74657386da2..cd42eb11595 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ResourcePermissionBase/CS/resourcepermissionbase.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ResourcePermissionBase/CS/resourcepermissionbase.cs
@@ -1,132 +1,132 @@
//
-using System;
-using System.Security.Permissions;
+using System;
+using System.Security.Permissions;
using System.Collections;
[Serializable()]
public class MailslotPermission: ResourcePermissionBase
{
-
+
private ArrayList innerCollection;
- public MailslotPermission()
+ public MailslotPermission()
{
SetNames();
- }
+ }
public MailslotPermission(PermissionState state):base(state)
{
SetNames();
- }
+ }
//
public MailslotPermission(MailslotPermissionAccess permissionAccess, string name, string machineName)
{
SetNames();
- this.AddPermissionAccess(new MailslotPermissionEntry(permissionAccess, name, machineName));
+ this.AddPermissionAccess(new MailslotPermissionEntry(permissionAccess, name, machineName));
}
- public MailslotPermission(MailslotPermissionEntry[] permissionAccessEntries)
+ public MailslotPermission(MailslotPermissionEntry[] permissionAccessEntries)
{
SetNames();
if (permissionAccessEntries == null)
throw new ArgumentNullException("permissionAccessEntries");
-
+
for (int index = 0; index < permissionAccessEntries.Length; ++index)
- this.AddPermissionAccess(permissionAccessEntries[index]);
+ this.AddPermissionAccess(permissionAccessEntries[index]);
}
//
- public ArrayList PermissionEntries
+ public ArrayList PermissionEntries
{
- get
+ get
{
- if (this.innerCollection == null)
+ if (this.innerCollection == null)
this.innerCollection = new ArrayList();
- this.innerCollection.InsertRange(0,base.GetPermissionEntries());
+ this.innerCollection.InsertRange(0,base.GetPermissionEntries());
- return this.innerCollection;
+ return this.innerCollection;
}
}
- internal void AddPermissionAccess(MailslotPermissionEntry entry)
+ internal void AddPermissionAccess(MailslotPermissionEntry entry)
{
base.AddPermissionAccess(entry.GetBaseEntry());
}
- internal new void Clear()
+ internal new void Clear()
{
base.Clear();
}
- internal void RemovePermissionAccess(MailslotPermissionEntry entry)
+ internal void RemovePermissionAccess(MailslotPermissionEntry entry)
{
base.RemovePermissionAccess(entry.GetBaseEntry());
}
- private void SetNames()
+ private void SetNames()
{
this.PermissionAccessType = typeof(MailslotPermissionAccess);
this.TagNames = new string[]{"Name","Machine"};
- }
+ }
}
-[Flags]
-public enum MailslotPermissionAccess
+[Flags]
+public enum MailslotPermissionAccess
{
None = 0,
Send = 1 << 1,
Receive = 1 << 2 | Send,
-}
+}
-[Serializable()]
-public class MailslotPermissionEntry
+[Serializable()]
+public class MailslotPermissionEntry
{
private string name;
private string machineName;
private MailslotPermissionAccess permissionAccess;
- public MailslotPermissionEntry(MailslotPermissionAccess permissionAccess, string name, string machineName)
+ public MailslotPermissionEntry(MailslotPermissionAccess permissionAccess, string name, string machineName)
{
this.permissionAccess = permissionAccess;
this.name = name;
this.machineName = machineName;
- }
+ }
- internal MailslotPermissionEntry(ResourcePermissionBaseEntry baseEntry)
+ internal MailslotPermissionEntry(ResourcePermissionBaseEntry baseEntry)
{
this.permissionAccess = (MailslotPermissionAccess)baseEntry.PermissionAccess;
- this.name = baseEntry.PermissionAccessPath[0];
- this.machineName = baseEntry.PermissionAccessPath[1];
+ this.name = baseEntry.PermissionAccessPath[0];
+ this.machineName = baseEntry.PermissionAccessPath[1];
}
- public string Name
+ public string Name
{
- get
- {
- return this.name;
- }
+ get
+ {
+ return this.name;
+ }
}
- public string MachineName
+ public string MachineName
{
- get
- {
- return this.machineName;
- }
+ get
+ {
+ return this.machineName;
+ }
}
- public MailslotPermissionAccess PermissionAccess
+ public MailslotPermissionAccess PermissionAccess
{
- get
+ get
{
return this.permissionAccess;
- }
- }
+ }
+ }
- internal ResourcePermissionBaseEntry GetBaseEntry()
+ internal ResourcePermissionBaseEntry GetBaseEntry()
{
- ResourcePermissionBaseEntry baseEntry = new ResourcePermissionBaseEntry((int)this.PermissionAccess, new string[] {this.Name,this.MachineName});
+ ResourcePermissionBaseEntry baseEntry = new ResourcePermissionBaseEntry((int)this.PermissionAccess, new string[] {this.Name,this.MachineName});
return baseEntry;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/RijndaelManaged Example/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_CLR/RijndaelManaged Example/CS/class1.cs
index 491df4f4cd3..e557225164d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/RijndaelManaged Example/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/RijndaelManaged Example/CS/class1.cs
@@ -15,7 +15,7 @@ public static void Main()
string original = "Here is some data to encrypt!";
// Create a new instance of the RijndaelManaged
- // class. This generates a new key and initialization
+ // class. This generates a new key and initialization
// vector (IV).
using (RijndaelManaged myRijndael = new RijndaelManaged())
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DefaultDependencyAttribute/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DefaultDependencyAttribute/cs/example.cs
index 5f9682530d9..8cec3af81b1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DefaultDependencyAttribute/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DefaultDependencyAttribute/cs/example.cs
@@ -5,7 +5,7 @@
[assembly: DefaultDependencyAttribute(LoadHint.Always)]
class Program
{
-
+
static void Main(string[] args)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DependencyAttribute/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DependencyAttribute/cs/example.cs
index 0162a8adf6b..013102e6a83 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DependencyAttribute/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DependencyAttribute/cs/example.cs
@@ -7,7 +7,7 @@
class Program
{
-
+
static void Main(string[] args)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DiscardableAttribute/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DiscardableAttribute/cs/example.cs
index 83c7435e118..e90442d695b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DiscardableAttribute/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.DiscardableAttribute/cs/example.cs
@@ -5,7 +5,7 @@
[DiscardableAttribute()]
class Program
{
-
+
static void Main(string[] args)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.StringFreezingAttribute/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.StringFreezingAttribute/cs/example.cs
index ef681adffb3..3b92febcb34 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.StringFreezingAttribute/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.CompilerServices.StringFreezingAttribute/cs/example.cs
@@ -6,9 +6,9 @@
class Program
{
-
+
string frozenString = "This is a frozen string after Ngen is run.";
-
+
static void Main(string[] args)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.GetHRForLastWin32Error/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.GetHRForLastWin32Error/cs/example.cs
index e07033481d7..50139c632ee 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.GetHRForLastWin32Error/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.GetHRForLastWin32Error/cs/example.cs
@@ -36,7 +36,7 @@ static void Main(string[] args)
Run();
}
}
-// This code example displays the following to the console:
+// This code example displays the following to the console:
//
// Calling Win32 MessageBox with error...
// The last Win32 Error was: -2147023496
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.GetLastWin32Error/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.GetLastWin32Error/cs/example.cs
index f6e3c190747..0ff8b420468 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.GetLastWin32Error/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.GetLastWin32Error/cs/example.cs
@@ -46,7 +46,7 @@ static void Main(string[] args)
Run();
}
}
-// This code example displays the following to the console:
+// This code example displays the following to the console:
//
// Calling Win32 MessageBox without error...
// The last Win32 Error was: 0
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.PtrToStructure-SizeOf/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.PtrToStructure-SizeOf/cs/sample.cs
index daa06130ef2..b174ec1f687 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.PtrToStructure-SizeOf/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.PtrToStructure-SizeOf/cs/sample.cs
@@ -33,8 +33,8 @@ static void Main()
// Create another point.
Point anotherP;
- // Set this Point to the value of the
- // Point in unmanaged memory.
+ // Set this Point to the value of the
+ // Point in unmanaged memory.
anotherP = (Point)Marshal.PtrToStructure(pnt, typeof(Point));
Console.WriteLine("The value of new point is " + anotherP.x + " and " + anotherP.y + ".");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToCoTaskMemAnsi/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToCoTaskMemAnsi/cs/sample.cs
index 85b70a66bb0..1df7608e81c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToCoTaskMemAnsi/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToCoTaskMemAnsi/cs/sample.cs
@@ -26,7 +26,7 @@ static void Main()
Marshal.ZeroFreeCoTaskMemAnsi(unmanagedRef);
}
passWord.Dispose();
-
+
Console.WriteLine("Done.");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToCoTaskMemUnicode/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToCoTaskMemUnicode/cs/sample.cs
index 0659e0b366a..fdf5195cfbc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToCoTaskMemUnicode/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToCoTaskMemUnicode/cs/sample.cs
@@ -16,7 +16,7 @@ static void Main()
// Copy the Secure string to unmanaged memory (and decrypt it).
unmanagedRef = Marshal.SecureStringToCoTaskMemUnicode(passWord);
passWord.Dispose();
-
+
if (unmanagedRef != IntPtr.Zero) {
Console.WriteLine("Zeroing out unmanaged memory...");
Marshal.ZeroFreeCoTaskMemUnicode(unmanagedRef);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToHGlobalAnsi/CS/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToHGlobalAnsi/CS/sample.cs
index b86edccdf3f..f4b20797103 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToHGlobalAnsi/CS/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToHGlobalAnsi/CS/sample.cs
@@ -17,7 +17,7 @@ static void Main()
// Copy the Secure string to unmanaged memory (and decrypt it).
unmanagedRef = Marshal.SecureStringToGlobalAllocAnsi(passWord);
passWord.Dispose();
-
+
if (unmanagedRef != IntPtr.Zero) {
Console.WriteLine("Zeroing out unmanaged memory...");
Marshal.ZeroFreeGlobalAllocAnsi(unmanagedRef);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToHGlobalUni/CS/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToHGlobalUni/CS/sample.cs
index a7d500c33ab..92458d8666a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToHGlobalUni/CS/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Runtime.InteropServices.Marshal.SecureStringToHGlobalUni/CS/sample.cs
@@ -95,7 +95,7 @@ public static WindowsImpersonationContext ImpersonateUser(SecureString password,
IntPtr passwordPtr = IntPtr.Zero;
bool returnValue = false;
int error = 0;
-
+
// Marshal the SecureString to unmanaged memory.
passwordPtr = Marshal.SecureStringToGlobalAllocUnicode(password);
@@ -116,7 +116,7 @@ public static WindowsImpersonationContext ImpersonateUser(SecureString password,
if (error != 0) {
throw new System.ComponentModel.Win32Exception(error);
}
- // The token that is passed to the following constructor must
+ // The token that is passed to the following constructor must
// be a primary token in order to use it for impersonation.
WindowsIdentity newId = new WindowsIdentity(tokenHandle);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/RuntimeEnvironment/CS/RuntimeEnvironment.cs b/samples/snippets/csharp/VS_Snippets_CLR/RuntimeEnvironment/CS/RuntimeEnvironment.cs
index 6c66733533e..8eec48eedf2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/RuntimeEnvironment/CS/RuntimeEnvironment.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/RuntimeEnvironment/CS/RuntimeEnvironment.cs
@@ -4,17 +4,17 @@
using System.Reflection;
using System.Runtime.InteropServices;
-public sealed class App
+public sealed class App
{
- static void Main()
- {
+ static void Main()
+ {
//
// Show whether the EXE assembly was loaded from the GAC or from a private subdirectory.
Assembly assem = typeof(App).Assembly;
Console.WriteLine("Did the {0} assembly load from the GAC? {1}",
assem, RuntimeEnvironment.FromGlobalAccessCache(assem));
//
-
+
//
// Show the path where the CLR was loaded from.
Console.WriteLine("Runtime directory: {0}", RuntimeEnvironment.GetRuntimeDirectory());
@@ -25,7 +25,7 @@ static void Main()
Console.WriteLine("System version: {0}", RuntimeEnvironment.GetSystemVersion());
//
- //
+ //
// Show the path of the machine's configuration file.
Console.WriteLine("System configuration file: {0}", RuntimeEnvironment.SystemConfigurationFile);
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/SafeHandle-RuntimeHelpers.PrepareConstrainedRegions/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/SafeHandle-RuntimeHelpers.PrepareConstrainedRegions/cs/sample.cs
index c474f2a094c..6fd841d8294 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/SafeHandle-RuntimeHelpers.PrepareConstrainedRegions/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/SafeHandle-RuntimeHelpers.PrepareConstrainedRegions/cs/sample.cs
@@ -53,7 +53,7 @@ public override bool IsInvalid
get { return IsClosed || handle == IntPtr.Zero; }
}
-
+
[DllImport("kernel32")]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
private static extern bool CloseHandle(IntPtr handle);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/SecureString.xAt/CS/xat.cs b/samples/snippets/csharp/VS_Snippets_CLR/SecureString.xAt/CS/xat.cs
index 45f7d9bef02..419df0481f8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/SecureString.xAt/CS/xat.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/SecureString.xAt/CS/xat.cs
@@ -4,7 +4,7 @@
class Example
{
- public static void Main()
+ public static void Main()
{
string msg = "The curent length of the SecureString object: {0}\n";
Console.WriteLine("1) Instantiate the SecureString object.");
@@ -38,7 +38,7 @@ public static void Main()
Console.WriteLine("8) Delete the value of the SecureString object:");
ss.Clear();
Console.WriteLine(msg, ss.Length);
-
+
ss.Dispose();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.MD5/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.MD5/cs/example.cs
index 4b8a23c9821..1a4100cca30 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.MD5/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.MD5/cs/example.cs
@@ -38,7 +38,7 @@ static string GetMd5Hash(MD5 md5Hash, string input)
// and create a string.
StringBuilder sBuilder = new StringBuilder();
- // Loop through each byte of the hashed data
+ // Loop through each byte of the hashed data
// and format each one as a hexadecimal string.
for (int i = 0; i < data.Length; i++)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.MD5CryptoServiceProvider/cs/example.cs b/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.MD5CryptoServiceProvider/cs/example.cs
index dc26debfc6c..6b8b25dcf53 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.MD5CryptoServiceProvider/cs/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.MD5CryptoServiceProvider/cs/example.cs
@@ -19,7 +19,7 @@ static string getMd5Hash(string input)
// and create a string.
StringBuilder sBuilder = new StringBuilder();
- // Loop through each byte of the hashed data
+ // Loop through each byte of the hashed data
// and format each one as a hexadecimal string.
for (int i = 0; i < data.Length; i++)
{
@@ -52,7 +52,7 @@ static bool verifyMd5Hash(string input, string hash)
static void Main()
{
string source = "Hello World!";
-
+
string hash = getMd5Hash(source);
Console.WriteLine("The MD5 hash of " + source + " is: " + hash + ".");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.Xml.SignedXml.CheckSignature/cs/sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.Xml.SignedXml.CheckSignature/cs/sample.cs
index a1897f5ed81..14cbf036eec 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.Xml.SignedXml.CheckSignature/cs/sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/Security.Cryptography.Xml.SignedXml.CheckSignature/cs/sample.cs
@@ -1,11 +1,11 @@
//
//
// This example signs an XML file using an
-// envelope signature. It then verifies the
+// envelope signature. It then verifies the
// signed XML.
//
// You must have a certificate with a subject name
-// of "CN=XMLDSIG_Test" in the "My" certificate store.
+// of "CN=XMLDSIG_Test" in the "My" certificate store.
//
// Run the following command to create a certificate
// and place it in the store.
@@ -33,7 +33,7 @@ public static void Main(String[] args)
CreateSomeXml("Example.xml");
Console.WriteLine("New XML file created.");
- // Sign the XML that was just created and save it in a
+ // Sign the XML that was just created and save it in a
// new file.
SignXmlFile("Example.xml", "SignedExample.xml", Certificate);
Console.WriteLine("XML file signed.");
@@ -79,7 +79,7 @@ public static void SignXmlFile(string FileName, string SignedFileName, string Su
// Create a SignedXml object.
SignedXml signedXml = new SignedXml(doc);
- // Add the key to the SignedXml document.
+ // Add the key to the SignedXml document.
signedXml.SigningKey = cert.PrivateKey;
// Create a reference to be signed.
@@ -128,7 +128,7 @@ public static void SignXmlFile(string FileName, string SignedFileName, string Su
}
//
- // Verify the signature of an XML file against an asymetric
+ // Verify the signature of an XML file against an asymetric
// algorithm and return the result.
public static Boolean VerifyXmlFile(String FileName, String CertificateSubject)
{
@@ -144,7 +144,7 @@ public static Boolean VerifyXmlFile(String FileName, String CertificateSubject)
// Create a new XML document.
XmlDocument xmlDocument = new XmlDocument();
- // Load the passed XML file into the document.
+ // Load the passed XML file into the document.
xmlDocument.Load(FileName);
// Create a new SignedXml object and pass it
@@ -202,7 +202,7 @@ public static X509Certificate2 GetCertificateBySubject(string CertificateSubject
// Close the store even if an exception was thrown.
store.Close();
}
-
+
return cert;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/SecurityElementMembers/CS/securityelementmembers.cs b/samples/snippets/csharp/VS_Snippets_CLR/SecurityElementMembers/CS/securityelementmembers.cs
index addf4db5599..9f7b605090a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/SecurityElementMembers/CS/securityelementmembers.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/SecurityElementMembers/CS/securityelementmembers.cs
@@ -1,5 +1,5 @@
// This sample demonstrates how to use members of the SecurityElement class.
-// The sample creates a SecurityElement for the root of the XML tree and
+// The sample creates a SecurityElement for the root of the XML tree and
// demonstrates how to add attributes and child elements.
//
using System;
@@ -12,7 +12,7 @@ class SecurityElementMembers
static void Main(string[] args)
{
//
- SecurityElement xmlRootElement =
+ SecurityElement xmlRootElement =
new SecurityElement("RootTag", "XML security tree");
//
@@ -21,10 +21,10 @@ static void Main(string[] args)
DateTime.Now.AddSeconds(1.0).ToString());
//
- SecurityElement windowsRoleElement =
+ SecurityElement windowsRoleElement =
new SecurityElement("WindowsMembership.WindowsRole");
//
-
+
//
windowsRoleElement.AddAttribute("version","1.00");
//
@@ -53,7 +53,7 @@ static void Main(string[] args)
//
Console.WriteLine(elementInXml);
}
-
+
Console.WriteLine("This sample completed successfully; " +
"press Enter to exit.");
Console.ReadLine();
@@ -97,7 +97,7 @@ private static SecurityElement AddChildElement(
if (!SecurityElement.IsValidText(tagText))
//
{
- // Replace invalid text with valid XML text
+ // Replace invalid text with valid XML text
// to enforce proper XML formatting.
//
tagText = SecurityElement.Escape(tagText);
@@ -128,7 +128,7 @@ private static SecurityElement AddChildElement(
new SecurityElement(tagName, tagText));
}
}
- else
+ else
{
// Add child element to the parent security element.
parentElement.AddChild(
@@ -139,7 +139,7 @@ private static SecurityElement AddChildElement(
return parentElement;
}
- // Create and display a summary sentence
+ // Create and display a summary sentence
// about the specified security element.
private static void DisplaySummary(SecurityElement xmlElement)
{
@@ -152,12 +152,12 @@ private static void DisplaySummary(SecurityElement xmlElement)
//
string xmlTreeDescription = xmlElement.Text;
//
-
+
// Retrieve value of the creationdate attribute.
//
string xmlCreationDate = xmlElement.Attribute("creationdate");
//
-
+
// Retrieve the number of children under the security element.
//
string childrenCount = xmlElement.Children.Count.ToString();
@@ -171,7 +171,7 @@ private static void DisplaySummary(SecurityElement xmlElement)
Console.WriteLine(outputMessage);
}
- // Compare the first two occurrences of an attribute
+ // Compare the first two occurrences of an attribute
// in the specified security element.
private static void CompareAttributes(
SecurityElement xmlElement, string attributeName)
@@ -191,7 +191,7 @@ private static void CompareAttributes(
}
}
- // Convert the contents of the specified security element
+ // Convert the contents of the specified security element
// to hash codes stored in a hash table.
private static void ConvertToHashTable(SecurityElement xmlElement)
{
@@ -208,7 +208,7 @@ private static void ConvertToHashTable(SecurityElement xmlElement)
{
parentNum++;
xmlAsHash.Add(xmlParent.GetHashCode(), "parent" + parentNum);
- if ((xmlParent.Children != null) &&
+ if ((xmlParent.Children != null) &&
(xmlParent.Children.Count > 0))
{
int childNum = 0;
@@ -226,7 +226,7 @@ private static void ConvertToHashTable(SecurityElement xmlElement)
private static SecurityElement DestroyTree(SecurityElement xmlElement)
{
SecurityElement localXmlElement = xmlElement;
- SecurityElement destroyElement =
+ SecurityElement destroyElement =
localXmlElement.SearchForChildByTag("destroytime");
// Verify that a destroytime tag exists.
@@ -234,7 +234,7 @@ private static SecurityElement DestroyTree(SecurityElement xmlElement)
if (localXmlElement.SearchForChildByTag("destroytime") != null)
//
{
- // Retrieve the destroytime text to get the time
+ // Retrieve the destroytime text to get the time
// the tree can be destroyed.
//
string storedDestroyTime =
@@ -255,7 +255,7 @@ private static SecurityElement DestroyTree(SecurityElement xmlElement)
typeof(System.Security.SecurityElement)))
//
{
- // Determine whether the localXmlElement object
+ // Determine whether the localXmlElement object
// differs from xmlElement.
//
if (xmlElement.Equals(localXmlElement))
@@ -279,8 +279,8 @@ private static SecurityElement DestroyTree(SecurityElement xmlElement)
}
//
// This sample produces the following output:
-//
-// The security XML tree named RootTag(XML security tree)
+//
+// The security XML tree named RootTag(XML security tree)
// was created on 2/23/2004 1:23:00 PM and contains 2 child elements.
//XML security tree
// 2/23/2004 1:23:01 PM
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ServiceBase_Commands/CS/simpleservice.cs b/samples/snippets/csharp/VS_Snippets_CLR/ServiceBase_Commands/CS/simpleservice.cs
index 8ab775e7b59..a127e29ddcf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ServiceBase_Commands/CS/simpleservice.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ServiceBase_Commands/CS/simpleservice.cs
@@ -125,7 +125,7 @@ protected override void OnStart(string[] args)
SetServiceStatus(handle, ref myServiceStatus);
EventLog.WriteEntry("SimpleService", "Starting SimpleService");
- // Get arguments from the ImagePath string value for the service's registry
+ // Get arguments from the ImagePath string value for the service's registry
// key (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SimpleService).
// These arguments are not used by this sample, this code is only intended to
// demonstrate how to obtain the arguments.
@@ -366,8 +366,8 @@ protected override void OnSessionChange(SessionChangeDescription changeDescripti
}
}
//
- // Define a simple method that runs as the worker thread for
- // the service.
+ // Define a simple method that runs as the worker thread for
+ // the service.
public void ServiceWorkerMethod()
{
#if LOGEVENTS
@@ -394,7 +394,7 @@ public void ServiceWorkerMethod()
{
// Another thread has signalled that this worker
// thread must terminate. Typically, this occurs when
- // the main service thread receives a service stop
+ // the main service thread receives a service stop
// command.
// Write a trace line indicating that the worker thread
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ServiceController/CS/servicecontroller.cs b/samples/snippets/csharp/VS_Snippets_CLR/ServiceController/CS/servicecontroller.cs
index 057cd4c2dd8..842522e7d10 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ServiceController/CS/servicecontroller.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ServiceController/CS/servicecontroller.cs
@@ -17,7 +17,7 @@ class ServiceControllerInfo
[STAThread]
static void Main()
{
- try
+ try
{
// This is a simple interface for exercising the snippet code.
Console.WriteLine("Service options:");
@@ -29,7 +29,7 @@ static void Main()
Console.WriteLine(" 6. List the running services on this computer");
Console.WriteLine("Enter the desired option (or any other key to quit): ");
- // Get the input number.
+ // Get the input number.
String inputText = Console.ReadLine();
int option = 0;
@@ -73,8 +73,8 @@ static void Main()
private static void CheckAlerterServiceStarted()
{
- // The following example uses the ServiceController class to
- // check whether the Alerter service is stopped. If the service is
+ // The following example uses the ServiceController class to
+ // check whether the Alerter service is stopped. If the service is
// stopped, the example starts the service and waits until
// the service status is set to "Running".
@@ -84,7 +84,7 @@ private static void CheckAlerterServiceStarted()
ServiceController sc = new ServiceController();
sc.ServiceName = "Alerter";
- Console.WriteLine("The Alerter service status is currently set to {0}",
+ Console.WriteLine("The Alerter service status is currently set to {0}",
sc.Status.ToString());
if (sc.Status == ServiceControllerStatus.Stopped)
@@ -92,14 +92,14 @@ private static void CheckAlerterServiceStarted()
// Start the service if the current status is stopped.
Console.WriteLine("Starting the Alerter service...");
- try
+ try
{
// Start the service, and wait until its status is "Running".
sc.Start();
sc.WaitForStatus(ServiceControllerStatus.Running);
-
+
// Display the current service status.
- Console.WriteLine("The Alerter service status is now set to {0}.",
+ Console.WriteLine("The Alerter service status is now set to {0}.",
sc.Status.ToString());
}
catch (InvalidOperationException)
@@ -112,8 +112,8 @@ private static void CheckAlerterServiceStarted()
private static void ToggleTelNetServiceState()
{
- // The following example uses the ServiceController class to
- // check the current status of the TelNet service.
+ // The following example uses the ServiceController class to
+ // check the current status of the TelNet service.
// If the service is stopped, the example starts the service.
// If the service is running, the example stops the service.
@@ -121,11 +121,11 @@ private static void ToggleTelNetServiceState()
//
- // Toggle the Telnet service -
+ // Toggle the Telnet service -
// If it is started (running, paused, etc), stop the service.
// If it is stopped, start the service.
ServiceController sc = new ServiceController("Telnet");
- Console.WriteLine("The Telnet service status is currently set to {0}",
+ Console.WriteLine("The Telnet service status is currently set to {0}",
sc.Status.ToString());
if ((sc.Status.Equals(ServiceControllerStatus.Stopped)) ||
@@ -135,43 +135,43 @@ private static void ToggleTelNetServiceState()
Console.WriteLine("Starting the Telnet service...");
sc.Start();
- }
+ }
else
{
// Stop the service if its status is not set to "Stopped".
Console.WriteLine("Stopping the Telnet service...");
sc.Stop();
- }
+ }
// Refresh and display the current service status.
sc.Refresh();
- Console.WriteLine("The Telnet service status is now set to {0}.",
+ Console.WriteLine("The Telnet service status is now set to {0}.",
sc.Status.ToString());
-
+
//
}
private static void CheckDependenciesOnEventLogService()
{
Console.WriteLine();
-
- // The following example uses the ServiceController class to
- // display the set of services that are dependent on the
+
+ // The following example uses the ServiceController class to
+ // display the set of services that are dependent on the
// Event Log service.
//
ServiceController sc = new ServiceController("Event Log");
ServiceController[] scServices = sc.DependentServices;
-
+
// Display the list of services dependent on the Event Log service.
if (scServices.Length == 0)
{
- Console.WriteLine("There are no services dependent on {0}",
+ Console.WriteLine("There are no services dependent on {0}",
sc.ServiceName);
}
- else
+ else
{
Console.WriteLine("Services dependent on {0}:",
sc.ServiceName);
@@ -187,7 +187,7 @@ private static void CheckDependenciesOnEventLogService()
private static void CheckMessengerServiceDependencies()
{
- // The following example uses the ServiceController class to
+ // The following example uses the ServiceController class to
// display the set of services that the "Messenger" service
// is dependent on.
@@ -200,10 +200,10 @@ private static void CheckMessengerServiceDependencies()
// Display the services that the Messenger service is dependent on.
if (scServices.Length == 0)
{
- Console.WriteLine("{0} service is not dependent on any other services.",
+ Console.WriteLine("{0} service is not dependent on any other services.",
sc.ServiceName);
}
- else
+ else
{
Console.WriteLine("{0} service is dependent on the following:",
sc.ServiceName);
@@ -218,8 +218,8 @@ private static void CheckMessengerServiceDependencies()
private static void ListDeviceDriverServices()
{
- // The following example uses the ServiceController class to
- // display the device driver services on the local computer.
+ // The following example uses the ServiceController class to
+ // display the device driver services on the local computer.
Console.WriteLine();
@@ -228,10 +228,10 @@ private static void ListDeviceDriverServices()
scDevices = ServiceController.GetDevices();
int numAdapter = 0,
- numFileSystem = 0,
- numKernel = 0,
+ numFileSystem = 0,
+ numKernel = 0,
numRecognizer = 0;
-
+
// Display the list of device driver services.
Console.WriteLine("Device driver services on the local computer:");
@@ -241,23 +241,23 @@ private static void ListDeviceDriverServices()
// [Running] PCI Bus Driver
// Type = KernelDriver
- Console.WriteLine(" [{0}] {1}",
+ Console.WriteLine(" [{0}] {1}",
scTemp.Status, scTemp.DisplayName);
- Console.WriteLine(" Type = {0}", scTemp.ServiceType);
+ Console.WriteLine(" Type = {0}", scTemp.ServiceType);
// Update counters using the service type bit flags.
if ((scTemp.ServiceType & ServiceType.Adapter) != 0)
{
numAdapter++;
- }
+ }
if ((scTemp.ServiceType & ServiceType.FileSystemDriver) != 0)
{
numFileSystem++;
- }
+ }
if ((scTemp.ServiceType & ServiceType.KernelDriver) != 0)
{
numKernel++;
- }
+ }
if ((scTemp.ServiceType & ServiceType.RecognizerDriver) != 0)
{
numRecognizer++;
@@ -276,7 +276,7 @@ private static void ListDeviceDriverServices()
private static void ListRunningServices()
{
- // The following example uses the ServiceController class to
+ // The following example uses the ServiceController class to
// display services that are running on the local computer.
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ServiceControllerClass/CS/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/ServiceControllerClass/CS/program.cs
index b05afdd20b3..8b693a95bd8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ServiceControllerClass/CS/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ServiceControllerClass/CS/program.cs
@@ -40,7 +40,7 @@ static void Main(string[] args)
}
//
// Issue custom commands to the service
- // enum SimpleServiceCustomCommands
+ // enum SimpleServiceCustomCommands
// { StopWorker = 128, RestartWorker, CheckWorker };
sc.ExecuteCommand((int)SimpleServiceCustomCommands.StopWorker);
sc.ExecuteCommand((int)SimpleServiceCustomCommands.RestartWorker);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/ServiceInstallConfig/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR/ServiceInstallConfig/CS/source.cs
index 1bc0ae6e7c9..92fad4acb6e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/ServiceInstallConfig/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/ServiceInstallConfig/CS/source.cs
@@ -75,9 +75,9 @@ public static bool QueryService(ref ServiceController sc, out String scInfo)
bool serviceValid = false;
scInfo = "";
- try
+ try
{
- if ((sc.ServiceName.Length > 0) ||
+ if ((sc.ServiceName.Length > 0) ||
(sc.DisplayName.Length > 0) )
{
@@ -115,7 +115,7 @@ public static bool QueryService(ref ServiceController sc, out String scInfo)
serviceValid = false;
scInfo = "";
}
-
+
return serviceValid;
}
@@ -126,7 +126,7 @@ public static bool ChangeServiceStartMode(ref ServiceController sc, String start
wmiService = new ManagementObject("Win32_Service.Name='" + sc.ServiceName + "'");
wmiService.Get();
String origStartMode = wmiService["StartMode"].ToString();
-
+
scInfo = "";
startMode = startMode.ToUpper(CultureInfo.InvariantCulture);
@@ -154,11 +154,11 @@ public static bool ChangeServiceStartMode(ref ServiceController sc, String start
retVal = wmiService.InvokeMethod("ChangeStartMode", startArgs);
if (retVal.ToString() != "0")
{
- scInfo += String.Format("Warning: Win32_Service.ChangeStartMode failed with return value {0}",
+ scInfo += String.Format("Warning: Win32_Service.ChangeStartMode failed with return value {0}",
retVal.ToString());
scInfo += Environment.NewLine;
}
- else
+ else
{
scInfo += String.Format("Service {0} start mode changed to {1}",
sc.ServiceName, startMode);
@@ -166,7 +166,7 @@ public static bool ChangeServiceStartMode(ref ServiceController sc, String start
}
}
}
- else
+ else
{
scInfo += String.Format("Invalid start mode.");
scInfo += Environment.NewLine;
@@ -211,7 +211,7 @@ public static bool GetServiceAccount(ref ServiceProcessInstaller svcInst)
svcInst.Password = null;
accountSet = true;
}
-
+
if (!accountSet )
{
// Display a message box. Tell the user to
@@ -220,7 +220,7 @@ public static bool GetServiceAccount(ref ServiceProcessInstaller svcInst)
DialogResult result;
result = MessageBox.Show("Invalid user name or password for service installation."+
" Press Cancel to leave the service account unchanged.",
- "Change Service Account",
+ "Change Service Account",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Hand);
@@ -249,7 +249,7 @@ public class ServiceSampleForm : System.Windows.Forms.Form
private System.Windows.Forms.ComboBox modeComboBox = new System.Windows.Forms.ComboBox();
private ServiceController currentService = new ServiceController();
-
+
private void query_button_Click(object sender, System.EventArgs e)
{
textBox.Text = "Querying service configuration...";
@@ -258,7 +258,7 @@ private void query_button_Click(object sender, System.EventArgs e)
currentService.DisplayName = "TelNet";
if (ServiceChange.QueryService(ref currentService, out scInfo))
- {
+ {
textBox.Text = scInfo;
this.startName_button.Enabled = true;
@@ -267,13 +267,13 @@ private void query_button_Click(object sender, System.EventArgs e)
this.modeLabel.Visible = true;
this.modeComboBox.Visible = true;
}
- else
+ else
{
textBox.Text = "Could not read configuration information for service.";
}
}
- private void startMode_button_Click(object sender,
+ private void startMode_button_Click(object sender,
System.EventArgs e)
{
String scInfo;
@@ -293,15 +293,15 @@ private void startMode_button_Click(object sender,
}
if (ServiceChange.ChangeServiceStartMode(ref currentService, wmiStartMode, out scInfo))
- {
+ {
textBox.Text = "Service start mode updated successfully.";
}
- else
+ else
{
textBox.Text = scInfo;
}
}
-
+
private void startName_button_Click(object sender, System.EventArgs e)
{
ServiceProcessInstaller svcProcInst = new ServiceProcessInstaller();
@@ -309,30 +309,30 @@ private void startName_button_Click(object sender, System.EventArgs e)
textBox.Text = "Displaying service installer dialog...";
if (ServiceChange.GetServiceAccount(ref svcProcInst))
- {
+ {
textBox.Text = "Changing the service account is not currently implemented in this application.";
}
- else
+ else
{
textBox.Text = "No change made to service account.";
}
String scInfo;
if (ServiceChange.QueryService(ref currentService, out scInfo))
- {
+ {
textBox.Text += Environment.NewLine + scInfo;
}
}
public ServiceSampleForm()
{
- this.SuspendLayout();
+ this.SuspendLayout();
- // Set properties for query_button.
+ // Set properties for query_button.
this.query_button.Enabled = true;
this.query_button.Location = new System.Drawing.Point(8, 16);
this.query_button.Name = "query_button";
- this.query_button.Size = new System.Drawing.Size(124, 30);
+ this.query_button.Size = new System.Drawing.Size(124, 30);
this.query_button.Text = "Query Service";
this.query_button.Click += new System.EventHandler(this.query_button_Click);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/keyedhashalgorithm/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/keyedhashalgorithm/cs/program.cs
index 5a402416994..c6ada1ad696 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/keyedhashalgorithm/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/keyedhashalgorithm/cs/program.cs
@@ -20,12 +20,12 @@ public static void Main()
{
// Create a key.
byte[] key1 = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b };
- // Pass the key to the constructor of the HMACMD5 class.
+ // Pass the key to the constructor of the HMACMD5 class.
HMACMD5 hmac1 = new HMACMD5(key1);
// Create another key.
byte[] key2 = System.Text.Encoding.ASCII.GetBytes("KeyString");
- // Pass the key to the constructor of the HMACMD5 class.
+ // Pass the key to the constructor of the HMACMD5 class.
HMACMD5 hmac2 = new HMACMD5(key2);
// Encode a string into a byte array, create a hash of the array,
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/list`1_find_methods/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/list`1_find_methods/cs/program.cs
index 3a3ac6cc8e5..b798fb7a812 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/list`1_find_methods/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/list`1_find_methods/cs/program.cs
@@ -14,7 +14,7 @@ class Program
public static void Main(string[] args)
{
FillList();
-
+
// Find a book by its ID.
Book result = Books.Find(
delegate(Book bk)
@@ -24,7 +24,7 @@ public static void Main(string[] args)
);
if (result != null)
{
- DisplayResult(result, "Find by ID: " + IDtoFind);
+ DisplayResult(result, "Find by ID: " + IDtoFind);
}
else
{
@@ -84,7 +84,7 @@ public static void Main(string[] args)
int mid = Books.Count / 2;
ndx = Books.FindIndex(mid, mid, FindComputer);
Console.WriteLine("Index of first computer book in the second half of the collection: {0}", ndx);
-
+
ndx = Books.FindLastIndex(Books.Count - 1, mid, FindComputer);
Console.WriteLine("Index of last computer book in the second half of the collection: {0}", ndx);
}
@@ -92,7 +92,7 @@ public static void Main(string[] args)
// Populates the list with sample data.
private static void FillList()
{
-
+
// Create XML elements from a source file.
XElement xTree = XElement.Load(@"c:\temp\books.xml");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/math.atanx/CS/atan.cs b/samples/snippets/csharp/VS_Snippets_CLR/math.atanx/CS/atan.cs
index 84e84c740d8..5fd076c3187 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/math.atanx/CS/atan.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/math.atanx/CS/atan.cs
@@ -4,9 +4,9 @@
// Math.Tan()
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
double x = 1.0;
double y = 2.0;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/math.bigmul/CS/bigmul.cs b/samples/snippets/csharp/VS_Snippets_CLR/math.bigmul/CS/bigmul.cs
index c826a210812..8988f5ee927 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/math.bigmul/CS/bigmul.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/math.bigmul/CS/bigmul.cs
@@ -2,9 +2,9 @@
// This example demonstrates Math.BigMul()
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
int int1 = Int32.MaxValue;
int int2 = Int32.MaxValue;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/math.max/CS/max.cs b/samples/snippets/csharp/VS_Snippets_CLR/math.max/CS/max.cs
index c8d6e924c64..d0c28de3717 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/math.max/CS/max.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/math.max/CS/max.cs
@@ -1,9 +1,9 @@
// This example demonstrates Math.Max()
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
//
string str = "{0}: The greater of {1,3} and {2,3} is {3}.";
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/math.midpointrounding/CS/mpr.cs b/samples/snippets/csharp/VS_Snippets_CLR/math.midpointrounding/CS/mpr.cs
index 9c4fa4c292c..3b8ddcd1809 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/math.midpointrounding/CS/mpr.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/math.midpointrounding/CS/mpr.cs
@@ -1,17 +1,17 @@
-// This example demonstrates the Math.Round() method in conjunction
+// This example demonstrates the Math.Round() method in conjunction
// with the MidpointRounding enumeration.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
//
decimal result = 0.0m;
decimal posValue = 3.45m;
decimal negValue = -3.45m;
- // By default, round a positive and a negative value to the nearest even number.
+ // By default, round a positive and a negative value to the nearest even number.
// The precision of the result is 1 decimal place.
result = Math.Round(posValue, 1);
@@ -20,7 +20,7 @@ public static void Main()
Console.WriteLine("{0,4} = Math.Round({1,5}, 1)", result, negValue);
Console.WriteLine();
- // Round a positive value to the nearest even number, then to the nearest number away from zero.
+ // Round a positive value to the nearest even number, then to the nearest number away from zero.
// The precision of the result is 1 decimal place.
result = Math.Round(posValue, 1, MidpointRounding.ToEven);
@@ -29,7 +29,7 @@ public static void Main()
Console.WriteLine("{0,4} = Math.Round({1,5}, 1, MidpointRounding.AwayFromZero)", result, posValue);
Console.WriteLine();
- // Round a negative value to the nearest even number, then to the nearest number away from zero.
+ // Round a negative value to the nearest even number, then to the nearest number away from zero.
// The precision of the result is 1 decimal place.
result = Math.Round(negValue, 1, MidpointRounding.ToEven);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/math.min/CS/min.cs b/samples/snippets/csharp/VS_Snippets_CLR/math.min/CS/min.cs
index d2c0af11494..2930a7128c2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/math.min/CS/min.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/math.min/CS/min.cs
@@ -1,9 +1,9 @@
// This example demonstrates Math.Min()
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
//
string str = "{0}: The lesser of {1,3} and {2,3} is {3}.";
@@ -30,7 +30,7 @@ public static void Main()
Console.WriteLine(str, "Single ", xSingle1, xSingle2, Math.Min(xSingle1, xSingle2));
Console.WriteLine(str, "Double ", xDouble1, xDouble2, Math.Min(xDouble1, xDouble2));
Console.WriteLine(str, "Decimal", xDecimal1, xDecimal2, Math.Min(xDecimal1, xDecimal2));
-
+
Console.WriteLine("\nThe following types are not CLS-compliant:\n");
Console.WriteLine(str, "SByte ", xSbyte1, xSbyte2, Math.Min(xSbyte1, xSbyte2));
Console.WriteLine(str, "UInt16 ", xUshort1, xUshort2, Math.Min(xUshort1, xUshort2));
@@ -57,6 +57,6 @@ public static void Main()
UInt32 : The lesser of 103 and 113 is 103.
UInt64 : The lesser of 104 and 114 is 104.
*/
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/math.sign/CS/sign.cs b/samples/snippets/csharp/VS_Snippets_CLR/math.sign/CS/sign.cs
index 1a4b41ec58b..2063a16e727 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/math.sign/CS/sign.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/math.sign/CS/sign.cs
@@ -2,9 +2,9 @@
// This example demonstrates Math.Sign()
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
string str = "{0}: {1,3} is {2} zero.";
string nl = Environment.NewLine;
@@ -34,11 +34,11 @@ public static void Main()
public static string Test(int compare)
{
- if (compare == 0)
+ if (compare == 0)
return "equal to";
- else if (compare < 0)
+ else if (compare < 0)
return "less than";
- else
+ else
return "greater than";
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/onexitsample/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR/onexitsample/cs/program.cs
index 23753d3f2e5..3ff86dad3e8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/onexitsample/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/onexitsample/cs/program.cs
@@ -9,7 +9,7 @@ public void Stop()
this.CloseMainWindow();
this.Close();
OnExited();
- }
+ }
}
class StartNotePad
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/pathcombine/CS/pathcombine.cs b/samples/snippets/csharp/VS_Snippets_CLR/pathcombine/CS/pathcombine.cs
index 1a6e1b048f6..e7ad5f4aff2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/pathcombine/CS/pathcombine.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/pathcombine/CS/pathcombine.cs
@@ -42,22 +42,22 @@ private static void CombinePaths(string p1, string p2) {
}
// This code produces output similar to the following:
//
-// When you combine 'c:\temp' and 'subdir\file.txt', the result is:
+// When you combine 'c:\temp' and 'subdir\file.txt', the result is:
// 'c:\temp\subdir\file.txt'
-//
-// When you combine 'c:\temp' and 'c:\temp.txt', the result is:
+//
+// When you combine 'c:\temp' and 'c:\temp.txt', the result is:
// 'c:\temp.txt'
-//
-// When you combine 'c:\temp.txt' and 'subdir\file.txt', the result is:
+//
+// When you combine 'c:\temp.txt' and 'subdir\file.txt', the result is:
// 'c:\temp.txt\subdir\file.txt'
-//
-// When you combine 'c:^*&)(_=@#'\^.*(.txt' and 'subdir\file.txt', the result is:
+//
+// When you combine 'c:^*&)(_=@#'\^.*(.txt' and 'subdir\file.txt', the result is:
// 'c:^*&)(_=@#'\^.*(.txt\subdir\file.txt'
-//
-// When you combine '' and 'subdir\file.txt', the result is:
+//
+// When you combine '' and 'subdir\file.txt', the result is:
// 'subdir\file.txt'
-//
-// You cannot combine '' and 'subdir\file.txt' because:
+//
+// You cannot combine '' and 'subdir\file.txt' because:
// Value cannot be null.
// Parameter name: path1
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/platformID.class/CS/pid.cs b/samples/snippets/csharp/VS_Snippets_CLR/platformID.class/CS/pid.cs
index 31098d7b21a..4737fb2acbc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/platformID.class/CS/pid.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/platformID.class/CS/pid.cs
@@ -2,9 +2,9 @@
// This example demonstrates the PlatformID enumeration.
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
string msg1 = "This is a Windows operating system.";
string msg2 = "This is a Unix operating system.";
@@ -14,7 +14,7 @@ public static void Main()
OperatingSystem os = Environment.OSVersion;
PlatformID pid = os.Platform;
- switch (pid)
+ switch (pid)
{
case PlatformID.Win32NT:
case PlatformID.Win32S:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/datareceivedevent.cs b/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/datareceivedevent.cs
index 1a1250e010a..a289f2d6aba 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/datareceivedevent.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/datareceivedevent.cs
@@ -27,7 +27,7 @@ public static void Main()
process.Start();
- // Asynchronously read the standard output of the spawned process.
+ // Asynchronously read the standard output of the spawned process.
// This raises OutputDataReceived events for each line of output.
process.BeginOutputReadLine();
process.WaitForExit();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/net_async.cs b/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/net_async.cs
index d6abf05c8f4..04552c14e3b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/net_async.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/net_async.cs
@@ -2,8 +2,8 @@
//
// Requires .NET Framework version 1.2 or higher.
-// The following example uses the net view command to list the
-// available network resources available on a remote computer,
+// The following example uses the net view command to list the
+// available network resources available on a remote computer,
// and displays the results to the console. Specifying the optional
// error log file redirects error output to that file.
@@ -42,7 +42,7 @@ public static void RedirectNetCommandStreams()
// Default to the help command if there is not an input argument.
netArguments = "/?";
}
-
+
// Check if errors should be redirected to a file.
errorsWritten = false;
Console.WriteLine("Enter a fully qualified path to an error log file");
@@ -56,41 +56,41 @@ public static void RedirectNetCommandStreams()
// Note that at this point, netArguments and netErrorFile
// are set with user input. If the user did not specify
// an error file, then errorRedirect is set to false.
-
+
// Initialize the process and its StartInfo properties.
netProcess = new Process();
netProcess.StartInfo.FileName = "Net.exe";
-
+
// Build the net command argument list.
- netProcess.StartInfo.Arguments = String.Format("view {0}",
+ netProcess.StartInfo.Arguments = String.Format("view {0}",
netArguments);
// Set UseShellExecute to false for redirection.
netProcess.StartInfo.UseShellExecute = false;
- // Redirect the standard output of the net command.
+ // Redirect the standard output of the net command.
// This stream is read asynchronously using an event handler.
netProcess.StartInfo.RedirectStandardOutput = true;
netProcess.OutputDataReceived += new DataReceivedEventHandler(NetOutputDataHandler);
netOutput = new StringBuilder();
-
+
if (errorRedirect)
{
- // Redirect the error output of the net command.
+ // Redirect the error output of the net command.
netProcess.StartInfo.RedirectStandardError = true;
netProcess.ErrorDataReceived += new DataReceivedEventHandler(NetErrorDataHandler);
}
- else
+ else
{
// Do not redirect the error output.
netProcess.StartInfo.RedirectStandardError = false;
}
- Console.WriteLine("\nStarting process: net {0}",
+ Console.WriteLine("\nStarting process: net {0}",
netProcess.StartInfo.Arguments);
if (errorRedirect)
{
- Console.WriteLine("Errors will be written to the file {0}",
+ Console.WriteLine("Errors will be written to the file {0}",
netErrorFile);
}
@@ -115,7 +115,7 @@ public static void RedirectNetCommandStreams()
// Close the error file.
streamError.Close();
}
- else
+ else
{
// Set errorsWritten to false if the stream is not
// open. Either there are no errors, or the error
@@ -127,13 +127,13 @@ public static void RedirectNetCommandStreams()
{
// If the process wrote more than just
// white space, write the output to the console.
- Console.WriteLine("\nPublic network shares from net view:\n{0}\n",
+ Console.WriteLine("\nPublic network shares from net view:\n{0}\n",
netOutput);
}
if (errorsWritten)
{
- // Signal that the error file had something
+ // Signal that the error file had something
// written to it.
String [] errorOutput = File.ReadAllLines(netErrorFile);
if (errorOutput.Length > 0)
@@ -151,7 +151,7 @@ public static void RedirectNetCommandStreams()
netProcess.Close();
}
- private static void NetOutputDataHandler(object sendingProcess,
+ private static void NetOutputDataHandler(object sendingProcess,
DataReceivedEventArgs outLine)
{
// Collect the net view command output.
@@ -162,7 +162,7 @@ private static void NetOutputDataHandler(object sendingProcess,
}
}
- private static void NetErrorDataHandler(object sendingProcess,
+ private static void NetErrorDataHandler(object sendingProcess,
DataReceivedEventArgs errLine)
{
// Write the error text to the file if there is something
@@ -175,7 +175,7 @@ private static void NetErrorDataHandler(object sendingProcess,
if (streamError == null)
{
// Open the file.
- try
+ try
{
streamError = new StreamWriter(netErrorFile, true);
}
@@ -206,7 +206,7 @@ private static void NetErrorDataHandler(object sendingProcess,
}
}
}
-}
+}
//
namespace ProcessAsyncStreamSamples
@@ -217,7 +217,7 @@ class ProcessSampleMain
/// The main entry point for the application.
static void Main()
{
- try
+ try
{
ProcessNetStreamRedirection.RedirectNetCommandStreams();
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/nmake_async.cs b/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/nmake_async.cs
index 27f341a3a5a..32635fc8797 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/nmake_async.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/nmake_async.cs
@@ -34,7 +34,7 @@ public static void RedirectNMakeCommandStreams()
{
nmakeArguments = inputText;
}
-
+
Console.WriteLine("Enter max line limit for log file (default is 25):");
inputText = Console.ReadLine();
if (!String.IsNullOrEmpty(inputText))
@@ -50,7 +50,7 @@ public static void RedirectNMakeCommandStreams()
// Initialize the process and its StartInfo properties.
nmakeProcess = new Process();
nmakeProcess.StartInfo.FileName = "NMake.exe";
-
+
// Build the nmake command argument list.
if (!String.IsNullOrEmpty(nmakeArguments))
{
@@ -60,12 +60,12 @@ public static void RedirectNMakeCommandStreams()
// Set UseShellExecute to false for redirection.
nmakeProcess.StartInfo.UseShellExecute = false;
- // Redirect the standard output of the nmake command.
+ // Redirect the standard output of the nmake command.
// Read the stream asynchronously using an event handler.
nmakeProcess.StartInfo.RedirectStandardOutput = true;
nmakeProcess.OutputDataReceived += new DataReceivedEventHandler(NMakeOutputDataHandler);
-
- // Redirect the error output of the nmake command.
+
+ // Redirect the error output of the nmake command.
nmakeProcess.StartInfo.RedirectStandardError = true;
nmakeProcess.ErrorDataReceived += new DataReceivedEventHandler(NMakeErrorDataHandler);
@@ -75,7 +75,7 @@ public static void RedirectNMakeCommandStreams()
// Write a header to the log file.
const String buildLogFile = "NmakeCmd.Txt";
- try
+ try
{
buildLogStream = new StreamWriter(buildLogFile, true);
}
@@ -89,10 +89,10 @@ public static void RedirectNMakeCommandStreams()
}
if (buildLogStream != null)
- {
- Console.WriteLine("Nmake output logged to {0}",
+ {
+ Console.WriteLine("Nmake output logged to {0}",
buildLogFile);
-
+
buildLogStream.WriteLine();
buildLogStream.WriteLine(DateTime.Now.ToString());
if (!String.IsNullOrEmpty(nmakeArguments))
@@ -100,13 +100,13 @@ public static void RedirectNMakeCommandStreams()
buildLogStream.Write("Command line = NMake {0}",
nmakeArguments);
}
- else
+ else
{
buildLogStream.Write("Command line = Nmake");
}
buildLogStream.WriteLine();
buildLogStream.Flush();
-
+
logMutex.ReleaseMutex();
// Start the process.
@@ -120,7 +120,7 @@ public static void RedirectNMakeCommandStreams()
// Start the asynchronous read of the output stream.
nmakeProcess.BeginOutputReadLine();
-
+
// Let the nmake command run, collecting the output.
nmakeProcess.WaitForExit();
@@ -130,10 +130,10 @@ public static void RedirectNMakeCommandStreams()
}
}
- private static void NMakeOutputDataHandler(object sendingProcess,
+ private static void NMakeOutputDataHandler(object sendingProcess,
DataReceivedEventArgs outLine)
{
- // Collect the output, displaying it to the screen and
+ // Collect the output, displaying it to the screen and
// logging it to the output file. Cancel the read
// operation when the maximum line limit is reached.
@@ -150,9 +150,9 @@ private static void NMakeOutputDataHandler(object sendingProcess,
}
else if (currentLogLines == maxLogLines)
{
- LogToFile("StdOut", "",
+ LogToFile("StdOut", "",
true);
-
+
// Stop reading the output streams.
Process p = sendingProcess as Process;
if (p != null)
@@ -161,7 +161,7 @@ private static void NMakeOutputDataHandler(object sendingProcess,
p.CancelErrorRead();
}
}
- else
+ else
{
// Write the line to the log file.
LogToFile("StdOut", outLine.Data, true);
@@ -170,10 +170,10 @@ private static void NMakeOutputDataHandler(object sendingProcess,
}
}
- private static void NMakeErrorDataHandler(object sendingProcess,
+ private static void NMakeErrorDataHandler(object sendingProcess,
DataReceivedEventArgs errLine)
{
- // Collect error output, displaying it to the screen and
+ // Collect error output, displaying it to the screen and
// logging it to the output file. Cancel the error output
// read operation when the maximum line limit is reached.
@@ -190,9 +190,9 @@ private static void NMakeErrorDataHandler(object sendingProcess,
}
else if (currentLogLines == maxLogLines)
{
- LogToFile("StdErr", "",
+ LogToFile("StdErr", "",
true);
-
+
// Stop reading the output streams
Process p = sendingProcess as Process;
if (p != null)
@@ -201,7 +201,7 @@ private static void NMakeErrorDataHandler(object sendingProcess,
p.CancelOutputRead();
}
}
- else
+ else
{
// Write the line to the log file.
LogToFile("StdErr", errLine.Data, true);
@@ -211,7 +211,7 @@ private static void NMakeErrorDataHandler(object sendingProcess,
}
}
- private static void LogToFile(String logPrefix,
+ private static void LogToFile(String logPrefix,
String logText, bool echoToConsole)
{
// Write the specified line to the log file stream.
@@ -224,7 +224,7 @@ private static void LogToFile(String logPrefix,
if (!String.IsNullOrEmpty(logText))
{
- logString.Append(logText);
+ logString.Append(logText);
}
if (buildLogStream != null)
@@ -233,14 +233,14 @@ private static void LogToFile(String logPrefix,
DateTime.Now.ToString(), logString.ToString());
buildLogStream.Flush();
}
-
+
if (echoToConsole)
{
Console.WriteLine(logString.ToString());
}
}
}
-}
+}
//
namespace ProcessAsyncStreamSamples
@@ -251,7 +251,7 @@ class ProcessSampleMain
/// The main entry point for the application.
static void Main()
{
- try
+ try
{
ProcessNMakeStreamRedirection.RedirectNMakeCommandStreams();
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/sort_async.cs b/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/sort_async.cs
index a83ac3eab26..9629f6fbb6b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/sort_async.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/process_asyncstreams/CS/sort_async.cs
@@ -3,7 +3,7 @@
// Requires .NET Framework version 1.2 or higher.
// The following example uses the sort command to sort a list
-// of input text lines, and displays the sorted list to the console.
+// of input text lines, and displays the sorted list to the console.
//
// Define the namespaces used by this sample.
@@ -34,7 +34,7 @@ public static void SortInputListText()
// Set UseShellExecute to false for redirection.
sortProcess.StartInfo.UseShellExecute = false;
- // Redirect the standard output of the sort command.
+ // Redirect the standard output of the sort command.
// This stream is read asynchronously using an event handler.
sortProcess.StartInfo.RedirectStandardOutput = true;
sortOutput = new StringBuilder();
@@ -55,7 +55,7 @@ public static void SortInputListText()
// Start the asynchronous read of the sort output stream.
sortProcess.BeginOutputReadLine();
- // Prompt the user for input text lines. Write each
+ // Prompt the user for input text lines. Write each
// line to the redirected input stream of the sort command.
Console.WriteLine("Ready to sort up to 50 lines of text");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/process_refresh/CS/process_refresh.cs b/samples/snippets/csharp/VS_Snippets_CLR/process_refresh/CS/process_refresh.cs
index 90453b39a6a..09995750630 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/process_refresh/CS/process_refresh.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/process_refresh/CS/process_refresh.cs
@@ -6,7 +6,7 @@
// The following example starts an instance of Notepad. It then
// retrieves the physical memory usage of the associated process at
// 2 second intervals for a maximum of 10 seconds. The example detects
-// whether the process exits before 10 seconds have elapsed.
+// whether the process exits before 10 seconds have elapsed.
// The example closes the process if it is still running after
// 10 seconds.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/process_sample/CS/process_sample.cs b/samples/snippets/csharp/VS_Snippets_CLR/process_sample/CS/process_sample.cs
index 7f2bab31625..7dc0e7ab260 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/process_sample/CS/process_sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/process_sample/CS/process_sample.cs
@@ -8,7 +8,7 @@
// System.Diagnostics.Process.PriorityClass
// System.Diagnostics.Process.ExitCode
-// The following example starts an instance of Notepad. The example
+// The following example starts an instance of Notepad. The example
// then retrieves and displays various properties of the associated
// process. The example detects when the process exits, and displays the process's exit code.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/regex match, nextmatch, groups, captures/cs/snippet8.cs b/samples/snippets/csharp/VS_Snippets_CLR/regex match, nextmatch, groups, captures/cs/snippet8.cs
index 2affac6333a..7fea29c6c79 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/regex match, nextmatch, groups, captures/cs/snippet8.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/regex match, nextmatch, groups, captures/cs/snippet8.cs
@@ -2,28 +2,28 @@
using System;
using System.Text.RegularExpressions;
-class Example
+class Example
{
- static void Main()
+ static void Main()
{
string text = "One car red car blue car";
string pat = @"(\w+)\s+(car)";
// Instantiate the regular expression object.
Regex r = new Regex(pat, RegexOptions.IgnoreCase);
-
+
// Match the regular expression pattern against a text string.
Match m = r.Match(text);
int matchCount = 0;
- while (m.Success)
+ while (m.Success)
{
Console.WriteLine("Match"+ (++matchCount));
- for (int i = 1; i <= 2; i++)
+ for (int i = 1; i <= 2; i++)
{
Group g = m.Groups[i];
Console.WriteLine("Group"+i+"='" + g + "'");
CaptureCollection cc = g.Captures;
- for (int j = 0; j < cc.Count; j++)
+ for (int j = 0; j < cc.Count; j++)
{
Capture c = cc[j];
System.Console.WriteLine("Capture"+j+"='" + c + "', Position="+c.Index);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR/rfc28981/CS/rfc28981.cs b/samples/snippets/csharp/VS_Snippets_CLR/rfc28981/CS/rfc28981.cs
index ffbdec0ea96..4e75ceb4981 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR/rfc28981/CS/rfc28981.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR/rfc28981/CS/rfc28981.cs
@@ -24,9 +24,9 @@ public static void Main(string[] passwordargs)
{
//
string pwd1 = passwordargs[0];
- // Create a byte array to hold the random value.
+ // Create a byte array to hold the random value.
byte[] salt1 = new byte[8];
- using (RNGCryptoServiceProvider rngCsp = new
+ using (RNGCryptoServiceProvider rngCsp = new
RNGCryptoServiceProvider())
{
// Fill the array with a random value.
@@ -43,7 +43,7 @@ public static void Main(string[] passwordargs)
try
{
//
- Rfc2898DeriveBytes k1 = new Rfc2898DeriveBytes(pwd1, salt1,
+ Rfc2898DeriveBytes k1 = new Rfc2898DeriveBytes(pwd1, salt1,
myIterations);
Rfc2898DeriveBytes k2 = new Rfc2898DeriveBytes(pwd1, salt1);
//
@@ -51,7 +51,7 @@ public static void Main(string[] passwordargs)
TripleDES encAlg = TripleDES.Create();
encAlg.Key = k1.GetBytes(16);
MemoryStream encryptionStream = new MemoryStream();
- CryptoStream encrypt = new CryptoStream(encryptionStream,
+ CryptoStream encrypt = new CryptoStream(encryptionStream,
encAlg.CreateEncryptor(), CryptoStreamMode.Write);
byte[] utfD1 = new System.Text.UTF8Encoding(false).GetBytes(
data1);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Collections.Generic.List.FindIndex/cs/FindIndex3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Collections.Generic.List.FindIndex/cs/FindIndex3.cs
index 3301ac8acc8..1d036ef182c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Collections.Generic.List.FindIndex/cs/FindIndex3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Collections.Generic.List.FindIndex/cs/FindIndex3.cs
@@ -47,12 +47,12 @@ public static void Main()
employees.Sort();
var es = new EmployeeSearch("J");
- int index = employees.FindIndex(4, es.StartsWith);
+ int index = employees.FindIndex(4, es.StartsWith);
Console.WriteLine("Starting index of'J': {0}",
index >= 0 ? index.ToString() : "Not found");
es = new EmployeeSearch("Ju");
- index = employees.FindIndex(4, es.StartsWith);
+ index = employees.FindIndex(4, es.StartsWith);
Console.WriteLine("Starting index of 'Ju': {0}",
index >= 0 ? index.ToString() : "Not found");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Console.ReadKey/cs/ReadKey1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Console.ReadKey/cs/ReadKey1.cs
index aa68b3e544f..b424353e594 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Console.ReadKey/cs/ReadKey1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Console.ReadKey/cs/ReadKey1.cs
@@ -8,7 +8,7 @@ public static void Main()
DateTime dat = DateTime.Now;
Console.WriteLine("The time: {0:d} at {0:t}", dat);
TimeZoneInfo tz = TimeZoneInfo.Local;
- Console.WriteLine("The time zone: {0}\n",
+ Console.WriteLine("The time zone: {0}\n",
tz.IsDaylightSavingTime(dat) ?
tz.DaylightName : tz.StandardName);
Console.Write("Press to exit... ");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Console.ReadKey/cs/ReadKey2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Console.ReadKey/cs/ReadKey2.cs
index e92357c427d..c4451223cf0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Console.ReadKey/cs/ReadKey2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Console.ReadKey/cs/ReadKey2.cs
@@ -8,7 +8,7 @@ public static void Main()
DateTime dat = DateTime.Now;
Console.WriteLine("The time: {0:d} at {0:t}", dat);
TimeZoneInfo tz = TimeZoneInfo.Local;
- Console.WriteLine("The time zone: {0}\n",
+ Console.WriteLine("The time zone: {0}\n",
tz.IsDaylightSavingTime(dat) ?
tz.DaylightName : tz.StandardName);
Console.Write("Press to exit... ");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert UUEncodeDecode functions/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert UUEncodeDecode functions/CS/class1.cs
index 3ce766c0205..cf9c38ef1b7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert UUEncodeDecode functions/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert UUEncodeDecode functions/CS/class1.cs
@@ -18,15 +18,15 @@ static void Main(string[] args)
string inputFileName = args[2];
string outputFileName = args[3];
Coder coder = new Coder(inputFileName, outputFileName);
-
+
switch (args[0]) {
- case "-d":
+ case "-d":
if (args[1] == "-s") {
coder.DecodeWithString();
- }
+ }
else if (args[1] == "-c") {
coder.DecodeWithCharArray();
- }
+ }
else {
System.Console.WriteLine("Second arg must be -s or -c");
return;
@@ -35,16 +35,16 @@ static void Main(string[] args)
case "-e":
if (args[1] == "-s") {
coder.EncodeWithString();
- }
+ }
else if (args[1] == "-c") {
coder.EncodeWithCharArray();
- }
+ }
else {
System.Console.WriteLine("Second arg must be -s or -c");
return;
}
break;
- default:
+ default:
System.Console.WriteLine("First arg must be -d or -e");
break;
}
@@ -57,7 +57,7 @@ public Coder (string inFile, string outFile) {
//
public void EncodeWithString() {
- System.IO.FileStream inFile;
+ System.IO.FileStream inFile;
byte[] binaryData;
try {
@@ -78,8 +78,8 @@ public void EncodeWithString() {
// Convert the binary input into Base64 UUEncoded output.
string base64String;
try {
- base64String =
- System.Convert.ToBase64String(binaryData,
+ base64String =
+ System.Convert.ToBase64String(binaryData,
0,
binaryData.Length);
}
@@ -89,11 +89,11 @@ public void EncodeWithString() {
}
// Write the UUEncoded version to the output file.
- System.IO.StreamWriter outFile;
+ System.IO.StreamWriter outFile;
try {
outFile = new System.IO.StreamWriter(outputFileName,
false,
- System.Text.Encoding.ASCII);
+ System.Text.Encoding.ASCII);
outFile.Write(base64String);
outFile.Close();
}
@@ -106,7 +106,7 @@ public void EncodeWithString() {
//
public void EncodeWithCharArray() {
- System.IO.FileStream inFile;
+ System.IO.FileStream inFile;
byte[] binaryData;
try {
@@ -126,18 +126,18 @@ public void EncodeWithCharArray() {
// Convert the binary input into Base64 UUEncoded output.
// Each 3 byte sequence in the source data becomes a 4 byte
- // sequence in the character array.
+ // sequence in the character array.
long arrayLength = (long) ((4.0d/3.0d) * binaryData.Length);
-
+
// If array length is not divisible by 4, go up to the next
// multiple of 4.
if (arrayLength % 4 != 0) {
arrayLength += 4 - arrayLength % 4;
}
-
+
char[] base64CharArray = new char[arrayLength];
try {
- System.Convert.ToBase64CharArray(binaryData,
+ System.Convert.ToBase64CharArray(binaryData,
0,
binaryData.Length,
base64CharArray,
@@ -153,11 +153,11 @@ public void EncodeWithCharArray() {
}
// Write the UUEncoded version to the output file.
- System.IO.StreamWriter outFile;
+ System.IO.StreamWriter outFile;
try {
outFile = new System.IO.StreamWriter(outputFileName,
false,
- System.Text.Encoding.ASCII);
+ System.Text.Encoding.ASCII);
outFile.Write(base64CharArray);
outFile.Close();
}
@@ -170,7 +170,7 @@ public void EncodeWithCharArray() {
//
public void DecodeWithCharArray() {
- System.IO.StreamReader inFile;
+ System.IO.StreamReader inFile;
char[] base64CharArray;
try {
@@ -189,7 +189,7 @@ public void DecodeWithCharArray() {
// Convert the Base64 UUEncoded input into binary output.
byte[] binaryData;
try {
- binaryData =
+ binaryData =
System.Convert.FromBase64CharArray(base64CharArray,
0,
base64CharArray.Length);
@@ -222,7 +222,7 @@ public void DecodeWithCharArray() {
//
public void DecodeWithString() {
- System.IO.StreamReader inFile;
+ System.IO.StreamReader inFile;
string base64String;
try {
@@ -242,7 +242,7 @@ public void DecodeWithString() {
// Convert the Base64 UUEncoded input into binary output.
byte[] binaryData;
try {
- binaryData =
+ binaryData =
System.Convert.FromBase64String(base64String);
}
catch (System.ArgumentNullException) {
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String.cs
index 70a16650394..d643b82f5ad 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String.cs
@@ -6,7 +6,7 @@ public class Example
public static void Main()
{
// Define an array of 20 elements and display it.
- int[] arr = new int[20];
+ int[] arr = new int[20];
int value = 1;
for (int ctr = 0; ctr <= arr.GetUpperBound(0); ctr++) {
arr[ctr] = value;
@@ -17,19 +17,19 @@ public static void Main()
// Convert the array of integers to a byte array.
byte[] bytes = new byte[arr.Length * 4];
for (int ctr = 0; ctr < arr.Length; ctr++) {
- Array.Copy(BitConverter.GetBytes(arr[ctr]), 0,
+ Array.Copy(BitConverter.GetBytes(arr[ctr]), 0,
bytes, ctr * 4, 4);
}
-
+
// Encode the byte array using Base64 encoding
String base64 = Convert.ToBase64String(bytes);
Console.WriteLine("The encoded string: ");
- for (int ctr = 0; ctr <= base64.Length / 50; ctr++)
- Console.WriteLine(base64.Substring(ctr * 50,
- ctr * 50 + 50 <= base64.Length
+ for (int ctr = 0; ctr <= base64.Length / 50; ctr++)
+ Console.WriteLine(base64.Substring(ctr * 50,
+ ctr * 50 + 50 <= base64.Length
? 50 : base64.Length - ctr * 50));
Console.WriteLine();
-
+
// Convert the string back to a byte array.
byte[] newBytes = Convert.FromBase64String(base64);
@@ -37,7 +37,7 @@ public static void Main()
int[] newArr = new int[newBytes.Length/4];
for (int ctr = 0; ctr < newBytes.Length / 4; ctr ++)
newArr[ctr] = BitConverter.ToInt32(newBytes, ctr * 4);
-
+
DisplayArray(newArr);
}
@@ -47,7 +47,7 @@ private static void DisplayArray(Array arr)
Console.Write("{ ");
for (int ctr = 0; ctr < arr.GetUpperBound(0); ctr++) {
Console.Write("{0}, ", arr.GetValue(ctr));
- if ((ctr + 1) % 10 == 0)
+ if ((ctr + 1) % 10 == 0)
Console.Write("\n ");
}
Console.WriteLine("{0} {1}", arr.GetValue(arr.GetUpperBound(0)), "}");
@@ -58,11 +58,11 @@ private static void DisplayArray(Array arr)
// The array:
// { 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023,
// 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575 }
-//
+//
// The encoded string:
// AQAAAAMAAAAHAAAADwAAAB8AAAA/AAAAfwAAAP8AAAD/AQAA/w
// MAAP8HAAD/DwAA/x8AAP8/AAD/fwAA//8AAP//AQD//wMA//8H
-//
+//
// The array:
// { 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023,
// 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575 }
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String2.cs
index 1f188c51c9d..53492b82986 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String2.cs
@@ -9,11 +9,11 @@ public static void Main()
byte[] bytes = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
Console.WriteLine("The byte array: ");
Console.WriteLine(" {0}\n", BitConverter.ToString(bytes));
-
+
// Convert the array to a base 64 string.
string s = Convert.ToBase64String(bytes);
Console.WriteLine("The base 64 string:\n {0}\n", s);
-
+
// Restore the byte array.
byte[] newBytes = Convert.FromBase64String(s);
Console.WriteLine("The restored byte array: ");
@@ -23,10 +23,10 @@ public static void Main()
// The example displays the following output:
// The byte array:
// 02-04-06-08-0A-0C-0E-10-12-14
-//
+//
// The base 64 string:
// AgQGCAoMDhASFA==
-//
+//
// The restored byte array:
// 02-04-06-08-0A-0C-0E-10-12-14
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String3.cs
index baba33bbaa1..35fec90244c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/cs/ToBase64String3.cs
@@ -17,14 +17,14 @@ public static void Main()
Console.WriteLine(" Total elements: {0}", bytes.Length);
Console.WriteLine(" Length of String Representation: {0}",
BitConverter.ToString(bytes).Length);
- Console.WriteLine(" Sum of elements: {0:N0}", originalTotal);
+ Console.WriteLine(" Sum of elements: {0:N0}", originalTotal);
Console.WriteLine();
-
+
// Convert the array to a base 64 string.
- string s = Convert.ToBase64String(bytes,
+ string s = Convert.ToBase64String(bytes,
Base64FormattingOptions.InsertLineBreaks);
Console.WriteLine("The base 64 string:\n {0}\n", s);
-
+
// Restore the byte array.
Byte[] newBytes = Convert.FromBase64String(s);
int newTotal = 0;
@@ -35,7 +35,7 @@ public static void Main()
Console.WriteLine(" Total elements: {0}", newBytes.Length);
Console.WriteLine(" Length of String Representation: {0}",
BitConverter.ToString(newBytes).Length);
- Console.WriteLine(" Sum of elements: {0:N0}", newTotal);
+ Console.WriteLine(" Sum of elements: {0:N0}", newTotal);
}
}
// The example displays the following output:
@@ -43,11 +43,11 @@ public static void Main()
// Total elements: 100
// Length of String Representation: 299
// Sum of elements: 5,050
-//
+//
// The base 64 string:
// AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5
// Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZA==
-//
+//
// Total elements: 100
// Length of String Representation: 299
// Sum of elements: 5,050
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Compare/cs/Compare1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Compare/cs/Compare1.cs
index 6cb4c13dd3c..dfa7606bebf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Compare/cs/Compare1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Compare/cs/Compare1.cs
@@ -10,18 +10,18 @@ public static void Main()
{
decimal value1 = Decimal.MaxValue;
decimal value2 = value1 - .01m;
- Console.WriteLine("{0} {2} {1}", value1, value2,
- (Relationship) Decimal.Compare(value1, value2));
-
+ Console.WriteLine("{0} {2} {1}", value1, value2,
+ (Relationship) Decimal.Compare(value1, value2));
+
value2 = value1 / 12m - .1m;
value1 = value1 / 12m;
- Console.WriteLine("{0} {2} {1}", value1, value2,
- (Relationship) Decimal.Compare(value1, value2));
-
+ Console.WriteLine("{0} {2} {1}", value1, value2,
+ (Relationship) Decimal.Compare(value1, value2));
+
value1 = value1 - .2m;
value2 = value2 + .1m;
- Console.WriteLine("{0} {2} {1}", value1, value2,
- (Relationship) Decimal.Compare(value1, value2));
+ Console.WriteLine("{0} {2} {1}", value1, value2,
+ (Relationship) Decimal.Compare(value1, value2));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromchar.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromchar.cs
index 0f0e6353985..7c98d2b8c78 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromchar.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromchar.cs
@@ -13,7 +13,7 @@ public static void Main()
decimal decValue = value;
Console.WriteLine("'{0}' ({1}) --> {2} ({3})", value,
value.GetType().Name, decValue,
- decValue.GetType().Name);
+ decValue.GetType().Name);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromdouble.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromdouble.cs
index 66544bb672a..1e078eada6d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromdouble.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromdouble.cs
@@ -10,7 +10,7 @@ class DecimalFromDoubleDemo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -34,12 +34,12 @@ public static void DecimalFromDouble( double argument )
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the explicit conversion from double " +
"to decimal \ngenerates the following output.\n" );
- Console.WriteLine( formatter, "double argument",
+ Console.WriteLine( formatter, "double argument",
"decimal value" );
- Console.WriteLine( formatter, "---------------",
+ Console.WriteLine( formatter, "---------------",
"-------------" );
// Convert double values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromsingle.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromsingle.cs
index 95198b4fa5b..d4468b3707f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromsingle.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.Others/CS/cfromsingle.cs
@@ -10,7 +10,7 @@ class DecimalFromSingleDemo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -34,12 +34,12 @@ public static void DecimalFromSingle( float argument )
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the explicit conversion from float " +
"to decimal \ngenerates the following output.\n" );
- Console.WriteLine( formatter, "float argument",
+ Console.WriteLine( formatter, "float argument",
"decimal value" );
- Console.WriteLine( formatter, "--------------",
+ Console.WriteLine( formatter, "--------------",
"-------------" );
// Convert float values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint16.cs
index 05d7b87e293..0a62a8d64b2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint16.cs
@@ -6,14 +6,14 @@ class Example
public static void Main()
{
// Define an array of 16-bit integer values.
- short[] values = { short.MinValue, short.MaxValue,
- 0xFFF, 12345, -10000 };
+ short[] values = { short.MinValue, short.MaxValue,
+ 0xFFF, 12345, -10000 };
// Convert each value to a Decimal.
foreach (var value in values) {
Decimal decValue = value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
value.GetType().Name, decValue,
- decValue.GetType().Name);
+ decValue.GetType().Name);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint32.cs
index f1f9e022b99..274b2d67b9e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint32.cs
@@ -13,7 +13,7 @@ public static void Main()
Decimal decValue = value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
value.GetType().Name, decValue,
- decValue.GetType().Name);
+ decValue.GetType().Name);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint64.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint64.cs
index 2ff9a6528c1..2856da81eac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromint64.cs
@@ -6,7 +6,7 @@ class Example
public static void Main()
{
// Define an array of 64-bit integer values.
- long[] values = { long.MinValue, long.MaxValue,
+ long[] values = { long.MinValue, long.MaxValue,
0xFFFFFFFFFFFF, 123456789123456789,
-1000000000000000 };
// Convert each value to a Decimal.
@@ -14,7 +14,7 @@ public static void Main()
Decimal decValue = value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
value.GetType().Name, decValue,
- decValue.GetType().Name);
+ decValue.GetType().Name);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromsbyte.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromsbyte.cs
index d83e56cdb96..4125e55e650 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromsbyte.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.SInts/CS/cfromsbyte.cs
@@ -6,14 +6,14 @@ class Example
public static void Main()
{
// Define an array of 8-bit signed integer values.
- sbyte[] values = { sbyte.MinValue, sbyte.MaxValue,
+ sbyte[] values = { sbyte.MinValue, sbyte.MaxValue,
0x3F, 123, -100 };
// Convert each value to a Decimal.
foreach (var value in values) {
Decimal decValue = value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
value.GetType().Name, decValue,
- decValue.GetType().Name);
+ decValue.GetType().Name);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfrombyte.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfrombyte.cs
index d841f72a05e..2efddf3d6ea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfrombyte.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfrombyte.cs
@@ -6,14 +6,14 @@ class Example
public static void Main()
{
// Define an array of byte values.
- byte[] values = { byte.MinValue, byte.MaxValue,
- 0x3F, 123, 200 };
+ byte[] values = { byte.MinValue, byte.MaxValue,
+ 0x3F, 123, 200 };
// Convert each value to a Decimal.
foreach (var value in values) {
decimal decValue = value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
value.GetType().Name, decValue,
- decValue.GetType().Name);
+ decValue.GetType().Name);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint16.cs
index eaf36a4622d..df5d82ee8bc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint16.cs
@@ -6,14 +6,14 @@ class Example
public static void Main()
{
// Define an array of 16-bit unsigned integer values.
- ushort[] values = { ushort.MinValue, ushort.MaxValue,
+ ushort[] values = { ushort.MinValue, ushort.MaxValue,
0xFFF, 12345, 40000 };
// Convert each value to a Decimal.
foreach (var value in values) {
Decimal decValue = value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
value.GetType().Name, decValue,
- decValue.GetType().Name);
+ decValue.GetType().Name);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint32.cs
index 7ab0522aa3f..9e552f25e3e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint32.cs
@@ -13,7 +13,7 @@ public static void Main()
Decimal decValue = value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
value.GetType().Name, decValue,
- decValue.GetType().Name);
+ decValue.GetType().Name);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint64.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint64.cs
index 2564373dd05..a18c3ac1cc7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvFrom.UInts/CS/cfromuint64.cs
@@ -6,15 +6,15 @@ public class Example
public static void Main()
{
// Define an array of 64-bit unsigned integer values.
- ulong[] values = { ulong.MinValue, ulong.MaxValue,
- 0xFFFFFFFFFFFF, 123456789123456789,
+ ulong[] values = { ulong.MinValue, ulong.MaxValue,
+ 0xFFFFFFFFFFFF, 123456789123456789,
1000000000000000 };
// Convert each value to a Decimal.
foreach (var value in values) {
Decimal decValue = value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
value.GetType().Name, decValue,
- decValue.GetType().Name);
+ decValue.GetType().Name);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctochar.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctochar.cs
index db8083b3d4c..89876cf139b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctochar.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctochar.cs
@@ -7,14 +7,14 @@ public static void Main( )
{
// Define an array of decimal values.
decimal[] values = { 3.33m, 55.5m, 77.7m, 123m, 123.999m, 170m,
- 188.88m, 222m, 244m, 8217m, 8250m, 65536m,
+ 188.88m, 222m, 244m, 8217m, 8250m, 65536m,
-1m };
// Convert each value to a Char.
foreach (decimal value in values) {
try {
char charValue = (char) value;
- Console.WriteLine("{0} --> {1} ({2:X4})", value,
- charValue, (ushort) charValue);
+ Console.WriteLine("{0} --> {1} ({2:X4})", value,
+ charValue, (ushort) charValue);
}
catch (OverflowException) {
Console.WriteLine("OverflowException: Cannot convert {0}",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctos_byte.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctos_byte.cs
index 817cbda7cc1..d0f2456733f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctos_byte.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctos_byte.cs
@@ -8,19 +8,19 @@ public static void Main()
// Define an array of decimal values.
decimal[] values = { 78m, new Decimal(78000, 0, 0, false, 3),
78.999m, 255.999m, 256m, 127.999m,
- 128m, -0.999m, -1m, -128.999m, -129m };
+ 128m, -0.999m, -1m, -128.999m, -129m };
foreach (var value in values) {
- try {
+ try {
Byte byteValue = (Byte) value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
- value.GetType().Name, byteValue,
+ value.GetType().Name, byteValue,
byteValue.GetType().Name);
}
catch (OverflowException) {
Console.WriteLine("OverflowException: Cannot convert {0}",
value);
}
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctosgl_dbl.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctosgl_dbl.cs
index 652b53b299a..d05e0b25285 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctosgl_dbl.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctosgl_dbl.cs
@@ -6,19 +6,19 @@ class Example
public static void Main( )
{
// Define an array of decimal values.
- decimal[] values = { 0.0000000000000000000000000001M,
+ decimal[] values = { 0.0000000000000000000000000001M,
0.0000000000123456789123456789M,
123M, new decimal(123000000, 0, 0, false, 6),
- 123456789.123456789M,
- 123456789123456789123456789M,
+ 123456789.123456789M,
+ 123456789123456789123456789M,
decimal.MinValue, decimal.MaxValue };
// Convert each value to a double.
foreach (var value in values) {
double dblValue = (double) value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
- value.GetType().Name, dblValue,
+ value.GetType().Name, dblValue,
dblValue.GetType().Name);
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int16.cs
index a1ab20ba3fe..b9a1a7b3dd4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int16.cs
@@ -1,5 +1,5 @@
//
-// Example of the explicit conversions from decimal to short and
+// Example of the explicit conversions from decimal to short and
// decimal to ushort.
using System;
@@ -11,7 +11,7 @@ class DecimalToU_Int16Demo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -41,20 +41,20 @@ public static void DecimalToU_Int16( decimal argument )
UInt16Value = GetExceptionType( ex );
}
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
Int16Value, UInt16Value );
}
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the explicit conversions from decimal " +
"to short \nand decimal to ushort generates the " +
"following output. It displays \nseveral converted " +
"decimal values.\n" );
- Console.WriteLine( formatter, "decimal argument",
+ Console.WriteLine( formatter, "decimal argument",
"short/exception", "ushort/exception" );
- Console.WriteLine( formatter, "----------------",
+ Console.WriteLine( formatter, "----------------",
"---------------", "----------------" );
// Convert decimal values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int32.cs
index 20e0d6cb0c4..cc1d3f57ed0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int32.cs
@@ -1,5 +1,5 @@
//
-// Example of the explicit conversions from decimal to int and
+// Example of the explicit conversions from decimal to int and
// decimal to uint.
using System;
@@ -11,7 +11,7 @@ class DecimalToU_Int32Demo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -41,20 +41,20 @@ public static void DecimalToU_Int32( decimal argument )
UInt32Value = GetExceptionType( ex );
}
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
Int32Value, UInt32Value );
}
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the explicit conversions from decimal " +
"to int \nand decimal to uint generates the following " +
"output. It displays \nseveral converted decimal " +
"values.\n" );
- Console.WriteLine( formatter, "decimal argument",
+ Console.WriteLine( formatter, "decimal argument",
"int/exception", "uint/exception" );
- Console.WriteLine( formatter, "----------------",
+ Console.WriteLine( formatter, "----------------",
"-------------", "--------------" );
// Convert decimal values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int64.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int64.cs
index 5a62c870d74..6874956c53d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.ConvTo/CS/ctou_int64.cs
@@ -1,5 +1,5 @@
//
-// Example of the explicit conversions from decimal to long and
+// Example of the explicit conversions from decimal to long and
// decimal to ulong.
using System;
@@ -11,7 +11,7 @@ class DecimalToU_Int64Demo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -41,20 +41,20 @@ public static void DecimalToU_Int64( decimal argument )
UInt64Value = GetExceptionType( ex );
}
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
Int64Value, UInt64Value );
}
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the explicit conversions from decimal " +
"to long \nand decimal to ulong generates the following " +
"output. It displays \nseveral converted decimal " +
"values.\n" );
- Console.WriteLine( formatter, "decimal argument",
+ Console.WriteLine( formatter, "decimal argument",
"long/exception", "ulong/exception" );
- Console.WriteLine( formatter, "----------------",
+ Console.WriteLine( formatter, "----------------",
"--------------", "---------------" );
// Convert decimal values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Divide/cs/Divide1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Divide/cs/Divide1.cs
index 48523e6e12a..fd8ec679b86 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Divide/cs/Divide1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Divide/cs/Divide1.cs
@@ -11,7 +11,7 @@ public static void Main()
for (int ctr = 0; ctr <= 10; ctr++) {
Console.WriteLine("{0:N1} / {1:N1} = {2:N4}", dividend, divisor,
Decimal.Divide(dividend, divisor));
- dividend += .1m;
+ dividend += .1m;
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Round/cs/Round12.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Round/cs/Round12.cs
index d29c8d66293..76678affefe 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Round/cs/Round12.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Round/cs/Round12.cs
@@ -6,22 +6,22 @@ class Example
public static void Main()
{
// Define a set of Decimal values.
- decimal[] values = { 1.45m, 1.55m, 123.456789m, 123.456789m,
- 123.456789m, -123.456m,
+ decimal[] values = { 1.45m, 1.55m, 123.456789m, 123.456789m,
+ 123.456789m, -123.456m,
new Decimal(1230000000, 0, 0, true, 7 ),
- new Decimal(1230000000, 0, 0, true, 7 ),
- -9999999999.9999999999m,
+ new Decimal(1230000000, 0, 0, true, 7 ),
+ -9999999999.9999999999m,
-9999999999.9999999999m };
// Define a set of integers to for decimals argument.
int[] decimals = { 1, 1, 4, 6, 8, 0, 3, 11, 9, 10};
-
- Console.WriteLine("{0,26}{1,8}{2,26}",
+
+ Console.WriteLine("{0,26}{1,8}{2,26}",
"Argument", "Digits", "Result" );
- Console.WriteLine("{0,26}{1,8}{2,26}",
+ Console.WriteLine("{0,26}{1,8}{2,26}",
"--------", "------", "------" );
for (int ctr = 0; ctr < values.Length; ctr++)
- Console.WriteLine("{0,26}{1,8}{2,26}",
- values[ctr], decimals[ctr],
+ Console.WriteLine("{0,26}{1,8}{2,26}",
+ values[ctr], decimals[ctr],
Decimal.Round(values[ctr], decimals[ctr]));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Round/cs/Round2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Round/cs/Round2.cs
index f0fcb156c85..06ea751325f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Round/cs/Round2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Decimal.Round/cs/Round2.cs
@@ -6,22 +6,22 @@ class Example
public static void Main()
{
// Define a set of Decimal values.
- decimal[] values = { 1.45m, 1.55m, 123.456789m, 123.456789m,
- 123.456789m, -123.456m,
+ decimal[] values = { 1.45m, 1.55m, 123.456789m, 123.456789m,
+ 123.456789m, -123.456m,
new Decimal(1230000000, 0, 0, true, 7 ),
- new Decimal(1230000000, 0, 0, true, 7 ),
- -9999999999.9999999999m,
+ new Decimal(1230000000, 0, 0, true, 7 ),
+ -9999999999.9999999999m,
-9999999999.9999999999m };
// Define a set of integers to for decimals argument.
int[] decimals = { 1, 1, 4, 6, 8, 0, 3, 11, 9, 10};
-
- Console.WriteLine("{0,26}{1,8}{2,26}",
+
+ Console.WriteLine("{0,26}{1,8}{2,26}",
"Argument", "Digits", "Result" );
- Console.WriteLine("{0,26}{1,8}{2,26}",
+ Console.WriteLine("{0,26}{1,8}{2,26}",
"--------", "------", "------" );
for (int ctr = 0; ctr < values.Length; ctr++)
- Console.WriteLine("{0,26}{1,8}{2,26}",
- values[ctr], decimals[ctr],
+ Console.WriteLine("{0,26}{1,8}{2,26}",
+ values[ctr], decimals[ctr],
Decimal.Round(values[ctr], decimals[ctr]));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Delegate.GetInvocationList/cs/GetInvocationList1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Delegate.GetInvocationList/cs/GetInvocationList1.cs
index 3318007a4e1..ad72f038c54 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Delegate.GetInvocationList/cs/GetInvocationList1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Delegate.GetInvocationList/cs/GetInvocationList1.cs
@@ -14,18 +14,18 @@ public static void Main()
outputMessage += ShowMessageBox;
// Dim output1 As Action(Of String) = AddressOf Console.WriteLine
-// Dim output2 As Action(Of String) = AddressOf OutputToFile
+// Dim output2 As Action(Of String) = AddressOf OutputToFile
// Dim output3 As Action(Of String) = AddressOf MessageBox.Show
-//
+//
// outputMessage = [Delegate].Combine( { output1, output2, output3 } )
- Console.WriteLine("Invocation list has {0} methods.",
+ Console.WriteLine("Invocation list has {0} methods.",
outputMessage.GetInvocationList().Length);
// Invoke delegates normally.
outputMessage("Hello there!");
Console.WriteLine("Press to continue...");
Console.ReadLine();
-
+
// Invoke each delegate in the invocation list in reverse order.
for (int ctr = outputMessage.GetInvocationList().Length - 1; ctr >= 0; ctr--) {
var outputMsg = outputMessage.GetInvocationList()[ctr];
@@ -35,7 +35,7 @@ public static void Main()
Console.ReadLine();
// Invoke each delegate that doesn't write to a file.
- for (int ctr = 0; ctr < outputMessage.GetInvocationList().Length; ctr++) {
+ for (int ctr = 0; ctr < outputMessage.GetInvocationList().Length; ctr++) {
var outputMsg = outputMessage.GetInvocationList()[ctr];
if (! outputMsg.GetMethodInfo().Name.Contains("File"))
outputMsg.DynamicInvoke( new String[] { "Hi!" } );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/Change1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/Change1.cs
index ef2891eff6f..0c8bcf5c812 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/Change1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/Change1.cs
@@ -11,12 +11,12 @@ public static void Main()
CultureInfo newCulture;
if (current.Name.Equals("fr-FR"))
newCulture = new CultureInfo("fr-LU");
- else
+ else
newCulture = new CultureInfo("fr-FR");
-
+
CultureInfo.CurrentCulture = newCulture;
- Console.WriteLine("The current culture is now {0}",
- CultureInfo.CurrentCulture.Name);
+ Console.WriteLine("The current culture is now {0}",
+ CultureInfo.CurrentCulture.Name);
}
}
// The example displays output like the following:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/ChangeUI1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/ChangeUI1.cs
index 8780cba5bc1..fa0b26cafda 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/ChangeUI1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/ChangeUI1.cs
@@ -11,12 +11,12 @@ public static void Main()
CultureInfo newUICulture;
if (current.Name.Equals("sl-SI"))
newUICulture = new CultureInfo("hr-HR");
- else
+ else
newUICulture = new CultureInfo("sl-SI");
-
+
CultureInfo.CurrentUICulture = newUICulture;
- Console.WriteLine("The current UI culture is now {0}",
- CultureInfo.CurrentUICulture.Name);
+ Console.WriteLine("The current UI culture is now {0}",
+ CultureInfo.CurrentUICulture.Name);
}
}
// The example displays output like the following:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/GetCultures1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/GetCultures1.cs
index fd7fdc383ae..d583a8f7d8a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/GetCultures1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.CultureInfo/cs/GetCultures1.cs
@@ -8,25 +8,25 @@ public static void Main()
{
// Get all custom cultures.
CultureInfo[] custom = CultureInfo.GetCultures(CultureTypes.UserCustomCulture);
- if (custom.Length == 0) {
+ if (custom.Length == 0) {
Console.WriteLine("There are no user-defined custom cultures.");
}
else {
Console.WriteLine("Custom cultures:");
- foreach (var culture in custom)
- Console.WriteLine(" {0} -- {1}", culture.Name, culture.DisplayName);
+ foreach (var culture in custom)
+ Console.WriteLine(" {0} -- {1}", culture.Name, culture.DisplayName);
}
Console.WriteLine();
-
+
// Get all replacement cultures.
CultureInfo[] replacements = CultureInfo.GetCultures(CultureTypes.ReplacementCultures);
- if (replacements.Length == 0) {
+ if (replacements.Length == 0) {
Console.WriteLine("There are no replacement cultures.");
- }
+ }
else {
Console.WriteLine("Replacement cultures:");
- foreach (var culture in replacements)
- Console.WriteLine(" {0} -- {1}", culture.Name, culture.DisplayName);
+ foreach (var culture in replacements)
+ Console.WriteLine(" {0} -- {1}", culture.Name, culture.DisplayName);
}
Console.WriteLine();
}
@@ -35,6 +35,6 @@ public static void Main()
// Custom cultures:
// x-en-US-sample -- English (United States)
// fj-FJ -- Boumaa Fijian (Viti)
-//
+//
// There are no replacement cultures.
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.DateTimeFormatInfo.Calendar/cs/CalendarTest1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.DateTimeFormatInfo.Calendar/cs/CalendarTest1.cs
index 447c5e13444..e317c366e22 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.DateTimeFormatInfo.Calendar/cs/CalendarTest1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.DateTimeFormatInfo.Calendar/cs/CalendarTest1.cs
@@ -8,17 +8,17 @@ public static void Main()
{
CultureInfo ci = CultureInfo.CreateSpecificCulture("ar-EG");
Console.WriteLine("The current calendar for the {0} culture is {1}",
- ci.Name,
+ ci.Name,
CalendarUtilities.ShowCalendarName(ci.DateTimeFormat.Calendar));
CalendarUtilities.ChangeCalendar(ci, new JapaneseCalendar());
Console.WriteLine("The current calendar for the {0} culture is {1}",
- ci.Name,
+ ci.Name,
CalendarUtilities.ShowCalendarName(ci.DateTimeFormat.Calendar));
-
+
CalendarUtilities.ChangeCalendar(ci, new UmAlQuraCalendar());
Console.WriteLine("The current calendar for the {0} culture is {1}",
- ci.Name,
+ ci.Name,
CalendarUtilities.ShowCalendarName(ci.DateTimeFormat.Calendar));
}
}
@@ -27,11 +27,11 @@ public class CalendarUtilities
{
private Calendar newCal;
private bool isGregorian;
-
+
public static void ChangeCalendar(CultureInfo ci, Calendar cal)
{
CalendarUtilities util = new CalendarUtilities(cal);
-
+
// Is the new calendar already the current calendar?
if (util.CalendarExists(ci.DateTimeFormat.Calendar))
return;
@@ -40,20 +40,20 @@ public static void ChangeCalendar(CultureInfo ci, Calendar cal)
if (Array.Exists(ci.OptionalCalendars, util.CalendarExists))
ci.DateTimeFormat.Calendar = cal;
}
-
+
private CalendarUtilities(Calendar cal)
{
newCal = cal;
-
+
// Is the new calendar a Gregorian calendar?
isGregorian = cal.GetType().Name.Contains("Gregorian");
}
-
+
private bool CalendarExists(Calendar cal)
{
if (cal.ToString() == newCal.ToString()) {
if (isGregorian) {
- if (((GregorianCalendar) cal).CalendarType ==
+ if (((GregorianCalendar) cal).CalendarType ==
((GregorianCalendar) newCal).CalendarType)
return true;
}
@@ -70,7 +70,7 @@ public static string ShowCalendarName(Calendar cal)
if (cal is GregorianCalendar)
calName += ", Type " + ((GregorianCalendar) cal).CalendarType.ToString();
- return calName;
+ return calName;
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.DateTimeFormatInfo.CurrentInfo/cs/CurrentInfo1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.DateTimeFormatInfo.CurrentInfo/cs/CurrentInfo1.cs
index 93ce44e80c2..bb332acd72a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.DateTimeFormatInfo.CurrentInfo/cs/CurrentInfo1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/System.Globalization.DateTimeFormatInfo.CurrentInfo/cs/CurrentInfo1.cs
@@ -8,32 +8,32 @@ public static void Main()
{
var date = new DateTime(2016, 05, 28, 10, 28, 0);
var dtfi = DateTimeFormatInfo.CurrentInfo;
- Console.WriteLine("Date and Time Formats for {0:u} in the {1} Culture:\n",
- date, CultureInfo.CurrentCulture.Name);
+ Console.WriteLine("Date and Time Formats for {0:u} in the {1} Culture:\n",
+ date, CultureInfo.CurrentCulture.Name);
- Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Long Date Pattern",
- dtfi.LongDatePattern,
+ Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Long Date Pattern",
+ dtfi.LongDatePattern,
date.ToString(dtfi.LongDatePattern));
- Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Long Time Pattern",
- dtfi.LongTimePattern,
+ Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Long Time Pattern",
+ dtfi.LongTimePattern,
date.ToString(dtfi.LongTimePattern));
- Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Month/Day Pattern",
- dtfi.MonthDayPattern,
+ Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Month/Day Pattern",
+ dtfi.MonthDayPattern,
date.ToString(dtfi.MonthDayPattern));
- Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Short Date Pattern",
- dtfi.ShortDatePattern,
+ Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Short Date Pattern",
+ dtfi.ShortDatePattern,
date.ToString(dtfi.ShortDatePattern));
- Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Short Time Pattern",
- dtfi.ShortTimePattern,
+ Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Short Time Pattern",
+ dtfi.ShortTimePattern,
date.ToString(dtfi.ShortTimePattern));
- Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Year/Month Pattern",
- dtfi.YearMonthPattern,
+ Console.WriteLine("{0,-22} {1,-20} {2,-30}", "Year/Month Pattern",
+ dtfi.YearMonthPattern,
date.ToString(dtfi.YearMonthPattern));
}
}
// The example displays the following output:
// Date and Time Formats for 2016-05-28 10:28:00Z in the en-US Culture:
-//
+//
// Long Date Pattern dddd, MMMM d, yyyy Saturday, May 28, 2016
// Long Time Pattern h:mm:ss tt 10:28:00 AM
// Month/Day Pattern MMMM d May 28
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint16.cs
index 578ea1480bd..711b2c3cdea 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint16.cs
@@ -5,22 +5,22 @@
class BytesToInt16Demo
{
const string formatter = "{0,5}{1,17}{2,10}";
-
+
// Convert two byte array elements to a short and display it.
public static void BAToInt16( byte[ ] bytes, int index )
{
short value = BitConverter.ToInt16( bytes, index );
- Console.WriteLine( formatter, index,
+ Console.WriteLine( formatter, index,
BitConverter.ToString( bytes, index, 2 ), value );
}
-
+
public static void Main( )
{
- byte[ ] byteArray =
+ byte[ ] byteArray =
{ 15, 0, 0, 128, 16, 39, 240, 216, 241, 255, 127 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.ToInt16( byte[ ], " +
"int ) \nmethod generates the following output. It " +
"converts elements \nof a byte array to short values.\n" );
@@ -30,7 +30,7 @@ public static void Main( )
Console.WriteLine( );
Console.WriteLine( formatter, "index", "array elements", "short" );
Console.WriteLine( formatter, "-----", "--------------", "-----" );
-
+
// Convert byte array elements to short values.
BAToInt16( byteArray, 1 );
BAToInt16( byteArray, 0 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint32.cs
index cf815866359..e92751ca12a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint32.cs
@@ -5,13 +5,13 @@
class BytesToInt32Demo
{
const string formatter = "{0,5}{1,17}{2,15}";
-
+
// Convert four byte array elements to an int and display it.
public static void BAToInt32( byte[ ] bytes, int index )
{
int value = BitConverter.ToInt32( 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,22 +38,22 @@ public static void WriteMultiLineByteArray( byte[ ] bytes )
public static void Main( )
{
byte[ ] byteArray = {
- 15, 0, 0, 0, 0, 128, 0, 0, 16, 0,
- 0, 240, 255, 0, 202, 154, 59, 0, 54, 101,
+ 15, 0, 0, 0, 0, 128, 0, 0, 16, 0,
+ 0, 240, 255, 0, 202, 154, 59, 0, 54, 101,
196, 241, 255, 255, 255, 127 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.ToInt32( byte[ ], " +
"int ) \nmethod generates the following output. It " +
"converts elements \nof a byte array to int values.\n" );
WriteMultiLineByteArray( byteArray );
- Console.WriteLine( formatter, "index", "array elements",
+ Console.WriteLine( formatter, "index", "array elements",
"int" );
- Console.WriteLine( formatter, "-----", "--------------",
+ Console.WriteLine( formatter, "-----", "--------------",
"---" );
-
+
// Convert byte array elements to int values.
BAToInt32( byteArray, 1 );
BAToInt32( byteArray, 0 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint64.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint64.cs
index 0751b669d0c..c32c1493f0b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CS/batoint64.cs
@@ -5,13 +5,13 @@
class BytesToInt64Demo
{
const string formatter = "{0,5}{1,27}{2,24}";
-
+
// Convert eight byte array elements to a long and display it.
public static void BAToInt64( byte[ ] bytes, int index )
{
long value = BitConverter.ToInt64( 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( "-" );
}
@@ -39,15 +39,15 @@ public static void Main( )
{
byte[ ] byteArray = {
0, 54, 101, 196, 255, 255, 255, 255, 0, 0,
- 0, 0, 0, 0, 0, 0, 128, 0, 202, 154,
- 59, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 255, 255, 255, 255, 1, 0, 0, 255, 255, 255,
- 255, 255, 255, 255, 127, 86, 85, 85, 85, 85,
- 85, 255, 255, 170, 170, 170, 170, 170, 170, 0,
- 0, 100, 167, 179, 182, 224, 13, 0, 0, 156,
+ 0, 0, 0, 0, 0, 0, 128, 0, 202, 154,
+ 59, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+ 255, 255, 255, 255, 1, 0, 0, 255, 255, 255,
+ 255, 255, 255, 255, 127, 86, 85, 85, 85, 85,
+ 85, 255, 255, 170, 170, 170, 170, 170, 170, 0,
+ 0, 100, 167, 179, 182, 224, 13, 0, 0, 156,
88, 76, 73, 31, 242 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.ToInt64( byte[ ], " +
"int ) \nmethod generates the following output. It " +
"converts elements \nof a byte array to long values.\r\n" );
@@ -56,7 +56,7 @@ public static void Main( )
Console.WriteLine( formatter, "index", "array elements", "long" );
Console.WriteLine( formatter, "-----", "--------------", "----" );
-
+
// Convert byte array elements to long values.
BAToInt64( byteArray, 8 );
BAToInt64( byteArray, 5 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint16.cs
index 1a44e0cc460..6a8c1065626 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint16.cs
@@ -5,22 +5,22 @@
class BytesToUInt16Demo
{
const string formatter = "{0,5}{1,17}{2,10}";
-
+
// Convert two byte array elements to a ushort and display it.
public static void BAToUInt16( byte[ ] bytes, int index )
{
ushort value = BitConverter.ToUInt16( bytes, index );
- Console.WriteLine( formatter, index,
+ Console.WriteLine( formatter, index,
BitConverter.ToString( bytes, index, 2 ), value );
}
-
+
public static void Main( )
{
byte[] byteArray = {
15, 0, 0, 255, 3, 16, 39, 255, 255, 127 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.ToUInt16( byte[ ], " +
"int ) \nmethod generates the following output. It " +
"converts elements \nof a byte array to ushort values.\n" );
@@ -28,11 +28,11 @@ public static void Main( )
Console.WriteLine( "------------------" );
Console.WriteLine( BitConverter.ToString( byteArray ) );
Console.WriteLine( );
- Console.WriteLine( formatter, "index", "array elements",
+ Console.WriteLine( formatter, "index", "array elements",
"ushort" );
- Console.WriteLine( formatter, "-----", "--------------",
+ Console.WriteLine( formatter, "-----", "--------------",
"------" );
-
+
// Convert byte array elements to ushort values.
BAToUInt16( byteArray, 1 );
BAToUInt16( byteArray, 0 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint32.cs
index 6bcab2d2ca4..cda026cf477 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint32.cs
@@ -5,23 +5,23 @@
class BytesToUInt32Demo
{
const string formatter = "{0,5}{1,17}{2,15}";
-
+
// Convert four byte array elements to a uint and display it.
public static void BAToUInt32( byte[ ] bytes, int index )
{
uint value = BitConverter.ToUInt32( bytes, index );
- Console.WriteLine( formatter, index,
+ Console.WriteLine( formatter, index,
BitConverter.ToString( bytes, index, 4 ), value );
}
public static void Main( )
{
byte[ ] byteArray = {
- 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(
+ Console.WriteLine(
"This example of the BitConverter.ToUInt32( byte[ ], " +
"int ) \nmethod generates the following output. It " +
"converts elements \nof a byte array to uint values.\n" );
@@ -29,11 +29,11 @@ public static void Main( )
Console.WriteLine( "------------------" );
Console.WriteLine( BitConverter.ToString( byteArray ) );
Console.WriteLine( );
- Console.WriteLine( formatter, "index", "array elements",
+ Console.WriteLine( formatter, "index", "array elements",
"uint" );
- Console.WriteLine( formatter, "-----", "--------------",
+ Console.WriteLine( formatter, "-----", "--------------",
"----" );
-
+
// Convert byte array elements to uint values.
BAToUInt32( byteArray, 1 );
BAToUInt32( byteArray, 0 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint64.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint64.cs
index bcc690ffb9d..f8d387dbf71 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CS/batouint64.cs
@@ -5,13 +5,13 @@
class BytesToUInt64Demo
{
const string formatter = "{0,5}{1,27}{2,24}";
-
+
// Convert eight byte array elements to a ulong and display it.
public static void BAToUInt64( byte[ ] bytes, int index )
{
ulong value = BitConverter.ToUInt64( 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,25 +38,25 @@ public static void WriteMultiLineByteArray( byte[ ] bytes )
public static void Main( )
{
byte[ ] byteArray = {
- 255, 255, 255, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 0, 100, 167, 179, 182, 224,
- 13, 0, 202, 154, 59, 0, 0, 0, 0, 170,
- 170, 170, 170, 170, 170, 0, 0, 232, 137, 4,
- 35, 199, 138, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 100, 167, 179, 182, 224,
+ 13, 0, 202, 154, 59, 0, 0, 0, 0, 170,
+ 170, 170, 170, 170, 170, 0, 0, 232, 137, 4,
+ 35, 199, 138, 255, 255, 255, 255, 255, 255, 255,
255, 127 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of the BitConverter.ToUInt64( byte[ ], " +
"int ) \nmethod generates the following output. It " +
"converts elements \nof a byte array to ulong values.\n" );
WriteMultiLineByteArray( byteArray );
- Console.WriteLine( formatter, "index", "array elements",
+ Console.WriteLine( formatter, "index", "array elements",
"ulong" );
- Console.WriteLine( formatter, "-----", "--------------",
+ Console.WriteLine( formatter, "-----", "--------------",
"------" );
-
+
// Convert byte array elements to ulong values.
BAToUInt64( byteArray, 3 );
BAToUInt64( byteArray, 0 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Boolean/CS/booleanmembers.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Boolean/CS/booleanmembers.cs
index 7f8366bf2af..d73db9467a2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Boolean/CS/booleanmembers.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Boolean/CS/booleanmembers.cs
@@ -22,7 +22,7 @@ public static void Main() {
val = bool.Parse(input);
Console.WriteLine("'{0}' parsed as {1}", input, val);
// The example displays the following output:
- // 'True' parsed as True
+ // 'True' parsed as True
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/bcopy.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/bcopy.cs
index e21fe2c80c0..19c4583cf0e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/bcopy.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/bcopy.cs
@@ -15,7 +15,7 @@ public static void DisplayArray(Array arr, string name)
bytes = BitConverter.GetBytes((long) arr.GetValue(ctr));
else
bytes = BitConverter.GetBytes((short) arr.GetValue(ctr));
-
+
foreach (byte byteValue in bytes)
Console.Write(" {0:X2}", byteValue);
}
@@ -38,7 +38,7 @@ public static void DisplayArrayValues(Array arr, string name)
public static void Main( )
{
// These are the source and destination arrays for BlockCopy.
- short[] src = { 258, 259, 260, 261, 262, 263, 264,
+ short[] src = { 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270 };
long[] dest = { 17, 18, 19, 20 };
@@ -62,8 +62,8 @@ public static void Main( )
DisplayArrayValues(src, "src");
DisplayArrayValues(dest, "dest");
Console.WriteLine();
-
- // Copy bytes 16-20 from source to index 22 in destination and display the result.
+
+ // Copy bytes 16-20 from source to index 22 in destination and display the result.
Buffer.BlockCopy(src, 16, dest, 22, 5);
Console.WriteLine("Buffer.BlockCopy(src, 16, dest, 22, 5)");
Console.WriteLine(" Array values as Bytes:");
@@ -73,7 +73,7 @@ public static void Main( )
DisplayArrayValues(src, "src");
DisplayArrayValues(dest, "dest");
Console.WriteLine();
-
+
// Copy overlapping range of bytes 4-10 to index 5 in source.
Buffer.BlockCopy(src, 4, src, 5, 7 );
Console.WriteLine("Buffer.BlockCopy( src, 4, src, 5, 7)");
@@ -84,8 +84,8 @@ public static void Main( )
DisplayArrayValues(src, "src");
DisplayArrayValues(dest, "dest");
Console.WriteLine();
-
- // Copy overlapping range of bytes 16-22 to index 15 in source.
+
+ // Copy overlapping range of bytes 16-22 to index 15 in source.
Buffer.BlockCopy(src, 16, src, 15, 7);
Console.WriteLine("Buffer.BlockCopy( src, 16, src, 15, 7)");
Console.WriteLine(" Array values as Bytes:");
@@ -104,7 +104,7 @@ public static void Main( )
// Array values:
// src: 0102 0103 0104 0105 0106 0107 0108 0109 010A 010B 010C 010D 010E
// dest: 0000000000000011 0000000000000012 0000000000000013 0000000000000014
-//
+//
// Buffer.BlockCopy(src, 5, dest, 7, 6 )
// Array values as Bytes:
// src: 02 01 03 01 04 01 05 01 06 01 07 01 08 01 09 01 0A 01 0B 01 0C 01 0D 01 0E 01
@@ -112,7 +112,7 @@ public static void Main( )
// Array values:
// src: 0102 0103 0104 0105 0106 0107 0108 0109 010A 010B 010C 010D 010E
// dest: 0100000000000011 0000000701060105 0000000000000013 0000000000000014
-//
+//
// Buffer.BlockCopy(src, 16, dest, 22, 5)
// Array values as Bytes:
// src: 02 01 03 01 04 01 05 01 06 01 07 01 08 01 09 01 0A 01 0B 01 0C 01 0D 01 0E 01
@@ -120,7 +120,7 @@ public static void Main( )
// Array values:
// src: 0102 0103 0104 0105 0106 0107 0108 0109 010A 010B 010C 010D 010E
// dest: 0100000000000011 0000000701060105 010A000000000013 00000000000C010B
-//
+//
// Buffer.BlockCopy( src, 4, src, 5, 7)
// Array values as Bytes:
// src: 02 01 03 01 04 04 01 05 01 06 01 07 08 01 09 01 0A 01 0B 01 0C 01 0D 01 0E 01
@@ -128,7 +128,7 @@ public static void Main( )
// Array values:
// src: 0102 0103 0404 0501 0601 0701 0108 0109 010A 010B 010C 010D 010E
// dest: 0100000000000011 0000000701060105 010A000000000013 00000000000C010B
-//
+//
// Buffer.BlockCopy( src, 16, src, 15, 7)
// Array values as Bytes:
// src: 02 01 03 01 04 04 01 05 01 06 01 07 08 01 09 0A 01 0B 01 0C 01 0D 0D 01 0E 01
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/buffer.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/buffer.cs
index b139493a79b..291331b4712 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/buffer.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/buffer.cs
@@ -16,7 +16,7 @@ public static void DisplayArray( short[ ] arr )
public static void Main( )
{
// This array is to be modified and displayed.
- short[ ] arr = { 258, 259, 260, 261, 262, 263, 264,
+ short[ ] arr = { 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271 };
Console.WriteLine( "This example of the Buffer class " +
@@ -26,7 +26,7 @@ public static void Main( )
// Display the initial array values and ByteLength.
DisplayArray( arr );
- Console.WriteLine( "\nBuffer.ByteLength( arr ): {0}",
+ Console.WriteLine( "\nBuffer.ByteLength( arr ): {0}",
Buffer.ByteLength( arr ) );
// Copy a region of the array; set a byte within the array.
@@ -40,7 +40,7 @@ public static void Main( )
// Display the array and a byte within the array.
Console.WriteLine( "Final values of array:\n" );
DisplayArray( arr );
- Console.WriteLine( "\nBuffer.GetByte( arr, 26 ): {0}",
+ Console.WriteLine( "\nBuffer.GetByte( arr, 26 ): {0}",
Buffer.GetByte( arr, 26 ) );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/overlap1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/overlap1.cs
index 47fd83a7595..1ac19fc8996 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/overlap1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/CS/overlap1.cs
@@ -18,7 +18,7 @@ private static void CopyUp()
foreach (int value in arr)
Console.Write("{0} ", value);
// The example displays the following output:
- // 2 4 6 2 4 6 8 16 18 20
+ // 2 4 6 2 4 6 8 16 18 20
//
}
@@ -31,7 +31,7 @@ private static void CopyDown()
foreach (int value in arr)
Console.Write("{0} ", value);
// The example displays the following output:
- // 8 10 12 14 10 12 14 16 18 20
+ // 8 10 12 14 10 12 14 16 18 20
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/bytelength.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/bytelength.cs
index 02fd8b7ef55..93b1ebf735a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/bytelength.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/bytelength.cs
@@ -11,7 +11,7 @@ public static void ArrayInfo( Array arr, string name )
int byteLength = Buffer.ByteLength( arr );
// Display the array name, type, Length, and ByteLength.
- Console.WriteLine( formatter, name, arr.GetType( ),
+ Console.WriteLine( formatter, name, arr.GetType( ),
arr.Length, byteLength );
}
@@ -25,12 +25,12 @@ public static void Main( )
double[ ] doubles = { 2E-22, .003, 4.4E44, 555E55 };
long[ ] longs = { 1, 10, 100, 1000, 10000, 100000 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of the Buffer.ByteLength( Array ) " +
"\nmethod generates the following output.\n" );
- Console.WriteLine( formatter, "Array name", "Array type",
+ Console.WriteLine( formatter, "Array name", "Array type",
"Length", "ByteLength" );
- Console.WriteLine( formatter, "----------", "----------",
+ Console.WriteLine( formatter, "----------", "----------",
"------", "----------" );
// Display the Length and ByteLength for each array.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/getbyte.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/getbyte.cs
index dc72e40034a..5c49ebad213 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/getbyte.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Buffer.Bytes/CS/getbyte.cs
@@ -25,16 +25,16 @@ public static void ArrayInfo( Array arr, string name, int index )
byte value = Buffer.GetByte( arr, index );
// Display the array name, index, and byte to be viewed.
- Console.WriteLine( formatter, name, index, value,
+ Console.WriteLine( formatter, name, index, value,
String.Format( "0x{0:X2}", value ) );
}
public static void Main( )
{
// These are the arrays to be viewed with GetByte.
- long[ ] longs =
+ long[ ] longs =
{ 333333333333333333, 666666666666666666, 999999999999999999 };
- int[ ] ints =
+ int[ ] ints =
{ 111111111, 222222222, 333333333, 444444444, 555555555 };
Console.WriteLine( "This example of the " +
@@ -49,7 +49,7 @@ public static void Main( )
Console.WriteLine( );
Console.WriteLine( formatter, "Array", "index", "value", "" );
- Console.WriteLine( formatter, "-----", "-----", "-----",
+ Console.WriteLine( formatter, "-----", "-----", "-----",
"----" );
// Display the Length and ByteLength for each array.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte Examples/CS/systembyte.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte Examples/CS/systembyte.cs
index 64998a795ec..6f30a3c9f12 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte Examples/CS/systembyte.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte Examples/CS/systembyte.cs
@@ -20,7 +20,7 @@ static void Main(string[] args)
sbe.MinMaxFields(numberToSet);
sbe.ParseByte();
-
+
sbe.Compare(compareByte);
}
}
@@ -40,7 +40,7 @@ public SystemByteExamples()
// the value is set. If not, an error message is displayed.
// MemberByte is assumed to exist as a class member.
-
+
//
public void MinMaxFields(int numberToSet)
{
@@ -69,7 +69,7 @@ public void ParseByte()
//
string stringToConvert = " 162";
byte byteValue;
-
+
try
{
byteValue = Byte.Parse(stringToConvert);
@@ -91,7 +91,7 @@ public void ParseByte()
public void Compare(Byte myByte)
{
int myCompareResult;
-
+
myCompareResult = MemberByte.CompareTo(myByte);
if(myCompareResult > 0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.Parse/CS/parse.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.Parse/CS/parse.cs
index e060b43955f..8d30e9a391b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.Parse/CS/parse.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.Parse/CS/parse.cs
@@ -23,27 +23,27 @@ private static void CallParse1()
{
byteValue = Byte.Parse(stringToConvert);
Console.WriteLine("Converted '{0}' to {1}.", stringToConvert, byteValue);
- }
+ }
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", stringToConvert);
}
catch (OverflowException)
{
- Console.WriteLine("'{0}' is greater than {1} or less than {2}.",
+ Console.WriteLine("'{0}' is greater than {1} or less than {2}.",
stringToConvert, Byte.MaxValue, Byte.MinValue);
- }
+ }
// The example displays the following output to the console:
- // Converted ' 162' to 162.
+ // Converted ' 162' to 162.
//
}
private static void CallParse2()
{
//
- string stringToConvert;
+ string stringToConvert;
byte byteValue;
-
+
stringToConvert = " 214 ";
try {
byteValue = Byte.Parse(stringToConvert, CultureInfo.InvariantCulture);
@@ -52,9 +52,9 @@ private static void CallParse2()
catch (FormatException) {
Console.WriteLine("Unable to parse '{0}'.", stringToConvert); }
catch (OverflowException) {
- Console.WriteLine("'{0}' is greater than {1} or less than {2}.",
+ Console.WriteLine("'{0}' is greater than {1} or less than {2}.",
stringToConvert, Byte.MaxValue, Byte.MinValue); }
-
+
stringToConvert = " + 214 ";
try {
byteValue = Byte.Parse(stringToConvert, CultureInfo.InvariantCulture);
@@ -63,9 +63,9 @@ private static void CallParse2()
catch (FormatException) {
Console.WriteLine("Unable to parse '{0}'.", stringToConvert); }
catch (OverflowException) {
- Console.WriteLine("'{0}' is greater than {1} or less than {2}.",
+ Console.WriteLine("'{0}' is greater than {1} or less than {2}.",
stringToConvert, Byte.MaxValue, Byte.MinValue); }
-
+
stringToConvert = " +214 ";
try {
byteValue = Byte.Parse(stringToConvert, CultureInfo.InvariantCulture);
@@ -74,7 +74,7 @@ private static void CallParse2()
catch (FormatException) {
Console.WriteLine("Unable to parse '{0}'.", stringToConvert); }
catch (OverflowException) {
- Console.WriteLine("'{0}' is greater than {1} or less than {2}.",
+ Console.WriteLine("'{0}' is greater than {1} or less than {2}.",
stringToConvert, Byte.MaxValue, Byte.MinValue); }
// The example displays the following output to the console:
// Converted ' 214 ' to 214.
@@ -88,7 +88,7 @@ private static void CallParse3()
string value;
NumberStyles style;
byte number;
-
+
// Parse value with no styles allowed.
style = NumberStyles.None;
value = " 241 ";
@@ -98,14 +98,14 @@ private static void CallParse3()
Console.WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException) {
- Console.WriteLine("Unable to parse '{0}'.", value); }
-
+ Console.WriteLine("Unable to parse '{0}'.", value); }
+
// Parse value with trailing sign.
style = NumberStyles.Integer | NumberStyles.AllowTrailingSign;
value = " 163+";
number = Byte.Parse(value, style);
Console.WriteLine("Converted '{0}' to {1}.", value, number);
-
+
// Parse value with leading sign.
value = " +253 ";
number = Byte.Parse(value, style);
@@ -113,8 +113,8 @@ private static void CallParse3()
// This example displays the following output to the console:
// Unable to parse ' 241 '.
// Converted ' 163+' to 163.
- // Converted ' +253 ' to 253.
- //
+ // Converted ' +253 ' to 253.
+ //
}
private static void CallParse4()
@@ -124,10 +124,10 @@ private static void CallParse4()
CultureInfo culture;
string value;
byte number;
-
+
// Parse number with decimals.
// NumberStyles.Float includes NumberStyles.AllowDecimalPoint.
- style = NumberStyles.Float;
+ style = NumberStyles.Float;
culture = CultureInfo.CreateSpecificCulture("fr-FR");
value = "12,000";
@@ -141,7 +141,7 @@ private static void CallParse4()
Console.WriteLine("Converted '{0}' to {1}.", value, number);
}
catch (FormatException) {
- Console.WriteLine("Unable to parse '{0}'.", value); }
+ Console.WriteLine("Unable to parse '{0}'.", value); }
value = "12.000";
number = Byte.Parse(value, style, culture);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.ToString/CS/NewByteMembers.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.ToString/CS/NewByteMembers.cs
index b98d2ed6307..b17563ab396 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.ToString/CS/NewByteMembers.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.ToString/CS/NewByteMembers.cs
@@ -34,35 +34,35 @@ private static void SpecifyFormatProvider()
{
//
byte[] bytes = {0, 1, 14, 168, 255};
- CultureInfo[] providers = {new CultureInfo("en-us"),
- new CultureInfo("fr-fr"),
- new CultureInfo("de-de"),
+ CultureInfo[] providers = {new CultureInfo("en-us"),
+ new CultureInfo("fr-fr"),
+ new CultureInfo("de-de"),
new CultureInfo("es-es")};
foreach (byte byteValue in bytes)
{
foreach (CultureInfo provider in providers)
- Console.Write("{0,3} ({1}) ",
+ Console.Write("{0,3} ({1}) ",
byteValue.ToString(provider), provider.Name);
- Console.WriteLine();
+ Console.WriteLine();
}
// The example displays the following output to the console:
// 0 (en-US) 0 (fr-FR) 0 (de-DE) 0 (es-ES)
// 1 (en-US) 1 (fr-FR) 1 (de-DE) 1 (es-ES)
// 14 (en-US) 14 (fr-FR) 14 (de-DE) 14 (es-ES)
// 168 (en-US) 168 (fr-FR) 168 (de-DE) 168 (es-ES)
- // 255 (en-US) 255 (fr-FR) 255 (de-DE) 255 (es-ES)
+ // 255 (en-US) 255 (fr-FR) 255 (de-DE) 255 (es-ES)
//
}
private static void SpecifyFormatString()
{
//
- string[] formats = {"C3", "D4", "e1", "E2", "F1", "G", "N1",
+ string[] formats = {"C3", "D4", "e1", "E2", "F1", "G", "N1",
"P0", "X4", "0000.0000"};
byte number = 240;
foreach (string format in formats)
- Console.WriteLine("'{0}' format specifier: {1}",
+ Console.WriteLine("'{0}' format specifier: {1}",
format, number.ToString(format));
// The example displays the following output to the console if the
@@ -76,27 +76,27 @@ private static void SpecifyFormatString()
// 'N1' format specifier: 240.0
// 'P0' format specifier: 24,000 %
// 'X4' format specifier: 00F0
- // '0000.0000' format specifier: 0240.0000
- //
+ // '0000.0000' format specifier: 0240.0000
+ //
}
private static void FormatWithProviders()
{
//
byte byteValue = 250;
- CultureInfo[] providers = {new CultureInfo("en-us"),
- new CultureInfo("fr-fr"),
- new CultureInfo("es-es"),
- new CultureInfo("de-de")};
-
- foreach (CultureInfo provider in providers)
- Console.WriteLine("{0} ({1})",
+ CultureInfo[] providers = {new CultureInfo("en-us"),
+ new CultureInfo("fr-fr"),
+ new CultureInfo("es-es"),
+ new CultureInfo("de-de")};
+
+ foreach (CultureInfo provider in providers)
+ Console.WriteLine("{0} ({1})",
byteValue.ToString("N2", provider), provider.Name);
// The example displays the following output to the console:
// 250.00 (en-US)
// 250,00 (fr-FR)
// 250,00 (es-ES)
- // 250,00 (de-DE)
+ // 250,00 (de-DE)
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.ToString/CS/tostring.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.ToString/CS/tostring.cs
index 359a8f6599f..9cd1522709e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.ToString/CS/tostring.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.ToString/CS/tostring.cs
@@ -9,55 +9,55 @@ static void RunToStringDemo( )
{
byte smallValue = 13;
byte largeValue = 234;
-
+
// Format the Byte values without and with format strings.
Console.WriteLine( "\nIFormatProvider is not used:" );
- Console.WriteLine( " {0,-20}{1,10}{2,10}",
- "No format string:", smallValue.ToString( ),
+ Console.WriteLine( " {0,-20}{1,10}{2,10}",
+ "No format string:", smallValue.ToString( ),
largeValue.ToString( ) );
- Console.WriteLine( " {0,-20}{1,10}{2,10}",
- "'X2' format string:", smallValue.ToString( "X2" ),
+ Console.WriteLine( " {0,-20}{1,10}{2,10}",
+ "'X2' format string:", smallValue.ToString( "X2" ),
largeValue.ToString( "X2" ) );
-
- // Get the NumberFormatInfo object from the
+
+ // Get the NumberFormatInfo object from the
// invariant culture.
CultureInfo culture = new CultureInfo( "" );
NumberFormatInfo numInfo = culture.NumberFormat;
-
+
// Set the digit grouping to 1, set the digit separator
// to underscore, and set decimal digits to 0.
numInfo.NumberGroupSizes = new int[ ] { 1 };
numInfo.NumberGroupSeparator = "_";
numInfo.NumberDecimalDigits = 0;
-
+
// Use the NumberFormatInfo object for an IFormatProvider.
- Console.WriteLine(
+ Console.WriteLine(
"\nA NumberFormatInfo object with digit group " +
"size = 1 and \ndigit separator " +
"= '_' is used for the IFormatProvider:" );
- Console.WriteLine( " {0,-20}{1,10}{2,10}",
- "No format string:", smallValue.ToString( numInfo ),
+ Console.WriteLine( " {0,-20}{1,10}{2,10}",
+ "No format string:", smallValue.ToString( numInfo ),
largeValue.ToString( numInfo ) );
- Console.WriteLine( " {0,-20}{1,10}{2,10}",
- "'N' format string:",
- smallValue.ToString( "N", numInfo ),
+ Console.WriteLine( " {0,-20}{1,10}{2,10}",
+ "'N' format string:",
+ smallValue.ToString( "N", numInfo ),
largeValue.ToString( "N", numInfo ) );
- }
-
+ }
+
static void Main( )
{
Console.WriteLine( "This example of\n" +
" Byte.ToString( ),\n" +
- " Byte.ToString( String ),\n" +
+ " Byte.ToString( String ),\n" +
" Byte.ToString( IFormatProvider ), and\n" +
" Byte.ToString( String, IFormatProvider )\n" +
"generates the following output when formatting " +
"Byte values \nwith combinations of format " +
"strings and IFormatProvider." );
-
+
RunToStringDemo( );
}
-}
+}
/*
This example of
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.TryParse/cs/TryParse.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.TryParse/cs/TryParse.cs
index ce9c946c3f5..1de842d1715 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.TryParse/cs/TryParse.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.TryParse/cs/TryParse.cs
@@ -17,20 +17,20 @@ public static void Main()
}
private static void CallTryParse(string stringToConvert)
- {
- byte byteValue;
+ {
+ byte byteValue;
bool success = Byte.TryParse(stringToConvert, out byteValue);
if (success)
{
- Console.WriteLine("Converted '{0}' to {1}",
+ Console.WriteLine("Converted '{0}' to {1}",
stringToConvert, byteValue);
}
else
{
- Console.WriteLine("Attempted conversion of '{0}' failed.",
+ Console.WriteLine("Attempted conversion of '{0}' failed.",
stringToConvert);
}
- }
+ }
}
// The example displays the following output to the console:
// Attempted conversion of '' failed.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.TryParse/cs/TryParse2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.TryParse/cs/TryParse2.cs
index 14b1042a112..d7b15d8e536 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.TryParse/cs/TryParse2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Byte.TryParse/cs/TryParse2.cs
@@ -6,57 +6,57 @@ public class ByteConversion2
{
public static void Main()
{
- string byteString;
+ string byteString;
NumberStyles styles;
-
+
byteString = "1024";
styles = NumberStyles.Integer;
CallTryParse(byteString, styles);
-
+
byteString = "100.1";
styles = NumberStyles.Integer | NumberStyles.AllowDecimalPoint;
CallTryParse(byteString, styles);
-
+
byteString = "100.0";
CallTryParse(byteString, styles);
-
+
byteString = "+100";
- styles = NumberStyles.Integer | NumberStyles.AllowLeadingSign
+ styles = NumberStyles.Integer | NumberStyles.AllowLeadingSign
| NumberStyles.AllowTrailingSign;
CallTryParse(byteString, styles);
-
+
byteString = "-100";
CallTryParse(byteString, styles);
-
+
byteString = "000000000000000100";
CallTryParse(byteString, styles);
-
+
byteString = "00,100";
styles = NumberStyles.Integer | NumberStyles.AllowThousands;
CallTryParse(byteString, styles);
-
+
byteString = "2E+3 ";
styles = NumberStyles.Integer | NumberStyles.AllowExponent;
CallTryParse(byteString, styles);
-
+
byteString = "FF";
styles = NumberStyles.HexNumber;
CallTryParse(byteString, styles);
-
+
byteString = "0x1F";
CallTryParse(byteString, styles);
}
private static void CallTryParse(string stringToConvert, NumberStyles styles)
- {
+ {
Byte byteValue;
- bool result = Byte.TryParse(stringToConvert, styles,
+ bool result = Byte.TryParse(stringToConvert, styles,
null as IFormatProvider, out byteValue);
if (result)
- Console.WriteLine("Converted '{0}' to {1}",
+ Console.WriteLine("Converted '{0}' to {1}",
stringToConvert, byteValue);
else
- Console.WriteLine("Attempted conversion of '{0}' failed.",
+ Console.WriteLine("Attempted conversion of '{0}' failed.",
stringToConvert.ToString());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char [Type Level]/CS/charstructure.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char [Type Level]/CS/charstructure.cs
index 4999052da6c..c3df6be31f5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char [Type Level]/CS/charstructure.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char [Type Level]/CS/charstructure.cs
@@ -7,7 +7,7 @@ public static void Main()
{
char chA = 'A';
char ch1 = '1';
- string str = "test string";
+ string str = "test string";
Console.WriteLine(chA.CompareTo('B')); //----------- Output: "-1" (meaning 'A' is 1 less than 'B')
Console.WriteLine(chA.Equals('A')); //----------- Output: "True"
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.GetNumericValue/CS/getnumericvalue1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.GetNumericValue/CS/getnumericvalue1.cs
index 995c4e8cf9a..cbfd442caa7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.GetNumericValue/CS/getnumericvalue1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.GetNumericValue/CS/getnumericvalue1.cs
@@ -15,7 +15,7 @@ private static void Overload1()
int utf32 = 0x10107; // AEGEAN NUMBER ONE
string surrogate = Char.ConvertFromUtf32(utf32);
foreach (var ch in surrogate)
- Console.WriteLine("U+{0:X4}: {1} ", Convert.ToUInt16(ch),
+ Console.WriteLine("U+{0:X4}: {1} ", Convert.ToUInt16(ch),
Char.GetNumericValue(ch));
// The example displays the following output:
@@ -23,21 +23,21 @@ private static void Overload1()
// U+DD07: -1
//
}
-
+
private static void Overload2()
{
//
- // Define a UTF32 value for each character in the
+ // Define a UTF32 value for each character in the
// Aegean numbering system.
for (int utf32 = 0x10107; utf32 <= 0x10133; utf32++) {
string surrogate = Char.ConvertFromUtf32(utf32);
- for (int ctr = 0; ctr < surrogate.Length; ctr++)
- Console.Write("U+{0:X4} at position {1}: {2} ",
- Convert.ToUInt16(surrogate[ctr]), ctr,
+ for (int ctr = 0; ctr < surrogate.Length; ctr++)
+ Console.Write("U+{0:X4} at position {1}: {2} ",
+ Convert.ToUInt16(surrogate[ctr]), ctr,
Char.GetNumericValue(surrogate, ctr));
Console.WriteLine();
- }
+ }
// The example displays the following output:
// U+D800 at position 0: 1 U+DD07 at position 1: -1
// U+D800 at position 0: 2 U+DD08 at position 1: -1
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsControl/CS/IsControl1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsControl/CS/IsControl1.cs
index 2cf9dcf8075..6a63389c0fb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsControl/CS/IsControl1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsControl/CS/IsControl1.cs
@@ -6,7 +6,7 @@ public class ControlChars
public static void Main()
{
int charsWritten = 0;
-
+
for (int ctr = 0x00; ctr <= 0xFFFF; ctr++)
{
char ch = Convert.ToChar(ctr);
@@ -16,8 +16,8 @@ public static void Main()
charsWritten++;
if (charsWritten % 6 == 0)
Console.WriteLine();
- }
- }
+ }
+ }
}
}
// The example displays the following output to the console:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsControl/CS/IsControl2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsControl/CS/IsControl2.cs
index 24bed98b968..80586900ca2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsControl/CS/IsControl2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsControl/CS/IsControl2.cs
@@ -9,7 +9,7 @@ public static void Main()
for (int ctr = 0; ctr < sentence.Length; ctr++)
{
if (Char.IsControl(sentence, ctr))
- Console.WriteLine("Control character \\U{0} found in position {1}.",
+ Console.WriteLine("Control character \\U{0} found in position {1}.",
Convert.ToInt32(sentence[ctr]).ToString("X4"), ctr);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsNumber/CS/isnumber1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsNumber/CS/isnumber1.cs
index b23175ae84e..0ebf4695de4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsNumber/CS/isnumber1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsNumber/CS/isnumber1.cs
@@ -15,12 +15,12 @@ private static void Overload1()
int utf32 = 0x10107; // AEGEAN NUMBER ONE
string surrogate = Char.ConvertFromUtf32(utf32);
foreach (var ch in surrogate)
- Console.WriteLine("U+{0:X4}: {1}", Convert.ToUInt16(ch),
+ Console.WriteLine("U+{0:X4}: {1}", Convert.ToUInt16(ch),
Char.IsNumber(ch));
// The example displays the following output:
// U+D800: False
- // U+DD07: False
+ // U+DD07: False
//
}
@@ -30,8 +30,8 @@ private static void Overload2()
int utf32 = 0x10107; // AEGEAN NUMBER ONE
string surrogate = Char.ConvertFromUtf32(utf32);
for (int ctr = 0; ctr < surrogate.Length; ctr++)
- Console.WriteLine("U+{0:X4} at position {1}: {2}",
- Convert.ToUInt16(surrogate[ctr]), ctr,
+ Console.WriteLine("U+{0:X4} at position {1}: {2}",
+ Convert.ToUInt16(surrogate[ctr]), ctr,
Char.IsNumber(surrogate, ctr));
// The example displays the following output:
// U+D800 at position 0: True
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsSymbol/CS/issymbol.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsSymbol/CS/issymbol.cs
index db20392a8cf..32558b608c5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsSymbol/CS/issymbol.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsSymbol/CS/issymbol.cs
@@ -3,7 +3,7 @@
public class IsSymbolSample {
public static void Main() {
- string str = "non-symbolic characters";
+ string str = "non-symbolic characters";
Console.WriteLine(Char.IsSymbol('+')); // Output: "True"
Console.WriteLine(Char.IsSymbol(str, 8)); // Output: "False"
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsWhiteSpace/CS/iswhitespace.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsWhiteSpace/CS/iswhitespace.cs
index f30aac78c4a..6402e908eb9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsWhiteSpace/CS/iswhitespace.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Char.IsWhiteSpace/CS/iswhitespace.cs
@@ -3,7 +3,7 @@
public class IsWhiteSpaceSample {
public static void Main() {
- string str = "black matter";
+ string str = "black matter";
Console.WriteLine(Char.IsWhiteSpace('A')); // Output: "False"
Console.WriteLine(Char.IsWhiteSpace(str, 5)); // Output: "True"
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/cs/CharEnumerator1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/cs/CharEnumerator1.cs
index 516b8af7a44..7df1b961211 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/cs/CharEnumerator1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/cs/CharEnumerator1.cs
@@ -17,8 +17,8 @@ private static void UseCharEnumerator()
int ctr = 1;
string outputLine1 = null;
string outputLine2 = null;
- string outputLine3 = null;
-
+ string outputLine3 = null;
+
while (chEnum.MoveNext())
{
outputLine1 += ctr < 10 || ctr % 10 != 0 ? " " : (ctr / 10) + " ";
@@ -26,19 +26,19 @@ private static void UseCharEnumerator()
outputLine3 += chEnum.Current + " ";
ctr++;
}
-
- Console.WriteLine("The length of the string is {0} characters:",
+
+ Console.WriteLine("The length of the string is {0} characters:",
title.Length);
Console.WriteLine(outputLine1);
- Console.WriteLine(outputLine2);
+ Console.WriteLine(outputLine2);
Console.WriteLine(outputLine3);
- // The example displays the following output to the console:
+ // The example displays the following output to the console:
// The length of the string is 20 characters:
// 1 2
// 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// A T a l e o f T w o C i t i e s
//
- }
+ }
private static void UseForEach()
{
@@ -47,8 +47,8 @@ private static void UseForEach()
int ctr = 1;
string outputLine1 = null;
string outputLine2 = null;
- string outputLine3 = null;
-
+ string outputLine3 = null;
+
foreach (char ch in title)
{
outputLine1 += ctr < 10 || ctr % 10 != 0 ? " " : (ctr / 10) + " ";
@@ -56,17 +56,17 @@ private static void UseForEach()
outputLine3 += ch + " ";
ctr++;
}
-
- Console.WriteLine("The length of the string is {0} characters:",
+
+ Console.WriteLine("The length of the string is {0} characters:",
title.Length);
Console.WriteLine(outputLine1);
- Console.WriteLine(outputLine2);
+ Console.WriteLine(outputLine2);
Console.WriteLine(outputLine3);
- // The example displays the following output to the console:
+ // The example displays the following output to the console:
// The length of the string is 20 characters:
// 1 2
// 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// A T a l e o f T w o C i t i e s
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.CodeDOM.Generics.1/CS/codedomgenerics.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.CodeDOM.Generics.1/CS/codedomgenerics.cs
index 79deb96f706..687715a92bb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.CodeDOM.Generics.1/CS/codedomgenerics.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.CodeDOM.Generics.1/CS/codedomgenerics.cs
@@ -55,7 +55,7 @@ static void CreateGenericsCode(string providerName, string sourceFileName, strin
s.Close();
CompilerParameters opt = new CompilerParameters(new string[]{
- "System.dll",
+ "System.dll",
"System.Xml.dll",
"System.Windows.Forms.dll",
"System.Data.dll",
@@ -106,8 +106,8 @@ static void CreateGraph(CodeDomProvider provider, CodeCompileUnit cu)
class1.Name = "MyDictionary";
class1.BaseTypes.Add(new CodeTypeReference("Dictionary",
new CodeTypeReference[] {
- new CodeTypeReference("TKey"),
- new CodeTypeReference("TValue"),
+ new CodeTypeReference("TKey"),
+ new CodeTypeReference("TValue"),
}));
//
//
@@ -174,8 +174,8 @@ static void CreateGraph(CodeDomProvider provider, CodeCompileUnit cu)
"MyDictionary",
new CodeTypeReference[] {
new CodeTypeReference(typeof(int)),
- new CodeTypeReference("List",
- new CodeTypeReference[]
+ new CodeTypeReference("List",
+ new CodeTypeReference[]
{new CodeTypeReference("System.String") })});
methodMain.Statements.Add(
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/CS/codedirective.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/CS/codedirective.cs
index 31c3fc869a4..7b1585a4644 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/CS/codedirective.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/CS/codedirective.cs
@@ -55,7 +55,7 @@ static void DemonstrateCodeDirectives(string providerName, string sourceFileName
s.Close();
CompilerParameters opt = new CompilerParameters(new string[]{
- "System.dll",
+ "System.dll",
"System.Xml.dll",
"System.Windows.Forms.dll",
"System.Data.dll",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collection.Specialized.StringDictionary/CS/stringdictionary.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collection.Specialized.StringDictionary/CS/stringdictionary.cs
index ac95090c34e..fd5c829e54e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collection.Specialized.StringDictionary/CS/stringdictionary.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collection.Specialized.StringDictionary/CS/stringdictionary.cs
@@ -66,7 +66,7 @@ public static void PrintKeysAndValues1( StringDictionary myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintKeysAndValues2( StringDictionary myCol ) {
IEnumerator myEnumerator = myCol.GetEnumerator();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collection.Specialized.StringDictionary_Enumeration/CS/stringdictionary_enumeration.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collection.Specialized.StringDictionary_Enumeration/CS/stringdictionary_enumeration.cs
index 707fca9956b..effbe9aa29d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collection.Specialized.StringDictionary_Enumeration/CS/stringdictionary_enumeration.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collection.Specialized.StringDictionary_Enumeration/CS/stringdictionary_enumeration.cs
@@ -37,7 +37,7 @@ public static void PrintKeysAndValues1( StringDictionary myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintKeysAndValues2( StringDictionary myCol ) {
IEnumerator myEnumerator = myCol.GetEnumerator();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Item/CS/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Item/CS/source.cs
index 8995f1b7188..8c35daecd93 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Item/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Item/CS/source.cs
@@ -24,17 +24,17 @@ public static void Main()
Console.WriteLine("Element {0} is \"{1}\"", 2, stringList[2]);
// Accessing an element outside the current element count
- // causes an exception.
- Console.WriteLine("Number of elements in the list: {0}",
+ // causes an exception.
+ Console.WriteLine("Number of elements in the list: {0}",
stringList.Count);
try
{
- Console.WriteLine("Element {0} is \"{1}\"",
+ Console.WriteLine("Element {0} is \"{1}\"",
stringList.Count, stringList[stringList.Count]);
}
catch(ArgumentOutOfRangeException aoore)
{
- Console.WriteLine("stringList({0}) is out of range.",
+ Console.WriteLine("stringList({0}) is out of range.",
stringList.Count);
}
@@ -45,14 +45,14 @@ public static void Main()
}
catch(ArgumentOutOfRangeException aoore)
{
- Console.WriteLine("stringList({0}) is out of range.",
+ Console.WriteLine("stringList({0}) is out of range.",
stringList.Count);
}
Console.WriteLine();
for (int i = 0; i < stringList.Count; i++)
{
- Console.WriteLine("Element {0} is \"{1}\"", i,
+ Console.WriteLine("Element {0} is \"{1}\"", i,
stringList[i]);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Item/CS/source2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Item/CS/source2.cs
index 68bb155970a..ead6844483b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Item/CS/source2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Item/CS/source2.cs
@@ -20,10 +20,10 @@ public static void Main()
Console.Write("{0}, ", value);
}
Console.WriteLine("\n\nScrambled:\n");
-
+
// Scramble the order of the items in the list.
integerList.Scramble();
-
+
foreach (int value in integerList)
{
Console.Write("{0}, ", value);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Sort_2/CS/arraylist_sort2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Sort_2/CS/arraylist_sort2.cs
index 5e865be59f7..266f30ea675 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Sort_2/CS/arraylist_sort2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Sort_2/CS/arraylist_sort2.cs
@@ -5,7 +5,7 @@
using System.Collections;
public class SamplesArrayList {
-
+
public class myReverserClass : IComparer {
// Calls CaseInsensitiveComparer.Compare with the parameters reversed.
@@ -15,7 +15,7 @@ int IComparer.Compare( Object x, Object y ) {
}
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -27,11 +27,11 @@ 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:" );
PrintIndexAndValues( myAL );
-
+
// Sorts the values of the ArrayList using the default comparer.
myAL.Sort();
Console.WriteLine( "After sorting with the default comparer:" );
@@ -43,7 +43,7 @@ public static void Main() {
Console.WriteLine( "After sorting with the reverse case-insensitive comparer:" );
PrintIndexAndValues( myAL );
}
-
+
public static void PrintIndexAndValues( IEnumerable myList ) {
int i = 0;
foreach ( Object obj in myList )
@@ -53,7 +53,7 @@ public static void PrintIndexAndValues( IEnumerable myList ) {
}
-/*
+/*
This code produces the following output.
The ArrayList initially contains the following values:
[0]: The
@@ -86,7 +86,7 @@ This code produces the following output.
[5]: jumps
[6]: fox
[7]: dog
- [8]: brown
+ [8]: brown
*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Sort_3/CS/arraylist_sort3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Sort_3/CS/arraylist_sort3.cs
index 0cb27b2108c..7804ba8cede 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Sort_3/CS/arraylist_sort3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.Sort_3/CS/arraylist_sort3.cs
@@ -15,7 +15,7 @@ int IComparer.Compare( Object x, Object y ) {
}
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -27,7 +27,7 @@ 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:" );
PrintIndexAndValues( myAL );
@@ -43,7 +43,7 @@ public static void Main() {
Console.WriteLine( "After sorting from index 1 to index 3 with the reverse case-insensitive comparer:" );
PrintIndexAndValues( myAL );
}
-
+
public static void PrintIndexAndValues( IEnumerable myList ) {
int i = 0;
foreach ( Object obj in myList )
@@ -53,7 +53,7 @@ public static void PrintIndexAndValues( IEnumerable myList ) {
}
-/*
+/*
This code produces the following output.
The ArrayList initially contains the following values:
[0]: The
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.ToArray/CS/arraylist_toarray.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.ToArray/CS/arraylist_toarray.cs
index 28c23b35e13..7e802d4d734 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.ToArray/CS/arraylist_toarray.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ArrayList.ToArray/CS/arraylist_toarray.cs
@@ -5,9 +5,9 @@
using System.Collections;
public class SamplesArrayList {
-
+
public static void Main() {
-
+
// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add( "The" );
@@ -19,11 +19,11 @@ public static void Main() {
myAL.Add( "the" );
myAL.Add( "lazy" );
myAL.Add( "dog" );
-
+
// Displays the values of the ArrayList.
Console.WriteLine( "The ArrayList contains the following values:" );
PrintIndexAndValues( myAL );
-
+
// Copies the elements of the ArrayList to a string array.
String[] myArr = (String[]) myAL.ToArray( typeof( string ) );
@@ -31,7 +31,7 @@ public static void Main() {
Console.WriteLine( "The string array contains the following values:" );
PrintIndexAndValues( myArr );
}
-
+
public static void PrintIndexAndValues( ArrayList myList ) {
int i = 0;
foreach ( Object o in myList )
@@ -47,7 +47,7 @@ public static void PrintIndexAndValues( String[] myArr ) {
}
-/*
+/*
This code produces the following output.
The ArrayList contains the following values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.CaseInsensitive/CS/caseinsensitive.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.CaseInsensitive/CS/caseinsensitive.cs
index 482a8b18c59..9f466d95e58 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.CaseInsensitive/CS/caseinsensitive.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.CaseInsensitive/CS/caseinsensitive.cs
@@ -47,7 +47,7 @@ public static void Main() {
}
-/*
+/*
This code produces the following output. Results vary depending on the system's culture settings.
first is in myHT1: False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.CollectionBase/CS/collectionbase.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.CollectionBase/CS/collectionbase.cs
index a65135024cb..911140aa685 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.CollectionBase/CS/collectionbase.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.CollectionBase/CS/collectionbase.cs
@@ -57,7 +57,7 @@ protected override void OnValidate( Object value ) {
public class SamplesCollectionBase {
public static void Main() {
-
+
// Create and initialize a new CollectionBase.
Int16Collection myI16 = new Int16Collection();
@@ -102,7 +102,7 @@ public static void Main() {
Console.WriteLine( "Contents of the collection after removing the element 2:" );
PrintIndexAndValues( myI16 );
}
-
+
// Uses the Count property and the Item property.
public static void PrintIndexAndValues( Int16Collection myCol ) {
for ( int i = 0; i < myCol.Count; i++ )
@@ -118,7 +118,7 @@ public static void PrintValues1( Int16Collection myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintValues2( Int16Collection myCol ) {
System.Collections.IEnumerator myEnumerator = myCol.GetEnumerator();
@@ -129,7 +129,7 @@ public static void PrintValues2( Int16Collection myCol ) {
}
-/*
+/*
This code produces the following output.
Contents of the collection (using foreach):
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.DictionaryBase/CS/dictionarybase.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.DictionaryBase/CS/dictionarybase.cs
index 34694b153da..d6327a00e49 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.DictionaryBase/CS/dictionarybase.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.DictionaryBase/CS/dictionarybase.cs
@@ -121,7 +121,7 @@ protected override void OnValidate( Object key, Object value ) {
public class SamplesDictionaryBase {
public static void Main() {
-
+
// Creates and initializes a new DictionaryBase.
ShortStringDictionary mySSC = new ShortStringDictionary();
@@ -183,7 +183,7 @@ public static void PrintKeysAndValues1( ShortStringDictionary myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintKeysAndValues2( ShortStringDictionary myCol ) {
DictionaryEntry myDE;
@@ -206,7 +206,7 @@ public static void PrintKeysAndValues3( ShortStringDictionary myCol ) {
}
-/*
+/*
This code produces the following output.
Contents of the collection (using foreach):
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.DictionaryEntry/cs/DictionaryEntrySample.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.DictionaryEntry/cs/DictionaryEntrySample.cs
index a0f68d218da..80897290483 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.DictionaryEntry/cs/DictionaryEntrySample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.DictionaryEntry/cs/DictionaryEntrySample.cs
@@ -11,7 +11,7 @@ public static void Main()
//
Hashtable openWith = new Hashtable();
- // Add some elements to the hash table. There are no
+ // Add some elements to the hash table. There are no
// duplicate keys, but some of the values are duplicates.
openWith.Add("txt", "notepad.exe");
openWith.Add("bmp", "paint.exe");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ClassExample/cs/hashtable_example.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ClassExample/cs/hashtable_example.cs
index a99fe98f588..cdac210d515 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ClassExample/cs/hashtable_example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ClassExample/cs/hashtable_example.cs
@@ -9,15 +9,15 @@ public static void Main()
// Create a new hash table.
//
Hashtable openWith = new Hashtable();
-
- // Add some elements to the hash table. There are no
+
+ // Add some elements to the hash table. 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 hash table.
try
{
@@ -28,20 +28,20 @@ public static void Main()
Console.WriteLine("An element with Key = \"txt\" already exists.");
}
- // The Item property is the default property, so you
- // can omit its name when accessing elements.
+ // The Item property is the default property, so you
+ // can omit its name when accessing elements.
Console.WriteLine("For key = \"rtf\", value = {0}.", openWith["rtf"]);
-
+
// The default Item property can be used to change the value
// associated with a key.
openWith["rtf"] = "winword.exe";
Console.WriteLine("For key = \"rtf\", value = {0}.", openWith["rtf"]);
-
+
// If a key does not exist, setting the default Item property
// for that key adds a new key/value pair.
openWith["doc"] = "winword.exe";
- // ContainsKey can be used to test keys before inserting
+ // ContainsKey can be used to test keys before inserting
// them.
if (!openWith.ContainsKey("ht"))
{
@@ -59,7 +59,7 @@ public static void Main()
// To get the values alone, use the Values property.
ICollection valueColl = openWith.Values;
-
+
// The elements of the ValueCollection are strongly typed
// with the type that was specified for hash table values.
Console.WriteLine();
@@ -70,7 +70,7 @@ public static void Main()
// To get the keys alone, use the Keys property.
ICollection keyColl = openWith.Keys;
-
+
// The elements of the KeyCollection are strongly typed
// with the type that was specified for hash table keys.
Console.WriteLine();
@@ -82,7 +82,7 @@ public static void Main()
// Use the Remove method to remove a key/value pair.
Console.WriteLine("\nRemove(\"doc\")");
openWith.Remove("doc");
-
+
if (!openWith.ContainsKey("doc"))
{
Console.WriteLine("Key \"doc\" is not found.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctor/CS/hashtable_ctor.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctor/CS/hashtable_ctor.cs
index 62bc4741967..b69661144c1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctor/CS/hashtable_ctor.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctor/CS/hashtable_ctor.cs
@@ -93,7 +93,7 @@ public static void Main()
}
-/*
+/*
This code produces the following output.
Results vary depending on the system's culture settings.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionary/CS/hashtable_ctordictionary.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionary/CS/hashtable_ctordictionary.cs
index 5f27beaa62c..98bb998047a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionary/CS/hashtable_ctordictionary.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionary/CS/hashtable_ctordictionary.cs
@@ -66,8 +66,8 @@ public static void Main()
}
-/*
-This code produces the following output.
+/*
+This code produces the following output.
Results vary depending on the system's culture settings.
first is in myHT1: False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionaryFloat/CS/hashtable_ctordictionaryfloat.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionaryFloat/CS/hashtable_ctordictionaryfloat.cs
index f7126734fe7..13c0b7166ef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionaryFloat/CS/hashtable_ctordictionaryfloat.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionaryFloat/CS/hashtable_ctordictionaryfloat.cs
@@ -57,7 +57,7 @@ public static void Main()
// Create a hash table using the specified IEqualityComparer that uses
// the CaseInsensitiveComparer.DefaultInvariant to determine equality.
- Hashtable myHT2 = new Hashtable(mySL, .8f,
+ Hashtable myHT2 = new Hashtable(mySL, .8f,
new myCultureComparer());
// Create a hash table using an IEqualityComparer that is based on
@@ -74,7 +74,7 @@ public static void Main()
}
-/*
+/*
This code produces the following output.
Results vary depending on the system's culture settings.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorInt/CS/hashtable_ctorint.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorInt/CS/hashtable_ctorint.cs
index b3b7ef0ff8f..d2d351758b6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorInt/CS/hashtable_ctorint.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorInt/CS/hashtable_ctorint.cs
@@ -76,7 +76,7 @@ public static void Main()
}
-/*
+/*
This code produces the following output.
Results vary depending on the system's culture settings.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorIntFloat/CS/hashtable_ctorintfloat.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorIntFloat/CS/hashtable_ctorintfloat.cs
index 12e7e21e96c..669ba23a79e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorIntFloat/CS/hashtable_ctorintfloat.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorIntFloat/CS/hashtable_ctorintfloat.cs
@@ -77,7 +77,7 @@ public static void Main()
}
-/*
+/*
This code produces the following output.
Results vary depending on the system's culture settings.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.IList_Implementation/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.IList_Implementation/cs/Program.cs
index 38aa048c902..787c4eaeed4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.IList_Implementation/cs/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.IList_Implementation/cs/Program.cs
@@ -45,7 +45,7 @@ static void Main()
Console.WriteLine($"List contains \"three\": {test.Contains("three")}");
Console.WriteLine($"List contains \"ten\": {test.Contains("ten")}");
}
-}
+}
//
class SimpleList : IList
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ReadOnlyCollectionBase/CS/readonlycollectionbase.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ReadOnlyCollectionBase/CS/readonlycollectionbase.cs
index 464045248f2..21a32d26cf8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ReadOnlyCollectionBase/CS/readonlycollectionbase.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.ReadOnlyCollectionBase/CS/readonlycollectionbase.cs
@@ -37,7 +37,7 @@ public static void Main() {
myAL.Add( "green" );
myAL.Add( "orange" );
myAL.Add( "purple" );
-
+
// Create a new ROCollection that contains the elements in myAL.
ROCollection myCol = new ROCollection( myAL );
@@ -58,7 +58,7 @@ public static void Main() {
Console.WriteLine( "orange is at index {0}.", myCol.IndexOf( "orange" ) );
Console.WriteLine();
}
-
+
// Uses the Count property and the Item property.
public static void PrintIndexAndValues( ROCollection myCol ) {
for ( int i = 0; i < myCol.Count; i++ )
@@ -74,7 +74,7 @@ public static void PrintValues1( ROCollection myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintValues2( ROCollection myCol ) {
System.Collections.IEnumerator myEnumerator = myCol.GetEnumerator();
@@ -85,7 +85,7 @@ public static void PrintValues2( ROCollection myCol ) {
}
-/*
+/*
This code produces the following output.
Contents of the collection (using foreach):
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctor/CS/sortedlist_ctor.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctor/CS/sortedlist_ctor.cs
index 1f4197537b7..fc9ab76d938 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctor/CS/sortedlist_ctor.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctor/CS/sortedlist_ctor.cs
@@ -99,7 +99,7 @@ public static void PrintKeysAndValues(SortedList myList)
}
-/*
+/*
This code produces the following output.
Results vary depending on the system's culture settings.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctorDictionary/CS/sortedlist_ctordictionary.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctorDictionary/CS/sortedlist_ctordictionary.cs
index ed15b876227..13aac0a4e04 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctorDictionary/CS/sortedlist_ctordictionary.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctorDictionary/CS/sortedlist_ctordictionary.cs
@@ -82,7 +82,7 @@ public static void PrintKeysAndValues(SortedList myList)
Console.WriteLine(" -KEY- -VALUE-");
for (int i = 0; i < myList.Count; i++)
{
- Console.WriteLine(" {0,-6}: {1}",
+ Console.WriteLine(" {0,-6}: {1}",
myList.GetKey(i), myList.GetByIndex(i));
}
Console.WriteLine();
@@ -90,7 +90,7 @@ public static void PrintKeysAndValues(SortedList myList)
}
-/*
+/*
This code produces the following output. Results vary depending on the system's culture settings.
mySL1 (default):
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctorInt/CS/sortedlist_ctorint.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctorInt/CS/sortedlist_ctorint.cs
index 9679567bd18..b441774b569 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctorInt/CS/sortedlist_ctorint.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.SortedList_ctorInt/CS/sortedlist_ctorint.cs
@@ -49,7 +49,7 @@ public static void Main()
// which is based on the Turkish culture (tr-TR), where "I" is not
// the uppercase version of "i".
CultureInfo myCul = new CultureInfo("tr-TR");
- SortedList mySL3 =
+ SortedList mySL3 =
new SortedList(new CaseInsensitiveComparer(myCul), 3);
Console.WriteLine(
@@ -101,7 +101,7 @@ public static void PrintKeysAndValues(SortedList myList)
}
-/*
+/*
This code produces the following output.
Results vary depending on the system's culture settings.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.HybridDictionary2/CS/hybriddictionary.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.HybridDictionary2/CS/hybriddictionary.cs
index 46c11247fbd..8761efb9d00 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.HybridDictionary2/CS/hybriddictionary.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.HybridDictionary2/CS/hybriddictionary.cs
@@ -80,7 +80,7 @@ public static void PrintKeysAndValues1( IDictionary myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintKeysAndValues2( IDictionary myCol ) {
IDictionaryEnumerator myEnumerator = myCol.GetEnumerator();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.HybridDictionary_Enumerator/CS/hybriddictionary_enumerator.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.HybridDictionary_Enumerator/CS/hybriddictionary_enumerator.cs
index 62be8aef315..4cb20439a39 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.HybridDictionary_Enumerator/CS/hybriddictionary_enumerator.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.HybridDictionary_Enumerator/CS/hybriddictionary_enumerator.cs
@@ -52,7 +52,7 @@ public static void PrintKeysAndValues1( IDictionary myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintKeysAndValues2( IDictionary myCol ) {
IDictionaryEnumerator myEnumerator = myCol.GetEnumerator();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.IOrderedDictionary_Implementation/cs/iordereddictionary.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.IOrderedDictionary_Implementation/cs/iordereddictionary.cs
index 0874c1a02e6..c54ea9685f4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.IOrderedDictionary_Implementation/cs/iordereddictionary.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.IOrderedDictionary_Implementation/cs/iordereddictionary.cs
@@ -186,7 +186,7 @@ IEnumerator IEnumerable.GetEnumerator()
public class PeopleEnum : IDictionaryEnumerator
{
public ArrayList _people;
-
+
// Enumerators are positioned before the first element
// until the first MoveNext() call.
int position = -1;
@@ -290,12 +290,12 @@ static void Main()
}
}
/* This code produces output similar to the following:
- *
+ *
* Displaying the entries in peopleCollection:
* John Smith
* Jim Johnson
* Sue Rabon
- *
+ *
* Displaying the entries in the modified peopleCollection:
* Fred Anderson
* John Smith
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.IOrderedDictionary_Implementation/cs/remarks.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.IOrderedDictionary_Implementation/cs/remarks.cs
index c0a88737f2d..69c84783bbc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.IOrderedDictionary_Implementation/cs/remarks.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.IOrderedDictionary_Implementation/cs/remarks.cs
@@ -184,7 +184,7 @@ IEnumerator IEnumerable.GetEnumerator()
public class ODEnum : IDictionaryEnumerator
{
public ArrayList itemlist;
-
+
// Enumerators are positioned before the first element
// until the first MoveNext() call.
int position = -1;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CS/listdictionary.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CS/listdictionary.cs
index 646655ae078..fb25f4741ba 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CS/listdictionary.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary2/CS/listdictionary.cs
@@ -68,7 +68,7 @@ public static void PrintKeysAndValues1( IDictionary myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintKeysAndValues2( IDictionary myCol ) {
IDictionaryEnumerator myEnumerator = myCol.GetEnumerator();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/CS/listdictionary_enumerator.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/CS/listdictionary_enumerator.cs
index e3cf0244f3b..7abd20851ae 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/CS/listdictionary_enumerator.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.ListDictionary_Enumerator/CS/listdictionary_enumerator.cs
@@ -40,7 +40,7 @@ public static void PrintKeysAndValues1( IDictionary myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintKeysAndValues2( IDictionary myCol ) {
IDictionaryEnumerator myEnumerator = myCol.GetEnumerator();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/nameobjectcollectionbase.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/nameobjectcollectionbase.cs
index 3cb16052a19..040d2ea51cf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/nameobjectcollectionbase.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/nameobjectcollectionbase.cs
@@ -22,7 +22,7 @@ public MyCollection( IDictionary d, Boolean bReadOnly ) {
// Gets a key-and-value pair (DictionaryEntry) using an index.
public DictionaryEntry this[ int index ] {
get {
- return ( new DictionaryEntry(
+ return ( new DictionaryEntry(
this.BaseGetKey(index), this.BaseGet(index) ) );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/remarks.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/remarks.cs
index 5ed5ca45779..46ff5d1c479 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/remarks.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/remarks.cs
@@ -19,7 +19,7 @@ public DerivedCollection( IDictionary d, Boolean bReadOnly ) {
// Gets a key-and-value pair (DictionaryEntry) using an index.
public DictionaryEntry this[ int index ] {
get {
- return ( new DictionaryEntry(
+ return ( new DictionaryEntry(
this.BaseGetKey(index), this.BaseGet(index) ) );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/CS/stringcollection.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/CS/stringcollection.cs
index c01e1e8373f..a1644a45bd3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/CS/stringcollection.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.StringCollection2/CS/stringcollection.cs
@@ -80,7 +80,7 @@ public static void PrintValues1( StringCollection myCol ) {
Console.WriteLine();
}
- // Uses the enumerator.
+ // Uses the enumerator.
// NOTE: The foreach statement is the preferred way of enumerating the contents of a collection.
public static void PrintValues2( StringCollection myCol ) {
StringEnumerator myEnumerator = myCol.GetEnumerator();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console-INSERTTABS/CS/inserttabs.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console-INSERTTABS/CS/inserttabs.cs
index c95fd385d92..78f382d14f2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console-INSERTTABS/CS/inserttabs.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console-INSERTTABS/CS/inserttabs.cs
@@ -1,8 +1,8 @@
-// This sample opens a file whose name is passed to it as a parameter.
-// It reads each line in the file and replaces every occurrence of 4
+// This sample opens a file whose name is passed to it as a parameter.
+// It reads each line in the file and replaces every occurrence of 4
// space characters with a tab character.
//
-// It takes two command-line arguments: the input file name, and
+// It takes two command-line arguments: the input file name, and
// the output file name.
//
// Usage:
@@ -53,7 +53,7 @@ public static int Main(string[] args)
return 1;
}
- // Recover the standard output stream so that a
+ // Recover the standard output stream so that a
// completion message can be displayed.
var standardOutput = new StreamWriter(Console.OpenStandardOutput());
standardOutput.AutoFlush = true;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console-REFORMAT/CS/reformat.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console-REFORMAT/CS/reformat.cs
index a15ca3e6995..a63eded6e7f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console-REFORMAT/CS/reformat.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console-REFORMAT/CS/reformat.cs
@@ -1,5 +1,5 @@
using System;
-// This sample converts tab-delmited input and converts it to
+// This sample converts tab-delmited input and converts it to
// comma-delimited output. Furthermore, it converts all boolean
// input to numeric representations.
// System.Console.Write
@@ -21,7 +21,7 @@ public static void Main(string[] args)
isFirstField = false;
else
Console.Write(',');
-
+
// If the field represents a boolean, replace with a numeric representation.
bool itemBool;
if (Boolean.TryParse(item, out itemBool))
@@ -39,7 +39,7 @@ public static void Main(string[] args)
To convert tab-delimited input from the keyboard and display
the output (type CTRL+Z to mark the end of input):
REFORMAT
-
+
To input tab-delimited data from a file and display the output:
REFORMAT
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/ReadLine3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/ReadLine3.cs
index 902a5a82d6c..648cca5b948 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/ReadLine3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/ReadLine3.cs
@@ -7,7 +7,7 @@ public static void Main()
{
if (! Console.IsInputRedirected) {
Console.WriteLine("This example requires that input be redirected from a file.");
- return;
+ return;
}
Console.WriteLine("About to call Console.ReadLine in a loop.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/ReadLineSimple.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/ReadLineSimple.cs
index 0cd92547192..455dc75f795 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/ReadLineSimple.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/ReadLineSimple.cs
@@ -16,7 +16,7 @@ public static void Main()
}
// The example displays output like the following:
// Today is 10/26/2015 at 12:22:22 PM.
-//
+//
// Press any key to continue...
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/readline1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/readline1.cs
index bd63709e8e9..4441d328cbb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/readline1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.ReadLine/cs/readline1.cs
@@ -7,7 +7,7 @@ public static void Main()
{
if (! Console.IsInputRedirected) {
Console.WriteLine("This example requires that input be redirected from a file.");
- return;
+ return;
}
Console.WriteLine("About to call Console.ReadLine in a loop.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.SetError/cs/SetError1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.SetError/cs/SetError1.cs
index e9302315fd6..ff629b179fd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.SetError/cs/SetError1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.SetError/cs/SetError1.cs
@@ -21,7 +21,7 @@ public static void Main()
Console.Error.WriteLine("Application started at {0}.", appStart);
Console.Error.WriteLine();
//
- // Application code along with error output
+ // Application code along with error output
//
// Close redirected error stream.
Console.Error.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs
index 93a8eee797c..71e78bfb1cd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs
@@ -5,7 +5,7 @@ public class Example
public static void Main()
{
//
- string[] lines = { "This is the first line.",
+ string[] lines = { "This is the first line.",
"This is the second line." };
// Output the lines using the default newline sequence.
Console.WriteLine("With the default new line characters:");
@@ -14,7 +14,7 @@ public static void Main()
Console.WriteLine(line);
Console.WriteLine();
-
+
// Redefine the newline characters to double space.
Console.Out.NewLine = "\r\n\r\n";
// Output the lines using the new newline sequence.
@@ -25,16 +25,16 @@ public static void Main()
// The example displays the following output:
// With the default new line characters:
- //
+ //
// This is the first line.
// This is the second line.
- //
+ //
// With redefined new line characters:
- //
- //
- //
+ //
+ //
+ //
// This is the first line.
- //
+ //
// This is the second line.
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_boolean1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_boolean1.cs
index 580c66aab82..479eedf297f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_boolean1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_boolean1.cs
@@ -7,16 +7,16 @@ public static void Main()
//
// Assign 10 random integers to an array.
Random rnd = new Random();
- int[] numbers = new int[10];
+ int[] numbers = new int[10];
for (int ctr = 0; ctr <= numbers.GetUpperBound(0); ctr++)
numbers[ctr] = rnd.Next();
-
+
// Determine whether the numbers are even or odd.
foreach (var number in numbers) {
bool even = (number % 2 == 0);
Console.WriteLine("Is {0} even:", number);
Console.WriteLine(even);
- Console.WriteLine();
+ Console.WriteLine();
}
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKey/cs/ConsoleKey1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKey/cs/ConsoleKey1.cs
index a77a080a98c..772647a9536 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKey/cs/ConsoleKey1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKey/cs/ConsoleKey1.cs
@@ -15,7 +15,7 @@ public static void Main()
StringBuilder output = new StringBuilder(
String.Format("You pressed {0}", input.Key.ToString()));
bool modifiers = false;
-
+
if ((input.Modifiers & ConsoleModifiers.Alt) == ConsoleModifiers.Alt) {
output.Append(", together with " + ConsoleModifiers.Alt.ToString());
modifiers = true;
@@ -24,7 +24,7 @@ public static void Main()
{
if (modifiers) {
output.Append(" and ");
- }
+ }
else {
output.Append(", together with ");
modifiers = true;
@@ -35,14 +35,14 @@ public static void Main()
{
if (modifiers) {
output.Append(" and ");
- }
+ }
else {
output.Append(", together with ");
modifiers = true;
}
output.Append(ConsoleModifiers.Shift.ToString());
}
- output.Append(".");
+ output.Append(".");
Console.WriteLine(output.ToString());
Console.WriteLine();
} while (input.Key != ConsoleKey.Escape);
@@ -52,20 +52,20 @@ public static void Main()
// Press a key, along with Alt, Ctrl, or Shift.
// Press Esc to exit.
// You pressed D.
-//
+//
// Press a key, along with Alt, Ctrl, or Shift.
// Press Esc to exit.
// You pressed X, along with Shift.
-//
+//
// Press a key, along with Alt, Ctrl, or Shift.
// Press Esc to exit.
// You pressed L, along with Control and Shift.
-//
+//
// Press a key, along with Alt, Ctrl, or Shift.
// Press Esc to exit.
// You pressed P, along with Alt and Control and Shift.
-//
+//
// Press a key, along with Alt, Ctrl, or Shift.
// Press Esc to exit.
-// You pressed Escape.
+// You pressed Escape.
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.Equals/cs/equals.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.Equals/cs/equals.cs
index d3bf1269242..0cda88372d6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.Equals/cs/equals.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.Equals/cs/equals.cs
@@ -4,9 +4,9 @@
using System;
using System.Text;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
string k1 = "\nEnter a key ......... ";
string k2 = "\nEnter another key ... ";
@@ -14,21 +14,21 @@ public static void Main()
string key2 = "";
string areKeysEqual = "The {0} and {1} keys are {2}equal.";
string equalValue = "";
- string prompt = "Press the escape key (ESC) to quit, " +
+ string prompt = "Press the escape key (ESC) to quit, " +
"or any other key to continue.";
ConsoleKeyInfo cki1;
ConsoleKeyInfo cki2;
//
// The Console.TreatControlCAsInput property prevents this example from
-// ending if you press CTL+C, however all other operating system keys and
-// shortcuts, such as ALT+TAB or the Windows Logo key, are still in effect.
+// ending if you press CTL+C, however all other operating system keys and
+// shortcuts, such as ALT+TAB or the Windows Logo key, are still in effect.
//
Console.TreatControlCAsInput = true;
-// Request that the user enter two key presses. A key press and any
+// Request that the user enter two key presses. A key press and any
// combination shift, CTRL, and ALT modifier keys is permitted.
- do
+ do
{
Console.Write(k1);
cki1 = Console.ReadKey(false);
@@ -50,8 +50,8 @@ public static void Main()
// Note: This example requires the Escape (Esc) key.
}
-// The KeyCombination() method creates a string that specifies what
-// key and what combination of shift, CTRL, and ALT modifier keys
+// The KeyCombination() method creates a string that specifies what
+// key and what combination of shift, CTRL, and ALT modifier keys
// were pressed simultaneously.
protected static string KeyCombination(ConsoleKeyInfo sourceCki)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.GetHashcode/cs/hash.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.GetHashcode/cs/hash.cs
index 2d4de80d0e1..973fe633c9a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.GetHashcode/cs/hash.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.GetHashcode/cs/hash.cs
@@ -4,28 +4,28 @@
using System;
using System.Text;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
string k1 = "\nEnter a key ......... ";
string key1 = "";
string hashCodeFmt = "The hash code for the {0} key is {1}.";
- string prompt = "Press the escape key (ESC) to quit, " +
+ string prompt = "Press the escape key (ESC) to quit, " +
"or any other key to continue.";
ConsoleKeyInfo cki1;
int hashCode = 0;
//
// The Console.TreatControlCAsInput property prevents this example from
-// ending if you press CTL+C, however all other operating system keys and
-// shortcuts, such as ALT+TAB or the Windows Logo key, are still in effect.
+// ending if you press CTL+C, however all other operating system keys and
+// shortcuts, such as ALT+TAB or the Windows Logo key, are still in effect.
//
Console.TreatControlCAsInput = true;
-// Request that the user enter two key presses. A key press and any
+// Request that the user enter two key presses. A key press and any
// combination shift, CTRL, and ALT modifier keys is permitted.
- do
+ do
{
Console.Write(k1);
cki1 = Console.ReadKey(false);
@@ -41,8 +41,8 @@ public static void Main()
// Note: This example requires the Escape (Esc) key.
}
-// The KeyCombination() method creates a string that specifies what
-// key and what combination of shift, CTRL, and ALT modifier keys
+// The KeyCombination() method creates a string that specifies what
+// key and what combination of shift, CTRL, and ALT modifier keys
// were pressed simultaneously.
protected static string KeyCombination(ConsoleKeyInfo sourceCki)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert Snippets/CS/system.convert snippet.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert Snippets/CS/system.convert snippet.cs
index 7562ab67bc7..b276622e35f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert Snippets/CS/system.convert snippet.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert Snippets/CS/system.convert snippet.cs
@@ -93,7 +93,7 @@ public void ConvertDoubleByte(double doubleVal) {
byteVal = System.Convert.ToByte(doubleVal);
System.Console.WriteLine("{0} as a byte is: {1}.",
doubleVal, byteVal);
- }
+ }
catch (System.OverflowException) {
System.Console.WriteLine(
"Overflow in double-to-byte conversion.");
@@ -115,7 +115,7 @@ public void ConvertDoubleInt(double doubleVal) {
intVal = System.Convert.ToInt32(doubleVal);
System.Console.WriteLine("{0} as an int is: {1}",
doubleVal, intVal);
- }
+ }
catch (System.OverflowException) {
System.Console.WriteLine(
"Overflow in double-to-int conversion.");
@@ -139,12 +139,12 @@ public void ConvertDoubleDecimal(decimal decimalVal){
decimalVal, doubleVal);
// Conversion from double to decimal can overflow.
- try
+ try
{
decimalVal = System.Convert.ToDecimal(doubleVal);
System.Console.WriteLine ("{0} as a decimal is: {1}",
doubleVal, decimalVal);
- }
+ }
catch (System.OverflowException) {
System.Console.WriteLine(
"Overflow in double-to-double conversion.");
@@ -171,9 +171,9 @@ public void CovertDoubleFloat(double doubleVal) {
//
public void ConvertDoubleString(double doubleVal) {
- string stringVal;
+ string stringVal;
- // A conversion from Double to string cannot overflow.
+ // A conversion from Double to string cannot overflow.
stringVal = System.Convert.ToString(doubleVal);
System.Console.WriteLine("{0} as a string is: {1}",
doubleVal, stringVal);
@@ -182,7 +182,7 @@ public void ConvertDoubleString(double doubleVal) {
doubleVal = System.Convert.ToDouble(stringVal);
System.Console.WriteLine("{0} as a double is: {1}",
stringVal, doubleVal);
- }
+ }
catch (System.OverflowException) {
System.Console.WriteLine(
"Conversion from string-to-double overflowed.");
@@ -207,7 +207,7 @@ public void ConvertLongChar(long longVal) {
charVal = System.Convert.ToChar(longVal);
System.Console.WriteLine("{0} as a char is {1}",
longVal, charVal);
- }
+ }
catch (System.OverflowException) {
System.Console.WriteLine(
"Overflow in long-to-char conversion.");
@@ -230,7 +230,7 @@ public void ConvertLongByte(long longVal) {
byteVal = System.Convert.ToByte(longVal);
System.Console.WriteLine("{0} as a byte is {1}",
longVal, byteVal);
- }
+ }
catch (System.OverflowException) {
System.Console.WriteLine(
"Overflow in long-to-byte conversion.");
@@ -250,13 +250,13 @@ public void ConvertLongDecimal(long longVal) {
// Long to decimal conversion cannot overflow.
decimalVal = System.Convert.ToDecimal(longVal);
- System.Console.WriteLine("{0} as a decimal is {1}",
+ System.Console.WriteLine("{0} as a decimal is {1}",
longVal, decimalVal);
// Decimal to long conversion can overflow.
try {
longVal = System.Convert.ToInt64(decimalVal);
- System.Console.WriteLine("{0} as a long is {1}",
+ System.Console.WriteLine("{0} as a long is {1}",
decimalVal, longVal);
}
catch (System.OverflowException) {
@@ -273,13 +273,13 @@ public void ConvertLongFloat(long longVal) {
// A conversion from Long to float cannot overflow.
floatVal = System.Convert.ToSingle(longVal);
- System.Console.WriteLine("{0} as a float is {1}",
+ System.Console.WriteLine("{0} as a float is {1}",
longVal, floatVal);
// A conversion from float to long can overflow.
try {
longVal = System.Convert.ToInt64(floatVal);
- System.Console.WriteLine("{0} as a long is {1}",
+ System.Console.WriteLine("{0} as a long is {1}",
floatVal, longVal);
}
catch (System.OverflowException) {
@@ -326,7 +326,7 @@ public void ConvertStringByte(string stringVal) {
byteVal = System.Convert.ToByte(stringVal);
System.Console.WriteLine("{0} as a byte is: {1}",
stringVal, byteVal);
- }
+ }
catch (System.OverflowException) {
System.Console.WriteLine(
"Conversion from string to byte overflowed.");
@@ -339,7 +339,7 @@ public void ConvertStringByte(string stringVal) {
System.Console.WriteLine(
"The string is null.");
}
-
+
//The conversion from byte to string is always valid.
stringVal = System.Convert.ToString(byteVal);
System.Console.WriteLine("{0} as a string is {1}",
@@ -380,7 +380,7 @@ public void ConvertStringDecimal(string stringVal) {
decimalVal = System.Convert.ToDecimal(stringVal);
System.Console.WriteLine(
"The string as a decimal is {0}.", decimalVal);
- }
+ }
catch (System.OverflowException){
System.Console.WriteLine(
"The conversion from string to decimal overflowed.");
@@ -409,7 +409,7 @@ public void ConvertStringFloat(string stringVal) {
floatVal = System.Convert.ToSingle(stringVal);
System.Console.WriteLine(
"The string as a float is {0}.", floatVal);
- }
+ }
catch (System.OverflowException){
System.Console.WriteLine(
"The conversion from string-to-float overflowed.");
@@ -438,7 +438,7 @@ public void ConvertCharDecimal(char charVal) {
// throw an InvalidCastException.
try {
decimalVal = System.Convert.ToDecimal(charVal);
- }
+ }
catch (System.InvalidCastException) {
System.Console.WriteLine(
"Char-to-Decimal conversion is not supported " +
@@ -448,7 +448,7 @@ public void ConvertCharDecimal(char charVal) {
//Decimal to char conversion is also not supported.
try {
charVal = System.Convert.ToChar(decimalVal);
- }
+ }
catch (System.InvalidCastException) {
System.Console.WriteLine(
"Decimal-to-Char conversion is not supported " +
@@ -504,7 +504,7 @@ public void ConvertByteSingle(byte byteVal) {
//
public void ConvertBoolean() {
const int year = 1979;
- const int month = 7;
+ const int month = 7;
const int day = 28;
const int hour = 13;
const int minute = 26;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cs/Conversion.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cs/Conversion.cs
index 97b940eca5f..70de1450703 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cs/Conversion.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.BaseConversion/cs/Conversion.cs
@@ -51,7 +51,7 @@ private static void ConvertHexToNegativeInteger()
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to an integer.", value);
- }
+ }
//
}
@@ -66,17 +66,17 @@ private static void ConvertHexToInteger()
try
{
targetNumber = Convert.ToInt32(value, 16);
- if (!(isNegative) & (targetNumber & 0x80000000) != 0)
+ if (!(isNegative) & (targetNumber & 0x80000000) != 0)
throw new OverflowException();
- else
+ else
Console.WriteLine("0x{0} converts to {1}.", value, targetNumber);
}
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to an integer.", value);
- }
+ }
// Displays the following to the console:
- // Unable to convert '0x80000000' to an integer.
+ // Unable to convert '0x80000000' to an integer.
//
}
@@ -90,11 +90,11 @@ private static void ConvertNegativeHexToByte()
{
byte number = Convert.ToByte(value, 16);
Console.WriteLine("0x{0} converts to {1}.", value, number);
- }
+ }
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to a byte.", value);
- }
+ }
//
}
@@ -111,15 +111,15 @@ private static void ConvertHexToByte()
targetNumber = Convert.ToByte(value, 16);
if (isSigned && ((targetNumber & 0x80) != 0))
throw new OverflowException();
- else
+ else
Console.WriteLine("0x{0} converts to {1}.", value, targetNumber);
}
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to an unsigned byte.", value);
- }
+ }
// Displays the following to the console:
- // Unable to convert '0x80' to an unsigned byte.
+ // Unable to convert '0x80' to an unsigned byte.
//
}
@@ -137,10 +137,10 @@ private static void ConvertHexToNegativeShort()
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to a 16-bit integer.", value);
- }
+ }
//
}
-
+
private static void ConvertHexToShort()
{
//
@@ -154,15 +154,15 @@ private static void ConvertHexToShort()
targetNumber = Convert.ToInt16(value, 16);
if (! isNegative && ((targetNumber & 0x8000) != 0))
throw new OverflowException();
- else
+ else
Console.WriteLine("0x{0} converts to {1}.", value, targetNumber);
}
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to a 16-bit integer.", value);
- }
+ }
// Displays the following to the console:
- // Unable to convert '0x8000' to a 16-bit integer.
+ // Unable to convert '0x8000' to a 16-bit integer.
//
}
@@ -176,11 +176,11 @@ private static void ConvertHexToNegativeLong()
{
long number = Convert.ToInt64(value, 16);
Console.WriteLine("0x{0} converts to {1}.", value, number);
- }
+ }
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to a long integer.", value);
- }
+ }
//
}
@@ -197,15 +197,15 @@ private static void ConvertHexToLong()
targetNumber = Convert.ToInt64(value, 16);
if (! isSigned && ((targetNumber & 0x80000000) != 0))
throw new OverflowException();
- else
+ else
Console.WriteLine("0x{0} converts to {1}.", value, targetNumber);
}
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to a long integer.", value);
- }
+ }
// Displays the following to the console:
- // Unable to convert '0xFFFFFFFFFFFFFFFF' to a long integer.
+ // Unable to convert '0xFFFFFFFFFFFFFFFF' to a long integer.
//
}
@@ -219,11 +219,11 @@ private static void ConvertHexToNegativeSByte()
{
sbyte number = Convert.ToSByte(value, 16);
Console.WriteLine("0x{0} converts to {1}.", value, number);
- }
+ }
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to a signed byte.", value);
- }
+ }
//
}
@@ -240,15 +240,15 @@ private static void ConvertHexToSByte()
targetNumber = Convert.ToSByte(value, 16);
if (! isSigned && ((targetNumber & 0x80) != 0))
throw new OverflowException();
- else
+ else
Console.WriteLine("0x{0} converts to {1}.", value, targetNumber);
}
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to a signed byte.", value);
- }
+ }
// Displays the following to the console:
- // Unable to convert '0xff' to a signed byte.
+ // Unable to convert '0xff' to a signed byte.
//
}
@@ -262,12 +262,12 @@ private static void ConvertNegativeHexToUInt16()
{
UInt16 number = Convert.ToUInt16(value, 16);
Console.WriteLine("0x{0} converts to {1}.", value, number);
- }
+ }
catch (OverflowException)
{
- Console.WriteLine("Unable to convert '0x{0}' to an unsigned short integer.",
+ Console.WriteLine("Unable to convert '0x{0}' to an unsigned short integer.",
value);
- }
+ }
//
}
@@ -284,15 +284,15 @@ private static void ConvertHexToUInt16()
targetNumber = Convert.ToUInt16(value, 16);
if (isSigned && ((targetNumber & 0x8000) != 0))
throw new OverflowException();
- else
+ else
Console.WriteLine("0x{0} converts to {1}.", value, targetNumber);
}
catch (OverflowException)
{
Console.WriteLine("Unable to convert '0x{0}' to an unsigned short integer.", value);
- }
+ }
// Displays the following to the console:
- // Unable to convert '0x8000' to an unsigned short integer.
+ // Unable to convert '0x8000' to an unsigned short integer.
//
}
@@ -306,12 +306,12 @@ private static void ConvertNegativeHexToUInt32()
{
UInt32 number = Convert.ToUInt32(value, 16);
Console.WriteLine("0x{0} converts to {1}.", value, number);
- }
+ }
catch (OverflowException)
{
- Console.WriteLine("Unable to convert '0x{0}' to an unsigned integer.",
+ Console.WriteLine("Unable to convert '0x{0}' to an unsigned integer.",
value);
- }
+ }
//
}
@@ -328,16 +328,16 @@ private static void ConvertHexToUInt32()
targetNumber = Convert.ToUInt32(value, 16);
if (isSigned && ((targetNumber & 0x80000000) != 0))
throw new OverflowException();
- else
+ else
Console.WriteLine("0x{0} converts to {1}.", value, targetNumber);
}
catch (OverflowException)
{
- Console.WriteLine("Unable to convert '0x{0}' to an unsigned integer.",
+ Console.WriteLine("Unable to convert '0x{0}' to an unsigned integer.",
value);
- }
+ }
// Displays the following to the console:
- // Unable to convert '0x80000000' to an unsigned integer.
+ // Unable to convert '0x80000000' to an unsigned integer.
//
}
@@ -351,12 +351,12 @@ private static void ConvertNegativeHexToUInt64()
{
UInt64 number = Convert.ToUInt64(value, 16);
Console.WriteLine("0x{0} converts to {1}.", value, number);
- }
+ }
catch (OverflowException)
{
- Console.WriteLine("Unable to convert '0x{0}' to an unsigned long integer.",
+ Console.WriteLine("Unable to convert '0x{0}' to an unsigned long integer.",
value);
- }
+ }
//
}
@@ -373,16 +373,16 @@ private static void ConvertHexToUInt64()
targetNumber = Convert.ToUInt64(value, 16);
if (isSigned && ((targetNumber & 0x8000000000000000) != 0))
throw new OverflowException();
- else
+ else
Console.WriteLine("0x{0} converts to {1}.", value, targetNumber);
}
catch (OverflowException)
{
- Console.WriteLine("Unable to convert '0x{0}' to an unsigned long integer.",
+ Console.WriteLine("Unable to convert '0x{0}' to an unsigned long integer.",
value);
- }
+ }
// Displays the following to the console:
- // Unable to convert '0x8000000000000000' to an unsigned long integer.
+ // Unable to convert '0x8000000000000000' to an unsigned long integer.
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.IsDBNull/cs/Form1.Designer.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.IsDBNull/cs/Form1.Designer.cs
index 2a442875b6d..8d2f24ab054 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.IsDBNull/cs/Form1.Designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.IsDBNull/cs/Form1.Designer.cs
@@ -31,17 +31,17 @@ private void InitializeComponent()
this.grid = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit();
this.SuspendLayout();
- //
+ //
// grid
- //
+ //
this.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.grid.Location = new System.Drawing.Point(36, 24);
this.grid.Name = "grid";
this.grid.Size = new System.Drawing.Size(465, 210);
this.grid.TabIndex = 0;
- //
+ //
// Form1
- //
+ //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(575, 280);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.IsDBNull/cs/Form1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.IsDBNull/cs/Form1.cs
index d7c40ad5c3a..1313ec07a89 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.IsDBNull/cs/Form1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.IsDBNull/cs/Form1.cs
@@ -23,7 +23,7 @@ static void Main()
Application.Run(new Form1());
}
}
-
+
public partial class Form1 : Form
{
private string connectionString = @"Data Source=RONPET59\SQLEXPRESS;Initial Catalog=SurveyDB;Integrated Security=True";
@@ -37,7 +37,7 @@ private bool CompareForMissing(object value)
{
//
return DBNull.Value.Equals(value);
- //
+ //
}
//
@@ -62,7 +62,7 @@ private void Form1_Load(object sender, EventArgs e)
int fieldCount = dr.FieldCount;
object[] fieldValues = new object[fieldCount];
string[] headers = new string[fieldCount];
-
+
// Get names of fields.
for (int ctr = 0; ctr < fieldCount; ctr++)
headers[ctr] = dr.GetName(ctr);
@@ -97,6 +97,6 @@ private void Form1_Load(object sender, EventArgs e)
}
dr.Close();
}
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToBoolean/cs/ToBoolean1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToBoolean/cs/ToBoolean1.cs
index 377f4738cf9..474f256e233 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToBoolean/cs/ToBoolean1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToBoolean/cs/ToBoolean1.cs
@@ -5,19 +5,19 @@ public class BooleanConversion
{
public static void Main()
{
- String[] values = { null, String.Empty, "true", "TrueString",
+ String[] values = { null, String.Empty, "true", "TrueString",
"False", " false ", "-1", "0" };
foreach (var value in values) {
try
{
- Console.WriteLine("Converted '{0}' to {1}.", value,
+ Console.WriteLine("Converted '{0}' to {1}.", value,
Convert.ToBoolean(value));
}
catch (FormatException)
{
Console.WriteLine("Unable to convert '{0}' to a Boolean.", value);
}
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToBoolean/cs/toboolean2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToBoolean/cs/toboolean2.cs
index dffab4fa1d4..cb01dd1f0b2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToBoolean/cs/toboolean2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToBoolean/cs/toboolean2.cs
@@ -32,12 +32,12 @@ private static void ConvertByte()
//
byte[] bytes = { Byte.MinValue, 100, 200, Byte.MaxValue };
bool result;
-
+
foreach (byte byteValue in bytes)
{
- result = Convert.ToBoolean(byteValue);
+ result = Convert.ToBoolean(byteValue);
Console.WriteLine("{0,-5} --> {1}", byteValue, result);
- }
+ }
// The example displays the following output:
// 0 --> False
// 100 --> True
@@ -45,17 +45,17 @@ private static void ConvertByte()
// 255 --> True
//
}
-
+
private static void ConvertDecimal()
{
//
- decimal[] numbers = { Decimal.MinValue, -12034.87m, -100m, 0m,
+ decimal[] numbers = { Decimal.MinValue, -12034.87m, -100m, 0m,
300m, 6790823.45m, Decimal.MaxValue };
bool result;
-
+
foreach (decimal number in numbers)
{
- result = Convert.ToBoolean(number);
+ result = Convert.ToBoolean(number);
Console.WriteLine("{0,-30} --> {1}", number, result);
}
// The example displays the following output:
@@ -68,17 +68,17 @@ private static void ConvertDecimal()
// 79228162514264337593543950335 --> True
//
}
-
+
private static void ConvertInt16()
{
//
- short[] numbers = { Int16.MinValue, -10000, -154, 0, 216, 21453,
+ short[] numbers = { Int16.MinValue, -10000, -154, 0, 216, 21453,
Int16.MaxValue };
bool result;
-
+
foreach (short number in numbers)
{
- result = Convert.ToBoolean(number);
+ result = Convert.ToBoolean(number);
Console.WriteLine("{0,-7:N0} --> {1}", number, result);
}
// The example displays the following output:
@@ -91,17 +91,17 @@ private static void ConvertInt16()
// 32,767 --> True
//
}
-
+
private static void ConvertInt32()
{
//
- int[] numbers = { Int32.MinValue, -201649, -68, 0, 612, 4038907,
+ int[] numbers = { Int32.MinValue, -201649, -68, 0, 612, 4038907,
Int32.MaxValue };
bool result;
-
+
foreach (int number in numbers)
{
- result = Convert.ToBoolean(number);
+ result = Convert.ToBoolean(number);
Console.WriteLine("{0,-15:N0} --> {1}", number, result);
}
// The example displays the following output:
@@ -114,17 +114,17 @@ private static void ConvertInt32()
// 2,147,483,647 --> True
//
}
-
+
private static void ConvertInt64()
{
//
- long[] numbers = { Int64.MinValue, -2016493, -689, 0, 6121,
+ long[] numbers = { Int64.MinValue, -2016493, -689, 0, 6121,
403890774, Int64.MaxValue };
bool result;
-
+
foreach (long number in numbers)
{
- result = Convert.ToBoolean(number);
+ result = Convert.ToBoolean(number);
Console.WriteLine("{0,-26:N0} --> {1}", number, result);
}
// The example displays the following output:
@@ -143,10 +143,10 @@ private static void ConvertSByte()
//
sbyte[] numbers = { SByte.MinValue, -1, 0, 10, 100, SByte.MaxValue };
bool result;
-
+
foreach (sbyte number in numbers)
{
- result = Convert.ToBoolean(number);
+ result = Convert.ToBoolean(number);
Console.WriteLine("{0,-5} --> {1}", number, result);
}
// The example displays the following output:
@@ -158,17 +158,17 @@ private static void ConvertSByte()
// 127 --> True
//
}
-
+
private static void ConvertSingle()
{
//
- float[] numbers = { Single.MinValue, -193.0012f, 20e-15f, 0f,
+ float[] numbers = { Single.MinValue, -193.0012f, 20e-15f, 0f,
10551e-10f, 100.3398f, Single.MaxValue };
bool result;
-
+
foreach (float number in numbers)
{
- result = Convert.ToBoolean(number);
+ result = Convert.ToBoolean(number);
Console.WriteLine("{0,-15} --> {1}", number, result);
}
// The example displays the following output:
@@ -181,16 +181,16 @@ private static void ConvertSingle()
// 3.402823E+38 --> True
//
}
-
+
private static void ConvertUInt16()
{
//
ushort[] numbers = { UInt16.MinValue, 216, 21453, UInt16.MaxValue };
bool result;
-
+
foreach (ushort number in numbers)
{
- result = Convert.ToBoolean(number);
+ result = Convert.ToBoolean(number);
Console.WriteLine("{0,-7:N0} --> {1}", number, result);
}
// The example displays the following output:
@@ -200,16 +200,16 @@ private static void ConvertUInt16()
// 65,535 --> True
//
}
-
+
private static void ConvertUInt32()
{
//
uint[] numbers = { UInt32.MinValue, 612, 4038907, Int32.MaxValue };
bool result;
-
+
foreach (uint number in numbers)
{
- result = Convert.ToBoolean(number);
+ result = Convert.ToBoolean(number);
Console.WriteLine("{0,-15:N0} --> {1}", number, result);
}
// The example displays the following output:
@@ -219,16 +219,16 @@ private static void ConvertUInt32()
// 2,147,483,647 --> True
//
}
-
+
private static void ConvertUInt64()
{
//
ulong[] numbers = { UInt64.MinValue, 6121, 403890774, UInt64.MaxValue };
bool result;
-
+
foreach (ulong number in numbers)
{
- result = Convert.ToBoolean(number);
+ result = Convert.ToBoolean(number);
Console.WriteLine("{0,-26:N0} --> {1}", number, result);
}
// The example displays the following output:
@@ -238,30 +238,30 @@ private static void ConvertUInt64()
// 18,446,744,073,709,551,615 --> True
//
}
-
+
private static void ConvertObject()
{
//
- object[] objects = { 16.33, -24, 0, "12", "12.7", String.Empty,
- "1String", "True", "false", null,
+ object[] objects = { 16.33, -24, 0, "12", "12.7", String.Empty,
+ "1String", "True", "false", null,
new System.Collections.ArrayList() };
-
+
foreach (object obj in objects)
{
- Console.Write("{0,-40} --> ",
- obj != null ?
- String.Format("{0} ({1})", obj, obj.GetType().Name) :
+ Console.Write("{0,-40} --> ",
+ obj != null ?
+ String.Format("{0} ({1})", obj, obj.GetType().Name) :
"null");
try {
Console.WriteLine("{0}", Convert.ToBoolean(obj));
- }
+ }
catch (FormatException) {
Console.WriteLine("Bad Format");
- }
+ }
catch (InvalidCastException) {
Console.WriteLine("No Conversion");
- }
- }
+ }
+ }
// The example displays the following output:
// 16.33 (Double) --> True
// -24 (Int32) --> True
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime1.cs
index 916605055e4..b0c0fd48a28 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime1.cs
@@ -10,17 +10,17 @@ public static void Main()
// Try converting an integer.
int number = 16352;
ConvertToDateTime(number);
-
+
// Convert a null.
object obj = null;
ConvertToDateTime(obj);
-
+
// Convert a non-date string.
string nonDateString = "monthly";
ConvertToDateTime(nonDateString);
-
+
// Try to convert various date strings.
- string dateString;
+ string dateString;
dateString = "05/01/1996";
ConvertToDateTime(dateString);
dateString = "Tue Apr 28, 2009";
@@ -40,9 +40,9 @@ private static void ConvertToDateTime(object value)
}
catch (FormatException) {
Console.WriteLine("'{0}' is not in the proper format.", value);
- }
+ }
catch (InvalidCastException) {
- Console.WriteLine("Conversion of the {0} '{1}' is not supported",
+ Console.WriteLine("Conversion of the {0} '{1}' is not supported",
value.GetType().Name, value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime2.cs
index ab8c135fac0..62eef738083 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime2.cs
@@ -8,18 +8,18 @@ public class ConversionToDateTime
public static void Main()
{
string dateString = null;
-
+
// Convert a null string.
ConvertToDateTime(dateString);
-
+
// Convert an empty string.
dateString = String.Empty;
ConvertToDateTime(dateString);
-
+
// Convert a non-date string.
dateString = "not a date";
ConvertToDateTime(dateString);
-
+
// Try to convert various date strings.
dateString = "05/01/1996";
ConvertToDateTime(dateString);
@@ -44,8 +44,8 @@ private static void ConvertToDateTime(string value)
DateTime convertedDate;
try {
convertedDate = Convert.ToDateTime(value);
- Console.WriteLine("'{0}' converts to {1} {2} time.",
- value, convertedDate,
+ Console.WriteLine("'{0}' converts to {1} {2} time.",
+ value, convertedDate,
convertedDate.Kind.ToString());
}
catch (FormatException) {
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime3.cs
index 4ddcc42e630..b314d3e4a12 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/ToDateTime3.cs
@@ -9,14 +9,14 @@ public static void Main()
Console.WriteLine("{0,-18}{1,-12}{2}\n", "Date String", "Culture", "Result");
string[] cultureNames = { "en-US", "ru-RU","ja-JP" };
- string[] dateStrings = { "01/02/09", "2009/02/03", "01/2009/03",
- "01/02/2009", "21/02/09", "01/22/09",
+ string[] dateStrings = { "01/02/09", "2009/02/03", "01/2009/03",
+ "01/02/2009", "21/02/09", "01/22/09",
"01/02/23" };
// Iterate each culture name in the array.
foreach (string cultureName in cultureNames)
{
CultureInfo culture = new CultureInfo(cultureName);
-
+
// Parse each date using the designated culture.
foreach (string dateStr in dateStrings)
{
@@ -27,8 +27,8 @@ public static void Main()
Console.WriteLine("{0,-18}{1,-12}{2:yyyy-MMM-dd}",
dateStr, cultureName, dateTimeValue);
}
- catch (FormatException e) {
- Console.WriteLine("{0,-18}{1,-12}{2}",
+ catch (FormatException e) {
+ Console.WriteLine("{0,-18}{1,-12}{2}",
dateStr, cultureName, e.GetType().Name);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/todatetime4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/todatetime4.cs
index 5fa92577bef..308fb6cd523 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/todatetime4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDateTime/cs/todatetime4.cs
@@ -7,24 +7,24 @@ public class Example
public static void Main()
{
string[] cultureNames = { "en-US", "hu-HU", "pt-PT" };
- object[] objects = { 12, 17.2, false, new DateTime(2010, 1, 1), "today",
- new System.Collections.ArrayList(), 'c',
+ object[] objects = { 12, 17.2, false, new DateTime(2010, 1, 1), "today",
+ new System.Collections.ArrayList(), 'c',
"05/10/2009 6:13:18 PM", "September 8, 1899" };
-
+
foreach (string cultureName in cultureNames)
{
Console.WriteLine("{0} culture:", cultureName);
CustomProvider provider = new CustomProvider(cultureName);
foreach (object obj in objects)
- {
+ {
try {
- DateTime dateValue = Convert.ToDateTime(obj, provider);
- Console.WriteLine("{0} --> {1}", obj,
+ DateTime dateValue = Convert.ToDateTime(obj, provider);
+ Console.WriteLine("{0} --> {1}", obj,
dateValue.ToString(new CultureInfo(cultureName)));
}
catch (FormatException) {
Console.WriteLine("{0} --> Bad Format", obj);
- }
+ }
catch (InvalidCastException) {
Console.WriteLine("{0} --> Conversion Not Supported", obj);
}
@@ -37,12 +37,12 @@ public static void Main()
public class CustomProvider : IFormatProvider
{
private string cultureName;
-
+
public CustomProvider(string cultureName)
{
this.cultureName = cultureName;
}
-
+
public object GetFormat(Type formatType)
{
if (formatType == typeof(DateTimeFormatInfo))
@@ -53,7 +53,7 @@ public object GetFormat(Type formatType)
else
{
return null;
- }
+ }
}
}
// The example displays the following output:
@@ -67,7 +67,7 @@ public object GetFormat(Type formatType)
// c --> Conversion Not Supported
// (CustomProvider retrieved.) 05/10/2009 6:13:18 PM --> 5/10/2009 6:13:18 PM
// (CustomProvider retrieved.) September 8, 1899 --> 9/8/1899 12:00:00 AM
-//
+//
// hu-HU culture:
// 12 --> Conversion Not Supported
// 17.2 --> Conversion Not Supported
@@ -78,7 +78,7 @@ public object GetFormat(Type formatType)
// c --> Conversion Not Supported
// (CustomProvider retrieved.) 05/10/2009 6:13:18 PM --> 2009. 05. 10. 18:13:18
// (CustomProvider retrieved.) September 8, 1899 --> 1899. 09. 08. 0:00:00
-//
+//
// pt-PT culture:
// 12 --> Conversion Not Supported
// 17.2 --> Conversion Not Supported
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDecimal/cs/ToDecimal1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDecimal/cs/ToDecimal1.cs
index 41051ca442c..12c8709be78 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDecimal/cs/ToDecimal1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToDecimal/cs/ToDecimal1.cs
@@ -13,8 +13,8 @@ private static void ConvertSingleToDecimal()
//
Console.WriteLine(Convert.ToDecimal(1234567500.12F)); // Displays 1234568000
Console.WriteLine(Convert.ToDecimal(1234568500.12F)); // Displays 1234568000
-
- Console.WriteLine(Convert.ToDecimal(10.980365F)); // Displays 10.98036
+
+ Console.WriteLine(Convert.ToDecimal(10.980365F)); // Displays 10.98036
Console.WriteLine(Convert.ToDecimal(10.980355F)); // Displays 10.98036
//
}
@@ -24,8 +24,8 @@ private static void ConvertDoubleToDecimal()
//
Console.WriteLine(Convert.ToDecimal(123456789012345500.12D)); // Displays 123456789012346000
Console.WriteLine(Convert.ToDecimal(123456789012346500.12D)); // Displays 123456789012346000
-
- Console.WriteLine(Convert.ToDecimal(10030.12345678905D)); // Displays 10030.123456789
+
+ Console.WriteLine(Convert.ToDecimal(10030.12345678905D)); // Displays 10030.123456789
Console.WriteLine(Convert.ToDecimal(10030.12345678915D)); // Displays 10030.1234567892
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToNonNum_String/CS/strdatetime.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToNonNum_String/CS/strdatetime.cs
index 9cb4487a3bf..5ba5060231d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToNonNum_String/CS/strdatetime.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToNonNum_String/CS/strdatetime.cs
@@ -6,22 +6,22 @@
class StringToDateTimeDemo
{
const string lineFmt = "{0,-18}{1,-12}{2}";
-
+
// Get the exception type name; remove the namespace prefix.
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
public static void StringToDateTime( string cultureName )
{
- string[ ] dateStrings = { "01/02/03",
- "2001/02/03", "01/2002/03", "01/02/2003",
+ string[ ] dateStrings = { "01/02/03",
+ "2001/02/03", "01/2002/03", "01/02/2003",
"21/02/03", "01/22/03", "01/02/23" };
CultureInfo culture = new CultureInfo( cultureName );
-
+
Console.WriteLine( );
// Convert each string in the dateStrings array.
@@ -37,7 +37,7 @@ public static void StringToDateTime( string cultureName )
// Convert the string to a DateTime object.
dateTimeValue = Convert.ToDateTime( dateStr, culture );
- // Display the DateTime object in a fixed format
+ // Display the DateTime object in a fixed format
// if Convert succeeded.
Console.WriteLine( "{0:yyyy-MMM-dd}", dateTimeValue );
}
@@ -48,7 +48,7 @@ public static void StringToDateTime( string cultureName )
}
}
}
-
+
public static void Main( )
{
Console.WriteLine( "This example of " +
@@ -57,9 +57,9 @@ public static void Main( )
"converted \nto DateTime objects using formatting " +
"information from different \ncultures, and then the " +
"strings are displayed in a \nculture-invariant form.\n" );
- Console.WriteLine( lineFmt, "Date String", "Culture",
+ Console.WriteLine( lineFmt, "Date String", "Culture",
"DateTime or Exception" );
- Console.WriteLine( lineFmt, "-----------", "-------",
+ Console.WriteLine( lineFmt, "-----------", "-------",
"---------------------" );
StringToDateTime( "en-US" );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToNonNum_String/CS/stringnonnum.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToNonNum_String/CS/stringnonnum.cs
index 864ddd6d420..dc5b653fda3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToNonNum_String/CS/stringnonnum.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToNonNum_String/CS/stringnonnum.cs
@@ -5,13 +5,13 @@
public class DummyProvider : IFormatProvider
{
// Normally, GetFormat returns an object of the requested type
- // (usually itself) if it is able; otherwise, it returns Nothing.
+ // (usually itself) if it is able; otherwise, it returns Nothing.
public object GetFormat(Type argType)
{
- // Here, GetFormat displays the name of argType, after removing
+ // Here, GetFormat displays the name of argType, after removing
// the namespace information. GetFormat always returns null.
string argStr = argType.ToString( );
- if( argStr == "" )
+ if( argStr == "" )
argStr = "Empty";
argStr = argStr.Substring( argStr.LastIndexOf( '.' ) + 1 );
@@ -47,20 +47,20 @@ public static void Main( )
// The format provider is called for the following conversions.
Console.WriteLine( );
- Console.WriteLine( format, "ToInt32", Int32A,
+ Console.WriteLine( format, "ToInt32", Int32A,
Convert.ToInt32( Int32A, provider ) );
- Console.WriteLine( format, "ToDouble", DoubleA,
+ Console.WriteLine( format, "ToDouble", DoubleA,
Convert.ToDouble( DoubleA, provider ) );
- Console.WriteLine( format, "ToDateTime", DayTimeA,
+ Console.WriteLine( format, "ToDateTime", DayTimeA,
Convert.ToDateTime( DayTimeA, provider ) );
// The format provider is not called for these conversions.
Console.WriteLine( );
- Console.WriteLine( format, "ToBoolean", BoolA,
+ Console.WriteLine( format, "ToBoolean", BoolA,
Convert.ToBoolean( BoolA, provider ) );
- Console.WriteLine( format, "ToString", StringA,
+ Console.WriteLine( format, "ToString", StringA,
Convert.ToString( StringA, provider ) );
- Console.WriteLine( format, "ToChar", CharA,
+ Console.WriteLine( format, "ToChar", CharA,
Convert.ToChar( CharA, provider ) );
}
}
@@ -80,5 +80,5 @@ NumberFormatInfo ToDouble 61680.3855 61680.3855
ToBoolean True True
ToString Qwerty Qwerty
ToChar $ $
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/todecimal.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/todecimal.cs
index 9baf125d40f..239a03a6f5b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/todecimal.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/todecimal.cs
@@ -1,5 +1,5 @@
//
-// Example of the Convert.ToDecimal( String ) and
+// Example of the Convert.ToDecimal( String ) and
// Convert.ToDecimal( String, IFormatProvider ) methods.
using System;
using System.Globalization;
@@ -12,11 +12,11 @@ class ToDecimalProviderDemo
static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
- static void ConvertToDecimal( string numericStr,
+ static void ConvertToDecimal( string numericStr,
IFormatProvider provider )
{
object defaultValue;
@@ -42,7 +42,7 @@ static void ConvertToDecimal( string numericStr,
providerValue = GetExceptionType( ex );
}
- Console.WriteLine( formatter, numericStr, defaultValue,
+ Console.WriteLine( formatter, numericStr, defaultValue,
providerValue );
}
@@ -56,18 +56,18 @@ static void Main( )
provider.NumberGroupSeparator = ".";
provider.NumberGroupSizes = new int[ ] { 3 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of\n Convert.ToDecimal( String ) and \n" +
" Convert.ToDecimal( String, IFormatProvider ) \n" +
"generates the following output when run in the " +
- "[{0}] culture.",
+ "[{0}] culture.",
CultureInfo.CurrentCulture.Name );
Console.WriteLine( "\nSeveral " +
"strings are converted to decimal values, using \n" +
"default formatting and a NumberFormatInfo object.\n");
- Console.WriteLine( formatter, "String to convert",
+ Console.WriteLine( formatter, "String to convert",
"Default/exception", "Provider/exception" );
- Console.WriteLine( formatter, "-----------------",
+ Console.WriteLine( formatter, "-----------------",
"-----------------", "------------------" );
// Convert strings, with and without an IFormatProvider.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/todouble.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/todouble.cs
index 56f4b27b9ff..2ad864054eb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/todouble.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/todouble.cs
@@ -13,11 +13,11 @@ static void Main()
provider.NumberGroupSizes = new int[] { 3 };
// Define an array of numeric strings to convert.
- String[] values = { "123456789", "12345.6789", "12345,6789",
- "123,456.789", "123.456,789",
+ String[] values = { "123456789", "12345.6789", "12345,6789",
+ "123,456.789", "123.456,789",
"123,456,789.0123", "123.456.789,0123" };
- Console.WriteLine("Default Culture: {0}\n",
+ Console.WriteLine("Default Culture: {0}\n",
CultureInfo.CurrentCulture.Name);
Console.WriteLine("{0,-22} {1,-20} {2,-20}\n", "String to Convert",
"Default/Exception", "Provider/Exception");
@@ -27,7 +27,7 @@ static void Main()
Console.Write("{0,-22} ", value);
try {
Console.Write("{0,-20} ", Convert.ToDouble(value));
- }
+ }
catch (FormatException e) {
Console.Write("{0,-20} ", e.GetType().Name);
}
@@ -42,9 +42,9 @@ static void Main()
}
// The example displays the following output:
// Default Culture: en-US
-//
+//
// String to Convert Default/Exception Provider/Exception
-//
+//
// 123456789 123456789 123456789
// 12345.6789 12345.6789 123456789
// 12345,6789 123456789 12345.6789
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/tosingle.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/tosingle.cs
index 85275509527..96a96a33367 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/tosingle.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToReals_String/CS/tosingle.cs
@@ -1,5 +1,5 @@
//
-// Example of the Convert.ToSingle( String ) and
+// Example of the Convert.ToSingle( String ) and
// Convert.ToSingle( String, IFormatProvider ) methods.
using System;
using System.Globalization;
@@ -12,11 +12,11 @@ class ToSingleProviderDemo
static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
- static void ConvertToSingle( string numericStr,
+ static void ConvertToSingle( string numericStr,
IFormatProvider provider )
{
object defaultValue;
@@ -42,7 +42,7 @@ static void ConvertToSingle( string numericStr,
providerValue = GetExceptionType( ex );
}
- Console.WriteLine( formatter, numericStr, defaultValue,
+ Console.WriteLine( formatter, numericStr, defaultValue,
providerValue );
}
@@ -56,18 +56,18 @@ static void Main( )
provider.NumberGroupSeparator = ".";
provider.NumberGroupSizes = new int[ ] { 3 };
- Console.WriteLine(
+ Console.WriteLine(
"This example of\n Convert.ToSingle( String ) and \n" +
" Convert.ToSingle( String, IFormatProvider ) \n" +
"generates the following output when run in the " +
- "[{0}] culture.",
+ "[{0}] culture.",
CultureInfo.CurrentCulture.Name );
Console.WriteLine( "\nSeveral " +
"strings are converted to float values, using \n" +
"default formatting and a NumberFormatInfo object.\n");
- Console.WriteLine( formatter, "String to convert",
+ Console.WriteLine( formatter, "String to convert",
"Default/exception", "Provider/exception" );
- Console.WriteLine( formatter, "-----------------",
+ Console.WriteLine( formatter, "-----------------",
"-----------------", "------------------" );
// Convert strings, with and without an IFormatProvider.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint16.cs
index 0344b985e85..7c2a369c88b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint16.cs
@@ -1,5 +1,5 @@
//
-// Example of the Convert.ToInt16( string ) and
+// Example of the Convert.ToInt16( string ) and
// Convert.ToInt16( string, IFormatProvider ) methods.
using System;
using System.Globalization;
@@ -12,11 +12,11 @@ class ToInt16ProviderDemo
static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
- static void ConvertToInt16( string numericStr,
+ static void ConvertToInt16( string numericStr,
IFormatProvider provider )
{
object defaultValue;
@@ -42,7 +42,7 @@ static void ConvertToInt16( string numericStr,
providerValue = GetExceptionType( ex );
}
- Console.WriteLine( format, numericStr,
+ Console.WriteLine( format, numericStr,
defaultValue, providerValue );
}
@@ -69,9 +69,9 @@ public static void Main( )
"\ngenerates the following output. It converts " +
"several strings to \nshort values, using " +
"default formatting or a NumberFormatInfo object.\n" );
- Console.WriteLine( format, "String to convert",
+ Console.WriteLine( format, "String to convert",
"Default/exception", "Provider/exception" );
- Console.WriteLine( format, "-----------------",
+ Console.WriteLine( format, "-----------------",
"-----------------", "------------------" );
// Convert strings, with and without an IFormatProvider.
@@ -107,5 +107,5 @@ 12345. FormatException FormatException
(12345) FormatException FormatException
32768 OverflowException OverflowException
-32769 OverflowException FormatException
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint32.cs
index 4d2ec645e23..c58a890421d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint32.cs
@@ -1,5 +1,5 @@
//
-// Example of the Convert.ToInt32( string ) and
+// Example of the Convert.ToInt32( string ) and
// Convert.ToInt32( string, IFormatProvider ) methods.
using System;
using System.Globalization;
@@ -12,11 +12,11 @@ class ToInt32ProviderDemo
static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
- static void ConvertToInt32( string numericStr,
+ static void ConvertToInt32( string numericStr,
IFormatProvider provider )
{
object defaultValue;
@@ -42,7 +42,7 @@ static void ConvertToInt32( string numericStr,
providerValue = GetExceptionType( ex );
}
- Console.WriteLine( format, numericStr,
+ Console.WriteLine( format, numericStr,
defaultValue, providerValue );
}
@@ -69,9 +69,9 @@ public static void Main( )
"\ngenerates the following output. It converts " +
"several strings to \nint values, using " +
"default formatting or a NumberFormatInfo object.\n" );
- Console.WriteLine( format, "String to convert",
+ Console.WriteLine( format, "String to convert",
"Default/exception", "Provider/exception" );
- Console.WriteLine( format, "-----------------",
+ Console.WriteLine( format, "-----------------",
"-----------------", "------------------" );
// Convert strings, with and without an IFormatProvider.
@@ -107,5 +107,5 @@ 123456789. FormatException FormatException
(123456789) FormatException FormatException
2147483648 OverflowException OverflowException
-2147483649 OverflowException FormatException
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint64.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint64.cs
index 44f8a052af3..bbb03c8386f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/toint64.cs
@@ -1,5 +1,5 @@
//
-// Example of the Convert.ToInt64( string ) and
+// Example of the Convert.ToInt64( string ) and
// Convert.ToInt64( string, IFormatProvider ) methods.
using System;
using System.Globalization;
@@ -12,11 +12,11 @@ class ToInt64ProviderDemo
static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
- static void ConvertToInt64( string numericStr,
+ static void ConvertToInt64( string numericStr,
IFormatProvider provider )
{
object defaultValue;
@@ -42,7 +42,7 @@ static void ConvertToInt64( string numericStr,
providerValue = GetExceptionType( ex );
}
- Console.WriteLine( format, numericStr,
+ Console.WriteLine( format, numericStr,
defaultValue, providerValue );
}
@@ -69,9 +69,9 @@ public static void Main( )
"\ngenerates the following output. It converts " +
"several strings to \nlong values, using " +
"default formatting or a NumberFormatInfo object.\n" );
- Console.WriteLine( format, "String to convert",
+ Console.WriteLine( format, "String to convert",
"Default/exception", "Provider/exception" );
- Console.WriteLine( format, "-----------------",
+ Console.WriteLine( format, "-----------------",
"-----------------", "------------------" );
// Convert strings, with and without an IFormatProvider.
@@ -107,5 +107,5 @@ 123456789. FormatException FormatException
(123456789) FormatException FormatException
9223372036854775808 OverflowException OverflowException
-9223372036854775809 OverflowException FormatException
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/tosbyte.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/tosbyte.cs
index cd52389c8bb..e8ae6b4a8f5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/tosbyte.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToSInts_String/CS/tosbyte.cs
@@ -1,5 +1,5 @@
//
-// Example of the Convert.ToSByte( string ) and
+// Example of the Convert.ToSByte( string ) and
// Convert.ToSByte( string, IFormatProvider ) methods.
using System;
using System.Globalization;
@@ -12,11 +12,11 @@ class ToSByteProviderDemo
static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
- static void ConvertToSByte( string numericStr,
+ static void ConvertToSByte( string numericStr,
IFormatProvider provider )
{
object defaultValue;
@@ -42,7 +42,7 @@ static void ConvertToSByte( string numericStr,
providerValue = GetExceptionType( ex );
}
- Console.WriteLine( format, numericStr,
+ Console.WriteLine( format, numericStr,
defaultValue, providerValue );
}
@@ -67,9 +67,9 @@ public static void Main( )
"\ngenerates the following output. It converts " +
"several strings to \nSByte values, using " +
"default formatting or a NumberFormatInfo object.\n" );
- Console.WriteLine( format, "String to convert",
+ Console.WriteLine( format, "String to convert",
"Default/exception", "Provider/exception" );
- Console.WriteLine( format, "-----------------",
+ Console.WriteLine( format, "-----------------",
"-----------------", "------------------" );
// Convert strings, with and without an IFormatProvider.
@@ -103,5 +103,5 @@ 123. FormatException FormatException
(123) FormatException FormatException
128 OverflowException OverflowException
-129 OverflowException FormatException
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/datetime.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/datetime.cs
index 0ab65e915b6..55be574b804 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/datetime.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/datetime.cs
@@ -1,12 +1,12 @@
//
-// Example of the Convert.ToString( DateTime ) and
+// Example of the Convert.ToString( DateTime ) and
// Convert.ToString( DateTime, IFormatProvider ) methods.
using System;
using System.Globalization;
class DateTimeIFormatProviderDemo
{
- static void DisplayDateNCultureName( DateTime testDate,
+ static void DisplayDateNCultureName( DateTime testDate,
string cultureName )
{
// Create the CultureInfo object for the specified culture,
@@ -15,7 +15,7 @@ static void DisplayDateNCultureName( DateTime testDate,
string dateString = Convert.ToString( testDate, culture );
// Bracket the culture name, and display the name and date.
- Console.WriteLine(" {0,-12}{1}",
+ Console.WriteLine(" {0,-12}{1}",
String.Concat( "[", cultureName, "]" ), dateString );
}
@@ -32,20 +32,20 @@ static void Main( )
"and formats a DateTime value with each.\n" );
// Format the date without an IFormatProvider.
- Console.WriteLine( " {0,-12}{1}",
+ Console.WriteLine( " {0,-12}{1}",
null, "No IFormatProvider" );
- Console.WriteLine( " {0,-12}{1}",
+ Console.WriteLine( " {0,-12}{1}",
null, "------------------" );
- Console.WriteLine( " {0,-12}{1}\n",
- String.Concat( "[", CultureInfo.CurrentCulture.Name, "]" ),
+ Console.WriteLine( " {0,-12}{1}\n",
+ String.Concat( "[", CultureInfo.CurrentCulture.Name, "]" ),
Convert.ToString( tDate ) );
// Format the date with IFormatProvider for several cultures.
- Console.WriteLine( " {0,-12}{1}",
+ Console.WriteLine( " {0,-12}{1}",
"Culture", "With IFormatProvider" );
- Console.WriteLine( " {0,-12}{1}",
+ Console.WriteLine( " {0,-12}{1}",
"-------", "--------------------" );
-
+
DisplayDateNCultureName( tDate, "" );
DisplayDateNCultureName( tDate, "en-US" );
DisplayDateNCultureName( tDate, "es-AR" );
@@ -80,5 +80,5 @@ Culture With IFormatProvider
[nl-NL] 15-4-2003 20:30:40
[ru-RU] 15.04.2003 20:30:40
[ur-PK] 15/04/2003 8:30:40 PM
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/nonnumeric.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/nonnumeric.cs
index 7f4f4b04cbe..4512bd354bc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/nonnumeric.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/nonnumeric.cs
@@ -3,12 +3,12 @@
using System;
using System.Globalization;
-// An instance of this class can be passed to methods that require
+// An instance of this class can be passed to methods that require
// an IFormatProvider.
public class DummyProvider : IFormatProvider
{
// Normally, GetFormat returns an object of the requested type
- // (usually itself) if it is able; otherwise, it returns Nothing.
+ // (usually itself) if it is able; otherwise, it returns Nothing.
public object GetFormat( Type argType )
{
// Here, the type of argType is displayed, and GetFormat
@@ -91,5 +91,5 @@ string Qwerty
TimeSpan 00:18:00
object DummyProvider
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/numeric.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/numeric.cs
index b259a8103f6..9b2e70fa3c4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/numeric.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString.IFormatProvider/CS/numeric.cs
@@ -1,5 +1,5 @@
//
-// Example of the Convert.ToString( numeric types ) and
+// Example of the Convert.ToString( numeric types ) and
// Convert.ToString( numeric types, IFormatProvider ) methods.
using System;
using System.Globalization;
@@ -53,31 +53,31 @@ static void Main( )
Console.WriteLine( formatter, "-------", "---------------" );
// Convert the values with and without a format provider.
- Console.WriteLine( formatter, Convert.ToString( ByteA ),
+ Console.WriteLine( formatter, Convert.ToString( ByteA ),
Convert.ToString( ByteA, provider ) );
- Console.WriteLine( formatter, Convert.ToString( SByteA ),
+ Console.WriteLine( formatter, Convert.ToString( SByteA ),
Convert.ToString( SByteA, provider ) );
- Console.WriteLine( formatter, Convert.ToString( UInt16A ),
+ Console.WriteLine( formatter, Convert.ToString( UInt16A ),
Convert.ToString( UInt16A, provider ) );
- Console.WriteLine( formatter, Convert.ToString( Int16A ),
+ Console.WriteLine( formatter, Convert.ToString( Int16A ),
Convert.ToString( Int16A, provider ) );
- Console.WriteLine( formatter, Convert.ToString( UInt32A ),
+ Console.WriteLine( formatter, Convert.ToString( UInt32A ),
Convert.ToString( UInt32A, provider ) );
- Console.WriteLine( formatter, Convert.ToString( Int32A ),
+ Console.WriteLine( formatter, Convert.ToString( Int32A ),
Convert.ToString( Int32A, provider ) );
- Console.WriteLine( formatter, Convert.ToString( UInt64A ),
+ Console.WriteLine( formatter, Convert.ToString( UInt64A ),
Convert.ToString( UInt64A, provider ) );
- Console.WriteLine( formatter, Convert.ToString( Int64A ),
+ Console.WriteLine( formatter, Convert.ToString( Int64A ),
Convert.ToString( Int64A, provider ) );
- Console.WriteLine( formatter, Convert.ToString( SingleA ),
+ Console.WriteLine( formatter, Convert.ToString( SingleA ),
Convert.ToString( SingleA, provider ) );
- Console.WriteLine( formatter, Convert.ToString( DoubleA ),
+ Console.WriteLine( formatter, Convert.ToString( DoubleA ),
Convert.ToString( DoubleA, provider ) );
- Console.WriteLine( formatter, Convert.ToString( DecimA ),
+ Console.WriteLine( formatter, Convert.ToString( DecimA ),
Convert.ToString( DecimA, provider ) );
- Console.WriteLine( formatter, Convert.ToString( ObjDouble ),
+ Console.WriteLine( formatter, Convert.ToString( ObjDouble ),
Convert.ToString( ObjDouble, provider ) );
}
}
@@ -105,5 +105,5 @@ 8138269444283625712 8138269444283625712
61680.3855 61680 point 3855
4042322160.252645135 4042322160 point 252645135
-98765.4321 minus 98765 point 4321
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString/cs/ToString.Byte1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString/cs/ToString.Byte1.cs
index 01f01592fdb..364f842cdbe 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString/cs/ToString.Byte1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString/cs/ToString.Byte1.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
public class Example
@@ -8,9 +8,9 @@ public static void Main()
byte[] values = { Byte.MinValue, 12, 100, 179, Byte.MaxValue } ;
foreach (var value in values)
- Console.WriteLine("{0,3} ({1}) --> {2}", value,
- value.GetType().Name,
- Convert.ToString(value));
+ Console.WriteLine("{0,3} ({1}) --> {2}", value,
+ value.GetType().Name,
+ Convert.ToString(value));
}
}
// The example displays the following output:
@@ -19,4 +19,4 @@ public static void Main()
// 100 (Byte) --> 100
// 179 (Byte) --> 179
// 255 (Byte) --> 255
-//
+//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString/cs/ToString_Bool1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString/cs/ToString_Bool1.cs
index c9ed84974e6..79261f1df56 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString/cs/ToString_Bool1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToString/cs/ToString_Bool1.cs
@@ -4,10 +4,10 @@ public class Class1
{
public static void Main()
{
- //
+ //
bool falseFlag = false;
bool trueFlag = true;
-
+
Console.WriteLine(Convert.ToString(falseFlag));
Console.WriteLine(Convert.ToString(falseFlag).Equals(Boolean.FalseString));
Console.WriteLine(Convert.ToString(trueFlag));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToXXX_Object_IFP/CS/objectifp.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToXXX_Object_IFP/CS/objectifp.cs
index 82169b62647..d70c25b4d82 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToXXX_Object_IFP/CS/objectifp.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert.ToXXX_Object_IFP/CS/objectifp.cs
@@ -2,7 +2,7 @@
using System;
using System.Collections;
-// Define the types of averaging available in the class
+// Define the types of averaging available in the class
// implementing IConvertible.
public enum AverageType : short
{
@@ -12,8 +12,8 @@ public enum AverageType : short
Median = 3
};
-// Pass an instance of this class to methods that require an
-// IFormatProvider. The class instance determines the type of
+// Pass an instance of this class to methods that require an
+// IFormatProvider. The class instance determines the type of
// average to calculate.
public class AverageInfo : IFormatProvider
{
@@ -25,8 +25,8 @@ public AverageInfo( AverageType avgType )
this.AvgType = avgType;
}
- // This method returns a reference to the containing object
- // if an object of AverageInfo type is requested.
+ // This method returns a reference to the containing object
+ // if an object of AverageInfo type is requested.
public object GetFormat( Type argType )
{
if ( argType == typeof( AverageInfo ) )
@@ -36,40 +36,40 @@ public object GetFormat( Type argType )
}
// Use this property to set or get the type of averaging.
- public AverageType TypeOfAverage
+ public AverageType TypeOfAverage
{
get { return this.AvgType; }
set { this.AvgType = value; }
}
}
-// This class encapsulates an array of double values and implements
-// the IConvertible interface. Most of the IConvertible methods
-// return an average of the array elements in one of three types:
-// arithmetic mean, geometric mean, or median.
+// This class encapsulates an array of double values and implements
+// the IConvertible interface. Most of the IConvertible methods
+// return an average of the array elements in one of three types:
+// arithmetic mean, geometric mean, or median.
public class DataSet : IConvertible
{
protected ArrayList data;
protected AverageInfo defaultProvider;
-
+
// Construct the object and add an initial list of values.
// Create a default format provider.
public DataSet( params double[ ] values )
{
data = new ArrayList( values );
- defaultProvider =
+ defaultProvider =
new AverageInfo( AverageType.ArithmeticMean );
}
-
+
// Add additional values with this method.
public int Add( double value )
{
data.Add( value );
return data.Count;
}
-
+
// Get, set, and add values with this indexer property.
- public double this[ int index ]
+ public double this[ int index ]
{
get
{
@@ -91,9 +91,9 @@ public double this[ int index ]
"[DataSet.set] Index out of range." );
}
}
-
+
// This property returns the number of elements in the object.
- public int Count
+ public int Count
{
get { return data.Count; }
}
@@ -103,7 +103,7 @@ protected double Average( AverageType avgType )
{
double SumProd;
- if( data.Count == 0 )
+ if( data.Count == 0 )
return 0.0;
switch( avgType )
@@ -113,10 +113,10 @@ protected double Average( AverageType avgType )
SumProd = 1.0;
for( int Index = 0; Index < data.Count; Index++ )
SumProd *= (double)data[ Index ];
-
- // This calculation will not fail with negative
+
+ // This calculation will not fail with negative
// elements.
- return Math.Sign( SumProd ) * Math.Pow(
+ return Math.Sign( SumProd ) * Math.Pow(
Math.Abs( SumProd ), 1.0 / data.Count );
case AverageType.ArithmeticMean:
@@ -130,7 +130,7 @@ protected double Average( AverageType avgType )
case AverageType.Median:
if( data.Count % 2 == 0 )
- return ( (double)data[ data.Count / 2 ] +
+ return ( (double)data[ data.Count / 2 ] +
(double)data[ data.Count / 2 - 1 ] ) / 2.0;
else
return (double)data[ data.Count / 2 ];
@@ -147,7 +147,7 @@ protected AverageInfo GetAverageInfo( IFormatProvider provider )
AverageInfo avgInfo = null;
if( provider != null )
- avgInfo = (AverageInfo)provider.GetFormat(
+ avgInfo = (AverageInfo)provider.GetFormat(
typeof( AverageInfo ) );
if ( avgInfo == null )
@@ -157,14 +157,14 @@ protected AverageInfo GetAverageInfo( IFormatProvider provider )
}
// Calculate the average and limit the range.
- protected double CalcNLimitAverage( double min, double max,
+ protected double CalcNLimitAverage( double min, double max,
IFormatProvider provider )
{
// Get the format provider and calculate the average.
AverageInfo avgInfo = GetAverageInfo( provider );
double avg = Average( avgInfo.TypeOfAverage );
- // Limit the range, based on the minimum and maximum values
+ // Limit the range, based on the minimum and maximum values
// for the type.
return avg > max ? max : avg < min ? min : avg;
}
@@ -187,24 +187,24 @@ public bool ToBoolean( IFormatProvider provider )
return false;
}
- // For median averaging, ToBoolean is true if any
+ // For median averaging, ToBoolean is true if any
// non-discarded elements are nonzero.
- else if( AverageType.Median ==
+ else if( AverageType.Median ==
GetAverageInfo( provider ).TypeOfAverage )
{
if (data.Count % 2 == 0 )
- return ( (double)data[ data.Count / 2 ] != 0.0 ||
+ return ( (double)data[ data.Count / 2 ] != 0.0 ||
(double)data[ data.Count / 2 - 1 ] != 0.0 );
else
return (double)data[ data.Count / 2 ] != 0.0;
}
- // For arithmetic or geometric mean averaging, ToBoolean is
- // true if any element of the dataset is nonzero.
+ // For arithmetic or geometric mean averaging, ToBoolean is
+ // true if any element of the dataset is nonzero.
else
{
for( int Index = 0; Index < data.Count; Index++ )
- if( (double)data[ Index ] != 0.0 )
+ if( (double)data[ Index ] != 0.0 )
return true;
return false;
}
@@ -212,22 +212,22 @@ public bool ToBoolean( IFormatProvider provider )
public byte ToByte( IFormatProvider provider )
{
- return Convert.ToByte( CalcNLimitAverage(
+ return Convert.ToByte( CalcNLimitAverage(
Byte.MinValue, Byte.MaxValue, provider ) );
}
public char ToChar( IFormatProvider provider )
{
- return Convert.ToChar( Convert.ToUInt16( CalcNLimitAverage(
+ return Convert.ToChar( Convert.ToUInt16( CalcNLimitAverage(
Char.MinValue, Char.MaxValue, provider ) ) );
}
- // Convert to DateTime by adding the calculated average as
- // seconds to the current date and time. A valid DateTime is
+ // Convert to DateTime by adding the calculated average as
+ // seconds to the current date and time. A valid DateTime is
// always returned.
public DateTime ToDateTime( IFormatProvider provider )
{
- double seconds =
+ double seconds =
Average( GetAverageInfo( provider ).TypeOfAverage );
try
{
@@ -241,11 +241,11 @@ public DateTime ToDateTime( IFormatProvider provider )
public decimal ToDecimal( IFormatProvider provider )
{
- // The Double conversion rounds Decimal.MinValue and
- // Decimal.MaxValue to invalid Decimal values, so the
+ // The Double conversion rounds Decimal.MinValue and
+ // Decimal.MaxValue to invalid Decimal values, so the
// following limits must be used.
- return Convert.ToDecimal( CalcNLimitAverage(
- -79228162514264330000000000000.0,
+ return Convert.ToDecimal( CalcNLimitAverage(
+ -79228162514264330000000000000.0,
79228162514264330000000000000.0, provider ) );
}
@@ -256,46 +256,46 @@ public double ToDouble( IFormatProvider provider )
public short ToInt16( IFormatProvider provider )
{
- return Convert.ToInt16( CalcNLimitAverage(
+ return Convert.ToInt16( CalcNLimitAverage(
Int16.MinValue, Int16.MaxValue, provider ) );
}
public int ToInt32( IFormatProvider provider )
{
- return Convert.ToInt32( CalcNLimitAverage(
+ return Convert.ToInt32( CalcNLimitAverage(
Int32.MinValue, Int32.MaxValue, provider ) );
}
public long ToInt64( IFormatProvider provider )
{
- // The Double conversion rounds Int64.MinValue and
- // Int64.MaxValue to invalid Int64 values, so the following
+ // The Double conversion rounds Int64.MinValue and
+ // Int64.MaxValue to invalid Int64 values, so the following
// limits must be used.
- return Convert.ToInt64( CalcNLimitAverage(
+ return Convert.ToInt64( CalcNLimitAverage(
-9223372036854775000, 9223372036854775000, provider ) );
}
public SByte ToSByte( IFormatProvider provider )
{
- return Convert.ToSByte( CalcNLimitAverage(
+ return Convert.ToSByte( CalcNLimitAverage(
SByte.MinValue, SByte.MaxValue, provider ) );
}
public float ToSingle( IFormatProvider provider )
{
- return Convert.ToSingle( CalcNLimitAverage(
+ return Convert.ToSingle( CalcNLimitAverage(
Single.MinValue, Single.MaxValue, provider ) );
}
public UInt16 ToUInt16( IFormatProvider provider )
{
- return Convert.ToUInt16( CalcNLimitAverage(
+ return Convert.ToUInt16( CalcNLimitAverage(
UInt16.MinValue, UInt16.MaxValue, provider ) );
}
public UInt32 ToUInt32( IFormatProvider provider )
{
- return Convert.ToUInt32( CalcNLimitAverage(
+ return Convert.ToUInt32( CalcNLimitAverage(
UInt32.MinValue, UInt32.MaxValue, provider ) );
}
@@ -303,26 +303,26 @@ public UInt64 ToUInt64( IFormatProvider provider )
{
// The Double conversion rounds UInt64.MaxValue to an invalid
// UInt64 value, so the following limit must be used.
- return Convert.ToUInt64( CalcNLimitAverage(
+ return Convert.ToUInt64( CalcNLimitAverage(
0, 18446744073709550000.0, provider ) );
}
- public object ToType( Type conversionType,
+ public object ToType( Type conversionType,
IFormatProvider provider )
{
- return Convert.ChangeType( Average(
- GetAverageInfo( provider ).TypeOfAverage ),
+ return Convert.ChangeType( Average(
+ GetAverageInfo( provider ).TypeOfAverage ),
conversionType );
}
public string ToString( IFormatProvider provider )
{
AverageType avgType = GetAverageInfo( provider ).TypeOfAverage;
- return String.Format( "( {0}: {1:G10} )", avgType,
+ return String.Format( "( {0}: {1:G10} )", avgType,
Average( avgType ) );
}
}
-
+
class IConvertibleProviderDemo
{
// Display a DataSet with three different format providers.
@@ -330,7 +330,7 @@ public static void DisplayDataSet( DataSet ds )
{
string fmt = "{0,-12}{1,20}{2,20}{3,20}";
AverageInfo median = new AverageInfo( AverageType.Median );
- AverageInfo geMean =
+ AverageInfo geMean =
new AverageInfo( AverageType.GeometricMean );
// Display the dataset elements.
@@ -342,69 +342,69 @@ public static void DisplayDataSet( DataSet ds )
Console.WriteLine( "]\n" );
}
- Console.WriteLine( fmt, "Convert.", "Default",
+ Console.WriteLine( fmt, "Convert.", "Default",
"Geometric Mean", "Median");
- Console.WriteLine( fmt, "--------", "-------",
+ Console.WriteLine( fmt, "--------", "-------",
"--------------", "------");
- Console.WriteLine( fmt, "ToBoolean",
- Convert.ToBoolean( ds, null ),
- Convert.ToBoolean( ds, geMean ),
+ Console.WriteLine( fmt, "ToBoolean",
+ Convert.ToBoolean( ds, null ),
+ Convert.ToBoolean( ds, geMean ),
Convert.ToBoolean( ds, median ) );
- Console.WriteLine( fmt, "ToByte",
- Convert.ToByte( ds, null ),
- Convert.ToByte( ds, geMean ),
+ Console.WriteLine( fmt, "ToByte",
+ Convert.ToByte( ds, null ),
+ Convert.ToByte( ds, geMean ),
Convert.ToByte( ds, median ) );
- Console.WriteLine( fmt, "ToChar",
- Convert.ToChar( ds, null ),
- Convert.ToChar( ds, geMean ),
+ Console.WriteLine( fmt, "ToChar",
+ Convert.ToChar( ds, null ),
+ Convert.ToChar( ds, geMean ),
Convert.ToChar( ds, median ) );
Console.WriteLine( "{0,-12}{1,20:yyyy-MM-dd HH:mm:ss}" +
- "{2,20:yyyy-MM-dd HH:mm:ss}{3,20:yyyy-MM-dd HH:mm:ss}",
- "ToDateTime", Convert.ToDateTime( ds, null ),
- Convert.ToDateTime( ds, geMean ),
+ "{2,20:yyyy-MM-dd HH:mm:ss}{3,20:yyyy-MM-dd HH:mm:ss}",
+ "ToDateTime", Convert.ToDateTime( ds, null ),
+ Convert.ToDateTime( ds, geMean ),
Convert.ToDateTime( ds, median ) );
- Console.WriteLine( fmt, "ToDecimal",
- Convert.ToDecimal( ds, null ),
- Convert.ToDecimal( ds, geMean ),
+ Console.WriteLine( fmt, "ToDecimal",
+ Convert.ToDecimal( ds, null ),
+ Convert.ToDecimal( ds, geMean ),
Convert.ToDecimal( ds, median ) );
- Console.WriteLine( fmt, "ToDouble",
- Convert.ToDouble( ds, null ),
- Convert.ToDouble( ds, geMean ),
+ Console.WriteLine( fmt, "ToDouble",
+ Convert.ToDouble( ds, null ),
+ Convert.ToDouble( ds, geMean ),
Convert.ToDouble( ds, median ) );
- Console.WriteLine( fmt, "ToInt16",
- Convert.ToInt16( ds, null ),
- Convert.ToInt16( ds, geMean ),
+ Console.WriteLine( fmt, "ToInt16",
+ Convert.ToInt16( ds, null ),
+ Convert.ToInt16( ds, geMean ),
Convert.ToInt16( ds, median ) );
- Console.WriteLine( fmt, "ToInt32",
- Convert.ToInt32( ds, null ),
- Convert.ToInt32( ds, geMean ),
+ Console.WriteLine( fmt, "ToInt32",
+ Convert.ToInt32( ds, null ),
+ Convert.ToInt32( ds, geMean ),
Convert.ToInt32( ds, median ) );
- Console.WriteLine( fmt, "ToInt64",
- Convert.ToInt64( ds, null ),
- Convert.ToInt64( ds, geMean ),
+ Console.WriteLine( fmt, "ToInt64",
+ Convert.ToInt64( ds, null ),
+ Convert.ToInt64( ds, geMean ),
Convert.ToInt64( ds, median ) );
- Console.WriteLine( fmt, "ToSByte",
- Convert.ToSByte( ds, null ),
- Convert.ToSByte( ds, geMean ),
+ Console.WriteLine( fmt, "ToSByte",
+ Convert.ToSByte( ds, null ),
+ Convert.ToSByte( ds, geMean ),
Convert.ToSByte( ds, median ) );
- Console.WriteLine( fmt, "ToSingle",
- Convert.ToSingle( ds, null ),
- Convert.ToSingle( ds, geMean ),
+ Console.WriteLine( fmt, "ToSingle",
+ Convert.ToSingle( ds, null ),
+ Convert.ToSingle( ds, geMean ),
Convert.ToSingle( ds, median ) );
- Console.WriteLine( fmt, "ToUInt16",
- Convert.ToUInt16( ds, null ),
- Convert.ToUInt16( ds, geMean ),
+ Console.WriteLine( fmt, "ToUInt16",
+ Convert.ToUInt16( ds, null ),
+ Convert.ToUInt16( ds, geMean ),
Convert.ToUInt16( ds, median ) );
- Console.WriteLine( fmt, "ToUInt32",
- Convert.ToUInt32( ds, null ),
- Convert.ToUInt32( ds, geMean ),
+ Console.WriteLine( fmt, "ToUInt32",
+ Convert.ToUInt32( ds, null ),
+ Convert.ToUInt32( ds, geMean ),
Convert.ToUInt32( ds, median ) );
- Console.WriteLine( fmt, "ToUInt64",
- Convert.ToUInt64( ds, null ),
- Convert.ToUInt64( ds, geMean ),
+ Console.WriteLine( fmt, "ToUInt64",
+ Convert.ToUInt64( ds, null ),
+ Convert.ToUInt64( ds, geMean ),
Convert.ToUInt64( ds, median ) );
}
-
+
public static void Main( )
{
Console.WriteLine( "This example of " +
@@ -412,12 +412,12 @@ public static void Main( )
"\ngenerates the following output. The example " +
"displays the values \nreturned by the methods, " +
"using several IFormatProvider objects.\n" );
-
- DataSet ds1 = new DataSet(
+
+ DataSet ds1 = new DataSet(
10.5, 22.2, 45.9, 88.7, 156.05, 297.6 );
DisplayDataSet( ds1 );
-
- DataSet ds2 = new DataSet(
+
+ DataSet ds2 = new DataSet(
359999.95, 425000, 499999.5, 775000, 1695000 );
DisplayDataSet( ds2 );
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert/CS/NonDecimal1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert/CS/NonDecimal1.cs
index fd3e84fb192..3c3bfa8c941 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert/CS/NonDecimal1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert/CS/NonDecimal1.cs
@@ -11,9 +11,9 @@ public static void Main()
String s = Convert.ToString(value, baseValue);
short value2 = Convert.ToInt16(s, baseValue);
- Console.WriteLine("{0} --> {1} (base {2}) --> {3}",
+ Console.WriteLine("{0} --> {1} (base {2}) --> {3}",
value, s, baseValue, value2);
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert/CS/converter.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert/CS/converter.cs
index f5d8aa34d5b..5e0f2129189 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert/CS/converter.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Convert/CS/converter.cs
@@ -27,7 +27,7 @@ static void Main(string[] args)
try {
// Returns '2'
char chrNumber = System.Convert.ToChar(strNumber[0]);
- }
+ }
catch (System.ArgumentNullException) {
System.Console.WriteLine("String is null");
}
@@ -49,7 +49,7 @@ static void Main(string[] args)
catch (System.FormatException) {
System.Console.WriteLine("String does not consist of an " +
"optional sign followed by a series of digits.");
- }
+ }
catch (System.OverflowException) {
System.Console.WriteLine(
"Overflow in string to int conversion.");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DBNull.Class/cs/DBNullExamples.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DBNull.Class/cs/DBNullExamples.cs
index 943136c94e6..4935a723c2e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DBNull.Class/cs/DBNullExamples.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DBNull.Class/cs/DBNullExamples.cs
@@ -12,9 +12,9 @@ public static void Main()
OleDbDataAdapter adapter = new OleDbDataAdapter();
DataSet ds = new DataSet();
string dbFilename = @"c:\Data\contacts.mdb";
-
+
// Open database connection
- conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
+ conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
dbFilename + ";";
conn.Open();
// Define command : retrieve all records in contact table
@@ -28,12 +28,12 @@ public static void Main()
conn.Close();
// Output labels to console
ex.OutputLabels(ds.Tables["Contact"]);
- }
+ }
//
private void OutputLabels(DataTable dt)
{
- string label;
+ string label;
// Iterate rows of table
foreach (DataRow row in dt.Rows)
@@ -61,13 +61,13 @@ private void OutputLabels(DataTable dt)
}
}
- private string AddFieldValue(string label, DataRow row,
- string fieldName)
- {
- if (! DBNull.Value.Equals(row[fieldName]))
+ private string AddFieldValue(string label, DataRow row,
+ string fieldName)
+ {
+ if (! DBNull.Value.Equals(row[fieldName]))
return (string) row[fieldName] + " ";
else
return String.Empty;
}
- //
+ //
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.DataContext/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.DataContext/cs/northwind.cs
index 87e0e7642c5..3ea08e89d23 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.DataContext/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.DataContext/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3721,7 +3721,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.AssociationAttribute/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.AssociationAttribute/cs/northwind.cs
index d5d7ee53aae..a9b28dd0c5c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.AssociationAttribute/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.AssociationAttribute/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -507,7 +507,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -542,7 +542,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1540,7 +1540,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1755,7 +1755,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1789,7 +1789,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1995,7 +1995,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2029,7 +2029,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2477,7 +2477,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2512,7 +2512,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2546,7 +2546,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2902,7 +2902,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2936,7 +2936,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3729,7 +3729,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.ColumnAttribute/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.ColumnAttribute/cs/northwind.cs
index f1210faaa3c..6dda787fdf6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.ColumnAttribute/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.ColumnAttribute/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -505,7 +505,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -539,7 +539,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1196,7 +1196,7 @@ public int VersionNum
{
return this._VersionNum;
}
-
+
set
{
if ((this._VersionNum != value))
@@ -1257,7 +1257,7 @@ public string FirstName
}
//
-
+
//
[Column(Storage="_Title", DbType="NVarChar(30)",IsDiscriminator=true)]
@@ -1575,7 +1575,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1790,7 +1790,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1824,7 +1824,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2030,7 +2030,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2064,7 +2064,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2512,7 +2512,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2546,7 +2546,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2580,7 +2580,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2727,7 +2727,7 @@ public int ProductID
}
//
-
+
[Column(Storage="_ProductName", DbType="NVarChar(40) NOT NULL", CanBeNull=false)]
public string ProductName
@@ -2942,7 +2942,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2976,7 +2976,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3769,7 +3769,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.InheritanceMappingAttribute/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.InheritanceMappingAttribute/cs/Program.cs
index e0af2e5b77a..527ac044b6c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.InheritanceMappingAttribute/cs/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Data.Linq.Mapping.InheritanceMappingAttribute/cs/Program.cs
@@ -47,7 +47,7 @@ class A { }
// Mapped and queryable.
[Table]
- [InheritanceMapping(Code = "B", Type = typeof(B),
+ [InheritanceMapping(Code = "B", Type = typeof(B),
IsDefault = true)]
[InheritanceMapping(Code = "D", Type = typeof(D))]
class B: A { }
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.AddHours/cs/AddHours1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.AddHours/cs/AddHours1.cs
index 7213e4e60cb..89ff4a6eadd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.AddHours/cs/AddHours1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.AddHours/cs/AddHours1.cs
@@ -5,12 +5,12 @@ public class Example
{
public static void Main()
{
- double[] hours = {.08333, .16667, .25, .33333, .5, .66667, 1, 2,
+ double[] hours = {.08333, .16667, .25, .33333, .5, .66667, 1, 2,
29, 30, 31, 90, 365};
DateTime dateValue = new DateTime(2009, 3, 1, 12, 0, 0);
-
+
foreach (double hour in hours)
- Console.WriteLine("{0} + {1} hour(s) = {2}", dateValue, hour,
+ Console.WriteLine("{0} + {1} hour(s) = {2}", dateValue, hour,
dateValue.AddHours(hour));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Date/cs/Date1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Date/cs/Date1.cs
index 62cdb0f6d07..2003e5e52fd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Date/cs/Date1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Date/cs/Date1.cs
@@ -7,14 +7,14 @@ public static void Main()
{
DateTime date1 = new DateTime(2008, 6, 1, 7, 47, 0);
Console.WriteLine(date1.ToString());
-
+
// Get date-only portion of date, without its time.
DateTime dateOnly = date1.Date;
// Display date using short date string.
Console.WriteLine(dateOnly.ToString("d"));
// Display date using 24-hour clock.
Console.WriteLine(dateOnly.ToString("g"));
- Console.WriteLine(dateOnly.ToString("MM/dd/yyyy HH:mm"));
+ Console.WriteLine(dateOnly.ToString("MM/dd/yyyy HH:mm"));
}
}
// The example displays output like the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Day/cs/Day1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Day/cs/Day1.cs
index 3e856a127d3..28d713770ee 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Day/cs/Day1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Day/cs/Day1.cs
@@ -8,18 +8,18 @@ public static void Main()
//
// Return day of 1/13/2009.
DateTime dateGregorian = new DateTime(2009, 1, 13);
- Console.WriteLine(dateGregorian.Day);
+ Console.WriteLine(dateGregorian.Day);
// Displays 13 (Gregorian day).
-
+
// Create date of 1/13/2009 using Hijri calendar.
HijriCalendar hijri = new HijriCalendar();
DateTime dateHijri = new DateTime(1430, 1, 17, hijri);
// Return day of date created using Hijri calendar.
- Console.WriteLine(dateHijri.Day);
+ Console.WriteLine(dateHijri.Day);
// Displays 13 (Gregorian day).
-
+
// Display day of date in Hijri calendar.
- Console.WriteLine(hijri.GetDayOfMonth(dateHijri));
+ Console.WriteLine(hijri.GetDayOfMonth(dateHijri));
// Displays 17 (Hijri day).
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Day/cs/Day2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Day/cs/Day2.cs
index adaaa1890c2..90d9ce86a37 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Day/cs/Day2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Day/cs/Day2.cs
@@ -12,8 +12,8 @@ public static void Main()
// Change current culture to ar-SA.
CultureInfo ci = new CultureInfo("ar-SA");
Thread.CurrentThread.CurrentCulture = ci;
-
- DateTime hijriDate = new DateTime(1430, 1, 17,
+
+ DateTime hijriDate = new DateTime(1430, 1, 17,
Thread.CurrentThread.CurrentCulture.Calendar);
// Display date (uses calendar of current culture by default).
Console.WriteLine(hijriDate.ToString("dd-MM-yyyy"));
@@ -22,12 +22,12 @@ public static void Main()
// Display day of 17th of Muharram
Console.WriteLine(hijriDate.Day);
// Displays 13 (corresponding day of January in Gregorian calendar).
-
+
// Display day of 17th of Muharram in Hijri calendar.
Console.WriteLine(Thread.CurrentThread.CurrentCulture.Calendar.GetDayOfMonth(hijriDate));
// Displays 17.
-
- Thread.CurrentThread.CurrentCulture = originalCulture;
+
+ Thread.CurrentThread.CurrentCulture = originalCulture;
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Hour/cs/Hour1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Hour/cs/Hour1.cs
index 9a56be26ad1..1deafb35267 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Hour/cs/Hour1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Hour/cs/Hour1.cs
@@ -6,7 +6,7 @@ public static void Main()
{
//
DateTime date1 = new DateTime(2008, 4, 1, 18, 53, 0);
- Console.WriteLine(date1.ToString("%h")); // Displays 6
+ Console.WriteLine(date1.ToString("%h")); // Displays 6
Console.WriteLine(date1.ToString("h tt")); // Displays 6 PM
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.IsLeapYear/cs/IsLeapYear1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.IsLeapYear/cs/IsLeapYear1.cs
index afb5a0155c3..c3a526eaf7e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.IsLeapYear/cs/IsLeapYear1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.IsLeapYear/cs/IsLeapYear1.cs
@@ -12,10 +12,10 @@ public static void Main()
Console.WriteLine("{0} is a leap year.", year);
DateTime leapDay = new DateTime(year, 2, 29);
DateTime nextYear = leapDay.AddYears(1);
- Console.WriteLine(" One year from {0} is {1}.",
- leapDay.ToString("d"),
+ Console.WriteLine(" One year from {0} is {1}.",
+ leapDay.ToString("d"),
nextYear.ToString("d"));
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Millisecond/cs/Millisecond.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Millisecond/cs/Millisecond.cs
index fea8ec60730..6306c3da734 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Millisecond/cs/Millisecond.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Millisecond/cs/Millisecond.cs
@@ -6,24 +6,24 @@ public static void Main()
{
//
DateTime date1 = new DateTime(2008, 1, 1, 0, 30, 45, 125);
- Console.WriteLine("Milliseconds: {0:fff}",
+ Console.WriteLine("Milliseconds: {0:fff}",
date1); // displays Milliseconds: 125
//
-
+
//
DateTime date2 = new DateTime(2008, 1, 1, 0, 30, 45, 125);
- Console.WriteLine("Date: {0:o}",
- date2);
+ Console.WriteLine("Date: {0:o}",
+ date2);
// Displays the following output to the console:
// Date: 2008-01-01T00:30:45.1250000
//
-
+
//
DateTime date3 = new DateTime(2008, 1, 1, 0, 30, 45, 125);
- Console.WriteLine("Date with milliseconds: {0:MM/dd/yyy HH:mm:ss.fff}",
+ Console.WriteLine("Date with milliseconds: {0:MM/dd/yyy HH:mm:ss.fff}",
date3);
// Displays the following output to the console:
- // Date with milliseconds: 01/01/2008 00:30:45.125
- //
+ // Date with milliseconds: 01/01/2008 00:30:45.125
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.MinValue/cs/MinValue.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.MinValue/cs/MinValue.cs
index b6e740e030a..12fc3557ef2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.MinValue/cs/MinValue.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.MinValue/cs/MinValue.cs
@@ -12,23 +12,23 @@ public static void Main()
Console.WriteLine(" (Equals Date.MinValue)");
// The example displays the following output:
// 1/1/0001 12:00:00 AM (Equals Date.MinValue)
- //
+ //
//
// Attempt to assign an out-of-range value to a DateTime constructor.
long numberOfTicks = Int64.MaxValue;
DateTime validDate;
-
+
// Validate the value.
if (numberOfTicks >= DateTime.MinValue.Ticks &&
- numberOfTicks <= DateTime.MaxValue.Ticks)
+ numberOfTicks <= DateTime.MaxValue.Ticks)
validDate = new DateTime(numberOfTicks);
- else if (numberOfTicks < DateTime.MinValue.Ticks)
- Console.WriteLine("{0:N0} is less than {1:N0} ticks.",
- numberOfTicks,
- DateTime.MinValue.Ticks);
+ else if (numberOfTicks < DateTime.MinValue.Ticks)
+ Console.WriteLine("{0:N0} is less than {1:N0} ticks.",
+ numberOfTicks,
+ DateTime.MinValue.Ticks);
else
- Console.WriteLine("{0:N0} is greater than {1:N0} ticks.",
+ Console.WriteLine("{0:N0} is greater than {1:N0} ticks.",
numberOfTicks,
DateTime.MaxValue.Ticks);
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse1.cs
index d345954a122..5a02354c94f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse1.cs
@@ -6,7 +6,7 @@ public class DateTimeParser
{
public static void Main()
{
- // Assume the current culture is en-US.
+ // Assume the current culture is en-US.
// The date is February 16, 2008, 12 hours, 15 minutes and 12 seconds.
// Use standard en-US date and time value
@@ -15,41 +15,41 @@ public static void Main()
try {
dateValue = DateTime.Parse(dateString);
Console.WriteLine("'{0}' converted to {1}.", dateString, dateValue);
- }
+ }
catch (FormatException) {
Console.WriteLine("Unable to convert '{0}'.", dateString);
}
-
+
// Reverse month and day to conform to the fr-FR culture.
// The date is February 16, 2008, 12 hours, 15 minutes and 12 seconds.
dateString = "16/02/2008 12:15:12";
try {
dateValue = DateTime.Parse(dateString);
Console.WriteLine("'{0}' converted to {1}.", dateString, dateValue);
- }
+ }
catch (FormatException) {
Console.WriteLine("Unable to convert '{0}'.", dateString);
}
// Call another overload of Parse to successfully convert string
- // formatted according to conventions of fr-FR culture.
+ // formatted according to conventions of fr-FR culture.
try {
dateValue = DateTime.Parse(dateString, new CultureInfo("fr-FR", false));
Console.WriteLine("'{0}' converted to {1}.", dateString, dateValue);
- }
+ }
catch (FormatException) {
Console.WriteLine("Unable to convert '{0}'.", dateString);
}
-
+
// Parse string with date but no time component.
dateString = "2/16/2008";
try {
dateValue = DateTime.Parse(dateString);
Console.WriteLine("'{0}' converted to {1}.", dateString, dateValue);
- }
+ }
catch (FormatException) {
Console.WriteLine("Unable to convert '{0}'.", dateString);
- }
+ }
}
}
// The example displays the following output to the console:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse2.cs
index c47a1897cd8..f56e45f90db 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse2.cs
@@ -1,22 +1,22 @@
-//
+//
using System;
public class Example
{
public static void Main()
{
- string[] dateStrings = {"2008-05-01T07:34:42-5:00",
- "2008-05-01 7:34:42Z",
+ string[] dateStrings = {"2008-05-01T07:34:42-5:00",
+ "2008-05-01 7:34:42Z",
"Thu, 01 May 2008 07:34:42 GMT"};
foreach (string dateString in dateStrings)
{
DateTime convertedDate = DateTime.Parse(dateString);
Console.WriteLine($"Converted {dateString} to {convertedDate.Kind} time {convertedDate}");
- }
+ }
}
}
// These calls to the DateTime.Parse method display the following output:
// Converted 2008-05-01T07:34:42-5:00 to Local time 5/1/2008 5:34:42 AM
// Converted 2008-05-01 7:34:42Z to Local time 5/1/2008 12:34:42 AM
-// Converted Thu, 01 May 2008 07:34:42 GMT to Local time 5/1/2008 12:34:42 AM
+// Converted Thu, 01 May 2008 07:34:42 GMT to Local time 5/1/2008 12:34:42 AM
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse3.cs
index 31da791fa97..38cd999e31e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse3.cs
@@ -7,18 +7,18 @@ public class ParseDate
public static void Main()
{
// Define cultures to be used to parse dates.
- CultureInfo[] cultures = {CultureInfo.CreateSpecificCulture("en-US"),
- CultureInfo.CreateSpecificCulture("fr-FR"),
+ CultureInfo[] cultures = {CultureInfo.CreateSpecificCulture("en-US"),
+ CultureInfo.CreateSpecificCulture("fr-FR"),
CultureInfo.CreateSpecificCulture("de-DE")};
// Define string representations of a date to be parsed.
- string[] dateStrings = {"01/10/2009 7:34 PM",
- "10.01.2009 19:34",
+ string[] dateStrings = {"01/10/2009 7:34 PM",
+ "10.01.2009 19:34",
"10-1-2009 19:34" };
// Parse dates using each culture.
foreach (CultureInfo culture in cultures)
{
DateTime dateValue;
- Console.WriteLine("Attempted conversions using {0} culture.",
+ Console.WriteLine("Attempted conversions using {0} culture.",
culture.Name);
foreach (string dateString in dateStrings)
{
@@ -28,12 +28,12 @@ public static void Main()
dateString, dateValue.ToString("f", culture));
}
catch (FormatException) {
- Console.WriteLine(" Unable to convert '{0}' for culture {1}.",
+ Console.WriteLine(" Unable to convert '{0}' for culture {1}.",
dateString, culture.Name);
}
}
Console.WriteLine();
- }
+ }
}
}
// The example displays the following output to the console:
@@ -41,12 +41,12 @@ public static void Main()
// Converted '01/10/2009 7:34 PM' to Saturday, January 10, 2009 7:34 PM.
// Converted '10.01.2009 19:34' to Thursday, October 01, 2009 7:34 PM.
// Converted '10-1-2009 19:34' to Thursday, October 01, 2009 7:34 PM.
-//
+//
// Attempted conversions using fr-FR culture.
// Converted '01/10/2009 7:34 PM' to jeudi 1 octobre 2009 19:34.
// Converted '10.01.2009 19:34' to samedi 10 janvier 2009 19:34.
// Converted '10-1-2009 19:34' to samedi 10 janvier 2009 19:34.
-//
+//
// Attempted conversions using de-DE culture.
// Converted '01/10/2009 7:34 PM' to Donnerstag, 1. Oktober 2009 19:34.
// Converted '10.01.2009 19:34' to Samstag, 10. Januar 2009 19:34.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse4.cs
index 842373131dd..942b4854a46 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse4.cs
@@ -10,70 +10,70 @@ public static void Main()
CultureInfo culture ;
DateTimeStyles styles;
DateTime result;
-
+
// Parse a date and time with no styles.
dateString = "03/01/2009 10:00 AM";
culture = CultureInfo.CreateSpecificCulture("en-US");
styles = DateTimeStyles.None;
try {
result = DateTime.Parse(dateString, culture, styles);
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, result, result.Kind.ToString());
}
catch (FormatException) {
- Console.WriteLine("Unable to convert {0} to a date and time.",
+ Console.WriteLine("Unable to convert {0} to a date and time.",
dateString);
- }
-
+ }
+
// Parse the same date and time with the AssumeLocal style.
styles = DateTimeStyles.AssumeLocal;
try {
result = DateTime.Parse(dateString, culture, styles);
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, result, result.Kind.ToString());
}
catch (FormatException) {
Console.WriteLine("Unable to convert {0} to a date and time.", dateString);
- }
-
+ }
+
// Parse a date and time that is assumed to be local.
- // This time is five hours behind UTC. The local system's time zone is
+ // This time is five hours behind UTC. The local system's time zone is
// eight hours behind UTC.
dateString = "2009/03/01T10:00:00-5:00";
styles = DateTimeStyles.AssumeLocal;
try {
result = DateTime.Parse(dateString, culture, styles);
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, result, result.Kind.ToString());
}
catch (FormatException) {
Console.WriteLine("Unable to convert {0} to a date and time.", dateString);
- }
-
+ }
+
// Attempt to convert a string in improper ISO 8601 format.
dateString = "03/01/2009T10:00:00-5:00";
try {
result = DateTime.Parse(dateString, culture, styles);
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, result, result.Kind.ToString());
- }
+ }
catch (FormatException) {
Console.WriteLine("Unable to convert {0} to a date and time.", dateString);
- }
+ }
- // Assume a date and time string formatted for the fr-FR culture is the local
+ // Assume a date and time string formatted for the fr-FR culture is the local
// time and convert it to UTC.
dateString = "2008-03-01 10:00";
culture = CultureInfo.CreateSpecificCulture("fr-FR");
styles = DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeLocal;
try {
result = DateTime.Parse(dateString, culture, styles);
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, result, result.Kind.ToString());
}
catch (FormatException) {
Console.WriteLine("Unable to convert {0} to a date and time.", dateString);
- }
+ }
}
}
// The example displays the following output to the console:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse5.cs
index ec9d381217c..1a96faf5d5b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse5.cs
@@ -7,22 +7,22 @@ public class Class1
public static void Main()
{
//
- string[] formattedDates = { "2008-09-15T09:30:41.7752486-07:00",
- "2008-09-15T09:30:41.7752486Z",
- "2008-09-15T09:30:41.7752486",
- "2008-09-15T09:30:41.7752486-04:00",
+ string[] formattedDates = { "2008-09-15T09:30:41.7752486-07:00",
+ "2008-09-15T09:30:41.7752486Z",
+ "2008-09-15T09:30:41.7752486",
+ "2008-09-15T09:30:41.7752486-04:00",
"Mon, 15 Sep 2008 09:30:41 GMT" };
foreach (string formattedDate in formattedDates)
{
Console.WriteLine(formattedDate);
- DateTime roundtripDate = DateTime.Parse(formattedDate, null,
- DateTimeStyles.RoundtripKind);
+ DateTime roundtripDate = DateTime.Parse(formattedDate, null,
+ DateTimeStyles.RoundtripKind);
Console.WriteLine($" With RoundtripKind flag: {roundtripDate} {roundtripDate.Kind} time.");
-
- DateTime noRoundtripDate = DateTime.Parse(formattedDate, null,
+
+ DateTime noRoundtripDate = DateTime.Parse(formattedDate, null,
DateTimeStyles.None);
Console.WriteLine($" Without RoundtripKind flag: {noRoundtripDate} {noRoundtripDate.Kind} time.");
- }
+ }
// The example displays the following output:
// 2008-09-15T09:30:41.7752486-07:00
// With RoundtripKind flag: 9/15/2008 9:30:41 AM Local time.
@@ -38,7 +38,7 @@ public static void Main()
// Without RoundtripKind flag: 9/15/2008 6:30:41 AM Local time.
// Mon, 15 Sep 2008 09:30:41 GMT
// With RoundtripKind flag: 9/15/2008 9:30:41 AM Utc time.
- // Without RoundtripKind flag: 9/15/2008 2:30:41 AM Local time.
+ // Without RoundtripKind flag: 9/15/2008 2:30:41 AM Local time.
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse6.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse6.cs
index 35dfb3e9ff2..d43e045d9b0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse6.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Parse/cs/Parse6.cs
@@ -4,27 +4,27 @@ public class Example
{
public static void Main()
{
- (string dateAsString, string description)[] dateInfo = { ("08/18/2018 07:22:16", "String with a date and time component"),
+ (string dateAsString, string description)[] dateInfo = { ("08/18/2018 07:22:16", "String with a date and time component"),
("08/18/2018", "String with a date component only"),
("8/2018", "String with a month and year component only"),
("8/18", "String with a month and day component only"),
("07:22:16", "String with a time component only"),
("7 PM", "String with an hour and AM/PM designator only"),
- ("2018-08-18T07:22:16.0000000Z", "UTC string that conforms to ISO 8601"),
+ ("2018-08-18T07:22:16.0000000Z", "UTC string that conforms to ISO 8601"),
("2018-08-18T07:22:16.0000000-07:00", "Non-UTC string that conforms to ISO 8601"),
("Sat, 18 Aug 2018 07:22:16 GMT", "String that conforms to RFC 1123"),
("08/18/2018 07:22:16 -5:00", "String with date, time, and time zone information" ) };
-
+
Console.WriteLine($"Today is {DateTime.Now:d}\n");
-
+
foreach (var item in dateInfo) {
- Console.WriteLine($"{item.description + ":",-52} '{item.dateAsString}' --> {DateTime.Parse(item.dateAsString)}");
+ Console.WriteLine($"{item.description + ":",-52} '{item.dateAsString}' --> {DateTime.Parse(item.dateAsString)}");
}
}
}
// The example displays output like the following:
// Today is 2/22/2018
-//
+//
// String with a date and time component: '08/18/2018 07:22:16' --> 8/18/2018 7:22:16 AM
// String with a date component only: '08/18/2018' --> 8/18/2018 12:00:00 AM
// String with a month and year component only: '8/2018' --> 8/1/2018 12:00:00 AM
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/ParseExact1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/ParseExact1.cs
index d7476bd75d6..c8f4530f4a1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/ParseExact1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/ParseExact1.cs
@@ -6,7 +6,7 @@ public class Example
{
public static void Main()
{
- string dateString, format;
+ string dateString, format;
DateTime result;
CultureInfo provider = CultureInfo.InvariantCulture;
@@ -19,10 +19,10 @@ public static void Main()
}
catch (FormatException) {
Console.WriteLine("{0} is not in the correct format.", dateString);
- }
+ }
// Parse date-only value without leading zero in month using "d" format.
- // Should throw a FormatException because standard short date pattern of
+ // Should throw a FormatException because standard short date pattern of
// invariant culture requires two-digit month.
dateString = "6/15/2008";
try {
@@ -32,7 +32,7 @@ public static void Main()
catch (FormatException) {
Console.WriteLine("{0} is not in the correct format.", dateString);
}
-
+
// Parse date and time with custom specifier.
dateString = "Sun 15 Jun 2008 8:30 AM -06:00";
format = "ddd dd MMM yyyy h:mm tt zzz";
@@ -43,29 +43,29 @@ public static void Main()
catch (FormatException) {
Console.WriteLine("{0} is not in the correct format.", dateString);
}
-
+
// Parse date and time with offset but without offset's minutes.
- // Should throw a FormatException because "zzz" specifier requires leading
+ // Should throw a FormatException because "zzz" specifier requires leading
// zero in hours.
dateString = "Sun 15 Jun 2008 8:30 AM -06";
try {
result = DateTime.ParseExact(dateString, format, provider);
Console.WriteLine("{0} converts to {1}.", dateString, result.ToString());
- }
+ }
catch (FormatException) {
Console.WriteLine("{0} is not in the correct format.", dateString);
- }
-
+ }
+
dateString = "15/06/2008 08:30";
format = "g";
provider = new CultureInfo("fr-FR");
try {
result = DateTime.ParseExact(dateString, format, provider);
Console.WriteLine("{0} converts to {1}.", dateString, result.ToString());
- }
+ }
catch (FormatException) {
Console.WriteLine("{0} is not in the correct format.", dateString);
- }
+ }
// Parse a date that includes seconds and milliseconds
// by using the French (France) and invariant cultures.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/parseexact2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/parseexact2.cs
index abc926b4e35..a1513a605a2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/parseexact2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/parseexact2.cs
@@ -6,88 +6,88 @@ public class Example
{
public static void Main()
{
- CultureInfo enUS = new CultureInfo("en-US");
+ CultureInfo enUS = new CultureInfo("en-US");
string dateString;
DateTime dateValue;
-
+
// Parse date with no style flags.
dateString = " 5/01/2009 8:30 AM";
try {
dateValue = DateTime.ParseExact(dateString, "g", enUS, DateTimeStyles.None);
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
- }
+ }
catch (FormatException) {
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
}
// Allow a leading space in the date string.
try {
dateValue = DateTime.ParseExact(dateString, "g", enUS, DateTimeStyles.AllowLeadingWhite);
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
- }
+ }
catch (FormatException) {
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
}
-
+
// Use custom formats with M and MM.
dateString = "5/01/2009 09:00";
try {
dateValue = DateTime.ParseExact(dateString, "M/dd/yyyy hh:mm", enUS, DateTimeStyles.None);
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
- }
+ }
catch (FormatException) {
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
}
// Allow a leading space in the date string.
try {
dateValue = DateTime.ParseExact(dateString, "MM/dd/yyyy hh:mm", enUS, DateTimeStyles.None);
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
- }
+ }
catch (FormatException) {
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
}
// Parse a string with time zone information.
- dateString = "05/01/2009 01:30:42 PM -05:00";
+ dateString = "05/01/2009 01:30:42 PM -05:00";
try {
dateValue = DateTime.ParseExact(dateString, "MM/dd/yyyy hh:mm:ss tt zzz", enUS, DateTimeStyles.None);
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
- }
+ }
catch (FormatException) {
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
}
// Allow a leading space in the date string.
try {
- dateValue = DateTime.ParseExact(dateString, "MM/dd/yyyy hh:mm:ss tt zzz", enUS,
+ dateValue = DateTime.ParseExact(dateString, "MM/dd/yyyy hh:mm:ss tt zzz", enUS,
DateTimeStyles.AdjustToUniversal);
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
- }
+ }
catch (FormatException) {
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
}
-
+
// Parse a string representing UTC.
dateString = "2008-06-11T16:11:20.0904778Z";
try {
- dateValue = DateTime.ParseExact(dateString, "o", CultureInfo.InvariantCulture,
+ dateValue = DateTime.ParseExact(dateString, "o", CultureInfo.InvariantCulture,
DateTimeStyles.None);
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
- }
+ }
catch (FormatException) {
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
}
try {
- dateValue = DateTime.ParseExact(dateString, "o", CultureInfo.InvariantCulture,
+ dateValue = DateTime.ParseExact(dateString, "o", CultureInfo.InvariantCulture,
DateTimeStyles.RoundtripKind);
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
- }
+ }
catch (FormatException) {
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/parseexact3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/parseexact3.cs
index 9c9c1a29bb3..63505f63935 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/parseexact3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ParseExact/cs/parseexact3.cs
@@ -6,29 +6,29 @@ public class Example
{
public static void Main()
{
- string[] formats= {"M/d/yyyy h:mm:ss tt", "M/d/yyyy h:mm tt",
- "MM/dd/yyyy hh:mm:ss", "M/d/yyyy h:mm:ss",
- "M/d/yyyy hh:mm tt", "M/d/yyyy hh tt",
- "M/d/yyyy h:mm", "M/d/yyyy h:mm",
+ string[] formats= {"M/d/yyyy h:mm:ss tt", "M/d/yyyy h:mm tt",
+ "MM/dd/yyyy hh:mm:ss", "M/d/yyyy h:mm:ss",
+ "M/d/yyyy hh:mm tt", "M/d/yyyy hh tt",
+ "M/d/yyyy h:mm", "M/d/yyyy h:mm",
"MM/dd/yyyy hh:mm", "M/dd/yyyy hh:mm",
"MM/d/yyyy HH:mm:ss.ffffff" };
- string[] dateStrings = {"5/1/2009 6:32 PM", "05/01/2009 6:32:05 PM",
- "5/1/2009 6:32:00", "05/01/2009 06:32",
+ string[] dateStrings = {"5/1/2009 6:32 PM", "05/01/2009 6:32:05 PM",
+ "5/1/2009 6:32:00", "05/01/2009 06:32",
"05/01/2009 06:32:00 PM", "05/01/2009 06:32:00",
"08/28/2015 16:17:39.125", "08/28/2015 16:17:39.125000" };
DateTime dateValue;
-
+
foreach (string dateString in dateStrings)
{
try {
- dateValue = DateTime.ParseExact(dateString, formats,
- new CultureInfo("en-US"),
+ dateValue = DateTime.ParseExact(dateString, formats,
+ new CultureInfo("en-US"),
DateTimeStyles.None);
Console.WriteLine("Converted '{0}' to {1}.", dateString, dateValue);
}
catch (FormatException) {
Console.WriteLine("Unable to convert '{0}' to a date.", dateString);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Ticks/cs/Ticks.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Ticks/cs/Ticks.cs
index 4a33e0374d6..bec523e7ad6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Ticks/cs/Ticks.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Ticks/cs/Ticks.cs
@@ -7,22 +7,22 @@ public static void Main()
//
DateTime centuryBegin = new DateTime(2001, 1, 1);
DateTime currentDate = DateTime.Now;
-
+
long elapsedTicks = currentDate.Ticks - centuryBegin.Ticks;
TimeSpan elapsedSpan = new TimeSpan(elapsedTicks);
-
- Console.WriteLine("Elapsed from the beginning of the century to {0:f}:",
+
+ Console.WriteLine("Elapsed from the beginning of the century to {0:f}:",
currentDate);
Console.WriteLine(" {0:N0} nanoseconds", elapsedTicks * 100);
Console.WriteLine(" {0:N0} ticks", elapsedTicks);
Console.WriteLine(" {0:N2} seconds", elapsedSpan.TotalSeconds);
Console.WriteLine(" {0:N2} minutes", elapsedSpan.TotalMinutes);
- Console.WriteLine(" {0:N0} days, {1} hours, {2} minutes, {3} seconds",
- elapsedSpan.Days, elapsedSpan.Hours,
+ Console.WriteLine(" {0:N0} days, {1} hours, {2} minutes, {3} seconds",
+ elapsedSpan.Days, elapsedSpan.Hours,
elapsedSpan.Minutes, elapsedSpan.Seconds);
// This example displays an output similar to the following:
- //
+ //
// Elapsed from the beginning of the century to Thursday, 14 November 2019 18:21:
// 595,448,498,171,000,000 nanoseconds
// 5,954,484,981,710,000 ticks
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToShortDateString/cs/ToShortDateString.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToShortDateString/cs/ToShortDateString.cs
index c645237f962..891daeb2a3f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToShortDateString/cs/ToShortDateString.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToShortDateString/cs/ToShortDateString.cs
@@ -11,29 +11,29 @@ public static void Main()
CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
// Change culture to en-US.
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
- Console.WriteLine("Displaying short date for {0} culture:",
+ Console.WriteLine("Displaying short date for {0} culture:",
Thread.CurrentThread.CurrentCulture.Name);
- Console.WriteLine(" {0} (Short Date String)",
+ Console.WriteLine(" {0} (Short Date String)",
dateToDisplay.ToShortDateString());
// Display using 'd' standard format specifier to illustrate it is
// identical to the string returned by ToShortDateString.
- Console.WriteLine(" {0} ('d' standard format specifier)",
+ Console.WriteLine(" {0} ('d' standard format specifier)",
dateToDisplay.ToString("d"));
Console.WriteLine();
-
+
// Change culture to fr-FR.
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
- Console.WriteLine("Displaying short date for {0} culture:",
+ Console.WriteLine("Displaying short date for {0} culture:",
Thread.CurrentThread.CurrentCulture.Name);
Console.WriteLine(" {0}", dateToDisplay.ToShortDateString());
Console.WriteLine();
-
- // Change culture to nl-NL.
+
+ // Change culture to nl-NL.
Thread.CurrentThread.CurrentCulture = new CultureInfo("nl-NL");
- Console.WriteLine("Displaying short date for {0} culture:",
+ Console.WriteLine("Displaying short date for {0} culture:",
Thread.CurrentThread.CurrentCulture.Name);
Console.WriteLine(" {0}", dateToDisplay.ToShortDateString());
-
+
// Restore original culture.
Thread.CurrentThread.CurrentCulture = originalCulture;
}
@@ -42,10 +42,10 @@ public static void Main()
// Displaying short date for en-US culture:
// 6/1/2009 (Short Date String)
// 6/1/2009 ('d' standard format specifier)
-//
+//
// Displaying short date for fr-FR culture:
// 01/06/2009
-//
+//
// Displaying short date for nl-NL culture:
// 1-6-2009
-//
+//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString1.cs
index c4f69248d21..2e91fbe1e10 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString1.cs
@@ -9,7 +9,7 @@ public static void Main()
{
CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
DateTime exampleDate = new DateTime(2008, 5, 1, 18, 32, 6);
-
+
// Display the date using the current (en-US) culture.
Console.WriteLine(exampleDate.ToString());
@@ -20,7 +20,7 @@ public static void Main()
// Change the current culture to ja-JP and display the date.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ja-JP");
Console.WriteLine(exampleDate.ToString());
-
+
// Restore the original culture
Thread.CurrentThread.CurrentCulture = currentCulture;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString2.cs
index 2e9a9b7054a..54ac79a8bdf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString2.cs
@@ -7,16 +7,16 @@ public static void Main()
{
DateTime dateValue = new DateTime(2008, 6, 15, 21, 15, 07);
// Create an array of standard format strings.
- string[] standardFmts = {"d", "D", "f", "F", "g", "G", "m", "o",
+ string[] standardFmts = {"d", "D", "f", "F", "g", "G", "m", "o",
"R", "s", "t", "T", "u", "U", "y"};
// Output date and time using each standard format string.
foreach (string standardFmt in standardFmts)
- Console.WriteLine("{0}: {1}", standardFmt,
+ Console.WriteLine("{0}: {1}", standardFmt,
dateValue.ToString(standardFmt));
Console.WriteLine();
-
+
// Create an array of some custom format strings.
- string[] customFmts = {"h:mm:ss.ff t", "d MMM yyyy", "HH:mm:ss.f",
+ string[] customFmts = {"h:mm:ss.ff t", "d MMM yyyy", "HH:mm:ss.f",
"dd MMM HH:mm:ss", @"\Mon\t\h\: M", "HH:mm:ss.ffffzzz" };
// Output date and time using each custom format string.
foreach (string customFmt in customFmts)
@@ -40,7 +40,7 @@ public static void Main()
// u: 2008-06-15 21:15:07Z
// U: Monday, June 16, 2008 4:15:07 AM
// y: June, 2008
-//
+//
// 'h:mm:ss.ff t': 9:15:07.00 P
// 'd MMM yyyy': 15 Jun 2008
// 'HH:mm:ss.f': 21:15:07.0
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString4.cs
index 034f128bbfa..50bb31ac32a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/ToString4.cs
@@ -6,26 +6,26 @@ public class Example
{
public static void Main()
{
- CultureInfo[] cultures = new CultureInfo[] {CultureInfo.InvariantCulture,
- new CultureInfo("en-us"),
- new CultureInfo("fr-fr"),
- new CultureInfo("de-DE"),
+ CultureInfo[] cultures = new CultureInfo[] {CultureInfo.InvariantCulture,
+ new CultureInfo("en-us"),
+ new CultureInfo("fr-fr"),
+ new CultureInfo("de-DE"),
new CultureInfo("es-ES"),
new CultureInfo("ja-JP")};
- DateTime thisDate = new DateTime(2009, 5, 1, 9, 0, 0);
+ DateTime thisDate = new DateTime(2009, 5, 1, 9, 0, 0);
foreach (CultureInfo culture in cultures)
{
- string cultureName;
+ string cultureName;
if (string.IsNullOrEmpty(culture.Name))
cultureName = culture.NativeName;
else
cultureName = culture.Name;
-
- Console.WriteLine("In {0}, {1}",
+
+ Console.WriteLine("In {0}, {1}",
cultureName, thisDate.ToString(culture));
- }
+ }
}
}
// The example produces the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/tostring3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/tostring3.cs
index 979ea9a8822..0c49aae2687 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/tostring3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.ToString/cs/tostring3.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
// Create an array of all supported standard date and time format specifiers.
- string[] formats = {"d", "D", "f", "F", "g", "G", "m", "o", "r",
+ string[] formats = {"d", "D", "f", "F", "g", "G", "m", "o", "r",
"s", "t", "T", "u", "U", "Y"};
- // Create an array of four cultures.
- CultureInfo[] cultures = {CultureInfo.CreateSpecificCulture("de-DE"),
- CultureInfo.CreateSpecificCulture("en-US"),
- CultureInfo.CreateSpecificCulture("es-ES"),
+ // Create an array of four cultures.
+ CultureInfo[] cultures = {CultureInfo.CreateSpecificCulture("de-DE"),
+ CultureInfo.CreateSpecificCulture("en-US"),
+ CultureInfo.CreateSpecificCulture("es-ES"),
CultureInfo.CreateSpecificCulture("fr-FR")};
// Define date to be displayed.
DateTime dateToDisplay = new DateTime(2008, 10, 1, 17, 4, 32);
@@ -21,11 +21,11 @@ public static void Main()
foreach (string formatSpecifier in formats)
{
foreach (CultureInfo culture in cultures)
- Console.WriteLine("{0} Format Specifier {1, 10} Culture {2, 40}",
- formatSpecifier, culture.Name,
+ Console.WriteLine("{0} Format Specifier {1, 10} Culture {2, 40}",
+ formatSpecifier, culture.Name,
dateToDisplay.ToString(formatSpecifier, culture));
Console.WriteLine();
- }
+ }
}
}
// The example displays the following output:
@@ -33,72 +33,72 @@ public static void Main()
// d Format Specifier en-US Culture 10/1/2008
// d Format Specifier es-ES Culture 01/10/2008
// d Format Specifier fr-FR Culture 01/10/2008
-//
+//
// D Format Specifier de-DE Culture Mittwoch, 1. Oktober 2008
// D Format Specifier en-US Culture Wednesday, October 01, 2008
// D Format Specifier es-ES Culture miércoles, 01 de octubre de 2008
// D Format Specifier fr-FR Culture mercredi 1 octobre 2008
-//
+//
// f Format Specifier de-DE Culture Mittwoch, 1. Oktober 2008 17:04
// f Format Specifier en-US Culture Wednesday, October 01, 2008 5:04 PM
// f Format Specifier es-ES Culture miércoles, 01 de octubre de 2008 17:04
// f Format Specifier fr-FR Culture mercredi 1 octobre 2008 17:04
-//
+//
// F Format Specifier de-DE Culture Mittwoch, 1. Oktober 2008 17:04:32
// F Format Specifier en-US Culture Wednesday, October 01, 2008 5:04:32 PM
// F Format Specifier es-ES Culture miércoles, 01 de octubre de 2008 17:04:3
// F Format Specifier fr-FR Culture mercredi 1 octobre 2008 17:04:32
-//
+//
// g Format Specifier de-DE Culture 01.10.2008 17:04
// g Format Specifier en-US Culture 10/1/2008 5:04 PM
// g Format Specifier es-ES Culture 01/10/2008 17:04
// g Format Specifier fr-FR Culture 01/10/2008 17:04
-//
+//
// G Format Specifier de-DE Culture 01.10.2008 17:04:32
// G Format Specifier en-US Culture 10/1/2008 5:04:32 PM
// G Format Specifier es-ES Culture 01/10/2008 17:04:32
// G Format Specifier fr-FR Culture 01/10/2008 17:04:32
-//
+//
// m Format Specifier de-DE Culture 01 Oktober
// m Format Specifier en-US Culture October 01
// m Format Specifier es-ES Culture 01 octubre
// m Format Specifier fr-FR Culture 1 octobre
-//
+//
// o Format Specifier de-DE Culture 2008-10-01T17:04:32.0000000
// o Format Specifier en-US Culture 2008-10-01T17:04:32.0000000
// o Format Specifier es-ES Culture 2008-10-01T17:04:32.0000000
// o Format Specifier fr-FR Culture 2008-10-01T17:04:32.0000000
-//
+//
// r Format Specifier de-DE Culture Wed, 01 Oct 2008 17:04:32 GMT
// r Format Specifier en-US Culture Wed, 01 Oct 2008 17:04:32 GMT
// r Format Specifier es-ES Culture Wed, 01 Oct 2008 17:04:32 GMT
// r Format Specifier fr-FR Culture Wed, 01 Oct 2008 17:04:32 GMT
-//
+//
// s Format Specifier de-DE Culture 2008-10-01T17:04:32
// s Format Specifier en-US Culture 2008-10-01T17:04:32
// s Format Specifier es-ES Culture 2008-10-01T17:04:32
// s Format Specifier fr-FR Culture 2008-10-01T17:04:32
-//
+//
// t Format Specifier de-DE Culture 17:04
// t Format Specifier en-US Culture 5:04 PM
// t Format Specifier es-ES Culture 17:04
// t Format Specifier fr-FR Culture 17:04
-//
+//
// T Format Specifier de-DE Culture 17:04:32
// T Format Specifier en-US Culture 5:04:32 PM
// T Format Specifier es-ES Culture 17:04:32
// T Format Specifier fr-FR Culture 17:04:32
-//
+//
// u Format Specifier de-DE Culture 2008-10-01 17:04:32Z
// u Format Specifier en-US Culture 2008-10-01 17:04:32Z
// u Format Specifier es-ES Culture 2008-10-01 17:04:32Z
// u Format Specifier fr-FR Culture 2008-10-01 17:04:32Z
-//
+//
// U Format Specifier de-DE Culture Donnerstag, 2. Oktober 2008 00:04:32
// U Format Specifier en-US Culture Thursday, October 02, 2008 12:04:32 AM
// U Format Specifier es-ES Culture jueves, 02 de octubre de 2008 0:04:32
// U Format Specifier fr-FR Culture jeudi 2 octobre 2008 00:04:32
-//
+//
// Y Format Specifier de-DE Culture Oktober 2008
// Y Format Specifier en-US Culture October, 2008
// Y Format Specifier es-ES Culture octubre de 2008
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Today/cs/Today1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Today/cs/Today1.cs
index a533c3a93bd..0fa9175efec 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Today/cs/Today1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Today/cs/Today1.cs
@@ -18,8 +18,8 @@ public static void Main()
}
// The example displays output similar to the following:
// 5/3/2012 12:00:00 AM
-//
+//
// 5/3/2012
// Thursday, May 03, 2012
// 5/3/2012 12:00 AM
-//
+//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParse/cs/TryParse1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParse/cs/TryParse1.cs
index bd87ada16bd..047eae2e97f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParse/cs/TryParse1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParse/cs/TryParse1.cs
@@ -8,17 +8,17 @@ public static void Main()
{
string[] dateStrings = {"05/01/2009 14:57:32.8", "2009-05-01 14:57:32.8",
"2009-05-01T14:57:32.8375298-04:00", "5/01/2008",
- "5/01/2008 14:57:32.80 -07:00",
- "1 May 2008 2:57:32.8 PM", "16-05-2009 1:00:32 PM",
+ "5/01/2008 14:57:32.80 -07:00",
+ "1 May 2008 2:57:32.8 PM", "16-05-2009 1:00:32 PM",
"Fri, 15 May 2009 20:10:57 GMT" };
DateTime dateValue;
-
- Console.WriteLine("Attempting to parse strings using {0} culture.",
+
+ Console.WriteLine("Attempting to parse strings using {0} culture.",
CultureInfo.CurrentCulture.Name);
foreach (string dateString in dateStrings)
{
- if (DateTime.TryParse(dateString, out dateValue))
- Console.WriteLine(" Converted '{0}' to {1} ({2}).", dateString,
+ if (DateTime.TryParse(dateString, out dateValue))
+ Console.WriteLine(" Converted '{0}' to {1} ({2}).", dateString,
dateValue, dateValue.Kind);
else
Console.WriteLine(" Unable to parse '{0}'.", dateString);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParse/cs/tryparse2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParse/cs/tryparse2.cs
index 299c4b42653..328fb170801 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParse/cs/tryparse2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParse/cs/tryparse2.cs
@@ -10,52 +10,52 @@ public static void Main()
CultureInfo culture;
DateTimeStyles styles;
DateTime dateResult;
-
+
// Parse a date and time with no styles.
dateString = "03/01/2009 10:00 AM";
culture = CultureInfo.CreateSpecificCulture("en-US");
styles = DateTimeStyles.None;
if (DateTime.TryParse(dateString, culture, styles, out dateResult))
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, dateResult, dateResult.Kind);
else
- Console.WriteLine("Unable to convert {0} to a date and time.",
+ Console.WriteLine("Unable to convert {0} to a date and time.",
dateString);
-
+
// Parse the same date and time with the AssumeLocal style.
styles = DateTimeStyles.AssumeLocal;
if (DateTime.TryParse(dateString, culture, styles, out dateResult))
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, dateResult, dateResult.Kind);
else
Console.WriteLine("Unable to convert {0} to a date and time.", dateString);
-
+
// Parse a date and time that is assumed to be local.
- // This time is five hours behind UTC. The local system's time zone is
+ // This time is five hours behind UTC. The local system's time zone is
// eight hours behind UTC.
dateString = "2009/03/01T10:00:00-5:00";
styles = DateTimeStyles.AssumeLocal;
if (DateTime.TryParse(dateString, culture, styles, out dateResult))
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, dateResult, dateResult.Kind);
else
Console.WriteLine("Unable to convert {0} to a date and time.", dateString);
-
+
// Attempt to convert a string in improper ISO 8601 format.
dateString = "03/01/2009T10:00:00-5:00";
if (DateTime.TryParse(dateString, culture, styles, out dateResult))
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, dateResult, dateResult.Kind);
else
Console.WriteLine("Unable to convert {0} to a date and time.", dateString);
- // Assume a date and time string formatted for the fr-FR culture is the local
+ // Assume a date and time string formatted for the fr-FR culture is the local
// time and convert it to UTC.
dateString = "2008-03-01 10:00";
culture = CultureInfo.CreateSpecificCulture("fr-FR");
styles = DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeLocal;
if (DateTime.TryParse(dateString, culture, styles, out dateResult))
- Console.WriteLine("{0} converted to {1} {2}.",
+ Console.WriteLine("{0} converted to {1} {2}.",
dateString, dateResult, dateResult.Kind);
else
Console.WriteLine("Unable to convert {0} to a date and time.", dateString);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/cs/TryParseExact1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/cs/TryParseExact1.cs
index 170c2022d35..7354f988de0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/cs/TryParseExact1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/cs/TryParseExact1.cs
@@ -6,73 +6,73 @@ public class Example
{
public static void Main()
{
- CultureInfo enUS = new CultureInfo("en-US");
+ CultureInfo enUS = new CultureInfo("en-US");
string dateString;
DateTime dateValue;
-
+
// Parse date with no style flags.
dateString = " 5/01/2009 8:30 AM";
- if (DateTime.TryParseExact(dateString, "g", enUS,
+ if (DateTime.TryParseExact(dateString, "g", enUS,
DateTimeStyles.None, out dateValue))
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
else
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
// Allow a leading space in the date string.
- if (DateTime.TryParseExact(dateString, "g", enUS,
+ if (DateTime.TryParseExact(dateString, "g", enUS,
DateTimeStyles.AllowLeadingWhite, out dateValue))
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
else
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
-
+
// Use custom formats with M and MM.
dateString = "5/01/2009 09:00";
- if (DateTime.TryParseExact(dateString, "M/dd/yyyy hh:mm", enUS,
+ if (DateTime.TryParseExact(dateString, "M/dd/yyyy hh:mm", enUS,
DateTimeStyles.None, out dateValue))
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
else
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
// Allow a leading space in the date string.
- if (DateTime.TryParseExact(dateString, "MM/dd/yyyy hh:mm", enUS,
+ if (DateTime.TryParseExact(dateString, "MM/dd/yyyy hh:mm", enUS,
DateTimeStyles.None, out dateValue))
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
else
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
// Parse a string with time zone information.
- dateString = "05/01/2009 01:30:42 PM -05:00";
- if (DateTime.TryParseExact(dateString, "MM/dd/yyyy hh:mm:ss tt zzz", enUS,
+ dateString = "05/01/2009 01:30:42 PM -05:00";
+ if (DateTime.TryParseExact(dateString, "MM/dd/yyyy hh:mm:ss tt zzz", enUS,
DateTimeStyles.None, out dateValue))
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
else
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
// Allow a leading space in the date string.
- if (DateTime.TryParseExact(dateString, "MM/dd/yyyy hh:mm:ss tt zzz", enUS,
+ if (DateTime.TryParseExact(dateString, "MM/dd/yyyy hh:mm:ss tt zzz", enUS,
DateTimeStyles.AdjustToUniversal, out dateValue))
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
else
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
-
+
// Parse a string representing UTC.
dateString = "2008-06-11T16:11:20.0904778Z";
- if (DateTime.TryParseExact(dateString, "o", CultureInfo.InvariantCulture,
+ if (DateTime.TryParseExact(dateString, "o", CultureInfo.InvariantCulture,
DateTimeStyles.None, out dateValue))
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
else
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
- if (DateTime.TryParseExact(dateString, "o", CultureInfo.InvariantCulture,
+ if (DateTime.TryParseExact(dateString, "o", CultureInfo.InvariantCulture,
DateTimeStyles.RoundtripKind, out dateValue))
- Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
+ Console.WriteLine("Converted '{0}' to {1} ({2}).", dateString, dateValue,
dateValue.Kind);
else
Console.WriteLine("'{0}' is not in an acceptable format.", dateString);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/cs/TryParseExact2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/cs/TryParseExact2.cs
index 00862a4728d..fc4f0ba9f8a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/cs/TryParseExact2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/cs/TryParseExact2.cs
@@ -6,21 +6,21 @@ public class Example
{
public static void Main()
{
- string[] formats= {"M/d/yyyy h:mm:ss tt", "M/d/yyyy h:mm tt",
- "MM/dd/yyyy hh:mm:ss", "M/d/yyyy h:mm:ss",
- "M/d/yyyy hh:mm tt", "M/d/yyyy hh tt",
- "M/d/yyyy h:mm", "M/d/yyyy h:mm",
+ string[] formats= {"M/d/yyyy h:mm:ss tt", "M/d/yyyy h:mm tt",
+ "MM/dd/yyyy hh:mm:ss", "M/d/yyyy h:mm:ss",
+ "M/d/yyyy hh:mm tt", "M/d/yyyy hh tt",
+ "M/d/yyyy h:mm", "M/d/yyyy h:mm",
"MM/dd/yyyy hh:mm", "M/dd/yyyy hh:mm"};
- string[] dateStrings = {"5/1/2009 6:32 PM", "05/01/2009 6:32:05 PM",
- "5/1/2009 6:32:00", "05/01/2009 06:32",
- "05/01/2009 06:32:00 PM", "05/01/2009 06:32:00"};
+ string[] dateStrings = {"5/1/2009 6:32 PM", "05/01/2009 6:32:05 PM",
+ "5/1/2009 6:32:00", "05/01/2009 06:32",
+ "05/01/2009 06:32:00 PM", "05/01/2009 06:32:00"};
DateTime dateValue;
-
+
foreach (string dateString in dateStrings)
{
- if (DateTime.TryParseExact(dateString, formats,
- new CultureInfo("en-US"),
- DateTimeStyles.None,
+ if (DateTime.TryParseExact(dateString, formats,
+ new CultureInfo("en-US"),
+ DateTimeStyles.None,
out dateValue))
Console.WriteLine("Converted '{0}' to {1}.", dateString, dateValue);
else
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Year/cs/Year.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Year/cs/Year.cs
index f5ae9ef08fa..92f8c26401f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Year/cs/Year.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTime.Year/cs/Year.cs
@@ -10,18 +10,18 @@ public static void Main()
// Initialize date variable and display year
DateTime date1 = new DateTime(2008, 1, 1, 6, 32, 0);
Console.WriteLine(date1.Year); // Displays 2008
-
+
// Set culture to th-TH
Thread.CurrentThread.CurrentCulture = new CultureInfo("th-TH");
Console.WriteLine(date1.Year); // Displays 2008
-
- // display year using current culture's calendar
+
+ // display year using current culture's calendar
Calendar thaiCalendar = CultureInfo.CurrentCulture.Calendar;
Console.WriteLine(thaiCalendar.GetYear(date1)); // Displays 2551
-
+
// display year using Persian calendar
PersianCalendar persianCalendar = new PersianCalendar();
- Console.WriteLine(persianCalendar.GetYear(date1)); // Displays 1386
+ Console.WriteLine(persianCalendar.GetYear(date1)); // Displays 1386
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs
index bc8411e9f23..066d20922be 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/cs/Constructors.cs
@@ -28,12 +28,12 @@ private static void ConstructWithDateTime()
DateTime localNow = DateTime.Now;
DateTimeOffset localOffset = new DateTimeOffset(localNow);
Console.WriteLine(localOffset.ToString());
-
+
DateTime utcNow = DateTime.UtcNow;
DateTimeOffset utcOffset = new DateTimeOffset(utcNow);
Console.WriteLine(utcOffset.ToString());
-
- DateTime unspecifiedNow = DateTime.SpecifyKind(DateTime.Now,
+
+ DateTime unspecifiedNow = DateTime.SpecifyKind(DateTime.Now,
DateTimeKind.Unspecified);
DateTimeOffset unspecifiedOffset = new DateTimeOffset(unspecifiedNow);
Console.WriteLine(unspecifiedOffset.ToString());
@@ -42,83 +42,83 @@ private static void ConstructWithDateTime()
// a system 8 hours earlier than UTC:
// 2/23/2007 4:21:58 PM -08:00
// 2/24/2007 12:21:58 AM +00:00
- // 2/23/2007 4:21:58 PM -08:00
- //
+ // 2/23/2007 4:21:58 PM -08:00
+ //
}
private static void ConstructWithTicks()
{
//
DateTime dateWithoutOffset = new DateTime(2007, 7, 16, 13, 32, 00);
- DateTimeOffset timeFromTicks = new DateTimeOffset(dateWithoutOffset.Ticks,
+ DateTimeOffset timeFromTicks = new DateTimeOffset(dateWithoutOffset.Ticks,
new TimeSpan(-5, 0, 0));
Console.WriteLine(timeFromTicks.ToString());
// The code produces the following output:
// 7/16/2007 1:32:00 PM -05:00
//
}
-
+
private static void ConstructWithDateAndOffset()
{
//
- DateTime localTime = new DateTime(2007, 07, 12, 06, 32, 00);
- DateTimeOffset dateAndOffset = new DateTimeOffset(localTime,
+ DateTime localTime = new DateTime(2007, 07, 12, 06, 32, 00);
+ DateTimeOffset dateAndOffset = new DateTimeOffset(localTime,
TimeZoneInfo.Local.GetUtcOffset(localTime));
Console.WriteLine(dateAndOffset);
// The code produces the following output:
// 7/12/2007 6:32:00 AM -07:00
//
}
-
+
private static void ConstructNonLocalWithLocalTicks()
{
//
DateTime localTime = DateTime.Now;
- DateTimeOffset nonLocalDateWithOffset = new DateTimeOffset(localTime.Ticks,
+ DateTimeOffset nonLocalDateWithOffset = new DateTimeOffset(localTime.Ticks,
new TimeSpan(2, 0, 0));
- Console.WriteLine(nonLocalDateWithOffset);
+ Console.WriteLine(nonLocalDateWithOffset);
//
// The code produces the following output if run on Feb. 23, 2007:
// 2/23/2007 4:37:50 PM +02:00
//
}
-
+
private static void ConstructWithDateElements()
{
//
- DateTime specificDate = new DateTime(2008, 5, 1, 06, 32, 00);
- DateTimeOffset offsetDate = new DateTimeOffset(specificDate.Year,
- specificDate.Month,
- specificDate.Day,
- specificDate.Hour,
- specificDate.Minute,
- specificDate.Second,
+ DateTime specificDate = new DateTime(2008, 5, 1, 06, 32, 00);
+ DateTimeOffset offsetDate = new DateTimeOffset(specificDate.Year,
+ specificDate.Month,
+ specificDate.Day,
+ specificDate.Hour,
+ specificDate.Minute,
+ specificDate.Second,
new TimeSpan(-5, 0, 0));
Console.WriteLine("Current time: {0}", offsetDate);
- Console.WriteLine("Corresponding UTC time: {0}", offsetDate.UtcDateTime);
+ Console.WriteLine("Corresponding UTC time: {0}", offsetDate.UtcDateTime);
// The code produces the following output:
// Current time: 5/1/2008 6:32:00 AM -05:00
- // Corresponding UTC time: 5/1/2008 11:32:00 AM
+ // Corresponding UTC time: 5/1/2008 11:32:00 AM
//
}
-
+
private static void ConstructWithDateElements2()
{
//
- DateTime specificDate = new DateTime(2008, 5, 1, 6, 32, 05);
- DateTimeOffset offsetDate = new DateTimeOffset(specificDate.Year - 1,
- specificDate.Month,
- specificDate.Day,
- specificDate.Hour,
- specificDate.Minute,
- specificDate.Second,
- 0,
+ DateTime specificDate = new DateTime(2008, 5, 1, 6, 32, 05);
+ DateTimeOffset offsetDate = new DateTimeOffset(specificDate.Year - 1,
+ specificDate.Month,
+ specificDate.Day,
+ specificDate.Hour,
+ specificDate.Minute,
+ specificDate.Second,
+ 0,
new TimeSpan(-5, 0, 0));
Console.WriteLine("Current time: {0}", offsetDate);
- Console.WriteLine("Corresponding UTC time: {0}", offsetDate.UtcDateTime);
+ Console.WriteLine("Corresponding UTC time: {0}", offsetDate.UtcDateTime);
// The code produces the following output:
// Current time: 5/1/2007 6:32:05 AM -05:00
- // Corresponding UTC time: 5/1/2007 11:32:05 AM
+ // Corresponding UTC time: 5/1/2007 11:32:05 AM
//
}
@@ -127,17 +127,17 @@ private static void ConstructWithDateElements3()
//
string fmt = "dd MMM yyyy HH:mm:ss";
DateTime thisDate = new DateTime(2007, 06, 12, 19, 00, 14, 16);
- DateTimeOffset offsetDate = new DateTimeOffset(thisDate.Year,
- thisDate.Month,
- thisDate.Day,
+ DateTimeOffset offsetDate = new DateTimeOffset(thisDate.Year,
+ thisDate.Month,
+ thisDate.Day,
thisDate.Hour,
thisDate.Minute,
thisDate.Second,
- thisDate.Millisecond,
- new TimeSpan(2, 0, 0));
+ thisDate.Millisecond,
+ new TimeSpan(2, 0, 0));
Console.WriteLine("Current time: {0}:{1}", offsetDate.ToString(fmt), offsetDate.Millisecond);
// The code produces the following output:
- // Current time: 12 Jun 2007 19:00:14:16
+ // Current time: 12 Jun 2007 19:00:14:16
//
}
@@ -145,23 +145,23 @@ private static void ConstructWithCalendar()
{
//
CultureInfo fmt;
- int year;
+ int year;
Calendar cal;
DateTimeOffset dateInCal;
-
+
// Instantiate DateTimeOffset with Hebrew calendar
year = 5770;
cal = new HebrewCalendar();
fmt = new CultureInfo("he-IL");
- fmt.DateTimeFormat.Calendar = cal;
- dateInCal = new DateTimeOffset(year, 7, 12,
- 15, 30, 0, 0,
- cal,
+ fmt.DateTimeFormat.Calendar = cal;
+ dateInCal = new DateTimeOffset(year, 7, 12,
+ 15, 30, 0, 0,
+ cal,
new TimeSpan(2, 0, 0));
// Display the date in the Hebrew calendar
- Console.WriteLine("Date in Hebrew Calendar: {0:g}",
+ Console.WriteLine("Date in Hebrew Calendar: {0:g}",
dateInCal.ToString(fmt));
- // Display the date in the Gregorian calendar
+ // Display the date in the Gregorian calendar
Console.WriteLine("Date in Gregorian Calendar: {0:g}", dateInCal);
Console.WriteLine();
@@ -170,14 +170,14 @@ private static void ConstructWithCalendar()
cal = new HijriCalendar();
fmt = new CultureInfo("ar-SA");
fmt.DateTimeFormat.Calendar = cal;
- dateInCal = new DateTimeOffset(year, 7, 12,
- 15, 30, 0, 0,
- cal,
+ dateInCal = new DateTimeOffset(year, 7, 12,
+ 15, 30, 0, 0,
+ cal,
new TimeSpan(2, 0, 0));
// Display the date in the Hijri calendar
- Console.WriteLine("Date in Hijri Calendar: {0:g}",
+ Console.WriteLine("Date in Hijri Calendar: {0:g}",
dateInCal.ToString(fmt));
- // Display the date in the Gregorian calendar
+ // Display the date in the Gregorian calendar
Console.WriteLine("Date in Gregorian Calendar: {0:g}", dateInCal);
Console.WriteLine();
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.FromFileTime/cs/FileTime.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.FromFileTime/cs/FileTime.cs
index 5312e9d8ecb..cfeefc7e226 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.FromFileTime/cs/FileTime.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.FromFileTime/cs/FileTime.cs
@@ -14,15 +14,15 @@ public static implicit operator long(FileTime fileTime)
// Convert 4 high-order bytes to a byte array
byte[] highBytes = BitConverter.GetBytes(fileTime.dwHighDateTime);
// Resize the array to 8 bytes (for a Long)
- Array.Resize(ref highBytes, 8);
+ Array.Resize(ref highBytes, 8);
// Assign high-order bytes to first 4 bytes of Long
- returnedLong = BitConverter.ToInt64(highBytes, 0);
+ returnedLong = BitConverter.ToInt64(highBytes, 0);
// Shift high-order bytes into position
returnedLong = returnedLong << 32;
// Or with low-order bytes
returnedLong = returnedLong | fileTime.dwLowDateTime;
- // Return long
+ // Return long
return returnedLong;
}
}
@@ -31,31 +31,31 @@ public class FileTimes
{
private const int OPEN_EXISTING = 3;
private const int INVALID_HANDLE_VALUE = -1;
-
+
[DllImport("Kernel32.dll", CharSet = CharSet.Unicode)]
- private static extern int CreateFile(string lpFileName,
- int dwDesiredAccess,
- int dwShareMode,
- int lpSecurityAttributes,
- int dwCreationDisposition,
- int dwFlagsAndAttributes,
+ private static extern int CreateFile(string lpFileName,
+ int dwDesiredAccess,
+ int dwShareMode,
+ int lpSecurityAttributes,
+ int dwCreationDisposition,
+ int dwFlagsAndAttributes,
int hTemplateFile);
[DllImport("Kernel32.dll")]
- private static extern bool GetFileTime(int hFile,
- out FileTime lpCreationTime,
- out FileTime lpLastAccessTime,
+ private static extern bool GetFileTime(int hFile,
+ out FileTime lpCreationTime,
+ out FileTime lpLastAccessTime,
out FileTime lpLastWriteTime);
[DllImport("Kernel32.dll")]
- private static extern bool CloseHandle(int hFile);
+ private static extern bool CloseHandle(int hFile);
public static void Main()
{
// Open file %windir%\write.exe
- string winDir = Environment.SystemDirectory;
+ string winDir = Environment.SystemDirectory;
if (! (winDir.EndsWith(Path.DirectorySeparatorChar.ToString())))
- winDir += Path.DirectorySeparatorChar;
+ winDir += Path.DirectorySeparatorChar;
winDir += "write.exe";
// Get file time using Windows API
@@ -65,11 +65,11 @@ public static void Main()
if (hFile == INVALID_HANDLE_VALUE)
{
Console.WriteLine("Unable to access {0}.", winDir);
- }
+ }
else
{
FileTime creationTime, accessTime, writeTime;
- if (GetFileTime(hFile, out creationTime, out accessTime, out writeTime))
+ if (GetFileTime(hFile, out creationTime, out accessTime, out writeTime))
{
CloseHandle(hFile);
long fileCreationTime = (long) creationTime;
@@ -81,14 +81,14 @@ public static void Main()
Console.WriteLine(" Last Access: {0:d}", DateTimeOffset.FromFileTime(fileAccessTime).ToString());
Console.WriteLine(" Last Write: {0:d}", DateTimeOffset.FromFileTime(fileWriteTime).ToString());
Console.WriteLine();
- }
+ }
}
-
+
// Get date and time, convert to file time, then convert back
FileInfo fileInfo = new FileInfo(winDir);
DateTimeOffset infoCreationTime, infoAccessTime, infoWriteTime;
long ftCreationTime, ftAccessTime, ftWriteTime;
-
+
// Get dates and times of file creation, last access, and last write
infoCreationTime = fileInfo.CreationTime;
infoAccessTime = fileInfo.LastAccessTime;
@@ -97,12 +97,12 @@ public static void Main()
ftCreationTime = infoCreationTime.ToFileTime();
ftAccessTime = infoAccessTime.ToFileTime();
ftWriteTime = infoWriteTime.ToFileTime();
-
+
// Convert file times back to DateTimeOffset values
Console.WriteLine("File {0} Retrieved Using a FileInfo Object:", winDir);
Console.WriteLine(" Created: {0:d}", DateTimeOffset.FromFileTime(ftCreationTime).ToString());
Console.WriteLine(" Last Access: {0:d}", DateTimeOffset.FromFileTime(ftAccessTime).ToString());
- Console.WriteLine(" Last Write: {0:d}", DateTimeOffset.FromFileTime(ftWriteTime).ToString());
+ Console.WriteLine(" Last Write: {0:d}", DateTimeOffset.FromFileTime(ftWriteTime).ToString());
}
}
// The example produces the following output:
@@ -110,7 +110,7 @@ public static void Main()
// Created: 10/13/2005 5:26:59 PM -07:00
// Last Access: 3/20/2007 2:07:00 AM -07:00
// Last Write: 8/4/2004 5:00:00 AM -07:00
-//
+//
// File C:\WINDOWS\system32\write.exe Retrieved Using a FileInfo Object:
// Created: 10/13/2005 5:26:59 PM -07:00
// Last Access: 3/20/2007 2:07:00 AM -07:00
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs
index 4e82cdce52a..9cf3b673e78 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods.cs
@@ -37,14 +37,14 @@ public static void Main()
private static void ShowSchedule()
{
//
- DateTimeOffset takeOff = new DateTimeOffset(2007, 6, 1, 7, 55, 0,
+ DateTimeOffset takeOff = new DateTimeOffset(2007, 6, 1, 7, 55, 0,
new TimeSpan(-5, 0, 0));
DateTimeOffset currentTime = takeOff;
TimeSpan[] flightTimes = new TimeSpan[]
{new TimeSpan(2, 25, 0), new TimeSpan(1, 48, 0)};
- Console.WriteLine("Takeoff is scheduled for {0:d} at {0:T}.",
+ Console.WriteLine("Takeoff is scheduled for {0:d} at {0:T}.",
takeOff);
- for (int ctr = flightTimes.GetLowerBound(0);
+ for (int ctr = flightTimes.GetLowerBound(0);
ctr <= flightTimes.GetUpperBound(0); ctr++)
{
currentTime = currentTime.Add(flightTimes[ctr]);
@@ -56,7 +56,7 @@ private static void ShowSchedule()
private static void ShowStartOfWorkWeek()
{
//
- DateTimeOffset workDay = new DateTimeOffset(2008, 3, 1, 9, 0, 0,
+ DateTimeOffset workDay = new DateTimeOffset(2008, 3, 1, 9, 0, 0,
DateTimeOffset.Now.Offset);
int month = workDay.Month;
// Start with the first Monday of the month
@@ -64,38 +64,38 @@ private static void ShowStartOfWorkWeek()
{
if (workDay.DayOfWeek == DayOfWeek.Sunday)
workDay = workDay.AddDays(1);
- else
+ else
workDay = workDay.AddDays(8 - (int)workDay.DayOfWeek);
}
Console.WriteLine("Beginning of Work Week In {0:MMMM} {0:yyyy}:", workDay);
- // Add one week to the current date
- do
+ // Add one week to the current date
+ do
{
Console.WriteLine(" {0:dddd}, {0:MMMM}{0: d}", workDay);
workDay = workDay.AddDays(7);
- } while (workDay.Month == month);
+ } while (workDay.Month == month);
// The example produces the following output:
// Beginning of Work Week In March 2008:
// Monday, March 3
// Monday, March 10
// Monday, March 17
// Monday, March 24
- // Monday, March 31
- //
+ // Monday, March 31
+ //
}
private static void ShowShiftStartTimes()
{
- //
+ //
const int SHIFT_LENGTH = 8;
-
- DateTimeOffset startTime = new DateTimeOffset(2007, 8, 6, 0, 0, 0,
+
+ DateTimeOffset startTime = new DateTimeOffset(2007, 8, 6, 0, 0, 0,
DateTimeOffset.Now.Offset);
DateTimeOffset startOfShift = startTime.AddHours(SHIFT_LENGTH);
-
+
Console.WriteLine("Shifts for the week of {0:D}", startOfShift);
do
- {
+ {
// Exclude third shift
if (startOfShift.Hour > 6)
Console.WriteLine(" {0:d} at {0:T}", startOfShift);
@@ -115,40 +115,40 @@ private static void ShowShiftStartTimes()
// 8/9/2007 at 8:00:00 AM
// 8/9/2007 at 4:00:00 PM
// 8/10/2007 at 8:00:00 AM
- // 8/10/2007 at 4:00:00 PM
- //
+ // 8/10/2007 at 4:00:00 PM
+ //
}
private static void ShowQuarters()
{
//
- DateTimeOffset quarterDate = new DateTimeOffset(2007, 1, 1, 0, 0, 0,
+ DateTimeOffset quarterDate = new DateTimeOffset(2007, 1, 1, 0, 0, 0,
DateTimeOffset.Now.Offset);
for (int ctr = 1; ctr <= 4; ctr++)
{
Console.WriteLine("Quarter {0}: {1:MMMM d}", ctr, quarterDate);
quarterDate = quarterDate.AddMonths(3);
- }
+ }
// This example produces the following output:
// Quarter 1: January 1
// Quarter 2: April 1
// Quarter 3: July 1
- // Quarter 4: October 1
+ // Quarter 4: October 1
//
}
private static void DisplayTimes()
{
//
- double[] lapTimes = {1.308, 1.283, 1.325, 1.3625, 1.317, 1.267};
- DateTimeOffset currentTime = new DateTimeOffset(1, 1, 1, 1, 30, 0,
+ double[] lapTimes = {1.308, 1.283, 1.325, 1.3625, 1.317, 1.267};
+ DateTimeOffset currentTime = new DateTimeOffset(1, 1, 1, 1, 30, 0,
DateTimeOffset.Now.Offset);
Console.WriteLine("Start: {0:T}", currentTime);
for (int ctr = lapTimes.GetLowerBound(0); ctr <= lapTimes.GetUpperBound(0); ctr++)
{
currentTime = currentTime.AddMinutes(lapTimes[ctr]);
Console.WriteLine("Lap {0}: {1:T}", ctr + 1, currentTime);
- }
+ }
// The example produces the following output:
// Start: 1:30:00 PM
// Lap 1: 1:31:18 PM
@@ -156,181 +156,181 @@ private static void DisplayTimes()
// Lap 3: 1:33:54 PM
// Lap 4: 1:35:16 PM
// Lap 5: 1:36:35 PM
- // Lap 6: 1:37:51 PM
+ // Lap 6: 1:37:51 PM
//
- }
+ }
private static void ShowLegalLicenseAge()
- {
+ {
//
const int minimumAge = 16;
DateTimeOffset dateToday = DateTimeOffset.Now;
DateTimeOffset latestBirthday = dateToday.AddYears(-1 * minimumAge);
- Console.WriteLine("To possess a driver's license, you must have been born on or before {0:d}.",
+ Console.WriteLine("To possess a driver's license, you must have been born on or before {0:d}.",
latestBirthday);
- //
- }
+ //
+ }
//
private static void CompareForEquality1()
{
- DateTimeOffset firstTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
+ DateTimeOffset firstTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset secondTime = firstTime;
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
firstTime.Equals(secondTime));
- secondTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
- new TimeSpan(-6, 0, 0));
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ secondTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
+ new TimeSpan(-6, 0, 0));
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
firstTime.Equals(secondTime));
-
- secondTime = new DateTimeOffset(2007, 9, 1, 8, 45, 0,
+
+ secondTime = new DateTimeOffset(2007, 9, 1, 8, 45, 0,
new TimeSpan(-5, 0, 0));
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
firstTime.Equals(secondTime));
// The example displays the following output to the console:
// 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 6:45:00 AM -07:00: True
// 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 6:45:00 AM -06:00: False
- // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 8:45:00 AM -05:00: True
+ // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 8:45:00 AM -05:00: True
//
- }
-
+ }
+
//
private static void CompareForEquality2()
{
- DateTimeOffset firstTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
+ DateTimeOffset firstTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
new TimeSpan(-7, 0, 0));
object secondTime = firstTime;
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
firstTime.Equals(secondTime));
- secondTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
- new TimeSpan(-6, 0, 0));
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ secondTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
+ new TimeSpan(-6, 0, 0));
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
firstTime.Equals(secondTime));
-
- secondTime = new DateTimeOffset(2007, 9, 1, 8, 45, 0,
+
+ secondTime = new DateTimeOffset(2007, 9, 1, 8, 45, 0,
new TimeSpan(-5, 0, 0));
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
firstTime.Equals(secondTime));
-
+
secondTime = null;
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
firstTime.Equals(secondTime));
- secondTime = new DateTime(2007, 9, 1, 6, 45, 00);
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ secondTime = new DateTime(2007, 9, 1, 6, 45, 00);
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
firstTime.Equals(secondTime));
// The example displays the following output to the console:
- // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 6:45:00 AM -07:00: True
- // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 6:45:00 AM -06:00: False
- // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 8:45:00 AM -05:00: True
- // 9/1/2007 6:45:00 AM -07:00 = : False
- // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 6:45:00 AM: False
+ // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 6:45:00 AM -07:00: True
+ // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 6:45:00 AM -06:00: False
+ // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 8:45:00 AM -05:00: True
+ // 9/1/2007 6:45:00 AM -07:00 = : False
+ // 9/1/2007 6:45:00 AM -07:00 = 9/1/2007 6:45:00 AM: False
//
}
private static void CompareForEquality3()
{
//
- DateTimeOffset firstTime = new DateTimeOffset(2007, 11, 15, 11, 35, 00,
+ DateTimeOffset firstTime = new DateTimeOffset(2007, 11, 15, 11, 35, 00,
DateTimeOffset.Now.Offset);
DateTimeOffset secondTime = firstTime;
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
DateTimeOffset.Equals(firstTime, secondTime));
// The value of firstTime remains unchanged
- secondTime = new DateTimeOffset(firstTime.DateTime,
- TimeSpan.FromHours(firstTime.Offset.Hours + 1));
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ secondTime = new DateTimeOffset(firstTime.DateTime,
+ TimeSpan.FromHours(firstTime.Offset.Hours + 1));
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
DateTimeOffset.Equals(firstTime, secondTime));
-
+
// value of firstTime remains unchanged
- secondTime = new DateTimeOffset(firstTime.DateTime + TimeSpan.FromHours(1),
+ secondTime = new DateTimeOffset(firstTime.DateTime + TimeSpan.FromHours(1),
TimeSpan.FromHours(firstTime.Offset.Hours + 1));
- Console.WriteLine("{0} = {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ firstTime, secondTime,
DateTimeOffset.Equals(firstTime, secondTime));
// The example produces the following output:
// 11/15/2007 11:35:00 AM -07:00 = 11/15/2007 11:35:00 AM -07:00: True
// 11/15/2007 11:35:00 AM -07:00 = 11/15/2007 11:35:00 AM -06:00: False
- // 11/15/2007 11:35:00 AM -07:00 = 11/15/2007 12:35:00 PM -06:00: True
- //
- }
+ // 11/15/2007 11:35:00 AM -07:00 = 11/15/2007 12:35:00 PM -06:00: True
+ //
+ }
private static void CompareExactly()
{
//
- DateTimeOffset instanceTime = new DateTimeOffset(2007, 10, 31, 0, 0, 0,
+ DateTimeOffset instanceTime = new DateTimeOffset(2007, 10, 31, 0, 0, 0,
DateTimeOffset.Now.Offset);
-
+
DateTimeOffset otherTime = instanceTime;
- Console.WriteLine("{0} = {1}: {2}",
- instanceTime, otherTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ instanceTime, otherTime,
instanceTime.EqualsExact(otherTime));
-
- otherTime = new DateTimeOffset(instanceTime.DateTime,
+
+ otherTime = new DateTimeOffset(instanceTime.DateTime,
TimeSpan.FromHours(instanceTime.Offset.Hours + 1));
- Console.WriteLine("{0} = {1}: {2}",
- instanceTime, otherTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ instanceTime, otherTime,
instanceTime.EqualsExact(otherTime));
-
- otherTime = new DateTimeOffset(instanceTime.DateTime + TimeSpan.FromHours(1),
+
+ otherTime = new DateTimeOffset(instanceTime.DateTime + TimeSpan.FromHours(1),
TimeSpan.FromHours(instanceTime.Offset.Hours + 1));
- Console.WriteLine("{0} = {1}: {2}",
+ Console.WriteLine("{0} = {1}: {2}",
instanceTime, otherTime,
instanceTime.EqualsExact(otherTime));
// The example produces the following output:
// 10/31/2007 12:00:00 AM -07:00 = 10/31/2007 12:00:00 AM -07:00: True
// 10/31/2007 12:00:00 AM -07:00 = 10/31/2007 12:00:00 AM -06:00: False
- // 10/31/2007 12:00:00 AM -07:00 = 10/31/2007 1:00:00 AM -06:00: False
- //
- }
+ // 10/31/2007 12:00:00 AM -07:00 = 10/31/2007 1:00:00 AM -06:00: False
+ //
+ }
private static void Subtract1()
{
//
- DateTimeOffset firstDate = new DateTimeOffset(2018, 10, 25, 18, 0, 0,
+ DateTimeOffset firstDate = new DateTimeOffset(2018, 10, 25, 18, 0, 0,
new TimeSpan(-7, 0, 0));
- DateTimeOffset secondDate = new DateTimeOffset(2018, 10, 25, 18, 0, 0,
+ DateTimeOffset secondDate = new DateTimeOffset(2018, 10, 25, 18, 0, 0,
new TimeSpan(-5, 0, 0));
- DateTimeOffset thirdDate = new DateTimeOffset(2018, 9, 28, 9, 0, 0,
+ DateTimeOffset thirdDate = new DateTimeOffset(2018, 9, 28, 9, 0, 0,
new TimeSpan(-7, 0, 0));
TimeSpan difference;
-
+
difference = firstDate.Subtract(secondDate);
Console.WriteLine($"({firstDate}) - ({secondDate}): {difference.Days} days, {difference.Hours}:{difference.Minutes:d2}");
difference = firstDate.Subtract(thirdDate);
Console.WriteLine($"({firstDate}) - ({thirdDate}): {difference.Days} days, {difference.Hours}:{difference.Minutes:d2}");
-
+
// The example produces the following output:
// (10/25/2018 6:00:00 PM -07:00) - (10/25/2018 6:00:00 PM -05:00): 0 days, 2:00
// (10/25/2018 6:00:00 PM -07:00) - (9/28/2018 9:00:00 AM -07:00): 27 days, 9:00
- //
+ //
}
private static void Subtract2()
{
- //
- DateTimeOffset offsetDate = new DateTimeOffset(2007, 12, 3, 11, 30, 0,
- new TimeSpan(-8, 0, 0));
+ //
+ DateTimeOffset offsetDate = new DateTimeOffset(2007, 12, 3, 11, 30, 0,
+ new TimeSpan(-8, 0, 0));
TimeSpan duration = new TimeSpan(7, 18, 0, 0);
Console.WriteLine(offsetDate.Subtract(duration).ToString()); // Displays 11/25/2007 5:30:00 PM -08:00
- //
+ //
}
private static void ConvertToLocal()
@@ -338,81 +338,81 @@ private static void ConvertToLocal()
//
// Local time changes on 3/11/2007 at 2:00 AM
DateTimeOffset originalTime, localTime;
-
- originalTime = new DateTimeOffset(2007, 3, 11, 3, 0, 0,
+
+ originalTime = new DateTimeOffset(2007, 3, 11, 3, 0, 0,
new TimeSpan(-6, 0, 0));
localTime = originalTime.ToLocalTime();
- Console.WriteLine("Converted {0} to {1}.", originalTime.ToString(),
- localTime.ToString());
+ Console.WriteLine("Converted {0} to {1}.", originalTime.ToString(),
+ localTime.ToString());
- originalTime = new DateTimeOffset(2007, 3, 11, 4, 0, 0,
+ originalTime = new DateTimeOffset(2007, 3, 11, 4, 0, 0,
new TimeSpan(-6, 0, 0));
localTime = originalTime.ToLocalTime();
- Console.WriteLine("Converted {0} to {1}.", originalTime.ToString(),
- localTime.ToString());
+ Console.WriteLine("Converted {0} to {1}.", originalTime.ToString(),
+ localTime.ToString());
// Define a summer UTC time
- originalTime = new DateTimeOffset(2007, 6, 15, 8, 0, 0,
+ originalTime = new DateTimeOffset(2007, 6, 15, 8, 0, 0,
TimeSpan.Zero);
localTime = originalTime.ToLocalTime();
Console.WriteLine("Converted {0} to {1}.", originalTime.ToString(),
- localTime.ToString());
+ localTime.ToString());
// Define a winter time
- originalTime = new DateTimeOffset(2007, 11, 30, 14, 0, 0,
+ originalTime = new DateTimeOffset(2007, 11, 30, 14, 0, 0,
new TimeSpan(3, 0, 0));
localTime = originalTime.ToLocalTime();
- Console.WriteLine("Converted {0} to {1}.", originalTime.ToString(),
+ Console.WriteLine("Converted {0} to {1}.", originalTime.ToString(),
localTime.ToString());
// The example produces the following output:
// Converted 3/11/2007 3:00:00 AM -06:00 to 3/11/2007 1:00:00 AM -08:00.
// Converted 3/11/2007 4:00:00 AM -06:00 to 3/11/2007 3:00:00 AM -07:00.
// Converted 6/15/2007 8:00:00 AM +00:00 to 6/15/2007 1:00:00 AM -07:00.
- // Converted 11/30/2007 2:00:00 PM +03:00 to 11/30/2007 3:00:00 AM -08:00.
- //
- }
-
+ // Converted 11/30/2007 2:00:00 PM +03:00 to 11/30/2007 3:00:00 AM -08:00.
+ //
+ }
+
private static void ConvertToUniversal()
{
//
DateTimeOffset localTime, otherTime, universalTime;
-
+
// Define local time in local time zone
localTime = new DateTimeOffset(new DateTime(2007, 6, 15, 12, 0, 0));
Console.WriteLine("Local time: {0}", localTime);
Console.WriteLine();
-
+
// Convert local time to offset 0 and assign to otherTime
otherTime = localTime.ToOffset(TimeSpan.Zero);
Console.WriteLine("Other time: {0}", otherTime);
- Console.WriteLine("{0} = {1}: {2}",
- localTime, otherTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ localTime, otherTime,
localTime.Equals(otherTime));
- Console.WriteLine("{0} exactly equals {1}: {2}",
- localTime, otherTime,
+ Console.WriteLine("{0} exactly equals {1}: {2}",
+ localTime, otherTime,
localTime.EqualsExact(otherTime));
Console.WriteLine();
-
+
// Convert other time to UTC
- universalTime = localTime.ToUniversalTime();
+ universalTime = localTime.ToUniversalTime();
Console.WriteLine("Universal time: {0}", universalTime);
- Console.WriteLine("{0} = {1}: {2}",
- otherTime, universalTime,
+ Console.WriteLine("{0} = {1}: {2}",
+ otherTime, universalTime,
universalTime.Equals(otherTime));
- Console.WriteLine("{0} exactly equals {1}: {2}",
- otherTime, universalTime,
+ Console.WriteLine("{0} exactly equals {1}: {2}",
+ otherTime, universalTime,
universalTime.EqualsExact(otherTime));
Console.WriteLine();
// The example produces the following output to the console:
// Local time: 6/15/2007 12:00:00 PM -07:00
- //
+ //
// Other time: 6/15/2007 7:00:00 PM +00:00
// 6/15/2007 12:00:00 PM -07:00 = 6/15/2007 7:00:00 PM +00:00: True
// 6/15/2007 12:00:00 PM -07:00 exactly equals 6/15/2007 7:00:00 PM +00:00: False
- //
+ //
// Universal time: 6/15/2007 7:00:00 PM +00:00
// 6/15/2007 7:00:00 PM +00:00 = 6/15/2007 7:00:00 PM +00:00: True
- // 6/15/2007 7:00:00 PM +00:00 exactly equals 6/15/2007 7:00:00 PM +00:00: True
- //
- }
+ // 6/15/2007 7:00:00 PM +00:00 exactly equals 6/15/2007 7:00:00 PM +00:00: True
+ //
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods2.cs
index e6b71549dea..a7052aa7f79 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods2.cs
@@ -4,37 +4,37 @@
public class CompareTimes
{
private enum TimeComparison
- {
+ {
Earlier = -1,
Same = 0,
Later = 1
};
-
+
public static void Main()
{
- DateTimeOffset firstTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
+ DateTimeOffset firstTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset secondTime = firstTime;
- Console.WriteLine("Comparing {0} and {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("Comparing {0} and {1}: {2}",
+ firstTime, secondTime,
(TimeComparison) DateTimeOffset.Compare(firstTime, secondTime));
- secondTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
- new TimeSpan(-6, 0, 0));
- Console.WriteLine("Comparing {0} and {1}: {2}",
- firstTime, secondTime,
+ secondTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
+ new TimeSpan(-6, 0, 0));
+ Console.WriteLine("Comparing {0} and {1}: {2}",
+ firstTime, secondTime,
(TimeComparison) DateTimeOffset.Compare(firstTime, secondTime));
-
- secondTime = new DateTimeOffset(2007, 9, 1, 8, 45, 0,
+
+ secondTime = new DateTimeOffset(2007, 9, 1, 8, 45, 0,
new TimeSpan(-5, 0, 0));
- Console.WriteLine("Comparing {0} and {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("Comparing {0} and {1}: {2}",
+ firstTime, secondTime,
(TimeComparison) DateTimeOffset.Compare(firstTime, secondTime));
// The example displays the following output to the console:
// Comparing 9/1/2007 6:45:00 AM -07:00 and 9/1/2007 6:45:00 AM -07:00: Same
// Comparing 9/1/2007 6:45:00 AM -07:00 and 9/1/2007 6:45:00 AM -06:00: Later
- // Comparing 9/1/2007 6:45:00 AM -07:00 and 9/1/2007 8:45:00 AM -05:00: Same
+ // Comparing 9/1/2007 6:45:00 AM -07:00 and 9/1/2007 8:45:00 AM -05:00: Same
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods3.cs
index c78309586e4..2750316bc02 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/cs/Methods3.cs
@@ -4,37 +4,37 @@
public class CompareTimes
{
private enum TimeComparison
- {
+ {
Earlier = -1,
Same = 0,
Later = 1
};
-
+
public static void Main()
{
- DateTimeOffset firstTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
+ DateTimeOffset firstTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset secondTime = firstTime;
- Console.WriteLine("Comparing {0} and {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("Comparing {0} and {1}: {2}",
+ firstTime, secondTime,
(TimeComparison) firstTime.CompareTo(secondTime));
- secondTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
- new TimeSpan(-6, 0, 0));
- Console.WriteLine("Comparing {0} and {1}: {2}",
- firstTime, secondTime,
+ secondTime = new DateTimeOffset(2007, 9, 1, 6, 45, 0,
+ new TimeSpan(-6, 0, 0));
+ Console.WriteLine("Comparing {0} and {1}: {2}",
+ firstTime, secondTime,
(TimeComparison) firstTime.CompareTo(secondTime));
-
- secondTime = new DateTimeOffset(2007, 9, 1, 8, 45, 0,
+
+ secondTime = new DateTimeOffset(2007, 9, 1, 8, 45, 0,
new TimeSpan(-5, 0, 0));
- Console.WriteLine("Comparing {0} and {1}: {2}",
- firstTime, secondTime,
+ Console.WriteLine("Comparing {0} and {1}: {2}",
+ firstTime, secondTime,
(TimeComparison) firstTime.CompareTo(secondTime));
// The example displays the following output to the console:
// Comparing 9/1/2007 6:45:00 AM -07:00 and 9/1/2007 6:45:00 AM -07:00: Same
// Comparing 9/1/2007 6:45:00 AM -07:00 and 9/1/2007 6:45:00 AM -06:00: Later
- // Comparing 9/1/2007 6:45:00 AM -07:00 and 9/1/2007 8:45:00 AM -05:00: Same
+ // Comparing 9/1/2007 6:45:00 AM -07:00 and 9/1/2007 8:45:00 AM -05:00: Same
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/cs/Operators.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/cs/Operators.cs
index f768449749c..8a391329c55 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/cs/Operators.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/cs/Operators.cs
@@ -4,100 +4,100 @@ public class Class1
{
public static void Main()
{
- ShowAddition();
- ShowEquality();
+ ShowAddition();
+ ShowEquality();
ShowGreaterThan();
ShowGreaterThanOrEqualTo();
- ShowImplicitConversions();
- ShowInequality();
- ShowLessThan();
- ShowLessThanOrEqualTo();
- ShowSubtraction1();
+ ShowImplicitConversions();
+ ShowInequality();
+ ShowLessThan();
+ ShowLessThanOrEqualTo();
+ ShowSubtraction1();
ShowSubtraction2();
}
private static void ShowAddition()
{
//
- DateTimeOffset date1 = new DateTimeOffset(2008, 1, 1, 13, 32, 45,
- new TimeSpan(-5, 0, 0));
+ DateTimeOffset date1 = new DateTimeOffset(2008, 1, 1, 13, 32, 45,
+ new TimeSpan(-5, 0, 0));
TimeSpan interval1 = new TimeSpan(202, 3, 30, 0);
- TimeSpan interval2 = new TimeSpan(5, 0, 0, 0);
- DateTimeOffset date2;
-
+ TimeSpan interval2 = new TimeSpan(5, 0, 0, 0);
+ DateTimeOffset date2;
+
Console.WriteLine(date1); // Displays 1/1/2008 1:32:45 PM -05:00
date2 = date1 + interval1;
Console.WriteLine(date2); // Displays 7/21/2008 5:02:45 PM -05:00
date2 += interval2;
- Console.WriteLine(date2); // Displays 7/26/2008 5:02:45 PM -05:00
+ Console.WriteLine(date2); // Displays 7/26/2008 5:02:45 PM -05:00
//
}
private static void ShowEquality()
{
//
- DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
+ DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset date2 = new DateTimeOffset(2007, 6, 3, 15, 45, 0,
new TimeSpan(-6, 0, 0));
- DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
+ DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
new TimeSpan(-6, 0, 0));
Console.WriteLine(date1 == date2); // Displays True
- Console.WriteLine(date1 == date3); // Displays False
+ Console.WriteLine(date1 == date3); // Displays False
//
}
private static void ShowGreaterThan()
{
//
- DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
+ DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset date2 = new DateTimeOffset(2007, 6, 3, 15, 45, 0,
new TimeSpan(-6, 0, 0));
- DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
+ DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
new TimeSpan(-6, 0, 0));
Console.WriteLine(date1 > date2); // Displays False
- Console.WriteLine(date1 > date3); // Displays True
+ Console.WriteLine(date1 > date3); // Displays True
//
}
private static void ShowGreaterThanOrEqualTo()
{
//
- DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
+ DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset date2 = new DateTimeOffset(2007, 6, 3, 15, 45, 0,
new TimeSpan(-7, 0, 0));
- DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
+ DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
new TimeSpan(-6, 0, 0));
DateTimeOffset date4 = date1;
Console.WriteLine(date1 >= date2); // Displays False
- Console.WriteLine(date1 >= date3); // Displays True
- Console.WriteLine(date1 >= date4); // Displays True
+ Console.WriteLine(date1 >= date3); // Displays True
+ Console.WriteLine(date1 >= date4); // Displays True
//
}
private static void ShowImplicitConversions()
{
//
- DateTimeOffset timeWithOffset;
+ DateTimeOffset timeWithOffset;
timeWithOffset = new DateTime(2008, 7, 3, 18, 45, 0);
Console.WriteLine(timeWithOffset.ToString());
-
+
timeWithOffset = DateTime.UtcNow;
Console.WriteLine(timeWithOffset.ToString());
-
- timeWithOffset = DateTime.SpecifyKind(DateTime.Now,
+
+ timeWithOffset = DateTime.SpecifyKind(DateTime.Now,
DateTimeKind.Unspecified);
Console.WriteLine(timeWithOffset.ToString());
-
+
timeWithOffset = new DateTime(2008, 7, 1, 2, 30, 0) +
new TimeSpan(1, 0, 0, 0);
Console.WriteLine(timeWithOffset.ToString());
-
+
timeWithOffset = new DateTime(2008, 1, 1, 2, 30, 0);
Console.WriteLine(timeWithOffset.ToString());
- // The example produces the following output if run on 3/20/2007
+ // The example produces the following output if run on 3/20/2007
// at 6:25 PM on a computer in the U.S. Pacific Daylight Time zone:
// 7/3/2008 6:45:00 PM -07:00
// 3/21/2007 1:25:52 AM +00:00
@@ -105,7 +105,7 @@ private static void ShowImplicitConversions()
// 7/2/2008 2:30:00 AM -07:00
// 1/1/2008 2:30:00 AM -08:00
//
- // The last example shows automatic adaption to the U.S. Pacific Time
+ // The last example shows automatic adaption to the U.S. Pacific Time
// for winter dates.
//
}
@@ -113,86 +113,86 @@ private static void ShowImplicitConversions()
private static void ShowInequality()
{
//
- DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
+ DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset date2 = new DateTimeOffset(2007, 6, 3, 15, 45, 0,
new TimeSpan(-6, 0, 0));
- DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
+ DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
new TimeSpan(-6, 0, 0));
Console.WriteLine(date1 != date2); // Displays False
- Console.WriteLine(date1 != date3); // Displays True
+ Console.WriteLine(date1 != date3); // Displays True
//
}
private static void ShowLessThan()
{
//
- DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
+ DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset date2 = new DateTimeOffset(2007, 6, 3, 15, 45, 0,
new TimeSpan(-6, 0, 0));
- DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
+ DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
new TimeSpan(-8, 0, 0));
Console.WriteLine(date1 < date2); // Displays False
- Console.WriteLine(date1 < date3); // Displays True
+ Console.WriteLine(date1 < date3); // Displays True
//
}
private static void ShowLessThanOrEqualTo()
{
//
- DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
+ DateTimeOffset date1 = new DateTimeOffset(2007, 6, 3, 14, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset date2 = new DateTimeOffset(2007, 6, 3, 15, 45, 0,
new TimeSpan(-7, 0, 0));
- DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
+ DateTimeOffset date3 = new DateTimeOffset(date1.DateTime,
new TimeSpan(-6, 0, 0));
DateTimeOffset date4 = date1;
Console.WriteLine(date1 <= date2); // Displays True
- Console.WriteLine(date1 <= date3); // Displays False
- Console.WriteLine(date1 <= date4); // Displays True
+ Console.WriteLine(date1 <= date3); // Displays False
+ Console.WriteLine(date1 <= date4); // Displays True
//
}
private static void ShowSubtraction1()
{
//
- DateTimeOffset firstDate = new DateTimeOffset(2008, 3, 25, 18, 0, 0,
+ DateTimeOffset firstDate = new DateTimeOffset(2008, 3, 25, 18, 0, 0,
new TimeSpan(-7, 0, 0));
- DateTimeOffset secondDate = new DateTimeOffset(2008, 3, 25, 18, 0, 0,
+ DateTimeOffset secondDate = new DateTimeOffset(2008, 3, 25, 18, 0, 0,
new TimeSpan(-5, 0, 0));
- DateTimeOffset thirdDate = new DateTimeOffset(2008, 2, 28, 9, 0, 0,
+ DateTimeOffset thirdDate = new DateTimeOffset(2008, 2, 28, 9, 0, 0,
new TimeSpan(-7, 0, 0));
TimeSpan difference;
-
+
difference = firstDate - secondDate;
- Console.WriteLine("({0}) - ({1}): {2} days, {3}:{4:d2}",
- firstDate.ToString(),
- secondDate.ToString(),
- difference.Days,
- difference.Hours,
- difference.Minutes);
-
+ Console.WriteLine("({0}) - ({1}): {2} days, {3}:{4:d2}",
+ firstDate.ToString(),
+ secondDate.ToString(),
+ difference.Days,
+ difference.Hours,
+ difference.Minutes);
+
difference = firstDate - thirdDate;
- Console.WriteLine("({0}) - ({1}): {2} days, {3}:{4:d2}",
- firstDate.ToString(),
- secondDate.ToString(),
- difference.Days,
- difference.Hours,
- difference.Minutes);
+ Console.WriteLine("({0}) - ({1}): {2} days, {3}:{4:d2}",
+ firstDate.ToString(),
+ secondDate.ToString(),
+ difference.Days,
+ difference.Hours,
+ difference.Minutes);
// The example produces the following output:
// (3/25/2008 6:00:00 PM -07:00) - (3/25/2008 6:00:00 PM -05:00): 0 days, 2:00
- // (3/25/2008 6:00:00 PM -07:00) - (3/25/2008 6:00:00 PM -05:00): 26 days, 9:00
- //
+ // (3/25/2008 6:00:00 PM -07:00) - (3/25/2008 6:00:00 PM -05:00): 26 days, 9:00
+ //
}
private static void ShowSubtraction2()
{
- //
- DateTimeOffset offsetDate = new DateTimeOffset(2007, 12, 3, 11, 30, 0,
- new TimeSpan(-8, 0, 0));
+ //
+ DateTimeOffset offsetDate = new DateTimeOffset(2007, 12, 3, 11, 30, 0,
+ new TimeSpan(-8, 0, 0));
TimeSpan duration = new TimeSpan(7, 18, 0, 0);
Console.WriteLine(offsetDate - duration); // Displays 11/25/2007 5:30:00 PM -08:00
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Parse/cs/ParseExamples.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Parse/cs/ParseExamples.cs
index 9d321c91291..6f35bf445ee 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Parse/cs/ParseExamples.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Parse/cs/ParseExamples.cs
@@ -9,12 +9,12 @@ public static void Main()
ParseOverload2();
ParseOverload3();
}
-
+
private static void ParseOverload1()
{
//
string dateString;
- DateTimeOffset offsetDate;
+ DateTimeOffset offsetDate;
// String with date only
dateString = "05/01/2008";
@@ -26,7 +26,7 @@ private static void ParseOverload1()
offsetDate = DateTimeOffset.Parse(dateString);
Console.WriteLine(offsetDate.ToString());
- // String with date and offset
+ // String with date and offset
dateString = "05/01/2008 +1:00";
offsetDate = DateTimeOffset.Parse(dateString);
Console.WriteLine(offsetDate.ToString());
@@ -40,33 +40,33 @@ private static void ParseOverload1()
private static void ParseOverload2()
{
- //
+ //
DateTimeFormatInfo fmt = new CultureInfo("fr-fr").DateTimeFormat;
string dateString;
DateTimeOffset offsetDate;
-
+
dateString = "03-12-07";
offsetDate = DateTimeOffset.Parse(dateString, fmt);
- Console.WriteLine("{0} returns {1}",
- dateString,
+ Console.WriteLine("{0} returns {1}",
+ dateString,
offsetDate.ToString());
-
+
dateString = "15/09/07 08:45:00 +1:00";
offsetDate = DateTimeOffset.Parse(dateString, fmt);
- Console.WriteLine("{0} returns {1}",
- dateString,
+ Console.WriteLine("{0} returns {1}",
+ dateString,
offsetDate.ToString());
-
- dateString = "mar. 1 janvier 2008 1:00:00 +1:00";
+
+ dateString = "mar. 1 janvier 2008 1:00:00 +1:00";
offsetDate = DateTimeOffset.Parse(dateString, fmt);
- Console.WriteLine("{0} returns {1}",
- dateString,
+ Console.WriteLine("{0} returns {1}",
+ dateString,
offsetDate.ToString());
// The example displays the following output to the console:
// 03-12-07 returns 12/3/2007 12:00:00 AM -08:00
// 15/09/07 08:45:00 +1:00 returns 9/15/2007 8:45:00 AM +01:00
- // mar. 1 janvier 2008 1:00:00 +1:00 returns 1/1/2008 1:00:00 AM +01:00
- //
+ // mar. 1 janvier 2008 1:00:00 +1:00 returns 1/1/2008 1:00:00 AM +01:00
+ //
}
private static void ParseOverload3()
@@ -76,7 +76,7 @@ private static void ParseOverload3()
DateTimeOffset offsetDate;
dateString = "05/01/2008 6:00:00";
- // Assume time is local
+ // Assume time is local
offsetDate = DateTimeOffset.Parse(dateString, null, DateTimeStyles.AssumeLocal);
Console.WriteLine(offsetDate.ToString()); // Displays 5/1/2008 6:00:00 AM -07:00
@@ -84,7 +84,7 @@ private static void ParseOverload3()
offsetDate = DateTimeOffset.Parse(dateString, null, DateTimeStyles.AssumeUniversal);
Console.WriteLine(offsetDate.ToString()); // Displays 5/1/2008 6:00:00 AM +00:00
- // Parse and convert to UTC
+ // Parse and convert to UTC
dateString = "05/01/2008 6:00:00AM +5:00";
offsetDate = DateTimeOffset.Parse(dateString, null, DateTimeStyles.AdjustToUniversal);
Console.WriteLine(offsetDate.ToString()); // Displays 5/1/2008 1:00:00 AM +00:00
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ParseExact/cs/ParseExact.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ParseExact/cs/ParseExact.cs
index f75869af95a..8f6879ebacb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ParseExact/cs/ParseExact.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ParseExact/cs/ParseExact.cs
@@ -12,14 +12,14 @@ public static void Main()
Console.WriteLine();
ParseExact3();
}
-
+
private static void ParseExact1()
{
//
- string dateString, format;
+ string dateString, format;
DateTimeOffset result;
CultureInfo provider = CultureInfo.InvariantCulture;
-
+
// Parse date-only value with invariant culture.
dateString = "06/15/2008";
format = "d";
@@ -27,14 +27,14 @@ private static void ParseExact1()
{
result = DateTimeOffset.ParseExact(dateString, format, provider);
Console.WriteLine("{0} converts to {1}.", dateString, result.ToString());
- }
+ }
catch (FormatException)
{
Console.WriteLine("{0} is not in the correct format.", dateString);
- }
-
+ }
+
// Parse date-only value without leading zero in month using "d" format.
- // Should throw a FormatException because standard short date pattern of
+ // Should throw a FormatException because standard short date pattern of
// invariant culture requires two-digit month.
dateString = "6/15/2008";
try
@@ -45,7 +45,7 @@ private static void ParseExact1()
catch (FormatException)
{
Console.WriteLine("{0} is not in the correct format.", dateString);
- }
+ }
// Parse date and time with custom specifier.
dateString = "Sun 15 Jun 2008 8:30 AM -06:00";
@@ -58,10 +58,10 @@ private static void ParseExact1()
catch (FormatException)
{
Console.WriteLine("{0} is not in the correct format.", dateString);
- }
-
+ }
+
// Parse date and time with offset without offset//s minutes.
- // Should throw a FormatException because "zzz" specifier requires leading
+ // Should throw a FormatException because "zzz" specifier requires leading
// zero in hours.
dateString = "Sun 15 Jun 2008 8:30 AM -06";
try
@@ -72,71 +72,71 @@ private static void ParseExact1()
catch (FormatException)
{
Console.WriteLine("{0} is not in the correct format.", dateString);
- }
+ }
// The example displays the following output:
// 06/15/2008 converts to 6/15/2008 12:00:00 AM -07:00.
// 6/15/2008 is not in the correct format.
// Sun 15 Jun 2008 8:30 AM -06:00 converts to 6/15/2008 8:30:00 AM -06:00.
- // Sun 15 Jun 2008 8:30 AM -06 is not in the correct format.
- //
+ // Sun 15 Jun 2008 8:30 AM -06 is not in the correct format.
+ //
}
private static void ParseExact2()
{
//
- string dateString, format;
+ string dateString, format;
DateTimeOffset result;
CultureInfo provider = CultureInfo.InvariantCulture;
-
+
// Parse date-only value with invariant culture and assume time is UTC.
dateString = "06/15/2008";
format = "d";
try
{
- result = DateTimeOffset.ParseExact(dateString, format, provider,
+ result = DateTimeOffset.ParseExact(dateString, format, provider,
DateTimeStyles.AssumeUniversal);
Console.WriteLine("'{0}' converts to {1}.", dateString, result.ToString());
}
catch (FormatException)
{
Console.WriteLine("'{0}' is not in the correct format.", dateString);
- }
-
+ }
+
// Parse date-only value with leading white space.
- // Should throw a FormatException because only trailing white space is
+ // Should throw a FormatException because only trailing white space is
// specified in method call.
dateString = " 06/15/2008";
try
{
- result = DateTimeOffset.ParseExact(dateString, format, provider,
+ result = DateTimeOffset.ParseExact(dateString, format, provider,
DateTimeStyles.AllowTrailingWhite);
Console.WriteLine("'{0}' converts to {1}.", dateString, result.ToString());
- }
+ }
catch (FormatException)
{
Console.WriteLine("'{0}' is not in the correct format.", dateString);
- }
+ }
// Parse date and time value, and allow all white space.
dateString = " 06/15/ 2008 15:15 -05:00";
format = "MM/dd/yyyy H:mm zzz";
try
{
- result = DateTimeOffset.ParseExact(dateString, format, provider,
+ result = DateTimeOffset.ParseExact(dateString, format, provider,
DateTimeStyles.AllowWhiteSpaces);
Console.WriteLine("'{0}' converts to {1}.", dateString, result.ToString());
- }
+ }
catch (FormatException)
{
Console.WriteLine("'{0}' is not in the correct format.", dateString);
- }
-
+ }
+
// Parse date and time and convert to UTC.
dateString = " 06/15/2008 15:15:30 -05:00";
- format = "MM/dd/yyyy H:mm:ss zzz";
+ format = "MM/dd/yyyy H:mm:ss zzz";
try
{
- result = DateTimeOffset.ParseExact(dateString, format, provider,
+ result = DateTimeOffset.ParseExact(dateString, format, provider,
DateTimeStyles.AllowWhiteSpaces |
DateTimeStyles.AdjustToUniversal);
Console.WriteLine("'{0}' converts to {1}.", dateString, result.ToString());
@@ -144,14 +144,14 @@ private static void ParseExact2()
catch (FormatException)
{
Console.WriteLine("'{0}' is not in the correct format.", dateString);
- }
+ }
// The example displays the following output:
// '06/15/2008' converts to 6/15/2008 12:00:00 AM +00:00.
// ' 06/15/2008' is not in the correct format.
// ' 06/15/ 2008 15:15 -05:00' converts to 6/15/2008 3:15:00 PM -05:00.
// ' 06/15/2008 15:15:30 -05:00' converts to 6/15/2008 8:15:30 PM +00:00.
//
- }
+ }
private static void ParseExact3()
{
@@ -160,61 +160,61 @@ private static void ParseExact3()
TextWriter conOut = Console.Out;
int tries = 0;
string input = String.Empty;
- string[] formats = new string[] {@"@M/dd/yyyy HH:m zzz", @"MM/dd/yyyy HH:m zzz",
- @"M/d/yyyy HH:m zzz", @"MM/d/yyyy HH:m zzz",
- @"M/dd/yy HH:m zzz", @"MM/dd/yy HH:m zzz",
- @"M/d/yy HH:m zzz", @"MM/d/yy HH:m zzz",
- @"M/dd/yyyy H:m zzz", @"MM/dd/yyyy H:m zzz",
- @"M/d/yyyy H:m zzz", @"MM/d/yyyy H:m zzz",
- @"M/dd/yy H:m zzz", @"MM/dd/yy H:m zzz",
- @"M/d/yy H:m zzz", @"MM/d/yy H:m zzz",
- @"M/dd/yyyy HH:mm zzz", @"MM/dd/yyyy HH:mm zzz",
- @"M/d/yyyy HH:mm zzz", @"MM/d/yyyy HH:mm zzz",
- @"M/dd/yy HH:mm zzz", @"MM/dd/yy HH:mm zzz",
- @"M/d/yy HH:mm zzz", @"MM/d/yy HH:mm zzz",
- @"M/dd/yyyy H:mm zzz", @"MM/dd/yyyy H:mm zzz",
- @"M/d/yyyy H:mm zzz", @"MM/d/yyyy H:mm zzz",
- @"M/dd/yy H:mm zzz", @"MM/dd/yy H:mm zzz",
+ string[] formats = new string[] {@"@M/dd/yyyy HH:m zzz", @"MM/dd/yyyy HH:m zzz",
+ @"M/d/yyyy HH:m zzz", @"MM/d/yyyy HH:m zzz",
+ @"M/dd/yy HH:m zzz", @"MM/dd/yy HH:m zzz",
+ @"M/d/yy HH:m zzz", @"MM/d/yy HH:m zzz",
+ @"M/dd/yyyy H:m zzz", @"MM/dd/yyyy H:m zzz",
+ @"M/d/yyyy H:m zzz", @"MM/d/yyyy H:m zzz",
+ @"M/dd/yy H:m zzz", @"MM/dd/yy H:m zzz",
+ @"M/d/yy H:m zzz", @"MM/d/yy H:m zzz",
+ @"M/dd/yyyy HH:mm zzz", @"MM/dd/yyyy HH:mm zzz",
+ @"M/d/yyyy HH:mm zzz", @"MM/d/yyyy HH:mm zzz",
+ @"M/dd/yy HH:mm zzz", @"MM/dd/yy HH:mm zzz",
+ @"M/d/yy HH:mm zzz", @"MM/d/yy HH:mm zzz",
+ @"M/dd/yyyy H:mm zzz", @"MM/dd/yyyy H:mm zzz",
+ @"M/d/yyyy H:mm zzz", @"MM/d/yyyy H:mm zzz",
+ @"M/dd/yy H:mm zzz", @"MM/dd/yy H:mm zzz",
@"M/d/yy H:mm zzz", @"MM/d/yy H:mm zzz"};
IFormatProvider provider = CultureInfo.InvariantCulture.DateTimeFormat;
DateTimeOffset result = new DateTimeOffset();
-
- do {
+
+ do {
conOut.WriteLine("Enter a date, time, and offset (MM/DD/YYYY HH:MM +/-HH:MM),");
conOut.Write("Then press Enter: ");
input = conIn.ReadLine();
conOut.WriteLine();
try
{
- result = DateTimeOffset.ParseExact(input, formats, provider,
+ result = DateTimeOffset.ParseExact(input, formats, provider,
DateTimeStyles.AllowWhiteSpaces);
break;
}
catch (FormatException)
{
- Console.WriteLine("Unable to parse {0}.", input);
+ Console.WriteLine("Unable to parse {0}.", input);
tries++;
}
} while (tries < 3);
if (tries >= 3)
Console.WriteLine("Exiting application without parsing {0}", input);
else
- Console.WriteLine("{0} was converted to {1}", input, result.ToString());
+ Console.WriteLine("{0} was converted to {1}", input, result.ToString());
// Some successful sample interactions with the user might appear as follows:
// Enter a date, time, and offset (MM/DD/YYYY HH:MM +/-HH:MM),
// Then press Enter: 12/08/2007 6:54 -6:00
- //
- // 12/08/2007 6:54 -6:00 was converted to 12/8/2007 6:54:00 AM -06:00
- //
+ //
+ // 12/08/2007 6:54 -6:00 was converted to 12/8/2007 6:54:00 AM -06:00
+ //
// Enter a date, time, and offset (MM/DD/YYYY HH:MM +/-HH:MM),
// Then press Enter: 12/8/2007 06:54 -06:00
- //
+ //
// 12/8/2007 06:54 -06:00 was converted to 12/8/2007 6:54:00 AM -06:00
- //
+ //
// Enter a date, time, and offset (MM/DD/YYYY HH:MM +/-HH:MM),
// Then press Enter: 12/5/07 6:54 -6:00
- //
- // 12/5/07 6:54 -6:00 was converted to 12/5/2007 6:54:00 AM -06:00
- //
+ //
+ // 12/5/07 6:54 -6:00 was converted to 12/5/2007 6:54:00 AM -06:00
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs
index 9dbfc8e3ecb..2a9c8e90430 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/cs/Properties.cs
@@ -5,40 +5,40 @@ public class Class1
{
public static void Main()
{
- ShowDateFormats();
- Console.WriteLine("----------");
+ ShowDateFormats();
+ Console.WriteLine("----------");
ConvertToDateTime();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowFirstOfMonth();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowHour();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ConvertToLocalTime();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowMinute();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowMonth();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowDay();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowResolution();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowMilliseconds();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowLocalOffset();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowSeconds();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
IllustrateTicks();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowTime();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ConvertToUtc();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
CompareUtcAndLocal();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
ShowYear();
- Console.WriteLine("----------");
+ Console.WriteLine("----------");
}
private static void ShowDateFormats()
@@ -52,28 +52,28 @@ private static void ShowDateFormats()
// For en-us culture, displays:
// 'D' format specifier: Monday, March 17, 2008
fmt = "D";
- Console.WriteLine("'{0}' format specifier: {1}",
+ Console.WriteLine("'{0}' format specifier: {1}",
fmt, thisDate.Date.ToString(fmt));
-
+
// Display date only using "d" format specifier
// For en-us culture, displays:
// 'd' format specifier: 3/17/2008
fmt = "d";
- Console.WriteLine("'{0}' format specifier: {1}",
+ Console.WriteLine("'{0}' format specifier: {1}",
fmt, thisDate.Date.ToString(fmt));
-
+
// Display date only using "Y" (or "y") format specifier
// For en-us culture, displays:
// 'Y' format specifier: March, 2008
fmt = "Y";
- Console.WriteLine("'{0}' format specifier: {1}",
+ Console.WriteLine("'{0}' format specifier: {1}",
fmt, thisDate.Date.ToString(fmt));
-
+
// Display date only using custom format specifier
// For en-us culture, displays:
// 'dd MMM yyyy' format specifier: 17 Mar 2008
fmt = "dd MMM yyyy";
- Console.WriteLine("'{0}' format specifier: {1}",
+ Console.WriteLine("'{0}' format specifier: {1}",
fmt, thisDate.Date.ToString(fmt));
//
}
@@ -81,36 +81,36 @@ private static void ShowDateFormats()
private static void ConvertToDateTime()
{
//
- DateTimeOffset offsetDate;
+ DateTimeOffset offsetDate;
DateTime regularDate;
-
+
offsetDate = DateTimeOffset.Now;
regularDate = offsetDate.DateTime;
- Console.WriteLine("{0} converts to {1}, Kind {2}.",
- offsetDate.ToString(),
- regularDate,
+ Console.WriteLine("{0} converts to {1}, Kind {2}.",
+ offsetDate.ToString(),
+ regularDate,
regularDate.Kind);
-
+
offsetDate = DateTimeOffset.UtcNow;
regularDate = offsetDate.DateTime;
- Console.WriteLine("{0} converts to {1}, Kind {2}.",
- offsetDate.ToString(),
- regularDate,
+ Console.WriteLine("{0} converts to {1}, Kind {2}.",
+ offsetDate.ToString(),
+ regularDate,
regularDate.Kind);
// If run on 3/6/2007 at 17:11, produces the following output:
//
// 3/6/2007 5:11:22 PM -08:00 converts to 3/6/2007 5:11:22 PM, Kind Unspecified.
- // 3/7/2007 1:11:22 AM +00:00 converts to 3/7/2007 1:11:22 AM, Kind Unspecified.
- //
+ // 3/7/2007 1:11:22 AM +00:00 converts to 3/7/2007 1:11:22 AM, Kind Unspecified.
+ //
}
private static void ShowFirstOfMonth()
{
//
- DateTimeOffset startOfMonth = new DateTimeOffset(2008, 1, 1, 0, 0, 0,
+ DateTimeOffset startOfMonth = new DateTimeOffset(2008, 1, 1, 0, 0, 0,
DateTimeOffset.Now.Offset);
int year = startOfMonth.Year;
- do
+ do
{
Console.WriteLine("{0:MMM d, yyyy} is a {1}.", startOfMonth, startOfMonth.DayOfWeek);
startOfMonth = startOfMonth.AddMonths(1);
@@ -128,44 +128,44 @@ private static void ShowFirstOfMonth()
// Sep 1, 2008 is a Monday.
// Oct 1, 2008 is a Wednesday.
// Nov 1, 2008 is a Saturday.
- // Dec 1, 2008 is a Monday.
- //
+ // Dec 1, 2008 is a Monday.
+ //
//
- DateTimeOffset displayDate = new DateTimeOffset(2008, 1, 1, 13, 18, 00,
+ DateTimeOffset displayDate = new DateTimeOffset(2008, 1, 1, 13, 18, 00,
DateTimeOffset.Now.Offset);
- Console.WriteLine("{0:D}", displayDate); // Output: Tuesday, January 01, 2008
- Console.WriteLine("{0:d} is a {0:dddd}.",
+ Console.WriteLine("{0:D}", displayDate); // Output: Tuesday, January 01, 2008
+ Console.WriteLine("{0:d} is a {0:dddd}.",
displayDate); // Output: 1/1/2008 is a Tuesday.
//
-
+
//
- DateTimeOffset thisDate = new DateTimeOffset(2007, 6, 1, 6, 15, 0,
+ DateTimeOffset thisDate = new DateTimeOffset(2007, 6, 1, 6, 15, 0,
DateTimeOffset.Now.Offset);
- string weekdayName = thisDate.ToString("dddd",
- new CultureInfo("fr-fr"));
- Console.WriteLine(weekdayName); // Displays vendredi
- //
+ string weekdayName = thisDate.ToString("dddd",
+ new CultureInfo("fr-fr"));
+ Console.WriteLine(weekdayName); // Displays vendredi
+ //
}
private static void ShowHour()
{
//
- DateTimeOffset theTime = new DateTimeOffset(2008, 3, 1, 14, 15, 00,
+ DateTimeOffset theTime = new DateTimeOffset(2008, 3, 1, 14, 15, 00,
DateTimeOffset.Now.Offset);
- Console.WriteLine("The hour component of {0} is {1}.",
+ Console.WriteLine("The hour component of {0} is {1}.",
theTime, theTime.Hour);
- Console.WriteLine("The hour component of {0} is{1}.",
+ Console.WriteLine("The hour component of {0} is{1}.",
theTime, theTime.ToString(" H"));
- Console.WriteLine("The hour component of {0} is {1}.",
+ Console.WriteLine("The hour component of {0} is {1}.",
theTime, theTime.ToString("HH"));
// The example produces the following output:
// The hour component of 3/1/2008 2:15:00 PM -08:00 is 14.
// The hour component of 3/1/2008 2:15:00 PM -08:00 is 14.
// The hour component of 3/1/2008 2:15:00 PM -08:00 is 14.
- //
+ //
}
private static void ConvertToLocalTime()
@@ -181,7 +181,7 @@ private static void ConvertToLocalTime()
Console.WriteLine(dto.LocalDateTime);
// Transition to DST in local time zone occurs on 3/11/2007 at 2:00 AM
- dto = new DateTimeOffset(2007, 3, 11, 3, 30, 0, new TimeSpan(-7, 0, 0));
+ dto = new DateTimeOffset(2007, 3, 11, 3, 30, 0, new TimeSpan(-7, 0, 0));
Console.WriteLine(dto.LocalDateTime);
dto = new DateTimeOffset(2007, 3, 11, 2, 30, 0, new TimeSpan(-7, 0, 0));
Console.WriteLine(dto.LocalDateTime);
@@ -195,11 +195,11 @@ private static void ConvertToLocalTime()
dto = new DateTimeOffset(2007, 11, 4, 1, 30, 0, new TimeSpan(-7, 0, 0));
Console.WriteLine(TimeZoneInfo.Local.IsAmbiguousTime(dto));
Console.WriteLine(dto.LocalDateTime);
- dto = new DateTimeOffset(2007, 11, 4, 2, 30, 0, new TimeSpan(-7, 0, 0));
+ dto = new DateTimeOffset(2007, 11, 4, 2, 30, 0, new TimeSpan(-7, 0, 0));
Console.WriteLine(TimeZoneInfo.Local.IsAmbiguousTime(dto));
Console.WriteLine(dto.LocalDateTime);
// This is also an ambiguous time
- dto = new DateTimeOffset(2007, 11, 4, 1, 30, 0, new TimeSpan(-8, 0, 0));
+ dto = new DateTimeOffset(2007, 11, 4, 1, 30, 0, new TimeSpan(-8, 0, 0));
Console.WriteLine(TimeZoneInfo.Local.IsAmbiguousTime(dto));
Console.WriteLine(dto.LocalDateTime);
// If run on 3/8/2007 at 4:56 PM, the code produces the following
@@ -214,68 +214,68 @@ private static void ConvertToLocalTime()
// 11/4/2007 1:30:00 AM
// 11/4/2007 1:30:00 AM
// True
- // 11/4/2007 1:30:00 AM
+ // 11/4/2007 1:30:00 AM
//
}
-
+
private static void ShowMinute()
{
//
- DateTimeOffset theTime = new DateTimeOffset(2008, 5, 1, 10, 3, 0,
+ DateTimeOffset theTime = new DateTimeOffset(2008, 5, 1, 10, 3, 0,
DateTimeOffset.Now.Offset);
- Console.WriteLine("The minute component of {0} is {1}.",
+ Console.WriteLine("The minute component of {0} is {1}.",
theTime, theTime.Minute);
- Console.WriteLine("The minute component of {0} is{1}.",
+ Console.WriteLine("The minute component of {0} is{1}.",
theTime, theTime.ToString(" m"));
- Console.WriteLine("The minute component of {0} is {1}.",
+ Console.WriteLine("The minute component of {0} is {1}.",
theTime, theTime.ToString("mm"));
// The example produces the following output:
// The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
// The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
// The minute component of 5/1/2008 10:03:00 AM -08:00 is 03.
- //
+ //
}
private static void ShowMonth()
{
//
- DateTimeOffset theTime = new DateTimeOffset(2008, 9, 7, 11, 25, 0,
+ DateTimeOffset theTime = new DateTimeOffset(2008, 9, 7, 11, 25, 0,
DateTimeOffset.Now.Offset);
- Console.WriteLine("The month component of {0} is {1}.",
+ Console.WriteLine("The month component of {0} is {1}.",
theTime, theTime.Month);
- Console.WriteLine("The month component of {0} is{1}.",
+ Console.WriteLine("The month component of {0} is{1}.",
theTime, theTime.ToString(" M"));
- Console.WriteLine("The month component of {0} is {1}.",
+ Console.WriteLine("The month component of {0} is {1}.",
theTime, theTime.ToString("MM"));
// The example produces the following output:
// The month component of 9/7/2008 11:25:00 AM -08:00 is 9.
// The month component of 9/7/2008 11:25:00 AM -08:00 is 9.
- // The month component of 9/7/2008 11:25:00 AM -08:00 is 09.
- //
+ // The month component of 9/7/2008 11:25:00 AM -08:00 is 09.
+ //
}
private static void ShowDay()
{
//
- DateTimeOffset theTime = new DateTimeOffset(2007, 5, 1, 16, 35, 0,
+ DateTimeOffset theTime = new DateTimeOffset(2007, 5, 1, 16, 35, 0,
DateTimeOffset.Now.Offset);
- Console.WriteLine("The day component of {0} is {1}.",
+ Console.WriteLine("The day component of {0} is {1}.",
theTime, theTime.Day);
- Console.WriteLine("The day component of {0} is{1}.",
+ Console.WriteLine("The day component of {0} is{1}.",
theTime, theTime.ToString(" d"));
- Console.WriteLine("The day component of {0} is {1}.",
+ Console.WriteLine("The day component of {0} is {1}.",
theTime, theTime.ToString("dd"));
// The example produces the following output:
// The day component of 5/1/2007 4:35:00 PM -08:00 is 1.
// The day component of 5/1/2007 4:35:00 PM -08:00 is 1.
// The day component of 5/1/2007 4:35:00 PM -08:00 is 01.
- //
+ //
}
private static void ShowResolution()
@@ -289,122 +289,122 @@ private static void ShowResolution()
if (dto.Millisecond != ms)
{
ms = dto.Millisecond;
- Console.WriteLine("{0}:{1:d3} ms. {2}",
- dto.ToString("M/d/yyyy h:mm:ss"),
+ Console.WriteLine("{0}:{1:d3} ms. {2}",
+ dto.ToString("M/d/yyyy h:mm:ss"),
ms, dto.ToString("zzz"));
ctr++;
}
} while (ctr < 100);
//
- }
+ }
private static void ShowMilliseconds()
{
//
- DateTimeOffset date1 = new DateTimeOffset(2008, 3, 5, 5, 45, 35, 649,
+ DateTimeOffset date1 = new DateTimeOffset(2008, 3, 5, 5, 45, 35, 649,
new TimeSpan(-7, 0, 0));
- Console.WriteLine("Milliseconds value of {0} is {1}.",
- date1.ToString("MM/dd/yyyy hh:mm:ss.fff"),
+ Console.WriteLine("Milliseconds value of {0} is {1}.",
+ date1.ToString("MM/dd/yyyy hh:mm:ss.fff"),
date1.Millisecond);
// The example produces the following output:
//
// Milliseconds value of 03/05/2008 05:45:35.649 is 649.
- //
+ //
}
private static void ShowLocalOffset()
{
//
DateTimeOffset localTime = DateTimeOffset.Now;
- Console.WriteLine("The local time zone is {0} hours and {1} minutes {2} than UTC.",
- Math.Abs(localTime.Offset.Hours),
- localTime.Offset.Minutes,
+ Console.WriteLine("The local time zone is {0} hours and {1} minutes {2} than UTC.",
+ Math.Abs(localTime.Offset.Hours),
+ localTime.Offset.Minutes,
localTime.Offset.Hours < 0 ? "earlier" : "later");
// The example displays output similar to the following for a system in the
- // U.S. Pacific Standard Time zone:
- // The local time zone is 8 hours and 0 minutes earlier than UTC.
+ // U.S. Pacific Standard Time zone:
+ // The local time zone is 8 hours and 0 minutes earlier than UTC.
//
}
private static void ShowSeconds()
{
//
- DateTimeOffset theTime = new DateTimeOffset(2008, 6, 12, 21, 16, 32,
+ DateTimeOffset theTime = new DateTimeOffset(2008, 6, 12, 21, 16, 32,
DateTimeOffset.Now.Offset);
- Console.WriteLine("The second component of {0} is {1}.",
+ Console.WriteLine("The second component of {0} is {1}.",
theTime, theTime.Second);
- Console.WriteLine("The second component of {0} is{1}.",
+ Console.WriteLine("The second component of {0} is{1}.",
theTime, theTime.ToString(" s"));
- Console.WriteLine("The second component of {0} is {1}.",
+ Console.WriteLine("The second component of {0} is {1}.",
theTime, theTime.ToString("ss"));
// The example produces the following output:
// The second component of 6/12/2008 9:16:32 PM -07:00 is 32.
// The second component of 6/12/2008 9:16:32 PM -07:00 is 32.
// The second component of 6/12/2008 9:16:32 PM -07:00 is 32.
- //
+ //
}
private static void IllustrateTicks()
{
//
// Attempt to initialize date to number of ticks
- // in July 1, 2008 1:23:07.
+ // in July 1, 2008 1:23:07.
//
// There are 10,000,000 100-nanosecond intervals in a second
const long NSPerSecond = 10000000;
- long ticks;
- ticks = 7 * NSPerSecond; // Ticks in a 7 seconds
+ long ticks;
+ ticks = 7 * NSPerSecond; // Ticks in a 7 seconds
ticks += 23 * 60 * NSPerSecond; // Ticks in 23 minutes
ticks += 1 * 60 * 60 * NSPerSecond; // Ticks in 1 hour
ticks += 60 * 60 * 24 * NSPerSecond; // Ticks in 1 day
- ticks += 181 * 60 * 60 * 24 * NSPerSecond; // Ticks in 6 months
- ticks += 2007 * 60 * 60 * 24 * 365L * NSPerSecond; // Ticks in 2007 years
- ticks += 486 * 60 * 60 * 24 * NSPerSecond; // Adjustment for leap years
- DateTimeOffset dto = new DateTimeOffset(
- ticks,
+ ticks += 181 * 60 * 60 * 24 * NSPerSecond; // Ticks in 6 months
+ ticks += 2007 * 60 * 60 * 24 * 365L * NSPerSecond; // Ticks in 2007 years
+ ticks += 486 * 60 * 60 * 24 * NSPerSecond; // Adjustment for leap years
+ DateTimeOffset dto = new DateTimeOffset(
+ ticks,
DateTimeOffset.Now.Offset);
- Console.WriteLine("There are {0:n0} ticks in {1}.",
- dto.Ticks,
+ Console.WriteLine("There are {0:n0} ticks in {1}.",
+ dto.Ticks,
dto.ToString());
// The example displays the following output:
- // There are 633,504,721,870,000,000 ticks in 7/1/2008 1:23:07 AM -08:00.
+ // There are 633,504,721,870,000,000 ticks in 7/1/2008 1:23:07 AM -08:00.
//
}
private static void ShowTime()
{
//
- DateTimeOffset currentDate = new DateTimeOffset(2008, 5, 10, 5, 32, 16,
- DateTimeOffset.Now.Offset);
+ DateTimeOffset currentDate = new DateTimeOffset(2008, 5, 10, 5, 32, 16,
+ DateTimeOffset.Now.Offset);
TimeSpan currentTime = currentDate.TimeOfDay;
Console.WriteLine("The current time is {0}.", currentTime.ToString());
- // The example produces the following output:
+ // The example produces the following output:
// The current time is 05:32:16.
//
- }
+ }
private static void ConvertToUtc()
{
//
- DateTimeOffset offsetTime = new DateTimeOffset(2007, 11, 25, 11, 14, 00,
+ DateTimeOffset offsetTime = new DateTimeOffset(2007, 11, 25, 11, 14, 00,
new TimeSpan(3, 0, 0));
- Console.WriteLine("{0} is equivalent to {1} {2}",
- offsetTime.ToString(),
- offsetTime.UtcDateTime.ToString(),
- offsetTime.UtcDateTime.Kind.ToString());
+ Console.WriteLine("{0} is equivalent to {1} {2}",
+ offsetTime.ToString(),
+ offsetTime.UtcDateTime.ToString(),
+ offsetTime.UtcDateTime.Kind.ToString());
// The example displays the following output:
- // 11/25/2007 11:14:00 AM +03:00 is equivalent to 11/25/2007 8:14:00 AM Utc
+ // 11/25/2007 11:14:00 AM +03:00 is equivalent to 11/25/2007 8:14:00 AM Utc
//
}
private static void CompareUtcAndLocal()
{
- //
+ //
DateTimeOffset localTime = DateTimeOffset.Now;
DateTimeOffset utcTime = DateTimeOffset.UtcNow;
-
+
Console.WriteLine("Local Time: {0}", localTime.ToString("T"));
Console.WriteLine("Difference from UTC: {0}", localTime.Offset.ToString());
Console.WriteLine("UTC: {0}", utcTime.ToString("T"));
@@ -412,31 +412,31 @@ private static void CompareUtcAndLocal()
// the following output:
// Local Time: 1:19:43 PM
// Difference from UTC: -07:00:00
- // UTC: 8:19:43 PM
+ // UTC: 8:19:43 PM
//
- }
-
+ }
+
private static void ShowYear()
{
//
- DateTimeOffset theTime = new DateTimeOffset(2008, 2, 17, 9, 0, 0,
+ DateTimeOffset theTime = new DateTimeOffset(2008, 2, 17, 9, 0, 0,
DateTimeOffset.Now.Offset);
- Console.WriteLine("The year component of {0} is {1}.",
+ Console.WriteLine("The year component of {0} is {1}.",
theTime, theTime.Year);
- Console.WriteLine("The year component of {0} is{1}.",
+ Console.WriteLine("The year component of {0} is{1}.",
theTime, theTime.ToString(" y"));
- Console.WriteLine("The year component of {0} is {1}.",
+ Console.WriteLine("The year component of {0} is {1}.",
theTime, theTime.ToString("yy"));
-
- Console.WriteLine("The year component of {0} is {1}.",
+
+ Console.WriteLine("The year component of {0} is {1}.",
theTime, theTime.ToString("yyyy"));
// The example produces the following output:
// The year component of 2/17/2008 9:00:00 AM -07:00 is 2008.
// The year component of 2/17/2008 9:00:00 AM -07:00 is 8.
// The year component of 2/17/2008 9:00:00 AM -07:00 is 08.
// The year component of 2/17/2008 9:00:00 AM -07:00 is 2008.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs
index d927d33d67e..f9dcff6c0c9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/cs/Syntax.cs
@@ -1,9 +1,9 @@
using System;
-public class Class1
+public class Class1
{
- private static DateTimeOffset dto;
-
+ private static DateTimeOffset dto;
+
public Class1()
{
dto = DateTimeOffset.Now;
@@ -18,9 +18,9 @@ public static void Main()
{
int retVal;
DateTime now = DateTime.Now;
- retVal = Comparison(now,
+ retVal = Comparison(now,
new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, new TimeSpan(-4, 0, 0)));
- Class1 thisInst = new Class1();
+ Class1 thisInst = new Class1();
Console.WriteLine(retVal);
Console.WriteLine(thisInst.Equality(DateTimeOffset.Now));
Console.WriteLine(thisInst.Equality2(dto));
@@ -35,18 +35,18 @@ private static int Comparison(DateTimeOffset first, DateTimeOffset second)
//
}
- private bool Equality(DateTimeOffset other)
+ private bool Equality(DateTimeOffset other)
{
//
return this.UtcDateTime == other.UtcDateTime;
//
}
-
+
private bool Equality2(object obj)
{
//
return this.UtcDateTime == ((DateTimeOffset) obj).UtcDateTime;
- //
+ //
}
private bool Equality3()
@@ -55,7 +55,7 @@ private bool Equality3()
DateTimeOffset second = DateTimeOffset.Now;
//
return first.UtcDateTime == second.UtcDateTime;
- //
+ //
}
private bool GreaterThan()
@@ -64,18 +64,18 @@ private bool GreaterThan()
DateTimeOffset left = DateTimeOffset.Now;
//
return left.UtcDateTime > right.UtcDateTime;
- //
+ //
//
return left.UtcDateTime >= right.UtcDateTime;
- //
+ //
//
return left.UtcDateTime != right.UtcDateTime;
- //
+ //
//
return left.UtcDateTime < right.UtcDateTime;
- //
+ //
//
return left.UtcDateTime <= right.UtcDateTime;
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ToOffset/cs/ToOffset.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ToOffset/cs/ToOffset.cs
index 1450c71767d..2477c298308 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ToOffset/cs/ToOffset.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ToOffset/cs/ToOffset.cs
@@ -3,26 +3,26 @@
public class DateTimeOffsetConversion
{
- private static DateTimeOffset sourceTime;
-
+ private static DateTimeOffset sourceTime;
+
public static void Main()
{
DateTimeOffset targetTime;
- sourceTime = new DateTimeOffset(2007, 9, 1, 9, 30, 0,
+ sourceTime = new DateTimeOffset(2007, 9, 1, 9, 30, 0,
new TimeSpan(-5, 0, 0));
-
+
// Convert to same time (return sourceTime unchanged)
targetTime = sourceTime.ToOffset(new TimeSpan(-5, 0, 0));
ShowDateAndTimeInfo(targetTime);
-
+
// Convert to UTC (0 offset)
targetTime = sourceTime.ToOffset(TimeSpan.Zero);
ShowDateAndTimeInfo(targetTime);
-
+
// Convert to 8 hours behind UTC
targetTime = sourceTime.ToOffset(new TimeSpan(-8, 0, 0));
ShowDateAndTimeInfo(targetTime);
-
+
// Convert to 3 hours ahead of UTC
targetTime = sourceTime.ToOffset(new TimeSpan(3, 0, 0));
ShowDateAndTimeInfo(targetTime);
@@ -31,11 +31,11 @@ public static void Main()
private static void ShowDateAndTimeInfo(DateTimeOffset newTime)
{
Console.WriteLine("{0} converts to {1}", sourceTime, newTime);
- Console.WriteLine("{0} and {1} are equal: {2}",
+ Console.WriteLine("{0} and {1} are equal: {2}",
sourceTime, newTime, sourceTime.Equals(newTime));
- Console.WriteLine("{0} and {1} are identical: {2}",
- sourceTime, newTime,
- sourceTime.EqualsExact(newTime));
+ Console.WriteLine("{0} and {1} are identical: {2}",
+ sourceTime, newTime,
+ sourceTime.EqualsExact(newTime));
Console.WriteLine();
}
}
@@ -44,15 +44,15 @@ private static void ShowDateAndTimeInfo(DateTimeOffset newTime)
// 9/1/2007 9:30:00 AM -05:00 converts to 9/1/2007 9:30:00 AM -05:00
// 9/1/2007 9:30:00 AM -05:00 and 9/1/2007 9:30:00 AM -05:00 are equal: True
// 9/1/2007 9:30:00 AM -05:00 and 9/1/2007 9:30:00 AM -05:00 are identical: True
-//
+//
// 9/1/2007 9:30:00 AM -05:00 converts to 9/1/2007 2:30:00 PM +00:00
// 9/1/2007 9:30:00 AM -05:00 and 9/1/2007 2:30:00 PM +00:00 are equal: True
// 9/1/2007 9:30:00 AM -05:00 and 9/1/2007 2:30:00 PM +00:00 are identical: False
-//
+//
// 9/1/2007 9:30:00 AM -05:00 converts to 9/1/2007 6:30:00 AM -08:00
// 9/1/2007 9:30:00 AM -05:00 and 9/1/2007 6:30:00 AM -08:00 are equal: True
// 9/1/2007 9:30:00 AM -05:00 and 9/1/2007 6:30:00 AM -08:00 are identical: False
-//
+//
// 9/1/2007 9:30:00 AM -05:00 converts to 9/1/2007 5:30:00 PM +03:00
// 9/1/2007 9:30:00 AM -05:00 and 9/1/2007 5:30:00 PM +03:00 are equal: True
// 9/1/2007 9:30:00 AM -05:00 and 9/1/2007 5:30:00 PM +03:00 are identical: False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ToString/cs/ToString.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ToString/cs/ToString.cs
index fe6b0e2181e..5e4bc40baf0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ToString/cs/ToString.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.ToString/cs/ToString.cs
@@ -18,15 +18,15 @@ private static void ToString1()
{
//
DateTimeOffset thisDate;
-
+
// Show output for UTC time
thisDate = DateTimeOffset.UtcNow;
Console.WriteLine(thisDate.ToString()); // Displays 3/28/2007 7:13:50 PM +00:00
-
- // Show output for local time
+
+ // Show output for local time
thisDate = DateTimeOffset.Now;
Console.WriteLine(thisDate.ToString()); // Displays 3/28/2007 12:13:50 PM -07:00
-
+
// Show output for arbitrary time offset
thisDate = thisDate.ToOffset(new TimeSpan(-5, 0, 0));
Console.WriteLine(thisDate.ToString()); // Displays 3/28/2007 2:13:50 PM -05:00
@@ -36,26 +36,26 @@ private static void ToString1()
private static void ToString2()
{
//
- CultureInfo[] cultures = new CultureInfo[] {CultureInfo.InvariantCulture,
- new CultureInfo("en-us"),
- new CultureInfo("fr-fr"),
- new CultureInfo("de-DE"),
+ CultureInfo[] cultures = new CultureInfo[] {CultureInfo.InvariantCulture,
+ new CultureInfo("en-us"),
+ new CultureInfo("fr-fr"),
+ new CultureInfo("de-DE"),
new CultureInfo("es-ES")};
- DateTimeOffset thisDate = new DateTimeOffset(2007, 5, 1, 9, 0, 0,
- TimeSpan.Zero);
-
+ DateTimeOffset thisDate = new DateTimeOffset(2007, 5, 1, 9, 0, 0,
+ TimeSpan.Zero);
+
foreach (CultureInfo culture in cultures)
{
- string cultureName;
+ string cultureName;
if (string.IsNullOrEmpty(culture.Name))
cultureName = culture.NativeName;
else
cultureName = culture.Name;
- Console.WriteLine("In {0}, {1}",
+ Console.WriteLine("In {0}, {1}",
cultureName, thisDate.ToString(culture));
- }
+ }
// The example produces the following output:
// In Invariant Language (Invariant Country), 05/01/2007 09:00:00 +00:00
// In en-US, 5/1/2007 9:00:00 AM +00:00
@@ -68,95 +68,95 @@ private static void ToString2()
private static void ToString3()
{
//
- DateTimeOffset outputDate = new DateTimeOffset(2007, 10, 31, 21, 0, 0,
+ DateTimeOffset outputDate = new DateTimeOffset(2007, 10, 31, 21, 0, 0,
new TimeSpan(-8, 0, 0));
- string specifier;
-
+ string specifier;
+
// Output date using each standard date/time format specifier
specifier = "d";
// Displays d: 10/31/2007
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
-
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+
specifier = "D";
// Displays D: Wednesday, October 31, 2007
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
specifier = "t";
// Displays t: 9:00 PM
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
specifier = "T";
// Displays T: 9:00:00 PM
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
specifier = "f";
// Displays f: Wednesday, October 31, 2007 9:00 PM
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
specifier = "F";
// Displays F: Wednesday, October 31, 2007 9:00:00 PM
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
specifier = "g";
// Displays g: 10/31/2007 9:00 PM
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
specifier = "G";
// Displays G: 10/31/2007 9:00:00 PM
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
specifier = "M"; // 'm' is identical
// Displays M: October 31
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
-
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+
specifier = "R"; // 'r' is identical
// Displays R: Thu, 01 Nov 2007 05:00:00 GMT
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
-
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+
specifier = "s";
// Displays s: 2007-10-31T21:00:00
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
specifier = "u";
// Displays u: 2007-11-01 05:00:00Z
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
// Specifier is not supported
specifier = "U";
try
{
Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
- }
+ }
catch (FormatException)
{
- Console.WriteLine("{0}: Not supported.", specifier);
+ Console.WriteLine("{0}: Not supported.", specifier);
}
specifier = "Y"; // 'y' is identical
// Displays Y: October, 2007
- Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
- //
+ Console.WriteLine("{0}: {1}", specifier, outputDate.ToString(specifier));
+ //
}
private static void ToString4()
{
//
- DateTimeOffset outputDate = new DateTimeOffset(2007, 11, 1, 9, 0, 0,
- new TimeSpan(-7, 0, 0));
+ DateTimeOffset outputDate = new DateTimeOffset(2007, 11, 1, 9, 0, 0,
+ new TimeSpan(-7, 0, 0));
string format = "dddd, MMM dd yyyy HH:mm:ss zzz";
-
+
// Output date and time using custom format specification
Console.WriteLine(outputDate.ToString(format, null as DateTimeFormatInfo));
Console.WriteLine(outputDate.ToString(format, CultureInfo.InvariantCulture));
- Console.WriteLine(outputDate.ToString(format,
+ Console.WriteLine(outputDate.ToString(format,
new CultureInfo("fr-FR")));
- Console.WriteLine(outputDate.ToString(format,
+ Console.WriteLine(outputDate.ToString(format,
new CultureInfo("es-ES")));
// The example displays the following output to the console:
// Thursday, Nov 01 2007 09:00:00 -07:00
// Thursday, Nov 01 2007 09:00:00 -07:00
// jeudi, nov. 01 2007 09:00:00 -07:00
// jueves, nov 01 2007 09:00:00 -07:00
- //
- }
+ //
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.TryParse/cs/TryParse.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.TryParse/cs/TryParse.cs
index 43c8b17caa5..030ec5dcb43 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.TryParse/cs/TryParse.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.TryParse/cs/TryParse.cs
@@ -7,7 +7,7 @@ public static void Main()
{
TryParse1();
Console.WriteLine();
- TryParse2();
+ TryParse2();
}
private static void TryParse1()
@@ -15,35 +15,35 @@ private static void TryParse1()
//
DateTimeOffset parsedDate;
string dateString;
-
+
// String with date only
dateString = "05/01/2008";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
- Console.WriteLine("{0} was converted to {1}.",
+ Console.WriteLine("{0} was converted to {1}.",
dateString, parsedDate);
// String with time only
dateString = "11:36 PM";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
- Console.WriteLine("{0} was converted to {1}.",
+ Console.WriteLine("{0} was converted to {1}.",
dateString, parsedDate);
- // String with date and offset
+ // String with date and offset
dateString = "05/01/2008 +7:00";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
- Console.WriteLine("{0} was converted to {1}.",
+ Console.WriteLine("{0} was converted to {1}.",
dateString, parsedDate);
// String with day abbreviation
dateString = "Thu May 01, 2008";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
- Console.WriteLine("{0} was converted to {1}.",
+ Console.WriteLine("{0} was converted to {1}.",
dateString, parsedDate);
// String with date, time with AM/PM designator, and offset
dateString = "5/1/2008 10:00 AM -07:00";
if (DateTimeOffset.TryParse(dateString, out parsedDate))
- Console.WriteLine("{0} was converted to {1}.",
+ Console.WriteLine("{0} was converted to {1}.",
dateString, parsedDate);
// if (run on 3/29/07, the example displays the following output
// to the console:
@@ -51,7 +51,7 @@ private static void TryParse1()
// 11:36 PM was converted to 3/29/2007 11:36:00 PM -07:00.
// 05/01/2008 +7:00 was converted to 5/1/2008 12:00:00 AM +07:00.
// Thu May 01, 2008 was converted to 5/1/2008 12:00:00 AM -07:00.
- // 5/1/2008 10:00 AM -07:00 was converted to 5/1/2008 10:00:00 AM -07:00.
+ // 5/1/2008 10:00 AM -07:00 was converted to 5/1/2008 10:00:00 AM -07:00.
//
}
@@ -62,37 +62,37 @@ private static void TryParse2()
DateTimeOffset parsedDate;
dateString = "05/01/2008 6:00:00";
- // Assume time is local
- if (DateTimeOffset.TryParse(dateString, null as IFormatProvider,
- DateTimeStyles.AssumeLocal,
+ // Assume time is local
+ if (DateTimeOffset.TryParse(dateString, null as IFormatProvider,
+ DateTimeStyles.AssumeLocal,
out parsedDate))
- Console.WriteLine("'{0}' was converted to {1}.",
+ Console.WriteLine("'{0}' was converted to {1}.",
dateString, parsedDate.ToString());
else
- Console.WriteLine("Unable to parse '{0}'.", dateString);
-
+ Console.WriteLine("Unable to parse '{0}'.", dateString);
+
// Assume time is UTC
- if (DateTimeOffset.TryParse(dateString, null as IFormatProvider,
- DateTimeStyles.AssumeUniversal,
+ if (DateTimeOffset.TryParse(dateString, null as IFormatProvider,
+ DateTimeStyles.AssumeUniversal,
out parsedDate))
- Console.WriteLine("'{0}' was converted to {1}.",
+ Console.WriteLine("'{0}' was converted to {1}.",
dateString, parsedDate.ToString());
else
- Console.WriteLine("Unable to parse '{0}'.", dateString);
+ Console.WriteLine("Unable to parse '{0}'.", dateString);
- // Parse and convert to UTC
+ // Parse and convert to UTC
dateString = "05/01/2008 6:00:00AM +5:00";
- if (DateTimeOffset.TryParse(dateString, null as IFormatProvider,
- DateTimeStyles.AdjustToUniversal,
+ if (DateTimeOffset.TryParse(dateString, null as IFormatProvider,
+ DateTimeStyles.AdjustToUniversal,
out parsedDate))
- Console.WriteLine("'{0}' was converted to {1}.",
+ Console.WriteLine("'{0}' was converted to {1}.",
dateString, parsedDate.ToString());
else
- Console.WriteLine("Unable to parse '{0}'.", dateString);
+ Console.WriteLine("Unable to parse '{0}'.", dateString);
// The example displays the following output to the console:
// '05/01/2008 6:00:00' was converted to 5/1/2008 6:00:00 AM -07:00.
// '05/01/2008 6:00:00' was converted to 5/1/2008 6:00:00 AM +00:00.
- // '05/01/2008 6:00:00AM +5:00' was converted to 5/1/2008 1:00:00 AM +00:00.
- //
+ // '05/01/2008 6:00:00AM +5:00' was converted to 5/1/2008 1:00:00 AM +00:00.
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.TryParseExact/cs/TryParseExact.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.TryParseExact/cs/TryParseExact.cs
index 2d7b23df63b..cd8335382b0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.TryParseExact/cs/TryParseExact.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.TryParseExact/cs/TryParseExact.cs
@@ -6,7 +6,7 @@ public class Class1
{
public static void Main()
{
- TryParseExact1();
+ TryParseExact1();
Console.WriteLine();
TryParseExact2();
}
@@ -14,26 +14,26 @@ public static void Main()
private static void TryParseExact1()
{
//
- string dateString, format;
+ string dateString, format;
DateTimeOffset result;
IFormatProvider provider = CultureInfo.InvariantCulture;
-
+
// Parse date-only value with invariant culture and assume time is UTC.
dateString = "06/15/2008";
format = "d";
- if (DateTimeOffset.TryParseExact(dateString, format, provider,
- DateTimeStyles.AssumeUniversal,
+ if (DateTimeOffset.TryParseExact(dateString, format, provider,
+ DateTimeStyles.AssumeUniversal,
out result))
Console.WriteLine("'{0}' converts to {1}.", dateString, result.ToString());
else
Console.WriteLine("'{0}' is not in the correct format.", dateString);
-
+
// Parse date-only value with leading white space.
- // Should return False because only trailing white space is
+ // Should return False because only trailing white space is
// specified in method call.
dateString = " 06/15/2008";
- if (DateTimeOffset.TryParseExact(dateString, format, provider,
- DateTimeStyles.AllowTrailingWhite,
+ if (DateTimeOffset.TryParseExact(dateString, format, provider,
+ DateTimeStyles.AllowTrailingWhite,
out result))
Console.WriteLine("'{0}' converts to {1}.", dateString, result.ToString());
else
@@ -42,19 +42,19 @@ private static void TryParseExact1()
// Parse date and time value, and allow all white space.
dateString = " 06/15/ 2008 15:15 -05:00";
format = "MM/dd/yyyy H:mm zzz";
- if (DateTimeOffset.TryParseExact(dateString, format, provider,
- DateTimeStyles.AllowWhiteSpaces,
+ if (DateTimeOffset.TryParseExact(dateString, format, provider,
+ DateTimeStyles.AllowWhiteSpaces,
out result))
Console.WriteLine("'{0}' converts to {1}.", dateString, result.ToString());
else
Console.WriteLine("'{0}' is not in the correct format.", dateString);
-
+
// Parse date and time and convert to UTC.
- dateString = " 06/15/2008 15:15:30 -05:00";
- format = "MM/dd/yyyy H:mm:ss zzz";
- if (DateTimeOffset.TryParseExact(dateString, format, provider,
- DateTimeStyles.AllowWhiteSpaces |
- DateTimeStyles.AdjustToUniversal,
+ dateString = " 06/15/2008 15:15:30 -05:00";
+ format = "MM/dd/yyyy H:mm:ss zzz";
+ if (DateTimeOffset.TryParseExact(dateString, format, provider,
+ DateTimeStyles.AllowWhiteSpaces |
+ DateTimeStyles.AdjustToUniversal,
out result))
Console.WriteLine("'{0}' converts to {1}.", dateString, result.ToString());
else
@@ -65,7 +65,7 @@ private static void TryParseExact1()
// ' 06/15/ 2008 15:15 -05:00' converts to 6/15/2008 3:15:00 PM -05:00.
// ' 06/15/2008 15:15:30 -05:00' converts to 6/15/2008 8:15:30 PM +00:00.
//
- }
+ }
private static void TryParseExact2()
{
@@ -75,61 +75,61 @@ private static void TryParseExact2()
int tries = 0;
string input = String.Empty;
- string[] formats = new string[] {"M/dd/yyyy HH:m zzz", "MM/dd/yyyy HH:m zzz",
- "M/d/yyyy HH:m zzz", "MM/d/yyyy HH:m zzz",
- "M/dd/yy HH:m zzz", "MM/dd/yy HH:m zzz",
- "M/d/yy HH:m zzz", "MM/d/yy HH:m zzz",
- "M/dd/yyyy H:m zzz", "MM/dd/yyyy H:m zzz",
- "M/d/yyyy H:m zzz", "MM/d/yyyy H:m zzz",
- "M/dd/yy H:m zzz", "MM/dd/yy H:m zzz",
- "M/d/yy H:m zzz", "MM/d/yy H:m zzz",
- "M/dd/yyyy HH:mm zzz", "MM/dd/yyyy HH:mm zzz",
- "M/d/yyyy HH:mm zzz", "MM/d/yyyy HH:mm zzz",
- "M/dd/yy HH:mm zzz", "MM/dd/yy HH:mm zzz",
- "M/d/yy HH:mm zzz", "MM/d/yy HH:mm zzz",
- "M/dd/yyyy H:mm zzz", "MM/dd/yyyy H:mm zzz",
- "M/d/yyyy H:mm zzz", "MM/d/yyyy H:mm zzz",
- "M/dd/yy H:mm zzz", "MM/dd/yy H:mm zzz",
- "M/d/yy H:mm zzz", "MM/d/yy H:mm zzz"};
+ string[] formats = new string[] {"M/dd/yyyy HH:m zzz", "MM/dd/yyyy HH:m zzz",
+ "M/d/yyyy HH:m zzz", "MM/d/yyyy HH:m zzz",
+ "M/dd/yy HH:m zzz", "MM/dd/yy HH:m zzz",
+ "M/d/yy HH:m zzz", "MM/d/yy HH:m zzz",
+ "M/dd/yyyy H:m zzz", "MM/dd/yyyy H:m zzz",
+ "M/d/yyyy H:m zzz", "MM/d/yyyy H:m zzz",
+ "M/dd/yy H:m zzz", "MM/dd/yy H:m zzz",
+ "M/d/yy H:m zzz", "MM/d/yy H:m zzz",
+ "M/dd/yyyy HH:mm zzz", "MM/dd/yyyy HH:mm zzz",
+ "M/d/yyyy HH:mm zzz", "MM/d/yyyy HH:mm zzz",
+ "M/dd/yy HH:mm zzz", "MM/dd/yy HH:mm zzz",
+ "M/d/yy HH:mm zzz", "MM/d/yy HH:mm zzz",
+ "M/dd/yyyy H:mm zzz", "MM/dd/yyyy H:mm zzz",
+ "M/d/yyyy H:mm zzz", "MM/d/yyyy H:mm zzz",
+ "M/dd/yy H:mm zzz", "MM/dd/yy H:mm zzz",
+ "M/d/yy H:mm zzz", "MM/d/yy H:mm zzz"};
IFormatProvider provider = CultureInfo.InvariantCulture.DateTimeFormat;
DateTimeOffset result;
-
+
do {
conOut.WriteLine("Enter a date, time, and offset (MM/DD/YYYY HH:MM +/-HH:MM),");
conOut.Write("Then press Enter: ");
input = conIn.ReadLine();
- conOut.WriteLine();
- if (DateTimeOffset.TryParseExact(input, formats, provider,
- DateTimeStyles.AllowWhiteSpaces,
+ conOut.WriteLine();
+ if (DateTimeOffset.TryParseExact(input, formats, provider,
+ DateTimeStyles.AllowWhiteSpaces,
out result))
- {
+ {
break;
}
else
- {
- Console.WriteLine("Unable to parse {0}.", input);
+ {
+ Console.WriteLine("Unable to parse {0}.", input);
tries++;
}
} while (tries < 3);
if (tries >= 3)
Console.WriteLine("Exiting application without parsing {0}", input);
else
- Console.WriteLine("{0} was converted to {1}", input, result.ToString());
+ Console.WriteLine("{0} was converted to {1}", input, result.ToString());
// Some successful sample interactions with the user might appear as follows:
// Enter a date, time, and offset (MM/DD/YYYY HH:MM +/-HH:MM),
// Then press Enter: 12/08/2007 6:54 -6:00
- //
- // 12/08/2007 6:54 -6:00 was converted to 12/8/2007 6:54:00 AM -06:00
- //
+ //
+ // 12/08/2007 6:54 -6:00 was converted to 12/8/2007 6:54:00 AM -06:00
+ //
// Enter a date, time, and offset (MM/DD/YYYY HH:MM +/-HH:MM),
// Then press Enter: 12/8/2007 06:54 -06:00
- //
+ //
// 12/8/2007 06:54 -06:00 was converted to 12/8/2007 6:54:00 AM -06:00
- //
+ //
// Enter a date, time, and offset (MM/DD/YYYY HH:MM +/-HH:MM),
// Then press Enter: 12/5/07 6:54 -6:00
- //
- // 12/5/07 6:54 -6:00 was converted to 12/5/2007 6:54:00 AM -06:00
+ //
+ // 12/5/07 6:54 -6:00 was converted to 12/5/2007 6:54:00 AM -06:00
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Type/cs/Type.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Type/cs/Type.cs
index 77c5d2bf223..6740deed3f0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Type/cs/Type.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.DateTimeOffset.Type/cs/Type.cs
@@ -8,23 +8,23 @@ public static void Main()
DateTime date1, date2;
DateTimeOffset dateOffset1, dateOffset2;
TimeSpan difference;
-
+
// Find difference between Date.Now and Date.UtcNow
date1 = DateTime.Now;
date2 = DateTime.UtcNow;
difference = date1 - date2;
Console.WriteLine("{0} - {1} = {2}", date1, date2, difference);
-
+
// Find difference between Now and UtcNow using DateTimeOffset
dateOffset1 = DateTimeOffset.Now;
dateOffset2 = DateTimeOffset.UtcNow;
difference = dateOffset1 - dateOffset2;
- Console.WriteLine("{0} - {1} = {2}",
+ Console.WriteLine("{0} - {1} = {2}",
dateOffset1, dateOffset2, difference);
// If run in the Pacific Standard time zone on 4/2/2007, the example
// displays the following output to the console:
// 4/2/2007 7:23:57 PM - 4/3/2007 2:23:57 AM = -07:00:00
- // 4/2/2007 7:23:57 PM -07:00 - 4/3/2007 2:23:57 AM +00:00 = 00:00:00
+ // 4/2/2007 7:23:57 PM -07:00 - 4/3/2007 2:23:57 AM +00:00 = 00:00:00
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ceiling/cs/ceiling1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ceiling/cs/ceiling1.cs
index cef87c4fa12..df58dd90c55 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ceiling/cs/ceiling1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ceiling/cs/ceiling1.cs
@@ -5,9 +5,9 @@ public class Example
{
public static void Main()
{
- decimal[] values = {12.6m, 12.1m, 9.5m, 8.16m, .1m, -.1m, -1.1m,
+ decimal[] values = {12.6m, 12.1m, 9.5m, 8.16m, .1m, -.1m, -1.1m,
-1.9m, -3.9m};
- Console.WriteLine("{0,-8} {1,10} {2,10}\n",
+ Console.WriteLine("{0,-8} {1,10} {2,10}\n",
"Value", "Ceiling", "Floor");
foreach (decimal value in values)
Console.WriteLine("{0,-8} {1,10} {2,10}", value,
@@ -16,7 +16,7 @@ public static void Main()
}
// The example displays the following output:
// Value Ceiling Floor
-//
+//
// 12.6 13 12
// 12.1 13 12
// 9.5 10 9
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Class/cs/DecimalDivision_46630_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Class/cs/DecimalDivision_46630_1.cs
index 4cc5a05de0c..b6b83b23503 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Class/cs/DecimalDivision_46630_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Class/cs/DecimalDivision_46630_1.cs
@@ -7,7 +7,7 @@ public static void Main()
DivideWithoutRounding();
DivideWithRounding();
}
-
+
private static void DivideWithoutRounding()
{
Console.WriteLine("DivideWithoutRounding");
@@ -15,10 +15,10 @@ private static void DivideWithoutRounding()
decimal dividend = Decimal.One;
decimal divisor = 3;
// The following displays 0.9999999999999999999999999999 to the console
- Console.WriteLine(dividend/divisor * divisor);
+ Console.WriteLine(dividend/divisor * divisor);
//
}
-
+
private static void DivideWithRounding()
{
Console.WriteLine("DivideWithRounding");
@@ -26,7 +26,7 @@ private static void DivideWithRounding()
decimal dividend = Decimal.One;
decimal divisor = 3;
// The following displays 1.00 to the console
- Console.WriteLine(Math.Round(dividend/divisor * divisor, 2));
+ Console.WriteLine(Math.Round(dividend/divisor * divisor, 2));
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Compare_Equals/CS/comp_equal.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Compare_Equals/CS/comp_equal.cs
index 2eee128e060..5375e65d62d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Compare_Equals/CS/comp_equal.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Compare_Equals/CS/comp_equal.cs
@@ -7,14 +7,14 @@ class DecCompareEqualsDemo
const string dataFmt = "{0,-45}{1}";
// Compare decimal parameters, and display them with the results.
- public static void CompareDecimals( decimal Left, decimal Right,
+ public static void CompareDecimals( decimal Left, decimal Right,
string RightText )
{
Console.WriteLine( );
Console.WriteLine( dataFmt, "Right: "+RightText, Right );
- Console.WriteLine( dataFmt, "decimal.Equals( Left, Right )",
+ Console.WriteLine( dataFmt, "decimal.Equals( Left, Right )",
Decimal.Equals( Left, Right ) );
- Console.WriteLine( dataFmt, "decimal.Compare( Left, Right )",
+ Console.WriteLine( dataFmt, "decimal.Compare( Left, Right )",
Decimal.Compare( Left, Right ) );
}
@@ -30,17 +30,17 @@ public static void Main( )
// Create a reference decimal value.
decimal Left = new decimal( 123.456 );
- Console.WriteLine( dataFmt, "Left: decimal( 123.456 )",
+ Console.WriteLine( dataFmt, "Left: decimal( 123.456 )",
Left );
// Create decimal values to compare with the reference.
- CompareDecimals( Left, new decimal( 1.2345600E+2 ),
+ CompareDecimals( Left, new decimal( 1.2345600E+2 ),
"decimal( 1.2345600E+2 )" );
CompareDecimals( Left, 123.4561M, "123.4561M" );
CompareDecimals( Left, 123.4559M, "123.4559M" );
CompareDecimals( Left, 123.456000M, "123.456000M" );
- CompareDecimals( Left,
- new decimal( 123456000, 0, 0, false, 6 ),
+ CompareDecimals( Left,
+ new decimal( 123456000, 0, 0, false, 6 ),
"decimal( 123456000, 0, 0, false, 6 )" );
}
}
@@ -72,5 +72,5 @@ values and compares them with the following reference value.
Right: decimal( 123456000, 0, 0, false, 6 ) 123.456000
decimal.Equals( Left, Right ) True
decimal.Compare( Left, Right ) 0
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Compare_Equals/CS/cto_eq_obj.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Compare_Equals/CS/cto_eq_obj.cs
index 5a3dfc1152f..5d29bf1ceb8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Compare_Equals/CS/cto_eq_obj.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Compare_Equals/CS/cto_eq_obj.cs
@@ -1,5 +1,5 @@
//
-// Example of the decimal.CompareTo and decimal.Equals instance
+// Example of the decimal.CompareTo and decimal.Equals instance
// methods.
using System;
@@ -9,19 +9,19 @@ class DecCompToEqualsObjDemo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
- // Compare the decimal to the object parameters,
+ // Compare the decimal to the object parameters,
// and display the object parameters with the results.
- public static void CompDecimalToObject( decimal Left,
+ public static void CompDecimalToObject( decimal Left,
object Right, string RightText )
{
- Console.WriteLine( "{0,-46}{1}", "object: "+RightText,
+ Console.WriteLine( "{0,-46}{1}", "object: "+RightText,
Right );
- Console.WriteLine( "{0,-46}{1}", "Left.Equals( object )",
+ Console.WriteLine( "{0,-46}{1}", "Left.Equals( object )",
Left.Equals( Right ) );
Console.Write( "{0,-46}", "Left.CompareTo( object )" );
@@ -38,7 +38,7 @@ public static void CompDecimalToObject( decimal Left,
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the decimal.Equals( object ) and \n" +
"decimal.CompareTo( object ) methods generates the \n" +
"following output. It creates several different " +
@@ -48,18 +48,18 @@ public static void Main( )
// Create a reference decimal value.
decimal Left = new decimal( 987.654 );
- Console.WriteLine( "{0,-46}{1}\n",
+ Console.WriteLine( "{0,-46}{1}\n",
"Left: decimal( 987.654 )", Left );
// Create objects to compare with the reference.
- CompDecimalToObject( Left, new decimal( 9.8765400E+2 ),
+ CompDecimalToObject( Left, new decimal( 9.8765400E+2 ),
"decimal( 9.8765400E+2 )" );
CompDecimalToObject( Left, 987.6541M, "987.6541D" );
CompDecimalToObject( Left, 987.6539M, "987.6539D" );
- CompDecimalToObject( Left,
- new decimal( 987654000, 0, 0, false, 6 ),
+ CompDecimalToObject( Left,
+ new decimal( 987654000, 0, 0, false, 6 ),
"decimal( 987654000, 0, 0, false, 6 )" );
- CompDecimalToObject( Left, 9.8765400E+2,
+ CompDecimalToObject( Left, 9.8765400E+2,
"Double 9.8765400E+2" );
CompDecimalToObject( Left, "987.654", "String \"987.654\"" );
}
@@ -96,5 +96,5 @@ values and compares them with the following reference value.
object: String "987.654" 987.654
Left.Equals( object ) False
Left.CompareTo( object ) ArgumentException
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Arrays/CS/ctoriarr.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Arrays/CS/ctoriarr.cs
index 264bb4d91f5..f7ccdd9bb55 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Arrays/CS/ctoriarr.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Arrays/CS/ctoriarr.cs
@@ -8,7 +8,7 @@ class DecimalCtorIArrDemo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -16,10 +16,10 @@ public static string GetExceptionType( Exception ex )
public static void CreateDecimal( int[ ] bits )
{
// Format the constructor for display.
- string ctor = String.Format(
+ string ctor = String.Format(
"decimal( {{ 0x{0:X}", bits[ 0 ] );
string valOrExc;
-
+
for( int index = 1; index < bits.Length; index++ )
ctor += String.Format( ", 0x{0:X}", bits[ index ] );
ctor += " } )";
@@ -43,7 +43,7 @@ public static void CreateDecimal( int[ ] bits )
// Display the data on one line if it will fit.
if( ctorLen > ctor.Length )
- Console.WriteLine( "{0}{1}", ctor.PadRight( ctorLen ),
+ Console.WriteLine( "{0}{1}", ctor.PadRight( ctorLen ),
valOrExc );
// Otherwise, display the data on two lines.
@@ -53,15 +53,15 @@ public static void CreateDecimal( int[ ] bits )
Console.WriteLine( "{0,76}", valOrExc );
}
}
-
+
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the decimal( int[ ] ) constructor " +
"\ngenerates the following output.\n" );
- Console.WriteLine( "{0,-38}{1,38}", "Constructor",
+ Console.WriteLine( "{0,-38}{1,38}", "Constructor",
"Value or Exception" );
- Console.WriteLine( "{0,-38}{1,38}", "-----------",
+ Console.WriteLine( "{0,-38}{1,38}", "-----------",
"------------------" );
// Construct decimal objects from integer arrays.
@@ -73,13 +73,13 @@ public static void Main( )
CreateDecimal( new int[ ] { 0, 0, 1000000000, 0 } );
CreateDecimal( new int[ ] { 0, 0, 0, 1000000000 } );
CreateDecimal( new int[ ] { -1, -1, -1, 0 } );
- CreateDecimal( new int[ ]
+ CreateDecimal( new int[ ]
{ -1, -1, -1, unchecked( (int)0x80000000 ) } );
CreateDecimal( new int[ ] { -1, 0, 0, 0x100000 } );
CreateDecimal( new int[ ] { -1, 0, 0, 0x1C0000 } );
CreateDecimal( new int[ ] { -1, 0, 0, 0x1D0000 } );
CreateDecimal( new int[ ] { -1, 0, 0, 0x1C0001 } );
- CreateDecimal( new int[ ]
+ CreateDecimal( new int[ ]
{ 0xF0000, 0xF0000, 0xF0000, 0xF0000 } );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Arrays/CS/ctoriiibby.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Arrays/CS/ctoriiibby.cs
index ad9ce57f502..04c8ac7dbeb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Arrays/CS/ctoriiibby.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Arrays/CS/ctoriiibby.cs
@@ -8,24 +8,24 @@ class DecimalCtorIIIBByDemo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
// Create a decimal object and display its value.
- public static void CreateDecimal( int low, int mid, int high,
+ public static void CreateDecimal( int low, int mid, int high,
bool isNeg, byte scale )
{
// Format the constructor for display.
- string ctor = String.Format(
- "decimal( {0}, {1}, {2}, {3}, {4} )",
+ string ctor = String.Format(
+ "decimal( {0}, {1}, {2}, {3}, {4} )",
low, mid, high, isNeg, scale );
string valOrExc;
try
{
// Construct the decimal value.
- decimal decimalNum = new decimal(
+ decimal decimalNum = new decimal(
low, mid, high, isNeg, scale );
// Format and save the decimal value.
@@ -42,7 +42,7 @@ public static void CreateDecimal( int low, int mid, int high,
// Display the data on one line if it will fit.
if ( ctorLen > ctor.Length )
- Console.WriteLine( "{0}{1}", ctor.PadRight( ctorLen ),
+ Console.WriteLine( "{0}{1}", ctor.PadRight( ctorLen ),
valOrExc );
// Otherwise, display the data on two lines.
@@ -52,16 +52,16 @@ public static void CreateDecimal( int low, int mid, int high,
Console.WriteLine( "{0,76}", valOrExc );
}
}
-
+
public static void Main( )
{
Console.WriteLine( "This example of the decimal( int, int, " +
"int, bool, byte ) \nconstructor " +
"generates the following output.\n" );
- Console.WriteLine( "{0,-38}{1,38}", "Constructor",
+ Console.WriteLine( "{0,-38}{1,38}", "Constructor",
"Value or Exception" );
- Console.WriteLine( "{0,-38}{1,38}", "-----------",
+ Console.WriteLine( "{0,-38}{1,38}", "-----------",
"------------------" );
// Construct decimal objects from the component fields.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctori.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctori.cs
index e6b7689a016..4aa13b96df7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctori.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctori.cs
@@ -15,7 +15,7 @@ public static void CreateDecimal( int value, string valToStr )
// Display the constructor and its value.
Console.WriteLine( "{0,-30}{1,16}", ctor, decimalNum );
}
-
+
public static void Main( )
{
Console.WriteLine( "This example of the decimal( int ) " +
@@ -29,7 +29,7 @@ public static void Main( )
CreateDecimal( 0, "0" );
CreateDecimal( 999999999, "999999999" );
CreateDecimal( 0x40000000, "0x40000000" );
- CreateDecimal( unchecked( (int)0xC0000000 ),
+ CreateDecimal( unchecked( (int)0xC0000000 ),
"(int)0xC0000000" );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorl.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorl.cs
index 6119c2b3872..04daffb217a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorl.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorl.cs
@@ -15,7 +15,7 @@ public static void CreateDecimal( long value, string valToStr )
// Display the constructor and its value.
Console.WriteLine( "{0,-35}{1,22}", ctor, decimalNum );
}
-
+
public static void Main( )
{
Console.WriteLine( "This example of the decimal( long ) " +
@@ -29,7 +29,7 @@ public static void Main( )
CreateDecimal( 0L, "0L" );
CreateDecimal( 999999999999999999, "999999999999999999" );
CreateDecimal( 0x2000000000000000, "0x2000000000000000" );
- CreateDecimal( unchecked( (long)0xE000000000000000 ),
+ CreateDecimal( unchecked( (long)0xE000000000000000 ),
"(long)0xE000000000000000" );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorui.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorui.cs
index 38497d1d89d..01489b00f25 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorui.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorui.cs
@@ -15,7 +15,7 @@ public static void CreateDecimal( uint value, string valToStr )
// Display the constructor and its value.
Console.WriteLine( "{0,-33}{1,16}", ctor, decimalNum );
}
-
+
public static void Main( )
{
Console.WriteLine( "This example of the decimal( uint ) " +
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorul.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorul.cs
index baed29865fe..b5a633344a5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorul.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Ints/CS/ctorul.cs
@@ -15,7 +15,7 @@ public static void CreateDecimal( ulong value, string valToStr )
// Display the constructor and its value.
Console.WriteLine( "{0,-35}{1,22}", ctor, decimalNum );
}
-
+
public static void Main( )
{
Console.WriteLine( "This example of the decimal( ulong ) " +
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Reals/CS/ctordo.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Reals/CS/ctordo.cs
index 028c89b4268..cf1eefdbdda 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Reals/CS/ctordo.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Reals/CS/ctordo.cs
@@ -8,7 +8,7 @@ class DecimalCtorDoDemo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' )+1 );
}
@@ -16,7 +16,7 @@ public static string GetExceptionType( Exception ex )
public static void CreateDecimal( double value, string valToStr )
{
// Format and display the constructor.
- Console.Write( "{0,-34}",
+ Console.Write( "{0,-34}",
String.Format( "decimal( {0} )", valToStr ) );
try
@@ -33,28 +33,28 @@ public static void CreateDecimal( double value, string valToStr )
Console.WriteLine( "{0,31}", GetExceptionType( ex ) );
}
}
-
+
public static void Main( )
{
Console.WriteLine( "This example of the decimal( double ) " +
"constructor \ngenerates the following output.\n" );
- Console.WriteLine( "{0,-34}{1,31}", "Constructor",
+ Console.WriteLine( "{0,-34}{1,31}", "Constructor",
"Value or Exception" );
- Console.WriteLine( "{0,-34}{1,31}", "-----------",
+ Console.WriteLine( "{0,-34}{1,31}", "-----------",
"------------------" );
// Construct decimal objects from double values.
CreateDecimal( 1.23456789E+5, "1.23456789E+5" );
CreateDecimal( 1.234567890123E+15, "1.234567890123E+15" );
- CreateDecimal( 1.2345678901234567E+25,
+ CreateDecimal( 1.2345678901234567E+25,
"1.2345678901234567E+25" );
- CreateDecimal( 1.2345678901234567E+35,
+ CreateDecimal( 1.2345678901234567E+35,
"1.2345678901234567E+35" );
CreateDecimal( 1.23456789E-5, "1.23456789E-5" );
CreateDecimal( 1.234567890123E-15, "1.234567890123E-15" );
- CreateDecimal( 1.2345678901234567E-25,
+ CreateDecimal( 1.2345678901234567E-25,
"1.2345678901234567E-25" );
- CreateDecimal( 1.2345678901234567E-35,
+ CreateDecimal( 1.2345678901234567E-35,
"1.2345678901234567E-35" );
CreateDecimal( 1.0 / 7.0, "1.0 / 7.0" );
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Reals/CS/ctors.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Reals/CS/ctors.cs
index 487ba107bc0..ea9c5e61868 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Reals/CS/ctors.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Ctor.Reals/CS/ctors.cs
@@ -8,7 +8,7 @@ class DecimalCtorSDemo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -16,7 +16,7 @@ public static string GetExceptionType( Exception ex )
public static void CreateDecimal( float value, string valToStr )
{
// Format and display the constructor.
- Console.Write( "{0,-27}",
+ Console.Write( "{0,-27}",
String.Format( "decimal( {0} )", valToStr ) );
try
@@ -33,15 +33,15 @@ public static void CreateDecimal( float value, string valToStr )
Console.WriteLine( "{0,31}", GetExceptionType( ex ) );
}
}
-
+
public static void Main( )
{
Console.WriteLine( "This example of the decimal( float ) " +
"constructor \ngenerates the following output.\n" );
- Console.WriteLine( "{0,-27}{1,31}", "Constructor",
+ Console.WriteLine( "{0,-27}{1,31}", "Constructor",
"Value or Exception" );
- Console.WriteLine( "{0,-27}{1,31}", "-----------",
+ Console.WriteLine( "{0,-27}{1,31}", "-----------",
"------------------" );
// Construct decimal objects from float values.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Fields/CS/fields.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Fields/CS/fields.cs
index 89204e5398c..02b63ddd20a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Fields/CS/fields.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Fields/CS/fields.cs
@@ -9,35 +9,35 @@ public static void Main( )
const string numberFmt = "{0,-25}{1,45:N0}";
const string exprFmt = "{0,-55}{1,15}";
- Console.WriteLine(
+ Console.WriteLine(
"This example of the fields of the Decimal structure " +
"\ngenerates the following output.\n" );
Console.WriteLine( numberFmt, "Field or Expression", "Value" );
Console.WriteLine( numberFmt, "-------------------", "-----" );
// Display the values of the Decimal fields.
- Console.WriteLine( numberFmt, "Decimal.MaxValue",
+ Console.WriteLine( numberFmt, "Decimal.MaxValue",
Decimal.MaxValue );
- Console.WriteLine( numberFmt, "Decimal.MinValue",
+ Console.WriteLine( numberFmt, "Decimal.MinValue",
Decimal.MinValue );
- Console.WriteLine( numberFmt, "Decimal.MinusOne",
+ Console.WriteLine( numberFmt, "Decimal.MinusOne",
Decimal.MinusOne );
Console.WriteLine( numberFmt, "Decimal.One", Decimal.One );
Console.WriteLine( numberFmt, "Decimal.Zero", Decimal.Zero );
Console.WriteLine( );
// Display the values of expressions of the Decimal fields.
- Console.WriteLine( exprFmt,
- "( Decimal.MinusOne + Decimal.One ) == Decimal.Zero",
+ Console.WriteLine( exprFmt,
+ "( Decimal.MinusOne + Decimal.One ) == Decimal.Zero",
(Decimal.MinusOne + Decimal.One ) == Decimal.Zero );
- Console.WriteLine( exprFmt,
- "Decimal.MaxValue + Decimal.MinValue",
+ Console.WriteLine( exprFmt,
+ "Decimal.MaxValue + Decimal.MinValue",
Decimal.MaxValue + Decimal.MinValue );
- Console.WriteLine( exprFmt,
- "Decimal.MinValue / Decimal.MaxValue",
+ Console.WriteLine( exprFmt,
+ "Decimal.MinValue / Decimal.MaxValue",
Decimal.MinValue / Decimal.MaxValue );
- Console.WriteLine( "{0,-40}{1,30}",
- "100000000000000M / Decimal.MaxValue",
+ Console.WriteLine( "{0,-40}{1,30}",
+ "100000000000000M / Decimal.MaxValue",
100000000000000M / Decimal.MaxValue );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Flr_Neg_Rnd_Trnc/CS/floor_neg_trunc.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Flr_Neg_Rnd_Trnc/CS/floor_neg_trunc.cs
index ac0d54cfaf0..39ee6ec1423 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Flr_Neg_Rnd_Trnc/CS/floor_neg_trunc.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Flr_Neg_Rnd_Trnc/CS/floor_neg_trunc.cs
@@ -1,6 +1,6 @@
//
-// Example of the decimal.Negate, decimal.Floor, and decimal.Truncate
-// methods.
+// Example of the decimal.Negate, decimal.Floor, and decimal.Truncate
+// methods.
using System;
class DecimalFloorNegTruncDemo
@@ -12,11 +12,11 @@ public static void ShowDecimalFloorNegTrunc( decimal Argument )
{
Console.WriteLine( );
Console.WriteLine( dataFmt, "decimal Argument", Argument );
- Console.WriteLine( dataFmt, "decimal.Negate( Argument )",
+ Console.WriteLine( dataFmt, "decimal.Negate( Argument )",
decimal.Negate( Argument ) );
- Console.WriteLine( dataFmt, "decimal.Floor( Argument )",
+ Console.WriteLine( dataFmt, "decimal.Floor( Argument )",
decimal.Floor( Argument ) );
- Console.WriteLine( dataFmt, "decimal.Truncate( Argument )",
+ Console.WriteLine( dataFmt, "decimal.Truncate( Argument )",
decimal.Truncate( Argument ) );
}
@@ -32,7 +32,7 @@ public static void Main( )
ShowDecimalFloorNegTrunc( 0M );
ShowDecimalFloorNegTrunc( 123.456M );
ShowDecimalFloorNegTrunc( -123.456M );
- ShowDecimalFloorNegTrunc(
+ ShowDecimalFloorNegTrunc(
new decimal( 1230000000, 0, 0, true, 7 ) );
ShowDecimalFloorNegTrunc( -9999999999.9999999999M );
}
@@ -69,5 +69,5 @@ decimal Argument -9999999999.9999999999
decimal.Negate( Argument ) 9999999999.9999999999
decimal.Floor( Argument ) -10000000000
decimal.Truncate( Argument ) -9999999999
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Flr_Neg_Rnd_Trnc/CS/round.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Flr_Neg_Rnd_Trnc/CS/round.cs
index c1aa620ea17..41d0677a229 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Flr_Neg_Rnd_Trnc/CS/round.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Flr_Neg_Rnd_Trnc/CS/round.cs
@@ -1,5 +1,5 @@
//
-// Example of the decimal.Round method.
+// Example of the decimal.Round method.
using System;
class DecimalRoundDemo
@@ -29,9 +29,9 @@ public static void Main( )
ShowDecimalRound( 123.456789M, 6 );
ShowDecimalRound( 123.456789M, 8 );
ShowDecimalRound( -123.456M, 0 );
- ShowDecimalRound(
+ ShowDecimalRound(
new decimal( 1230000000, 0, 0, true, 7 ), 3 );
- ShowDecimalRound(
+ ShowDecimalRound(
new decimal( 1230000000, 0, 0, true, 7 ), 11 );
ShowDecimalRound( -9999999999.9999999999M, 9 );
ShowDecimalRound( -9999999999.9999999999M, 10 );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/getbits.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/getbits.cs
index 53b509c61f5..0f051935717 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/getbits.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/getbits.cs
@@ -11,19 +11,19 @@ public static void Main()
123456789M, 0.123456789M, 0.000000000123456789M,
0.000000000000000000123456789M, 4294967295M,
18446744073709551615M, Decimal.MaxValue,
- Decimal.MinValue, -7.9228162514264337593543950335M };
-
- Console.WriteLine("{0,31} {1,10:X8}{2,10:X8}{3,10:X8}{4,10:X8}",
- "Argument", "Bits[3]", "Bits[2]", "Bits[1]",
+ Decimal.MinValue, -7.9228162514264337593543950335M };
+
+ Console.WriteLine("{0,31} {1,10:X8}{2,10:X8}{3,10:X8}{4,10:X8}",
+ "Argument", "Bits[3]", "Bits[2]", "Bits[1]",
"Bits[0]" );
- Console.WriteLine( "{0,31} {1,10:X8}{2,10:X8}{3,10:X8}{4,10:X8}",
- "--------", "-------", "-------", "-------",
+ Console.WriteLine( "{0,31} {1,10:X8}{2,10:X8}{3,10:X8}{4,10:X8}",
+ "--------", "-------", "-------", "-------",
"-------" );
// Iterate each element and display its binary representation
foreach (var value in values) {
int[] bits = decimal.GetBits(value);
- Console.WriteLine("{0,31} {1,10:X8}{2,10:X8}{3,10:X8}{4,10:X8}",
+ Console.WriteLine("{0,31} {1,10:X8}{2,10:X8}{3,10:X8}{4,10:X8}",
value, bits[3], bits[2], bits[1], bits[0]);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/gethashcode.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/gethashcode.cs
index 5e89b895faf..723de98f2e2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/gethashcode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/gethashcode.cs
@@ -1,5 +1,5 @@
//
-// Example of the decimal.GetHashCode method.
+// Example of the decimal.GetHashCode method.
using System;
class DecimalGetHashCodeDemo
@@ -9,7 +9,7 @@ public static void ShowDecimalGetHashCode( decimal Argument )
{
int hashCode = Argument.GetHashCode( );
- Console.WriteLine( "{0,31}{1,14} 0x{1:X8}",
+ Console.WriteLine( "{0,31}{1,14} 0x{1:X8}",
Argument, hashCode );
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/gettypecode.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/gettypecode.cs
index 9aca6a8df49..3f881b307c2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/gettypecode.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Get_Bits_Hash_Type/CS/gettypecode.cs
@@ -1,5 +1,5 @@
//
-// Example of the decimal.GetTypeCode method.
+// Example of the decimal.GetTypeCode method.
using System;
class DecimalGetTypeCodeDemo
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem.cs
index 2c36de0a296..156e3c7bac6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem.cs
@@ -1,6 +1,6 @@
//
-// Example of the decimal.Multiply, decimal.Divide, and
-// decimal.Remainder methods.
+// Example of the decimal.Multiply, decimal.Divide, and
+// decimal.Remainder methods.
using System;
using Microsoft.VisualBasic;
@@ -8,18 +8,18 @@ class DecimalMulDivRemDemo
{
const string dataFmt = "{0,-35}{1,31}";
- // Display decimal parameters and their product, quotient, and
+ // Display decimal parameters and their product, quotient, and
// remainder.
public static void ShowDecimalProQuoRem( decimal Left, decimal Right )
{
Console.WriteLine( );
Console.WriteLine( dataFmt, "decimal Left", Left );
Console.WriteLine( dataFmt, "decimal Right", Right );
- Console.WriteLine( dataFmt, "decimal.Multiply( Left, Right )",
+ Console.WriteLine( dataFmt, "decimal.Multiply( Left, Right )",
decimal.Multiply( Left, Right ) );
- Console.WriteLine( dataFmt, "decimal.Divide( Left, Right )",
+ Console.WriteLine( dataFmt, "decimal.Divide( Left, Right )",
decimal.Divide( Left, Right ) );
- Console.WriteLine( dataFmt, "decimal.Remainder( Left, Right )",
+ Console.WriteLine( dataFmt, "decimal.Remainder( Left, Right )",
decimal.Remainder( Left, Right ) );
}
@@ -36,11 +36,11 @@ public static void Main( )
// Create pairs of decimal objects.
ShowDecimalProQuoRem( 1000M, 7M );
ShowDecimalProQuoRem( -1000M, 7M );
- ShowDecimalProQuoRem(
+ ShowDecimalProQuoRem(
new decimal( 1230000000, 0, 0, false, 7 ), 0.0012300M );
- ShowDecimalProQuoRem( 12345678900000000M,
+ ShowDecimalProQuoRem( 12345678900000000M,
0.0000000012345678M );
- ShowDecimalProQuoRem( 123456789.0123456789M,
+ ShowDecimalProQuoRem( 123456789.0123456789M,
123456789.1123456789M );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem_ops.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem_ops.cs
index 68eaf6b01c9..0a5de7021f4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem_ops.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Mul_Div_Rem/CS/mul_div_rem_ops.cs
@@ -1,5 +1,5 @@
//
-// Example of the decimal multiplication, division, and modulus
+// Example of the decimal multiplication, division, and modulus
// operators.
using System;
@@ -7,7 +7,7 @@ class DecimalMulDivRemOpsDemo
{
const string dataFmt = " {0,-18}{1,31}";
- // Display decimal parameters and their product, quotient, and
+ // Display decimal parameters and their product, quotient, and
// remainder.
public static void ShowDecimalProQuoRem( decimal Left, decimal Right )
{
@@ -21,7 +21,7 @@ public static void ShowDecimalProQuoRem( decimal Left, decimal Right )
public static void Main( )
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the decimal multiplication, division, " +
"and modulus \noperators generates the following " +
"output. It displays the product, \nquotient, and " +
@@ -30,11 +30,11 @@ public static void Main( )
// Create pairs of decimal objects.
ShowDecimalProQuoRem( 1000M, 7M );
ShowDecimalProQuoRem( -1000M, 7M );
- ShowDecimalProQuoRem(
+ ShowDecimalProQuoRem(
new decimal( 1230000000, 0, 0, false, 7 ), 0.0012300M );
- ShowDecimalProQuoRem( 12345678900000000M,
+ ShowDecimalProQuoRem( 12345678900000000M,
0.0000000012345678M );
- ShowDecimalProQuoRem( 123456789.0123456789M,
+ ShowDecimalProQuoRem( 123456789.0123456789M,
123456789.1123456789M );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.OACurrency/CS/fromoacurrency.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.OACurrency/CS/fromoacurrency.cs
index 8531fd5cc98..737a487ace4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.OACurrency/CS/fromoacurrency.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.OACurrency/CS/fromoacurrency.cs
@@ -1,5 +1,5 @@
//
-// Example of the decimal.FromOACurrency method.
+// Example of the decimal.FromOACurrency method.
using System;
class DecimalFromOACurrencyDemo
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.OACurrency/CS/tooacurrency.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.OACurrency/CS/tooacurrency.cs
index 72eda6406a3..a6a045e4c4b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.OACurrency/CS/tooacurrency.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.OACurrency/CS/tooacurrency.cs
@@ -1,5 +1,5 @@
//
-// Example of the decimal.ToOACurrency method.
+// Example of the decimal.ToOACurrency method.
using System;
class DecimalToOACurrencyDemo
@@ -10,11 +10,11 @@ class DecimalToOACurrencyDemo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
- // Display the decimal.ToOACurrency parameter and the result
+ // Display the decimal.ToOACurrency parameter and the result
// or exception.
public static void ShowDecimalToOACurrency( decimal Argument )
{
@@ -26,7 +26,7 @@ public static void ShowDecimalToOACurrency( decimal Argument )
}
catch( Exception ex )
{
- Console.WriteLine( dataFmt, Argument,
+ Console.WriteLine( dataFmt, Argument,
GetExceptionType( ex ) );
}
}
@@ -38,9 +38,9 @@ public static void Main( )
"following output. It displays the argument as a " +
"decimal \nand the OLE Automation Currency value " +
"as a long.\n" );
- Console.WriteLine( dataFmt, "Argument",
+ Console.WriteLine( dataFmt, "Argument",
"OA Currency or Exception" );
- Console.WriteLine( dataFmt, "--------",
+ Console.WriteLine( dataFmt, "--------",
"------------------------" );
// Convert decimal values to OLE Automation Currency values.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs
index 85ae98c5f5d..0d9475b1b6a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.Parse/CS/parse.cs
@@ -17,33 +17,33 @@ private static void CallParse()
//
string value;
decimal number;
- // Parse an integer with thousands separators.
+ // Parse an integer with thousands separators.
value = "16,523,421";
number = Decimal.Parse(value);
Console.WriteLine("'{0}' converted to {1}.", value, number);
- // Displays:
+ // Displays:
// 16,523,421' converted to 16523421.
-
+
// Parse a floating point value with thousands separators
value = "25,162.1378";
number = Decimal.Parse(value);
Console.WriteLine("'{0}' converted to {1}.", value, number);
- // Displays:
+ // Displays:
// 25,162.1378' converted to 25162.1378.
-
+
// Parse a floating point number with US currency symbol.
value = "$16,321,421.75";
try
{
number = Decimal.Parse(value);
Console.WriteLine("'{0}' converted to {1}.", value, number);
- }
+ }
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", value);
}
// Displays:
- // Unable to parse '$16,321,421.75'.
+ // Unable to parse '$16,321,421.75'.
// Parse a number in exponential notation
value = "1.62345e-02";
@@ -51,13 +51,13 @@ private static void CallParse()
{
number = Decimal.Parse(value);
Console.WriteLine("'{0}' converted to {1}.", value, number);
- }
+ }
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", value);
}
- // Displays:
- // Unable to parse '1.62345e-02'.
+ // Displays:
+ // Unable to parse '1.62345e-02'.
//
}
@@ -67,13 +67,13 @@ private static void CallParseWithStyles()
string value;
decimal number;
NumberStyles style;
-
- // Parse string with a floating point value using NumberStyles.None.
+
+ // Parse string with a floating point value using NumberStyles.None.
value = "8694.12";
style = NumberStyles.None;
try
{
- number = Decimal.Parse(value, style);
+ number = Decimal.Parse(value, style);
Console.WriteLine("'{0}' converted to {1}.", value, number);
}
catch (FormatException)
@@ -82,65 +82,65 @@ private static void CallParseWithStyles()
}
// Displays:
// Unable to parse '8694.12'.
-
- // Parse string with a floating point value and allow decimal point.
+
+ // Parse string with a floating point value and allow decimal point.
style = NumberStyles.AllowDecimalPoint;
- number = Decimal.Parse(value, style);
+ number = Decimal.Parse(value, style);
Console.WriteLine("'{0}' converted to {1}.", value, number);
// Displays:
// '8694.12' converted to 8694.12.
-
+
// Parse string with negative value in parentheses
value = "(1,789.34)";
- style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands |
- NumberStyles.AllowParentheses;
- number = Decimal.Parse(value, style);
+ style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands |
+ NumberStyles.AllowParentheses;
+ number = Decimal.Parse(value, style);
Console.WriteLine("'{0}' converted to {1}.", value, number);
// Displays:
// '(1,789.34)' converted to -1789.34.
-
+
// Parse string using Number style
value = " -17,623.49 ";
style = NumberStyles.Number;
- number = Decimal.Parse(value, style);
+ number = Decimal.Parse(value, style);
Console.WriteLine("'{0}' converted to {1}.", value, number);
// Displays:
// ' -17,623.49 ' converted to -17623.49.
- //
+ //
}
private static void CallParseWithStylesAndProvider()
{
- //
+ //
string value;
decimal number;
NumberStyles style;
CultureInfo provider;
-
- // Parse string using "." as the thousands separator
- // and " " as the decimal separator.
+
+ // Parse string using "." as the thousands separator
+ // and " " as the decimal separator.
value = "892 694,12";
style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands;
provider = new CultureInfo("fr-FR");
- number = Decimal.Parse(value, style, provider);
+ number = Decimal.Parse(value, style, provider);
Console.WriteLine("'{0}' converted to {1}.", value, number);
- // Displays:
+ // Displays:
// 892 694,12' converted to 892694.12.
try
{
- number = Decimal.Parse(value, style, CultureInfo.InvariantCulture);
+ number = Decimal.Parse(value, style, CultureInfo.InvariantCulture);
Console.WriteLine("'{0}' converted to {1}.", value, number);
- }
+ }
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", value);
}
- // Displays:
- // Unable to parse '892 694,12'.
-
- // Parse string using "$" as the currency symbol for en-GB and
+ // Displays:
+ // Unable to parse '892 694,12'.
+
+ // Parse string using "$" as the currency symbol for en-GB and
// en-us cultures.
value = "$6,032.51";
style = NumberStyles.Number | NumberStyles.AllowCurrencySymbol;
@@ -148,20 +148,20 @@ private static void CallParseWithStylesAndProvider()
try
{
- number = Decimal.Parse(value, style, provider);
+ number = Decimal.Parse(value, style, provider);
Console.WriteLine("'{0}' converted to {1}.", value, number);
- }
+ }
catch (FormatException)
{
Console.WriteLine("Unable to parse '{0}'.", value);
}
- // Displays:
+ // Displays:
// Unable to parse '$6,032.51'.
provider = new CultureInfo("en-US");
- number = Decimal.Parse(value, style, provider);
+ number = Decimal.Parse(value, style, provider);
Console.WriteLine("'{0}' converted to {1}.", value, number);
- // Displays:
+ // Displays:
// '$6,032.51' converted to 6032.51.
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToString/CS/ToString2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToString/CS/ToString2.cs
index e939f16a491..68f21ef44bd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToString/CS/ToString2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToString/CS/ToString2.cs
@@ -23,7 +23,7 @@ private static void CallDefaultToString()
// Display value using some standard format specifiers.
Console.WriteLine(value.ToString("G")); // Displays -16325.62
Console.WriteLine(value.ToString("C")); // Displays ($16,325.62)
- Console.WriteLine(value.ToString("F")); // Displays -16325.62
+ Console.WriteLine(value.ToString("F")); // Displays -16325.62
//
}
@@ -49,7 +49,7 @@ private static void CallWithSpecificSpecifiers()
//
decimal value = 16325.62m;
string specifier;
-
+
// Use standard numeric format specifiers.
specifier = "G";
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
@@ -69,7 +69,7 @@ private static void CallWithSpecificSpecifiers()
specifier = "P";
Console.WriteLine("{0}: {1}", specifier, (value/10000).ToString(specifier));
// Displays: P: 163.26 %
-
+
// Use custom numeric format specifiers.
specifier = "0,0.000";
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
@@ -86,7 +86,7 @@ private static void CallWithSpecificSpecifiersAndCultures()
decimal value = 16325.62m;
string specifier;
CultureInfo culture;
-
+
// Use standard numeric format specifiers.
specifier = "G";
culture = CultureInfo.CreateSpecificCulture("eu-ES");
@@ -94,7 +94,7 @@ private static void CallWithSpecificSpecifiersAndCultures()
// Displays: 16325,62
Console.WriteLine(value.ToString(specifier, CultureInfo.InvariantCulture));
// Displays: 16325.62
-
+
specifier = "C";
culture = CultureInfo.CreateSpecificCulture("en-US");
Console.WriteLine(value.ToString(specifier, culture));
@@ -102,14 +102,14 @@ private static void CallWithSpecificSpecifiersAndCultures()
culture = CultureInfo.CreateSpecificCulture("en-GB");
Console.WriteLine(value.ToString(specifier, culture));
// Displays: £16,325.62
-
+
specifier = "E04";
culture = CultureInfo.CreateSpecificCulture("sv-SE");
Console.WriteLine(value.ToString(specifier, culture));
- // Displays: 1,6326E+004
+ // Displays: 1,6326E+004
culture = CultureInfo.CreateSpecificCulture("en-NZ");
Console.WriteLine(value.ToString(specifier, culture));
- // Displays: 1.6326E+004
+ // Displays: 1.6326E+004
specifier = "F";
culture = CultureInfo.CreateSpecificCulture("fr-FR");
@@ -135,5 +135,5 @@ private static void CallWithSpecificSpecifiersAndCultures()
Console.WriteLine((value/10000).ToString(specifier, culture));
// Displays: 163.256 %
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToString/CS/tostring.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToString/CS/tostring.cs
index 135f0eff718..d408f517a20 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToString/CS/tostring.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToString/CS/tostring.cs
@@ -9,7 +9,7 @@ class DecimalToStringDemo
static void Main( )
{
decimal nineBillPlus = 9876543210.9876543210M;
-
+
Console.WriteLine( "This example of\n" +
" Decimal.ToString( ), \n" +
" Decimal.ToString( String ),\n" +
@@ -18,53 +18,53 @@ static void Main( )
"generates the following output when run in the " +
"[{0}] culture.\nDecimal numbers are formatted " +
"with various combinations \nof format strings " +
- "and IFormatProvider.",
+ "and IFormatProvider.",
CultureInfo.CurrentCulture.Name );
// Format the number without and with format strings.
Console.WriteLine( "\nIFormatProvider is not " +
- "used; the default culture is [{0}]:",
+ "used; the default culture is [{0}]:",
CultureInfo.CurrentCulture.Name );
- Console.WriteLine( " {0,-30}{1}", "No format string:",
+ Console.WriteLine( " {0,-30}{1}", "No format string:",
nineBillPlus.ToString( ) );
- Console.WriteLine( " {0,-30}{1}", "'N' format string:",
+ Console.WriteLine( " {0,-30}{1}", "'N' format string:",
nineBillPlus.ToString( "N" ) );
- Console.WriteLine( " {0,-30}{1}", "'N5' format string:",
+ Console.WriteLine( " {0,-30}{1}", "'N5' format string:",
nineBillPlus.ToString( "N5" ) );
-
+
// Create a CultureInfo object for another culture. Use
// [Dutch - The Netherlands] unless the current culture
// is Dutch language. In that case use [English - U.S.].
- string cultureName =
- CultureInfo.CurrentCulture.Name.Substring( 0, 2 ) ==
+ string cultureName =
+ CultureInfo.CurrentCulture.Name.Substring( 0, 2 ) ==
"nl" ? "en-US" : "nl-NL";
CultureInfo culture = new CultureInfo( cultureName );
-
+
// Use the CultureInfo object for an IFormatProvider.
Console.WriteLine( "\nA CultureInfo object " +
- "for [{0}] is used for the IFormatProvider: ",
+ "for [{0}] is used for the IFormatProvider: ",
cultureName );
- Console.WriteLine( " {0,-30}{1}", "No format string:",
+ Console.WriteLine( " {0,-30}{1}", "No format string:",
nineBillPlus.ToString( culture ) );
- Console.WriteLine( " {0,-30}{1}", "'N5' format string:",
+ Console.WriteLine( " {0,-30}{1}", "'N5' format string:",
nineBillPlus.ToString( "N5", culture ) );
-
+
// Get the NumberFormatInfo object from CultureInfo, and
// then change the digit group size to 4 and the digit
// separator to '_'.
NumberFormatInfo numInfo = culture.NumberFormat;
numInfo.NumberGroupSizes = new int[ ] { 4 };
numInfo.NumberGroupSeparator = "_";
-
+
// Use a NumberFormatInfo object for IFormatProvider.
- Console.WriteLine(
+ Console.WriteLine(
"\nA NumberFormatInfo object with digit group " +
"size = 4 and \ndigit separator " +
"= '_' is used for the IFormatProvider:" );
- Console.WriteLine( " {0,-30}{1}", "'N5' format string:",
+ Console.WriteLine( " {0,-30}{1}", "'N5' format string:",
nineBillPlus.ToString( "N5", culture ) );
- }
-}
+ }
+}
/*
This example of
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tos_byte.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tos_byte.cs
index 5ce60d85162..401582a9739 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tos_byte.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tos_byte.cs
@@ -10,7 +10,7 @@ class DecimalToS_ByteDemo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -40,7 +40,7 @@ public static void DecimalToS_Byte( decimal argument )
ByteValue = GetExceptionType( ex );
}
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
SByteValue, ByteValue );
}
@@ -51,9 +51,9 @@ public static void Main( )
" decimal.ToByte( decimal ) \nmethods " +
"generates the following output. It \ndisplays " +
"several converted decimal values.\n" );
- Console.WriteLine( formatter, "decimal argument",
+ Console.WriteLine( formatter, "decimal argument",
"sbyte/exception", "byte/exception" );
- Console.WriteLine( formatter, "----------------",
+ Console.WriteLine( formatter, "----------------",
"---------------", "--------------" );
// Convert decimal values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tosgl_dbl.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tosgl_dbl.cs
index efed14b5e63..6654015107f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tosgl_dbl.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tosgl_dbl.cs
@@ -18,7 +18,7 @@ public static void DecimalToSgl_Dbl( decimal argument )
// Convert the argument to a double value.
DoubleValue = decimal.ToDouble( argument );
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
SingleValue, DoubleValue );
}
@@ -29,9 +29,9 @@ public static void Main( )
" decimal.ToDouble( decimal ) \nmethods " +
"generates the following output. It \ndisplays " +
"several converted decimal values.\n" );
- Console.WriteLine( formatter, "decimal argument",
+ Console.WriteLine( formatter, "decimal argument",
"float", "double" );
- Console.WriteLine( formatter, "----------------",
+ Console.WriteLine( formatter, "----------------",
"-----", "------" );
// Convert decimal values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int16.cs
index a09bf2c9e19..9e2babd8efb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int16.cs
@@ -10,7 +10,7 @@ class DecimalToU_Int16Demo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -40,7 +40,7 @@ public static void DecimalToU_Int16( decimal argument )
UInt16Value = GetExceptionType( ex );
}
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
Int16Value, UInt16Value );
}
@@ -51,9 +51,9 @@ public static void Main( )
" decimal.ToUInt16( decimal ) \nmethods " +
"generates the following output. It \ndisplays " +
"several converted decimal values.\n" );
- Console.WriteLine( formatter, "decimal argument",
+ Console.WriteLine( formatter, "decimal argument",
"short/exception", "ushort/exception" );
- Console.WriteLine( formatter, "----------------",
+ Console.WriteLine( formatter, "----------------",
"---------------", "----------------" );
// Convert decimal values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int32.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int32.cs
index 0de1d14e10a..f7db3040b04 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int32.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int32.cs
@@ -10,7 +10,7 @@ class DecimalToU_Int32Demo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -40,7 +40,7 @@ public static void DecimalToU_Int32( decimal argument )
UInt32Value = GetExceptionType( ex );
}
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
Int32Value, UInt32Value );
}
@@ -51,9 +51,9 @@ public static void Main( )
" decimal.ToUInt32( decimal ) \nmethods " +
"generates the following output. It \ndisplays " +
"several converted decimal values.\n" );
- Console.WriteLine( formatter, "decimal argument",
+ Console.WriteLine( formatter, "decimal argument",
"int/exception", "uint/exception" );
- Console.WriteLine( formatter, "----------------",
+ Console.WriteLine( formatter, "----------------",
"-------------", "--------------" );
// Convert decimal values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int64.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int64.cs
index 71c625cf38b..e169f410948 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int64.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.ToXXX/CS/tou_int64.cs
@@ -10,7 +10,7 @@ class DecimalToU_Int64Demo
public static string GetExceptionType( Exception ex )
{
string exceptionType = ex.GetType( ).ToString( );
- return exceptionType.Substring(
+ return exceptionType.Substring(
exceptionType.LastIndexOf( '.' ) + 1 );
}
@@ -40,7 +40,7 @@ public static void DecimalToU_Int64( decimal argument )
UInt64Value = GetExceptionType( ex );
}
- Console.WriteLine( formatter, argument,
+ Console.WriteLine( formatter, argument,
Int64Value, UInt64Value );
}
@@ -51,9 +51,9 @@ public static void Main( )
" decimal.ToUInt64( decimal ) \nmethods " +
"generates the following output. It \ndisplays " +
"several converted decimal values.\n" );
- Console.WriteLine( formatter, "decimal argument",
+ Console.WriteLine( formatter, "decimal argument",
"long/exception", "ulong/exception" );
- Console.WriteLine( formatter, "----------------",
+ Console.WriteLine( formatter, "----------------",
"--------------", "---------------" );
// Convert decimal values and display the results.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.TryParse/cs/TryParse.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.TryParse/cs/TryParse.cs
index a4001241d2d..7efab79ed00 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.TryParse/cs/TryParse.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Decimal.TryParse/cs/TryParse.cs
@@ -15,40 +15,40 @@ private static void CallTryParse1()
//
string value;
decimal number;
-
+
// Parse a floating-point value with a thousands separator.
value = "1,643.57";
if (Decimal.TryParse(value, out number))
Console.WriteLine(number);
else
- Console.WriteLine("Unable to parse '{0}'.", value);
-
- // Parse a floating-point value with a currency symbol and a
+ Console.WriteLine("Unable to parse '{0}'.", value);
+
+ // Parse a floating-point value with a currency symbol and a
// thousands separator.
value = "$1,643.57";
if (Decimal.TryParse(value, out number))
Console.WriteLine(number);
else
- Console.WriteLine("Unable to parse '{0}'.", value);
-
+ Console.WriteLine("Unable to parse '{0}'.", value);
+
// Parse value in exponential notation.
value = "-1.643e6";
if (Decimal.TryParse(value, out number))
Console.WriteLine(number);
else
- Console.WriteLine("Unable to parse '{0}'.", value);
-
+ Console.WriteLine("Unable to parse '{0}'.", value);
+
// Parse a negative integer value.
value = "-1689346178821";
if (Decimal.TryParse(value, out number))
Console.WriteLine(number);
else
- Console.WriteLine("Unable to parse '{0}'.", value);
+ Console.WriteLine("Unable to parse '{0}'.", value);
// The example displays the following output to the console:
// 1643.57
// Unable to parse '$1,643.57'.
// Unable to parse '-1.643e6'.
- // -1689346178821
+ // -1689346178821
//
}
@@ -59,7 +59,7 @@ private static void CallTryParse2()
NumberStyles style;
CultureInfo culture;
decimal number;
-
+
// Parse currency value using en-GB culture.
value = "£1,097.63";
style = NumberStyles.Number | NumberStyles.AllowCurrencySymbol;
@@ -68,9 +68,9 @@ private static void CallTryParse2()
Console.WriteLine("Converted '{0}' to {1}.", value, number);
else
Console.WriteLine("Unable to convert '{0}'.", value);
- // Displays:
+ // Displays:
// Converted '£1,097.63' to 1097.63.
-
+
value = "1345,978";
style = NumberStyles.AllowDecimalPoint;
culture = CultureInfo.CreateSpecificCulture("fr-FR");
@@ -88,9 +88,9 @@ private static void CallTryParse2()
Console.WriteLine("Converted '{0}' to {1}.", value, number);
else
Console.WriteLine("Unable to convert '{0}'.", value);
- // Displays:
+ // Displays:
// Converted '1.345,978' to 1345.978.
-
+
value = "1 345,978";
if (Decimal.TryParse(value, style, culture, out number))
Console.WriteLine("Converted '{0}' to {1}.", value, number);
@@ -98,6 +98,6 @@ private static void CallTryParse2()
Console.WriteLine("Unable to convert '{0}'.", value);
// Displays:
// Unable to convert '1 345,978'.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.DefaultTraceListener.WriteLine/CS/defaulttracelistener.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.DefaultTraceListener.WriteLine/CS/defaulttracelistener.cs
index 076ae0b8356..032fdc04d50 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.DefaultTraceListener.WriteLine/CS/defaulttracelistener.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.DefaultTraceListener.WriteLine/CS/defaulttracelistener.cs
@@ -63,7 +63,7 @@ public static void Main(string[] args)
else
{
//
- // Request the required argument if it was not entered
+ // Request the required argument if it was not entered
// on the command-line.
const string ENTER_PARAM = "Enter the number of " +
"possibilities as a command-line argument.";
@@ -81,7 +81,7 @@ public static void Main(string[] args)
{
//
- // Compute the next binomial coefficient.
+ // Compute the next binomial coefficient.
// If an exception is thrown, quit.
decimal result = CalcBinomial(possibilities, iter);
if (result==0) {return;}
@@ -103,7 +103,7 @@ public static decimal CalcBinomial(decimal possibilities, decimal outcomes)
decimal result = 1;
try
{
- // Calculate a binomial coefficient, and minimize the chance
+ // Calculate a binomial coefficient, and minimize the chance
// of overflow.
decimal iter;
for(iter=1; iter<=possibilities-outcomes; iter++)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.Class/CS/perfcountercatcreateexist.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.Class/CS/perfcountercatcreateexist.cs
index 167170ee466..3913c8ca828 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.Class/CS/perfcountercatcreateexist.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.Class/CS/perfcountercatcreateexist.cs
@@ -78,7 +78,7 @@ public static void Main(string[] args)
}
else
{
- // Handle the exception that is thrown if the computer
+ // Handle the exception that is thrown if the computer
// cannot be found.
try
{
@@ -137,14 +137,14 @@ public static void Main(string[] args)
// Tell the user whether the counter exists.
Console.WriteLine("Counter \"{0}\" "+(objectExists? "exists": "does not exist")+
- " in category \"{1}\" on "+(machineName.Length>0? "computer \"{2}\".": "this computer."),
+ " in category \"{1}\" on "+(machineName.Length>0? "computer \"{2}\".": "this computer."),
counterName, categoryName, machineName);
//
// If the counter does not exist, consider creating it.
if (!objectExists)
- // If this is a remote computer,
+ // If this is a remote computer,
// exit because the category cannot be created.
{
if (machineName.Length>0)
@@ -196,7 +196,7 @@ public static void Main(string[] args)
// Tell the user whether the instance exists.
Console.WriteLine("Instance \"{0}\" "+(objectExists? "exists": "does not exist")+
- " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
+ " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
instanceName, categoryName, machineName);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatobjexists.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatobjexists.cs
index 123e3ffd5e2..b502499cc2a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatobjexists.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatobjexists.cs
@@ -46,14 +46,14 @@ public static void Main(string[] args)
{
Console.WriteLine("Unable to check for the existence of " +
"counter \"{0}\" in category \"{1}\" on "+
- (machineName.Length>0? "computer \"{2}\".": "this computer.")+ "\n" +
+ (machineName.Length>0? "computer \"{2}\".": "this computer.")+ "\n" +
ex.Message, counterName, categoryName, machineName);
return;
}
// Tell the user whether the counter exists.
- Console.WriteLine("Counter \"{0}\" " + (objectExists? "exists": "does not exist") +
- " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
+ Console.WriteLine("Counter \"{0}\" " + (objectExists? "exists": "does not exist") +
+ " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
counterName, pcc.CategoryName, pcc.MachineName);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatstatcounterexists.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatstatcounterexists.cs
index 4b303722020..06f8ee951e0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatstatcounterexists.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatstatcounterexists.cs
@@ -42,15 +42,15 @@ public static void Main(string[] args)
catch(Exception ex)
{
Console.WriteLine("Unable to check for the existence of " +
- "counter \"{0}\" in category \"{1}\" on " +
- (machineName.Length>0? "computer \"{2}\".": "this computer.") + "\n" +
+ "counter \"{0}\" in category \"{1}\" on " +
+ (machineName.Length>0? "computer \"{2}\".": "this computer.") + "\n" +
ex.Message, counterName, categoryName, machineName);
return;
}
// Tell the user whether the counter exists.
- Console.WriteLine("Counter \"{0}\" "+ (objectExists? "exists": "does not exist") +
- " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
+ Console.WriteLine("Counter \"{0}\" "+ (objectExists? "exists": "does not exist") +
+ " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
counterName, categoryName, machineName);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatstatinstexists.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatstatinstexists.cs
index bed58aca48f..0eb6bcf9b50 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatstatinstexists.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcountercatstatinstexists.cs
@@ -49,15 +49,15 @@ public static void Main(string[] args)
catch(Exception ex)
{
Console.WriteLine("Unable to check for the existence of " +
- "instance \"{0}\" in category \"{1}\" on " +
- (machineName.Length>0? "computer \"{2}\":": "this computer:") + "\n" +
+ "instance \"{0}\" in category \"{1}\" on " +
+ (machineName.Length>0? "computer \"{2}\":": "this computer:") + "\n" +
ex.Message, instanceName, categoryName, machineName);
return;
}
// Tell the user whether the instance exists.
- Console.WriteLine("Instance \"{0}\" " + (objectExists? "exists": "does not exist") +
- " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
+ Console.WriteLine("Instance \"{0}\" " + (objectExists? "exists": "does not exist") +
+ " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
instanceName, categoryName, machineName);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcounterobjinstexists.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcounterobjinstexists.cs
index 0df6e41e149..b88bc2dfd57 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcounterobjinstexists.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.ExistMembers/CS/perfcounterobjinstexists.cs
@@ -52,15 +52,15 @@ public static void Main(string[] args)
catch(Exception ex)
{
Console.WriteLine("Unable to check for the existence of " +
- "instance \"{0}\" in category \"{1}\" on " +
- (machineName.Length>0? "computer \"{2}\":": "this computer:") +
+ "instance \"{0}\" in category \"{1}\" on " +
+ (machineName.Length>0? "computer \"{2}\":": "this computer:") +
"\n" + ex.Message, instanceName, categoryName, machineName);
return;
}
// Tell the user whether the instance exists.
- Console.WriteLine("Instance \"{0}\" " + (objectExists? "exists": "does not exist") +
- " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
+ Console.WriteLine("Instance \"{0}\" " + (objectExists? "exists": "does not exist") +
+ " in category \"{1}\" on " + (machineName.Length>0? "computer \"{2}\".": "this computer."),
instanceName, pcc.CategoryName, pcc.MachineName);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountercatgetcount.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountercatgetcount.cs
index 41c65c7603d..a539acd05b7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountercatgetcount.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountercatgetcount.cs
@@ -38,7 +38,7 @@ public static void Main(string[] args)
pcc = new PerformanceCounterCategory(categoryName);
}
- // Get the counters for this instance or a single instance
+ // Get the counters for this instance or a single instance
// of the selected category.
if (instanceName.Length>0)
{
@@ -51,9 +51,9 @@ public static void Main(string[] args)
}
catch(Exception ex)
{
- Console.WriteLine("Unable to get counter information for " +
- (instanceName.Length>0? "instance \"{2}\" in ": "single-instance ") +
- "category \"{0}\" on " + (machineName.Length>0? "computer \"{1}\":": "this computer:"),
+ Console.WriteLine("Unable to get counter information for " +
+ (instanceName.Length>0? "instance \"{2}\" in ": "single-instance ") +
+ "category \"{0}\" on " + (machineName.Length>0? "computer \"{1}\":": "this computer:"),
categoryName, machineName, instanceName);
Console.WriteLine(ex.Message);
return;
@@ -62,9 +62,9 @@ public static void Main(string[] args)
// Display the counter names if GetCounters was successful.
if (counters!=null)
{
- Console.WriteLine("These counters exist in " +
- (instanceName.Length>0? "instance \"{1}\" of": "single instance") +
- " category {0} on " + (machineName.Length>0? "computer \"{2}\":": "this computer:"),
+ Console.WriteLine("These counters exist in " +
+ (instanceName.Length>0? "instance \"{1}\" of": "single instance") +
+ " category {0} on " + (machineName.Length>0? "computer \"{2}\":": "this computer:"),
categoryName, instanceName, machineName);
// Display a numbered list of the counter names.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountercatgetinst.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountercatgetinst.cs
index 36b001b118f..50b3bf760a2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountercatgetinst.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountercatgetinst.cs
@@ -42,8 +42,8 @@ public static void Main(string[] args)
catch(Exception ex)
{
Console.WriteLine("Unable to get instance information for " +
- "category \"{0}\" on " +
- (machineName.Length>0? "computer \"{1}\":": "this computer:"),
+ "category \"{0}\" on " +
+ (machineName.Length>0? "computer \"{1}\":": "this computer:"),
categoryName, machineName);
Console.WriteLine(ex.Message);
return;
@@ -52,15 +52,15 @@ public static void Main(string[] args)
//If an empty array is returned, the category has a single instance.
if (instances.Length==0)
{
- Console.WriteLine("Category \"{0}\" on " +
- (machineName.Length>0? "computer \"{1}\"": "this computer") +
+ Console.WriteLine("Category \"{0}\" on " +
+ (machineName.Length>0? "computer \"{1}\"": "this computer") +
" is single-instance.", pcc.CategoryName, pcc.MachineName);
}
else
{
// Otherwise, display the instances.
- Console.WriteLine("These instances exist in category \"{0}\" on " +
- (machineName.Length>0? "computer \"{1}\".": "this computer:"),
+ Console.WriteLine("These instances exist in category \"{0}\" on " +
+ (machineName.Length>0? "computer \"{1}\".": "this computer:"),
pcc.CategoryName, pcc.MachineName);
Array.Sort(instances);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountergetcat.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountergetcat.cs
index 6420ee6fbbc..cae6f48ed2b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountergetcat.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.GetMembers/CS/perfcountergetcat.cs
@@ -34,13 +34,13 @@ public static void Main(string[] args)
}
catch(Exception ex)
{
- Console.WriteLine("Unable to get categories on " +
+ Console.WriteLine("Unable to get categories on " +
(machineName.Length > 0 ? "computer \"{0}\":": "this computer:"), machineName);
Console.WriteLine(ex.Message);
return;
}
- Console.WriteLine("These categories are registered on " +
+ Console.WriteLine("These categories are registered on " +
(machineName.Length > 0 ? "computer \"{0}\":": "this computer:"), machineName);
// Create and sort an array of category names.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.OtherMembers/CS/perfcountercatctor.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.OtherMembers/CS/perfcountercatctor.cs
index 7a30938df1e..65da38eea53 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.OtherMembers/CS/perfcountercatctor.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.PerformanceCounterCategory.OtherMembers/CS/perfcountercatctor.cs
@@ -24,7 +24,7 @@ public static void Main(string[] args)
// Ignore the exception from non-supplied arguments.
}
- // Create a PerformanceCounterCategory object using
+ // Create a PerformanceCounterCategory object using
// the appropriate constructor.
if (categoryName.Length==0)
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.Process.EnableExited/CS/processexitedevent.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.Process.EnableExited/CS/processexitedevent.cs
index 3ddf498773a..756dbb863b3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.Process.EnableExited/CS/processexitedevent.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.Process.EnableExited/CS/processexitedevent.cs
@@ -32,13 +32,13 @@ public async Task PrintDoc(string fileName)
}
// Wait for Exited event, but not more than 30 seconds.
- await Task.WhenAny(eventHandled.Task,Task.Delay(30000));
+ await Task.WhenAny(eventHandled.Task,Task.Delay(30000));
}
}
// Handle Exited event and display process information.
private void myProcess_Exited(object sender, System.EventArgs e)
- {
+ {
Console.WriteLine(
$"Exit time : {myProcess.ExitTime}\n" +
$"Exit code : {myProcess.ExitCode}\n" +
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.Process.Id/CS/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.Process.Id/CS/program.cs
index 52a4dde00e6..b6803fd451f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.Process.Id/CS/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.Process.Id/CS/program.cs
@@ -22,7 +22,7 @@ public static void Main()
Console.WriteLine(localByName[i - 1].Id.ToString());
i -= 1;
}
-
+
i = localByName.Length;
while (i > 0)
{
@@ -47,7 +47,7 @@ public static void Main()
Console.WriteLine("Incorrect entry.");
continue;
}
-
+
i -= 1;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TextWriterTraceListener.Ctor/CS/twtlconstring.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TextWriterTraceListener.Ctor/CS/twtlconstring.cs
index 48b1782e824..04494da1951 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TextWriterTraceListener.Ctor/CS/twtlconstring.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TextWriterTraceListener.Ctor/CS/twtlconstring.cs
@@ -17,7 +17,7 @@ public static void Main(string[] args)
}
else
{
- // Create a TextWriterTraceListener object that takes a
+ // Create a TextWriterTraceListener object that takes a
// file specification.
TextWriterTraceListener textListener;
try
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TextWriterTraceListener.Ctor/CS/twtlconstringname.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TextWriterTraceListener.Ctor/CS/twtlconstringname.cs
index 75f4f17e246..0c25afe2a1e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TextWriterTraceListener.Ctor/CS/twtlconstringname.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TextWriterTraceListener.Ctor/CS/twtlconstringname.cs
@@ -19,7 +19,7 @@ public static void Main(string[] args)
}
else
{
- // Create a TextWriterTraceListener object that takes a
+ // Create a TextWriterTraceListener object that takes a
// file specification.
TextWriterTraceListener textListener;
try
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TraceSource/CS/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TraceSource/CS/program.cs
index fd117af97dc..c391c7b546a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TraceSource/CS/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TraceSource/CS/program.cs
@@ -180,14 +180,14 @@ static void Main()
//
// Test the filter on the ConsoleTraceListener.
ts.Listeners["console"].Filter = new SourceFilter("No match");
- ts.TraceData(TraceEventType.Information, 5,
+ ts.TraceData(TraceEventType.Information, 5,
"SourceFilter should reject this message for the console trace listener.");
ts.Listeners["console"].Filter = new SourceFilter("TraceTest");
- ts.TraceData(TraceEventType.Information, 6,
+ ts.TraceData(TraceEventType.Information, 6,
"SourceFilter should let this message through on the console trace listener.");
//
ts.Listeners["console"].Filter = null;
- // Use the TraceData method.
+ // Use the TraceData method.
//
ts.TraceData(TraceEventType.Warning, 9, new object());
//
@@ -268,7 +268,7 @@ public string FirstTraceSourceAttribute
get {
foreach (DictionaryEntry de in this.Attributes)
if (de.Key.ToString().ToLower() == "firsttracesourceattribute")
- firstAttribute = de.Value.ToString() ;
+ firstAttribute = de.Value.ToString() ;
return firstAttribute;
}
set { firstAttribute = value; }
@@ -334,7 +334,7 @@ public override void WriteLine(string s)
}
protected override string[] GetSupportedAttributes()
{
- // The following string array will allow the use of
+ // The following string array will allow the use of
// the name "customListenerAttribute" in the configuration file.
return new string[] { "customListenerAttribute" };
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TraceSource2/CS/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TraceSource2/CS/program.cs
index 04f8822f946..7a54a614127 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TraceSource2/CS/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Diagnostics.TraceSource2/CS/program.cs
@@ -87,7 +87,7 @@ static void Main()
"SourceFilter should let this message through on the console trace listener.");
//
ts.Listeners["console"].Filter = null;
- // Use the TraceData method.
+ // Use the TraceData method.
//
ts.TraceData(TraceEventType.Warning, 7, new object());
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/Equals_25051.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/Equals_25051.cs
index 4d2c5515adf..62637e8aae6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/Equals_25051.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/Equals_25051.cs
@@ -21,13 +21,13 @@ private static void CompareUsingEquals()
double double2 = 1/3;
// Compare them for equality
Console.WriteLine(double1.Equals(double2)); // displays false
- //
+ //
}
-
+
private static void CompareApproximateValues()
{
Console.WriteLine("Snippet2");
- //
+ //
// Initialize two doubles with apparently identical values
double double1 = .333333;
double double2 = (double) 1/3;
@@ -41,8 +41,8 @@ private static void CompareApproximateValues()
else
Console.WriteLine("double1 and double2 are unequal.");
//
- }
-
+ }
+
private static void CompareObjectsUsingEquals()
{
//
@@ -51,12 +51,12 @@ private static void CompareObjectsUsingEquals()
object double2 = 1/3;
// Compare them for equality
Console.WriteLine(double1.Equals(double2)); // displays false
- //
+ //
}
-
+
private static void CompareApproximateObjectValues()
{
- //
+ //
// Initialize two doubles with apparently identical values
double double1 = .33333;
object double2 = (double) 1/3;
@@ -70,5 +70,5 @@ private static void CompareApproximateObjectValues()
else
Console.WriteLine("double1 and double2 are unequal.");
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/epsilon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/epsilon.cs
index 83e075270c7..98c008835a1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/epsilon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/epsilon.cs
@@ -6,22 +6,22 @@ public class Example
public static void Main()
{
double[] values = { 0, Double.Epsilon, Double.Epsilon * .5 };
-
+
for (int ctr = 0; ctr <= values.Length - 2; ctr++)
{
for (int ctr2 = ctr + 1; ctr2 <= values.Length - 1; ctr2++)
{
- Console.WriteLine("{0:r} = {1:r}: {2}",
- values[ctr], values[ctr2],
+ Console.WriteLine("{0:r} = {1:r}: {2}",
+ values[ctr], values[ctr2],
values[ctr].Equals(values[ctr2]));
}
Console.WriteLine();
- }
+ }
}
}
// The example displays the following output:
// 0 = 4.94065645841247E-324: False
// 0 = 0: True
-//
+//
// 4.94065645841247E-324 = 0: False
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/epsilon1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/epsilon1.cs
index 7a6dd610494..0799c9cb2a3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/epsilon1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Epsilon/cs/epsilon1.cs
@@ -9,7 +9,7 @@ public static void Main()
foreach (var value in values) {
Console.WriteLine(GetComponentParts(value));
Console.WriteLine();
- }
+ }
}
private static string GetComponentParts(double value)
@@ -20,35 +20,35 @@ private static string GetComponentParts(double value)
// Convert the double to an 8-byte array.
byte[] bytes = BitConverter.GetBytes(value);
// Get the sign bit (byte 7, bit 7).
- result += String.Format("Sign: {0}\n",
+ result += String.Format("Sign: {0}\n",
(bytes[7] & 0x80) == 0x80 ? "1 (-)" : "0 (+)");
// Get the exponent (byte 6 bits 4-7 to byte 7, bits 0-6)
int exponent = (bytes[7] & 0x07F) << 4;
- exponent = exponent | ((bytes[6] & 0xF0) >> 4);
+ exponent = exponent | ((bytes[6] & 0xF0) >> 4);
int adjustment = exponent != 0 ? 1023 : 1022;
result += String.Format("{0}Exponent: 0x{1:X4} ({1})\n", new String(' ', indent), exponent - adjustment);
// Get the significand (bits 0-51)
- long significand = ((bytes[6] & 0x0F) << 48);
+ long significand = ((bytes[6] & 0x0F) << 48);
significand = significand | ((long) bytes[5] << 40);
significand = significand | ((long) bytes[4] << 32);
significand = significand | ((long) bytes[3] << 24);
significand = significand | ((long) bytes[2] << 16);
significand = significand | ((long) bytes[1] << 8);
- significand = significand | bytes[0];
- result += String.Format("{0}Mantissa: 0x{1:X13}\n", new String(' ', indent), significand);
+ significand = significand | bytes[0];
+ result += String.Format("{0}Mantissa: 0x{1:X13}\n", new String(' ', indent), significand);
- return result;
+ return result;
}
}
// // The example displays the following output:
// 0: Sign: 0 (+)
// Exponent: 0xFFFFFC02 (-1022)
// Mantissa: 0x0000000000000
-//
-//
+//
+//
// 4.94065645841247E-324: Sign: 0 (+)
// Exponent: 0xFFFFFC02 (-1022)
// Mantissa: 0x0000000000001
-//
\ No newline at end of file
+//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/Parse.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/Parse.cs
index 8e31191f8c2..7292b89e406 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/Parse.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/Parse.cs
@@ -9,15 +9,15 @@ public static void Main()
{
// Set current thread culture to en-US.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
-
+
string value;
NumberStyles styles;
-
- // Parse a string in exponential notation with only the AllowExponent flag.
+
+ // Parse a string in exponential notation with only the AllowExponent flag.
value = "-1.063E-02";
styles = NumberStyles.AllowExponent;
ShowNumericValue(value, styles);
-
+
// Parse a string in exponential notation
// with the AllowExponent and Number flags.
styles = NumberStyles.AllowExponent | NumberStyles.Number;
@@ -28,13 +28,13 @@ public static void Main()
value = " $ 6,164.3299 ";
styles = NumberStyles.Number | NumberStyles.AllowCurrencySymbol;
ShowNumericValue(value, styles);
-
+
// Parse negative value with thousands separator and decimal.
value = "(4,320.64)";
styles = NumberStyles.AllowParentheses | NumberStyles.AllowTrailingSign |
- NumberStyles.Float;
+ NumberStyles.Float;
ShowNumericValue(value, styles);
-
+
styles = NumberStyles.AllowParentheses | NumberStyles.AllowTrailingSign |
NumberStyles.Float | NumberStyles.AllowThousands;
ShowNumericValue(value, styles);
@@ -46,25 +46,25 @@ private static void ShowNumericValue(string value, NumberStyles styles)
try
{
number = Double.Parse(value, styles);
- Console.WriteLine("Converted '{0}' using {1} to {2}.",
+ Console.WriteLine("Converted '{0}' using {1} to {2}.",
value, styles.ToString(), number);
}
catch (FormatException)
{
- Console.WriteLine("Unable to parse '{0}' with styles {1}.",
+ Console.WriteLine("Unable to parse '{0}' with styles {1}.",
value, styles.ToString());
}
- Console.WriteLine();
- }
+ Console.WriteLine();
+ }
// The example displays the following output to the console:
// Unable to parse '-1.063E-02' with styles AllowExponent.
- //
+ //
// Converted '-1.063E-02' using AllowTrailingSign, AllowThousands, Float to -0.01063.
- //
+ //
// Converted ' $ 6,164.3299 ' using Number, AllowCurrencySymbol to 6164.3299.
- //
+ //
// Unable to parse '(4,320.64)' with styles AllowTrailingSign, AllowParentheses, Float.
- //
- // Converted '(4,320.64)' using AllowTrailingSign, AllowParentheses, AllowThousands, Float to -4320.64.
+ //
+ // Converted '(4,320.64)' using AllowTrailingSign, AllowParentheses, AllowThousands, Float to -4320.64.
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/Parse3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/Parse3.cs
index 681b63dbcd8..bb37a642800 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/Parse3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/Parse3.cs
@@ -4,52 +4,52 @@
public class Temperature
{
- // Parses the temperature from a string. Temperature scale is
+ // Parses the temperature from a string. Temperature scale is
// indicated by 'F (for Fahrenheit) or 'C (for Celcius) at the end
// of the string.
- public static Temperature Parse(string s, NumberStyles styles,
+ public static Temperature Parse(string s, NumberStyles styles,
IFormatProvider provider)
- {
+ {
Temperature temp = new Temperature();
if (s.TrimEnd(null).EndsWith("'F"))
{
- temp.Value = Double.Parse(s.Remove(s.LastIndexOf((char)39), 2),
+ temp.Value = Double.Parse(s.Remove(s.LastIndexOf((char)39), 2),
styles, provider);
}
else
{
if (s.TrimEnd(null).EndsWith("'C"))
- temp.Celsius = Double.Parse(s.Remove(s.LastIndexOf((char)39), 2),
+ temp.Celsius = Double.Parse(s.Remove(s.LastIndexOf((char)39), 2),
styles, provider);
else
- temp.Value = Double.Parse(s, styles, provider);
+ temp.Value = Double.Parse(s, styles, provider);
}
- return temp;
- }
-
+ return temp;
+ }
+
// Declare private constructor so Temperature so only Parse method can
// create a new instance
private Temperature() {}
protected double m_value;
-
- public double Value
+
+ public double Value
{
get { return m_value; }
private set { m_value = value; }
}
-
+
public double Celsius
{
get { return (m_value - 32) / 1.8; }
private set { m_value = value * 1.8 + 32; }
}
-
+
public double Fahrenheit
{
get {return m_value; }
- }
+ }
}
public class TestTemperature
@@ -60,28 +60,28 @@ public static void Main()
NumberStyles styles;
IFormatProvider provider;
Temperature temp;
-
+
value = "25,3'C";
styles = NumberStyles.Float;
provider = CultureInfo.CreateSpecificCulture("fr-FR");
temp = Temperature.Parse(value, styles, provider);
- Console.WriteLine("{0} degrees Fahrenheit equals {1} degrees Celsius.",
+ Console.WriteLine("{0} degrees Fahrenheit equals {1} degrees Celsius.",
temp.Fahrenheit, temp.Celsius);
-
+
value = " (40) 'C";
- styles = NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite
+ styles = NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite
| NumberStyles.AllowParentheses;
provider = NumberFormatInfo.InvariantInfo;
temp = Temperature.Parse(value, styles, provider);
- Console.WriteLine("{0} degrees Fahrenheit equals {1} degrees Celsius.",
+ Console.WriteLine("{0} degrees Fahrenheit equals {1} degrees Celsius.",
temp.Fahrenheit, temp.Celsius);
-
+
value = "5,778E03'C"; // Approximate surface temperature of the Sun
styles = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands |
NumberStyles.AllowExponent;
- provider = CultureInfo.CreateSpecificCulture("en-GB");
+ provider = CultureInfo.CreateSpecificCulture("en-GB");
temp = Temperature.Parse(value, styles, provider);
- Console.WriteLine("{0} degrees Fahrenheit equals {1} degrees Celsius.",
+ Console.WriteLine("{0} degrees Fahrenheit equals {1} degrees Celsius.",
temp.Fahrenheit.ToString("N"), temp.Celsius.ToString("N"));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/parse2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/parse2.cs
index cd91fe4bd67..fb20b71c5d7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/parse2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.Parse/cs/parse2.cs
@@ -6,15 +6,15 @@ public static void Main()
{
//
string value;
-
+
value = Double.MinValue.ToString();
try {
Console.WriteLine(Double.Parse(value));
- }
+ }
catch (OverflowException) {
Console.WriteLine($"{value} is outside the range of the Double type.");
}
-
+
value = Double.MaxValue.ToString();
try {
Console.WriteLine(Double.Parse(value));
@@ -25,7 +25,7 @@ public static void Main()
// Format without the default precision.
value = Double.MinValue.ToString("G17");
- try
+ try
{
Console.WriteLine(Double.Parse(value));
}
@@ -36,7 +36,7 @@ public static void Main()
// The example displays the following output:
// -1.79769313486232E+308 is outside the range of the Double type.
// 1.79769313486232E+308 is outside the range of the Double type.
- // -1.79769313486232E+308
- //
+ // -1.79769313486232E+308
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.ToString/cs/ToString1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.ToString/cs/ToString1.cs
index a987f07cdf6..dc23fdd568f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.ToString/cs/ToString1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.ToString/cs/ToString1.cs
@@ -18,7 +18,7 @@ private static void CallDefaultToString()
{
//
double number;
-
+
number = 1.6E20;
// Displays 1.6E+20.
Console.WriteLine(number.ToString());
@@ -26,7 +26,7 @@ private static void CallDefaultToString()
number = 1.6E2;
// Displays 160.
Console.WriteLine(number.ToString());
-
+
number = -3.541;
// Displays -3.541.
Console.WriteLine(number.ToString());
@@ -34,15 +34,15 @@ private static void CallDefaultToString()
number = -1502345222199E-07;
// Displays -150234.5222199.
Console.WriteLine(number.ToString());
-
+
number = -15023452221990199574E-09;
// Displays -15023452221.9902.
Console.WriteLine(number.ToString());
-
+
number = .60344;
// Displays 0.60344.
Console.WriteLine(number.ToString());
-
+
number = .000000001;
// Displays 1E-09.
Console.WriteLine(number.ToString());
@@ -53,7 +53,7 @@ private static void CallToStringWithFormatProvider()
{
//
double value;
-
+
value = -16325.62015;
// Display value using the invariant culture.
Console.WriteLine(value.ToString(CultureInfo.InvariantCulture));
@@ -76,32 +76,32 @@ private static void CallToStringWithFormatProvider()
// 1.6034125E+25
// 1.6034125E+25
// 1,6034125E+25
- //
+ //
}
private static void CallToStringWithFormatString()
{
//
- double[] numbers= {1054.32179, -195489100.8377, 1.0437E21,
+ double[] numbers= {1054.32179, -195489100.8377, 1.0437E21,
-1.0573e-05};
- string[] specifiers = { "C", "E", "e", "F", "G", "N", "P",
+ string[] specifiers = { "C", "E", "e", "F", "G", "N", "P",
"R", "#,000.000", "0.###E-000",
"000,000,000,000.00###" };
foreach (double number in numbers)
{
Console.WriteLine("Formatting of {0}:", number);
foreach (string specifier in specifiers) {
- Console.WriteLine(" {0,-22} {1}",
+ Console.WriteLine(" {0,-22} {1}",
specifier + ":", number.ToString(specifier));
// Add precision specifiers from 0 to 3.
if (specifier.Length == 1 & ! specifier.Equals("R")) {
for (int precision = 0; precision <= 3; precision++) {
string pSpecifier = String.Format("{0}{1}", specifier, precision);
- Console.WriteLine(" {0,-22} {1}",
+ Console.WriteLine(" {0,-22} {1}",
pSpecifier + ":", number.ToString(pSpecifier));
- }
+ }
Console.WriteLine();
- }
+ }
}
Console.WriteLine();
}
@@ -112,192 +112,192 @@ private static void CallToStringWithFormatString()
// C1: $1,054.3
// C2: $1,054.32
// C3: $1,054.322
- //
+ //
// E: 1.054322E+003
// E0: 1E+003
// E1: 1.1E+003
// E2: 1.05E+003
// E3: 1.054E+003
- //
+ //
// e: 1.054322e+003
// e0: 1e+003
// e1: 1.1e+003
// e2: 1.05e+003
// e3: 1.054e+003
- //
+ //
// F: 1054.32
// F0: 1054
// F1: 1054.3
// F2: 1054.32
// F3: 1054.322
- //
+ //
// G: 1054.32179
// G0: 1054.32179
// G1: 1E+03
// G2: 1.1E+03
// G3: 1.05E+03
- //
+ //
// N: 1,054.32
// N0: 1,054
// N1: 1,054.3
// N2: 1,054.32
// N3: 1,054.322
- //
+ //
// P: 105,432.18 %
// P0: 105,432 %
// P1: 105,432.2 %
// P2: 105,432.18 %
// P3: 105,432.179 %
- //
+ //
// R: 1054.32179
// #,000.000: 1,054.322
// 0.###E-000: 1.054E003
// 000,000,000,000.00###: 000,000,001,054.32179
- //
+ //
// Formatting of -195489100.8377:
// C: ($195,489,100.84)
// C0: ($195,489,101)
// C1: ($195,489,100.8)
// C2: ($195,489,100.84)
// C3: ($195,489,100.838)
- //
+ //
// E: -1.954891E+008
// E0: -2E+008
// E1: -2.0E+008
// E2: -1.95E+008
// E3: -1.955E+008
- //
+ //
// e: -1.954891e+008
// e0: -2e+008
// e1: -2.0e+008
// e2: -1.95e+008
// e3: -1.955e+008
- //
+ //
// F: -195489100.84
// F0: -195489101
// F1: -195489100.8
// F2: -195489100.84
// F3: -195489100.838
- //
+ //
// G: -195489100.8377
// G0: -195489100.8377
// G1: -2E+08
// G2: -2E+08
// G3: -1.95E+08
- //
+ //
// N: -195,489,100.84
// N0: -195,489,101
// N1: -195,489,100.8
// N2: -195,489,100.84
// N3: -195,489,100.838
- //
+ //
// P: -19,548,910,083.77 %
// P0: -19,548,910,084 %
// P1: -19,548,910,083.8 %
// P2: -19,548,910,083.77 %
// P3: -19,548,910,083.770 %
- //
+ //
// R: -195489100.8377
// #,000.000: -195,489,100.838
// 0.###E-000: -1.955E008
// 000,000,000,000.00###: -000,195,489,100.8377
- //
+ //
// Formatting of 1.0437E+21:
// C: $1,043,700,000,000,000,000,000.00
// C0: $1,043,700,000,000,000,000,000
// C1: $1,043,700,000,000,000,000,000.0
// C2: $1,043,700,000,000,000,000,000.00
// C3: $1,043,700,000,000,000,000,000.000
- //
+ //
// E: 1.043700E+021
// E0: 1E+021
// E1: 1.0E+021
// E2: 1.04E+021
// E3: 1.044E+021
- //
+ //
// e: 1.043700e+021
// e0: 1e+021
// e1: 1.0e+021
// e2: 1.04e+021
// e3: 1.044e+021
- //
+ //
// F: 1043700000000000000000.00
// F0: 1043700000000000000000
// F1: 1043700000000000000000.0
// F2: 1043700000000000000000.00
// F3: 1043700000000000000000.000
- //
+ //
// G: 1.0437E+21
// G0: 1.0437E+21
// G1: 1E+21
// G2: 1E+21
// G3: 1.04E+21
- //
+ //
// N: 1,043,700,000,000,000,000,000.00
// N0: 1,043,700,000,000,000,000,000
// N1: 1,043,700,000,000,000,000,000.0
// N2: 1,043,700,000,000,000,000,000.00
// N3: 1,043,700,000,000,000,000,000.000
- //
+ //
// P: 104,370,000,000,000,000,000,000.00 %
// P0: 104,370,000,000,000,000,000,000 %
// P1: 104,370,000,000,000,000,000,000.0 %
// P2: 104,370,000,000,000,000,000,000.00 %
// P3: 104,370,000,000,000,000,000,000.000 %
- //
+ //
// R: 1.0437E+21
// #,000.000: 1,043,700,000,000,000,000,000.000
// 0.###E-000: 1.044E021
// 000,000,000,000.00###: 1,043,700,000,000,000,000,000.00
- //
+ //
// Formatting of -1.0573E-05:
// C: $0.00
// C0: $0
// C1: $0.0
// C2: $0.00
// C3: $0.000
- //
+ //
// E: -1.057300E-005
// E0: -1E-005
// E1: -1.1E-005
// E2: -1.06E-005
// E3: -1.057E-005
- //
+ //
// e: -1.057300e-005
// e0: -1e-005
// e1: -1.1e-005
// e2: -1.06e-005
// e3: -1.057e-005
- //
+ //
// F: 0.00
// F0: 0
// F1: 0.0
// F2: 0.00
// F3: 0.000
- //
+ //
// G: -1.0573E-05
// G0: -1.0573E-05
// G1: -1E-05
// G2: -1.1E-05
// G3: -1.06E-05
- //
+ //
// N: 0.00
// N0: 0
// N1: 0.0
// N2: 0.00
// N3: 0.000
- //
+ //
// P: 0.00 %
// P0: 0 %
// P1: 0.0 %
// P2: 0.00 %
// P3: -0.001 %
- //
+ //
// R: -1.0573E-05
// #,000.000: 000.000
// 0.###E-000: -1.057E-005
- // 000,000,000,000.00###: -000,000,000,000.00001
- //
+ // 000,000,000,000.00###: -000,000,000,000.00001
+ //
}
private static void CallToStringWithFormatStringAndProvider()
@@ -314,7 +314,7 @@ private static void CallToStringWithFormatStringAndProvider()
// Displays: 16325,62901
Console.WriteLine(value.ToString(specifier, CultureInfo.InvariantCulture));
// Displays: 16325.62901
-
+
specifier = "C";
culture = CultureInfo.CreateSpecificCulture("en-US");
Console.WriteLine(value.ToString(specifier, culture));
@@ -322,15 +322,15 @@ private static void CallToStringWithFormatStringAndProvider()
culture = CultureInfo.CreateSpecificCulture("en-GB");
Console.WriteLine(value.ToString(specifier, culture));
// Displays: £16,325.63
-
+
specifier = "E04";
culture = CultureInfo.CreateSpecificCulture("sv-SE");
Console.WriteLine(value.ToString(specifier, culture));
- // Displays: 1,6326E+004
+ // Displays: 1,6326E+004
culture = CultureInfo.CreateSpecificCulture("en-NZ");
Console.WriteLine(value.ToString(specifier, culture));
- // Displays: 1.6326E+004
-
+ // Displays: 1.6326E+004
+
specifier = "F";
culture = CultureInfo.CreateSpecificCulture("fr-FR");
Console.WriteLine(value.ToString(specifier, culture));
@@ -338,7 +338,7 @@ private static void CallToStringWithFormatStringAndProvider()
culture = CultureInfo.CreateSpecificCulture("en-CA");
Console.WriteLine(value.ToString(specifier, culture));
// Displays: 16325.63
-
+
specifier = "N";
culture = CultureInfo.CreateSpecificCulture("es-ES");
Console.WriteLine(value.ToString(specifier, culture));
@@ -346,7 +346,7 @@ private static void CallToStringWithFormatStringAndProvider()
culture = CultureInfo.CreateSpecificCulture("fr-CA");
Console.WriteLine(value.ToString(specifier, culture));
// Displays: 16 325,63
-
+
specifier = "P";
culture = CultureInfo.InvariantCulture;
Console.WriteLine((value/10000).ToString(specifier, culture));
@@ -354,6 +354,6 @@ private static void CallToStringWithFormatStringAndProvider()
culture = CultureInfo.CreateSpecificCulture("ar-EG");
Console.WriteLine((value/10000).ToString(specifier, culture));
// Displays: 163.256 %
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.ToString/cs/ToString7.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.ToString/cs/ToString7.cs
index 4dad4e33d92..ebd7f3131ee 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.ToString/cs/ToString7.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.ToString/cs/ToString7.cs
@@ -6,10 +6,10 @@ public class Example
public static void Main()
{
float number = 1764.3789m;
-
+
// Format as a currency value.
Console.WriteLine(number.ToString("C"));
-
+
// Format as a numeric value with 3 decimal places.
Console.WriteLine(number.ToString("N3"));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/TryParse1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/TryParse1.cs
index d8e16cb84a7..e757cd42a39 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/TryParse1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/TryParse1.cs
@@ -14,35 +14,35 @@ private static void DefaultTryParse()
{
string value;
double number;
-
+
// Parse a floating-point value with a thousands separator.
value = "1,643.57";
if (Double.TryParse(value, out number))
Console.WriteLine(number);
else
- Console.WriteLine("Unable to parse '{0}'.", value);
-
- // Parse a floating-point value with a currency symbol and a
+ Console.WriteLine("Unable to parse '{0}'.", value);
+
+ // Parse a floating-point value with a currency symbol and a
// thousands separator.
value = "$1,643.57";
if (Double.TryParse(value, out number))
Console.WriteLine(number);
else
- Console.WriteLine("Unable to parse '{0}'.", value);
-
+ Console.WriteLine("Unable to parse '{0}'.", value);
+
// Parse value in exponential notation.
value = "-1.643e6";
if (Double.TryParse(value, out number))
Console.WriteLine(number);
else
- Console.WriteLine("Unable to parse '{0}'.", value);
-
+ Console.WriteLine("Unable to parse '{0}'.", value);
+
// Parse a negative integer value.
value = "-168934617882109132";
if (Double.TryParse(value, out number))
Console.WriteLine(number);
else
- Console.WriteLine("Unable to parse '{0}'.", value);
+ Console.WriteLine("Unable to parse '{0}'.", value);
// The example displays the following output to the console:
// 1643.57
// Unable to parse '$1,643.57'.
@@ -57,7 +57,7 @@ private static void TryParseWithConstraints()
NumberStyles style;
CultureInfo culture;
double number;
-
+
// Parse currency value using en-GB culture.
value = "£1,097.63";
style = NumberStyles.Number | NumberStyles.AllowCurrencySymbol;
@@ -66,9 +66,9 @@ private static void TryParseWithConstraints()
Console.WriteLine("Converted '{0}' to {1}.", value, number);
else
Console.WriteLine("Unable to convert '{0}'.", value);
- // Displays:
+ // Displays:
// Converted '£1,097.63' to 1097.63.
-
+
value = "1345,978";
style = NumberStyles.AllowDecimalPoint;
culture = CultureInfo.CreateSpecificCulture("fr-FR");
@@ -78,7 +78,7 @@ private static void TryParseWithConstraints()
Console.WriteLine("Unable to convert '{0}'.", value);
// Displays:
// Converted '1345,978' to 1345.978.
-
+
value = "1.345,978";
style = NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands;
culture = CultureInfo.CreateSpecificCulture("es-ES");
@@ -86,9 +86,9 @@ private static void TryParseWithConstraints()
Console.WriteLine("Converted '{0}' to {1}.", value, number);
else
Console.WriteLine("Unable to convert '{0}'.", value);
- // Displays:
+ // Displays:
// Converted '1.345,978' to 1345.978.
-
+
value = "1 345,978";
if (Double.TryParse(value, style, culture, out number))
Console.WriteLine("Converted '{0}' to {1}.", value, number);
@@ -96,6 +96,6 @@ private static void TryParseWithConstraints()
Console.WriteLine("Unable to convert '{0}'.", value);
// Displays:
// Unable to convert '1 345,978'.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/tryparse1a.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/tryparse1a.cs
index 974759fd2fb..7dc2842a8aa 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/tryparse1a.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/tryparse1a.cs
@@ -5,17 +5,17 @@ public class Example
{
public static void Main()
{
- string[] values = { "1,643.57", "$1,643.57", "-1.643e6",
- "-168934617882109132", "123AE6",
+ string[] values = { "1,643.57", "$1,643.57", "-1.643e6",
+ "-168934617882109132", "123AE6",
null, String.Empty, "ABCDEF" };
double number;
-
+
foreach (var value in values) {
- if (Double.TryParse(value, out number))
+ if (Double.TryParse(value, out number))
Console.WriteLine("'{0}' --> {1}", value, number);
else
- Console.WriteLine("Unable to parse '{0}'.", value);
- }
+ Console.WriteLine("Unable to parse '{0}'.", value);
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/tryparse2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/tryparse2.cs
index 9f20a939258..ce5fdeea51a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/tryparse2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double.TryParse/cs/tryparse2.cs
@@ -7,14 +7,14 @@ public static void Main()
{
string value;
double number;
-
+
value = Double.MinValue.ToString();
if (Double.TryParse(value, out number))
Console.WriteLine(number);
else
- Console.WriteLine("{0} is outside the range of a Double.",
+ Console.WriteLine("{0} is outside the range of a Double.",
value);
-
+
value = Double.MaxValue.ToString();
if (Double.TryParse(value, out number))
Console.WriteLine(number);
@@ -25,5 +25,5 @@ public static void Main()
}
// The example displays the following output:
// -1.79769313486232E+308 is outside the range of the Double type.
-// 1.79769313486232E+308 is outside the range of the Double type.
+// 1.79769313486232E+308 is outside the range of the Double type.
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double/CS/doublesample.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double/CS/doublesample.cs
index 9c24487e6c1..150cbc3b9b3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double/CS/doublesample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Double/CS/doublesample.cs
@@ -1,17 +1,17 @@
using System;
class DoubleSample {
- public static void Main()
+ public static void Main()
{
- //
+ //
Double d = 4.55;
//
- //
+ //
Console.WriteLine("A double is of type {0}.", d.GetType().ToString());
//
- //
+ //
bool done = false;
string inp;
do {
@@ -21,7 +21,7 @@ public static void Main()
d = Double.Parse(inp);
Console.WriteLine("You entered {0}.", d.ToString());
done = true;
- }
+ }
catch (FormatException) {
Console.WriteLine("You did not enter a number.");
}
@@ -29,99 +29,99 @@ public static void Main()
Console.WriteLine("You did not supply any input.");
}
catch (OverflowException) {
- Console.WriteLine("The value you entered, {0}, is out of range.", inp);
+ Console.WriteLine("The value you entered, {0}, is out of range.", inp);
}
} while (!done);
//
- //
- if (d > Double.MaxValue)
+ //
+ if (d > Double.MaxValue)
Console.WriteLine("Your number is bigger than a double.");
//
- //
- if (d < Double.MinValue)
+ //
+ if (d < Double.MinValue)
Console.WriteLine("Your number is smaller than a double.");
//
- //
+ //
Console.WriteLine("Epsilon, or the permittivity of a vacuum, has value {0}", Double.Epsilon.ToString());
//
- //
+ //
Double zero = 0;
// This condition will return false.
- if ((0 / zero) == Double.NaN)
+ if ((0 / zero) == Double.NaN)
Console.WriteLine("0 / 0 can be tested with Double.NaN.");
- else
+ else
Console.WriteLine("0 / 0 cannot be tested with Double.NaN; use Double.IsNan() instead.");
//
- //
+ //
// This will return true.
- if (Double.IsNaN(0 / zero))
+ if (Double.IsNaN(0 / zero))
Console.WriteLine("Double.IsNan() can determine whether a value is not-a-number.");
//
- //
+ //
// This will equal Infinity.
Console.WriteLine("10.0 minus NegativeInfinity equals {0}.", (10.0 - Double.NegativeInfinity).ToString());
//
- //
+ //
// This will equal Infinity.
Console.WriteLine("PositiveInfinity plus 10.0 equals {0}.", (Double.PositiveInfinity + 10.0).ToString());
//
-
- //
+
+ //
// This will return "true".
Console.WriteLine("IsInfinity(3.0 / 0) == {0}.", Double.IsInfinity(3.0 / 0) ? "true" : "false");
//
- //
+ //
// This will return "true".
Console.WriteLine("IsPositiveInfinity(4.0 / 0) == {0}.", Double.IsPositiveInfinity(4.0 / 0) ? "true" : "false");
//
-
- //
+
+ //
// This will return "true".
Console.WriteLine("IsNegativeInfinity(-5.0 / 0) == {0}.", Double.IsNegativeInfinity(-5.0 / 0) ? "true" : "false");
//
-
+
//
Double a = 500;
Object obj1;
//
-
- //
+
+ //
// The variables point to the same objects.
Object obj2;
obj1 = a;
obj2 = obj1;
-
- if (Double.ReferenceEquals(obj1, obj2))
+
+ if (Double.ReferenceEquals(obj1, obj2))
Console.WriteLine("The variables point to the same double object.");
- else
+ else
Console.WriteLine("The variables point to different double objects.");
//
-
- //
+
+ //
obj1 = (Double)450;
- if (a.CompareTo(obj1) < 0)
+ if (a.CompareTo(obj1) < 0)
Console.WriteLine("{0} is less than {1}.", a.ToString(), obj1.ToString());
-
- if (a.CompareTo(obj1) > 0)
+
+ if (a.CompareTo(obj1) > 0)
Console.WriteLine("{0} is greater than {1}.", a.ToString(), obj1.ToString());
-
- if (a.CompareTo(obj1) == 0)
+
+ if (a.CompareTo(obj1) == 0)
Console.WriteLine("{0} equals {1}.", a.ToString(), obj1.ToString());
//
-
- //
+
+ //
obj1 = (Double)500;
- if (a.Equals(obj1))
+ if (a.Equals(obj1))
Console.WriteLine("The value type and reference type values are equal.");
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.IsDefined/cs/isdefined1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.IsDefined/cs/isdefined1.cs
index 042a076e793..12bd0aaa70f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.IsDefined/cs/isdefined1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.IsDefined/cs/isdefined1.cs
@@ -10,8 +10,8 @@ public class Example
{
public static void Main()
{
- object value;
-
+ object value;
+
// Call IsDefined with underlying integral value of member.
value = 1;
Console.WriteLine("{0}: {1}", value, Enum.IsDefined(typeof(PetType), value));
@@ -26,7 +26,7 @@ public static void Main()
Console.WriteLine("{0}: {1}", value, Enum.IsDefined(typeof(PetType), value));
value = PetType.Dog | PetType.Cat;
Console.WriteLine("{0}: {1}", value, Enum.IsDefined(typeof(PetType), value));
- // Call IsDefined with uppercase member name.
+ // Call IsDefined with uppercase member name.
value = "None";
Console.WriteLine("{0}: {1}", value, Enum.IsDefined(typeof(PetType), value));
value = "NONE";
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.IsDefined/cs/isdefined2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.IsDefined/cs/isdefined2.cs
index 64597546e46..8f48cf73afb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.IsDefined/cs/isdefined2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.IsDefined/cs/isdefined2.cs
@@ -1,8 +1,8 @@
//
using System;
-[Flags] public enum Pets {
- None = 0, Dog = 1, Cat = 2, Bird = 4,
+[Flags] public enum Pets {
+ None = 0, Dog = 1, Cat = 2, Bird = 4,
Rodent = 8, Other = 16 };
public class Example
@@ -10,10 +10,10 @@ public class Example
public static void Main()
{
Pets value = Pets.Dog | Pets.Cat;
- Console.WriteLine("{0:D} Exists: {1}",
+ Console.WriteLine("{0:D} Exists: {1}",
value, Pets.IsDefined(typeof(Pets), value));
string name = value.ToString();
- Console.WriteLine("{0} Exists: {1}",
+ Console.WriteLine("{0} Exists: {1}",
name, Pets.IsDefined(typeof(Pets), name));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.Parse/cs/ParseExample1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.Parse/cs/ParseExample1.cs
index a01a07ed54e..09f4bfc91b4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.Parse/cs/ParseExample1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.Parse/cs/ParseExample1.cs
@@ -2,7 +2,7 @@
using System;
[Flags] enum Colors { None=0, Red = 1, Green = 2, Blue = 4 };
-
+
public class Example
{
public static void Main()
@@ -11,8 +11,8 @@ public static void Main()
foreach (string colorString in colorStrings)
{
try {
- Colors colorValue = (Colors) Enum.Parse(typeof(Colors), colorString);
- if (Enum.IsDefined(typeof(Colors), colorValue) | colorValue.ToString().Contains(","))
+ Colors colorValue = (Colors) Enum.Parse(typeof(Colors), colorString);
+ if (Enum.IsDefined(typeof(Colors), colorValue) | colorValue.ToString().Contains(","))
Console.WriteLine("Converted '{0}' to {1}.", colorString, colorValue.ToString());
else
Console.WriteLine("{0} is not an underlying value of the Colors enumeration.", colorString);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.Parse/cs/ParseExample2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.Parse/cs/ParseExample2.cs
index 2cf703ec16a..dac24c7a718 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.Parse/cs/ParseExample2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Enum.Parse/cs/ParseExample2.cs
@@ -2,7 +2,7 @@
using System;
[Flags] enum Colors { None=0, Red = 1, Green = 2, Blue = 4 };
-
+
public class Example
{
public static void Main()
@@ -11,8 +11,8 @@ public static void Main()
foreach (string colorString in colorStrings)
{
try {
- Colors colorValue = (Colors) Enum.Parse(typeof(Colors), colorString, true);
- if (Enum.IsDefined(typeof(Colors), colorValue) | colorValue.ToString().Contains(","))
+ Colors colorValue = (Colors) Enum.Parse(typeof(Colors), colorString, true);
+ if (Enum.IsDefined(typeof(Colors), colorValue) | colorValue.ToString().Contains(","))
Console.WriteLine("Converted '{0}' to {1}.", colorString, colorValue.ToString());
else
Console.WriteLine("{0} is not an underlying value of the Colors enumeration.", colorString);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Environment/CS/Vars1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Environment/CS/Vars1.cs
index eaaad89c288..51bdc1d2541 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Environment/CS/Vars1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Environment/CS/Vars1.cs
@@ -7,7 +7,7 @@ public class Example
public static void Main()
{
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
- {
+ {
// Change the directory to %WINDIR%
Environment.CurrentDirectory = Environment.GetEnvironmentVariable("windir");
DirectoryInfo info = new DirectoryInfo(".");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Environment/CS/environmentsample.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Environment/CS/environmentsample.cs
index eb0d1c5f684..dcb5c587fe1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Environment/CS/environmentsample.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Environment/CS/environmentsample.cs
@@ -15,17 +15,17 @@ public static void Main() {
//
- Console.WriteLine("Initial WS:"+Environment.WorkingSet);
+ Console.WriteLine("Initial WS:"+Environment.WorkingSet);
int[] i1,i2,i3;
i1 = new int[10000];
- Console.WriteLine("WS 1:"+Environment.WorkingSet);
+ Console.WriteLine("WS 1:"+Environment.WorkingSet);
i2 = new int[10000];
- Console.WriteLine("WS 2:"+Environment.WorkingSet);
+ Console.WriteLine("WS 2:"+Environment.WorkingSet);
i3 = new int[10000];
- Console.WriteLine("WS 3:"+Environment.WorkingSet);
+ Console.WriteLine("WS 3:"+Environment.WorkingSet);
//
- }
+ }
//
static void OuterMethod() {
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/new.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/new.cs
index b1de7699b52..f9b119c9129 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/new.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/new.cs
@@ -13,21 +13,21 @@ public NotEvenException( ) :
{ }
}
- class NewExceptionDemo
+ class NewExceptionDemo
{
- public static void Main()
+ public static void Main()
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the Exception( ) constructor " +
"generates the following output." );
- Console.WriteLine(
+ Console.WriteLine(
"\nHere, an exception is thrown using the \n" +
"parameterless constructor of the base class.\n" );
CalcHalf( 12 );
CalcHalf( 15 );
- Console.WriteLine(
+ Console.WriteLine(
"\nHere, an exception is thrown using the \n" +
"parameterless constructor of a derived class.\n" );
@@ -59,7 +59,7 @@ static void CalcHalf(int input )
try
{
int halfInput = Half( input );
- Console.WriteLine(
+ Console.WriteLine(
"Half of {0} is {1}.", input, halfInput );
}
catch( Exception ex )
@@ -74,7 +74,7 @@ static void CalcHalf2(int input )
try
{
int halfInput = Half2( input );
- Console.WriteLine(
+ Console.WriteLine(
"Half of {0} is {1}.", input, halfInput );
}
catch( Exception ex )
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/news.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/news.cs
index f5552e03ba6..571dbd3e97e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/news.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/news.cs
@@ -7,7 +7,7 @@ namespace NDP_UE_CS
// Derive an exception with a specifiable message.
class NotEvenException : Exception
{
- const string notEvenMessage =
+ const string notEvenMessage =
"The argument to a function requiring " +
"even input is not divisible by 2.";
@@ -16,26 +16,26 @@ public NotEvenException( ) :
{ }
public NotEvenException( string auxMessage ) :
- base( String.Format( "{0} - {1}",
+ base( String.Format( "{0} - {1}",
auxMessage, notEvenMessage ) )
{ }
}
- class NewSExceptionDemo
+ class NewSExceptionDemo
{
- public static void Main()
+ public static void Main()
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the Exception( string )\n" +
"constructor generates the following output." );
- Console.WriteLine(
+ Console.WriteLine(
"\nHere, an exception is thrown using the \n" +
"constructor of the base class.\n" );
CalcHalf( 18 );
CalcHalf( 21 );
- Console.WriteLine(
+ Console.WriteLine(
"\nHere, an exception is thrown using the \n" +
"constructor of a derived class.\n" );
@@ -47,8 +47,8 @@ public static void Main()
static int Half( int input )
{
if( input % 2 != 0 )
- throw new Exception( String.Format(
- "The argument {0} is not divisible by 2.",
+ throw new Exception( String.Format(
+ "The argument {0} is not divisible by 2.",
input ) );
else return input / 2;
@@ -58,7 +58,7 @@ static int Half( int input )
static int Half2( int input )
{
if( input % 2 != 0 )
- throw new NotEvenException(
+ throw new NotEvenException(
String.Format( "Invalid argument: {0}", input ) );
else return input / 2;
@@ -70,7 +70,7 @@ static void CalcHalf(int input )
try
{
int halfInput = Half( input );
- Console.WriteLine(
+ Console.WriteLine(
"Half of {0} is {1}.", input, halfInput );
}
catch( Exception ex )
@@ -85,7 +85,7 @@ static void CalcHalf2(int input )
try
{
int halfInput = Half2( input );
- Console.WriteLine(
+ Console.WriteLine(
"Half of {0} is {1}.", input, halfInput );
}
catch( Exception ex )
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/newsi.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/newsi.cs
index c7648d46c9b..5cb9052f162 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/newsi.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Ctor/CS/newsi.cs
@@ -7,7 +7,7 @@ namespace NDP_UE_CS
// Derive an exception with a specifiable message and inner exception.
class LogTableOverflowException : Exception
{
- const string overflowMessage =
+ const string overflowMessage =
"The log table has overflowed.";
public LogTableOverflowException( ) :
@@ -15,13 +15,13 @@ public LogTableOverflowException( ) :
{ }
public LogTableOverflowException( string auxMessage ) :
- base( String.Format( "{0} - {1}",
+ base( String.Format( "{0} - {1}",
overflowMessage, auxMessage ) )
{ }
- public LogTableOverflowException(
+ public LogTableOverflowException(
string auxMessage, Exception inner ) :
- base( String.Format( "{0} - {1}",
+ base( String.Format( "{0} - {1}",
overflowMessage, auxMessage ), inner )
{ }
}
@@ -37,7 +37,7 @@ public LogTable( int numElements )
protected string[ ] logArea;
protected int elemInUse;
- // The AddRecord method throws a derived exception
+ // The AddRecord method throws a derived exception
// if the array bounds exception is caught.
public int AddRecord( string newRecord )
{
@@ -48,32 +48,32 @@ public int AddRecord( string newRecord )
}
catch( Exception ex )
{
- throw new LogTableOverflowException(
- String.Format( "Record \"{0}\" was not logged.",
+ throw new LogTableOverflowException(
+ String.Format( "Record \"{0}\" was not logged.",
newRecord ), ex );
}
}
}
- class OverflowDemo
+ class OverflowDemo
{
// Create a log table and force an overflow.
- public static void Main()
+ public static void Main()
{
LogTable log = new LogTable( 4 );
- Console.WriteLine(
+ Console.WriteLine(
"This example of the Exception( string, Exception )" +
"\nconstructor generates the following output." );
- Console.WriteLine(
+ Console.WriteLine(
"\nExample of a derived exception " +
"that references an inner exception:\n" );
try
{
for( int count = 1; ; count++ )
{
- log.AddRecord(
- String.Format(
+ log.AddRecord(
+ String.Format(
"Log record number {0}", count ) );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.GetBaseException/CS/getbaseexc.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.GetBaseException/CS/getbaseexc.cs
index a0f87eb9a1a..c271d7cdce4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.GetBaseException/CS/getbaseexc.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.GetBaseException/CS/getbaseexc.cs
@@ -13,26 +13,26 @@ public SecondLevelException( string message, Exception inner )
}
class ThirdLevelException : Exception
{
- public ThirdLevelException( string message, Exception inner )
+ public ThirdLevelException( string message, Exception inner )
: base( message, inner )
{ }
}
class NestedExceptions
{
- public static void Main()
+ public static void Main()
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of Exception.GetBaseException " +
"generates the following output." );
- Console.WriteLine(
+ Console.WriteLine(
"\nThe program forces a division by 0, then " +
"throws the exception \ntwice more, " +
"using a different derived exception each time.\n" );
try
{
- // This function calls another that forces a
+ // This function calls another that forces a
// division by 0.
Rethrow( );
}
@@ -40,11 +40,11 @@ public static void Main()
{
Exception current;
- Console.WriteLine(
+ Console.WriteLine(
"Unwind the nested exceptions " +
"using the InnerException property:\n" );
- // This code unwinds the nested exceptions using the
+ // This code unwinds the nested exceptions using the
// InnerException property.
current = ex;
while( current != null )
@@ -55,15 +55,15 @@ public static void Main()
}
// Display the innermost exception.
- Console.WriteLine(
+ Console.WriteLine(
"Display the base exception " +
"using the GetBaseException method:\n" );
- Console.WriteLine(
+ Console.WriteLine(
ex.GetBaseException( ).ToString( ) );
}
}
- // This function catches the exception from the called
+ // This function catches the exception from the called
// function DivideBy0( ) and throws another in response.
static void Rethrow()
{
@@ -73,13 +73,13 @@ static void Rethrow()
}
catch( Exception ex )
{
- throw new ThirdLevelException(
+ throw new ThirdLevelException(
"Caught the second exception and " +
"threw a third in response.", ex );
}
}
- // This function forces a division by 0 and throws a second
+ // This function forces a division by 0 and throws a second
// exception.
static void DivideBy0( )
{
@@ -90,7 +90,7 @@ static void DivideBy0( )
}
catch( Exception ex )
{
- throw new SecondLevelException(
+ throw new SecondLevelException(
"Forced a division by 0 and threw " +
"a second exception.", ex );
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.GetObjectData/CS/getobjdata.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.GetObjectData/CS/getobjdata.cs
index dff62a4eb23..84476a1049e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.GetObjectData/CS/getobjdata.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.GetObjectData/CS/getobjdata.cs
@@ -18,17 +18,17 @@ public SecondLevelException( string message, Exception inner ) :
}
// This protected constructor is used for deserialization.
- protected SecondLevelException( SerializationInfo info,
+ protected SecondLevelException( SerializationInfo info,
StreamingContext context ) :
base( info, context )
{ }
// GetObjectData performs a custom serialization.
[SecurityPermissionAttribute(SecurityAction.Demand,SerializationFormatter=true)]
- public override void GetObjectData( SerializationInfo info,
- StreamingContext context )
+ public override void GetObjectData( SerializationInfo info,
+ StreamingContext context )
{
- // Change the case of two properties, and then use the
+ // Change the case of two properties, and then use the
// method of the base class.
HelpLink = HelpLink.ToLower( );
Source = Source.ToUpperInvariant();
@@ -37,11 +37,11 @@ public override void GetObjectData( SerializationInfo info,
}
}
- class SerializationDemo
+ class SerializationDemo
{
- public static void Main()
+ public static void Main()
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of the Exception constructor " +
"and Exception.GetObjectData\nwith Serialization" +
"Info and StreamingContext parameters " +
@@ -49,7 +49,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
{
@@ -60,53 +60,53 @@ public static void Main()
{
// Create a new exception to throw again.
SecondLevelException newExcept =
- new SecondLevelException(
+ new SecondLevelException(
"Forced a division by 0 and threw " +
"another exception.", ex );
- Console.WriteLine(
+ Console.WriteLine(
"Forced a division by 0, caught the " +
"resulting exception, \n" +
"and created a derived exception:\n" );
- Console.WriteLine( "HelpLink: {0}",
+ Console.WriteLine( "HelpLink: {0}",
newExcept.HelpLink );
- Console.WriteLine( "Source: {0}",
+ Console.WriteLine( "Source: {0}",
newExcept.Source );
// This FileStream is used for the serialization.
- FileStream stream =
- new FileStream( "NewException.dat",
+ FileStream stream =
+ new FileStream( "NewException.dat",
FileMode.Create );
try
{
// Serialize the derived exception.
- SoapFormatter formatter =
+ SoapFormatter formatter =
new SoapFormatter( null,
- new StreamingContext(
+ new StreamingContext(
StreamingContextStates.File ) );
formatter.Serialize( stream, newExcept );
- // Rewind the stream and deserialize the
+ // Rewind the stream and deserialize the
// exception.
stream.Position = 0;
- SecondLevelException deserExcept =
+ SecondLevelException deserExcept =
(SecondLevelException)
formatter.Deserialize( stream );
- Console.WriteLine(
+ Console.WriteLine(
"\nSerialized the exception, and then " +
"deserialized the resulting stream " +
"into a \nnew exception. " +
"The deserialization changed the case " +
"of certain properties:\n" );
-
+
// Throw the deserialized exception again.
throw deserExcept;
}
catch( SerializationException se )
{
- Console.WriteLine( "Failed to serialize: {0}",
+ Console.WriteLine( "Failed to serialize: {0}",
se.ToString( ) );
}
finally
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.HResult/CS/hresult.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.HResult/CS/hresult.cs
index 90490f8bef2..39a3ab67eec 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.HResult/CS/hresult.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.HResult/CS/hresult.cs
@@ -9,25 +9,25 @@ class SecondLevelException : Exception
{
const int SecondLevelHResult = unchecked( (int)0x81234567 );
- // Set HResult for this exception, and include it in
+ // Set HResult for this exception, and include it in
// the exception message.
public SecondLevelException( string message, Exception inner ) :
- base( string.Format( "(HRESULT:0x{1:X8}) {0}",
+ base( string.Format( "(HRESULT:0x{1:X8}) {0}",
message, SecondLevelHResult ), inner )
{
HResult = SecondLevelHResult;
}
}
- class HResultDemo
+ class HResultDemo
{
- public static void Main()
+ public static void Main()
{
- Console.WriteLine(
+ Console.WriteLine(
"This example of Exception.HResult " +
"generates the following output.\n" );
- // This function forces a division by 0 and throws
+ // This function forces a division by 0 and throws
// a second exception.
try
{
@@ -38,7 +38,7 @@ public static void Main()
}
catch( Exception ex )
{
- throw new SecondLevelException(
+ throw new SecondLevelException(
"Forced a division by 0 and threw " +
"a second exception.", ex );
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Properties/CS/properties.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Properties/CS/properties.cs
index 38c8004f649..e07ec363d7b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Properties/CS/properties.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Exception.Properties/CS/properties.cs
@@ -5,15 +5,15 @@
namespace NDP_UE_CS
{
- // Derive an exception; the constructor sets the HelpLink and
+ // Derive an exception; the constructor sets the HelpLink and
// Source properties.
class LogTableOverflowException : Exception
{
const string overflowMessage = "The log table has overflowed.";
- public LogTableOverflowException(
+ public LogTableOverflowException(
string auxMessage, Exception inner ) :
- base( String.Format( "{0} - {1}",
+ base( String.Format( "{0} - {1}",
overflowMessage, auxMessage ), inner )
{
this.HelpLink = "http://msdn.microsoft.com";
@@ -32,7 +32,7 @@ public LogTable( int numElements )
protected string[ ] logArea;
protected int elemInUse;
- // The AddRecord method throws a derived exception if
+ // The AddRecord method throws a derived exception if
// the array bounds exception is caught.
public int AddRecord( string newRecord )
{
@@ -43,21 +43,21 @@ public int AddRecord( string newRecord )
}
catch( Exception e )
{
- throw new LogTableOverflowException(
- String.Format( "Record \"{0}\" was not logged.",
+ throw new LogTableOverflowException(
+ String.Format( "Record \"{0}\" was not logged.",
newRecord ), e );
}
}
}
- class OverflowDemo
+ class OverflowDemo
{
// Create a log table and force an overflow.
- public static void Main()
+ public static void Main()
{
LogTable log = new LogTable( 4 );
- Console.WriteLine(
+ Console.WriteLine(
"This example of \n Exception.Message, \n" +
" Exception.HelpLink, \n Exception.Source, \n" +
" Exception.StackTrace, and \n Exception." +
@@ -67,20 +67,20 @@ public static void Main()
{
for( int count = 1; ; count++ )
{
- log.AddRecord(
- String.Format(
+ log.AddRecord(
+ String.Format(
"Log record number {0}", count ) );
}
}
catch( Exception ex )
{
Console.WriteLine( "\nMessage ---\n{0}", ex.Message );
- Console.WriteLine(
+ Console.WriteLine(
"\nHelpLink ---\n{0}", ex.HelpLink );
Console.WriteLine( "\nSource ---\n{0}", ex.Source );
- Console.WriteLine(
+ Console.WriteLine(
"\nStackTrace ---\n{0}", ex.StackTrace );
- Console.WriteLine(
+ Console.WriteLine(
"\nTargetSite ---\n{0}", ex.TargetSite );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.FlagsAttribute/CS/flags.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.FlagsAttribute/CS/flags.cs
index caf1a5eb6e3..8c1d680cf2f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.FlagsAttribute/CS/flags.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.FlagsAttribute/CS/flags.cs
@@ -14,7 +14,7 @@ enum SingleHue : short
};
// Define an Enum with FlagsAttribute.
- [Flags]
+ [Flags]
enum MultiHue : short
{
None = 0,
@@ -27,18 +27,18 @@ enum MultiHue : short
static void Main( )
{
// Display all possible combinations of values.
- Console.WriteLine(
+ Console.WriteLine(
"All possible combinations of values without FlagsAttribute:");
for(int val = 0; val <= 16; val++ )
Console.WriteLine( "{0,3} - {1:G}", val, (SingleHue)val);
// Display all combinations of values, and invalid values.
- Console.WriteLine(
+ Console.WriteLine(
"\nAll possible combinations of values with FlagsAttribute:");
for( int val = 0; val <= 16; val++ )
Console.WriteLine( "{0,3} - {1:G}", val, (MultiHue)val);
- }
-}
+ }
+}
// The example displays the following output:
// All possible combinations of values without FlagsAttribute:
// 0 - None
@@ -58,7 +58,7 @@ static void Main( )
// 14 - 14
// 15 - 15
// 16 - 16
-//
+//
// All possible combinations of values with FlagsAttribute:
// 0 - None
// 1 - Black
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Anon.cs
index 7d16a8848b1..5557c1956bb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Anon.cs
@@ -9,7 +9,7 @@ public static void Main()
OutputTarget output = new OutputTarget();
Func methodCall = delegate() { return output.SendToFile(); };
if (methodCall())
- Console.WriteLine("Success!");
+ Console.WriteLine("Success!");
else
Console.WriteLine("File write operation failed.");
}
@@ -26,7 +26,7 @@ public bool SendToFile()
sw.WriteLine("Hello, World!");
sw.Close();
return true;
- }
+ }
catch
{
return false;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Delegate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Delegate.cs
index 63b7c877224..ca4765efd36 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Delegate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Delegate.cs
@@ -11,7 +11,7 @@ public static void Main()
OutputTarget output = new OutputTarget();
WriteMethod methodCall = output.SendToFile;
if (methodCall())
- Console.WriteLine("Success!");
+ Console.WriteLine("Success!");
else
Console.WriteLine("File write operation failed.");
}
@@ -28,7 +28,7 @@ public bool SendToFile()
sw.WriteLine("Hello, World!");
sw.Close();
return true;
- }
+ }
catch
{
return false;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Example.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Example.cs
index c7e3412b5d5..2e22694e267 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Example.cs
@@ -15,7 +15,7 @@ public static void Main()
Console.WriteLine(lazyOne.Value);
Console.WriteLine(lazyTwo.Value);
}
-
+
static int ExpensiveOne()
{
Console.WriteLine("\nExpensiveOne() is executing.");
@@ -55,11 +55,11 @@ public T Value
/* The example produces the following output:
LazyValue objects have been created.
-
+
ExpensiveOne() is executing.
1
-
+
ExpensiveTwo() is executing.
5
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Func1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Func1.cs
index 82a89b01fa0..d19452d4fd6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Func1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Func1.cs
@@ -9,7 +9,7 @@ public static void Main()
OutputTarget output = new OutputTarget();
Func methodCall = output.SendToFile;
if (methodCall())
- Console.WriteLine("Success!");
+ Console.WriteLine("Success!");
else
Console.WriteLine("File write operation failed.");
}
@@ -26,7 +26,7 @@ public bool SendToFile()
sw.WriteLine("Hello, World!");
sw.Close();
return true;
- }
+ }
catch
{
return false;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Lambda.cs
index bcf87a9fde7..729a7ac419a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~1/cs/Lambda.cs
@@ -7,9 +7,9 @@ public class Anonymous
public static void Main()
{
OutputTarget output = new OutputTarget();
- Func methodCall = () => output.SendToFile();
+ Func methodCall = () => output.SendToFile();
if (methodCall())
- Console.WriteLine("Success!");
+ Console.WriteLine("Success!");
else
Console.WriteLine("File write operation failed.");
}
@@ -26,7 +26,7 @@ public bool SendToFile()
sw.WriteLine("Hello, World!");
sw.Close();
return true;
- }
+ }
catch
{
return false;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Anon.cs
index 85ee9466ff0..843252f797c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Anon.cs
@@ -6,14 +6,14 @@ public static void Main()
{
//
Func convert = delegate(string s)
- { return s.ToUpper();};
-
+ { return s.ToUpper();};
+
string name = "Dakota";
- Console.WriteLine(convert(name));
+ Console.WriteLine(convert(name));
// This code example produces the following output:
//
- // DAKOTA
+ // DAKOTA
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Example.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Example.cs
index c5086f6cbb9..0d2946bfa83 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Example.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Example.cs
@@ -8,7 +8,7 @@ static class Func
static void Main(string[] args)
{
//
- // Declare a Func variable and assign a lambda expression to the
+ // Declare a Func variable and assign a lambda expression to the
// variable. The method takes a string and converts it to uppercase.
Func selector = str => str.ToUpper();
@@ -23,7 +23,7 @@ static void Main(string[] args)
/*
This code example produces the following output:
-
+
ORANGE
APPLE
ARTICLE
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Func2_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Func2_1.cs
index db371ea7928..359be5ff290 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Func2_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Func2_1.cs
@@ -18,7 +18,7 @@ string UppercaseString(string inputString)
// This code example produces the following output:
//
- // DAKOTA
+ // DAKOTA
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Lambda.cs
index ad67d193774..b731b586d78 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~2/cs/Lambda.cs
@@ -8,13 +8,13 @@ public static void Main()
{
//
Func convert = s => s.ToUpper();
-
+
string name = "Dakota";
- Console.WriteLine(convert(name));
+ Console.WriteLine(convert(name));
// This code example produces the following output:
//
- // DAKOTA
+ // DAKOTA
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~3/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~3/cs/Anon.cs
index cb8f64415da..43a0bc121a9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~3/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~3/cs/Anon.cs
@@ -6,10 +6,10 @@ public class Anonymous
public static void Main()
{
Func extractMeth = delegate(string s, int i)
- { char[] delimiters = new char[] {' '};
+ { char[] delimiters = new char[] {' '};
return i > 0 ? s.Split(delimiters, i) : s.Split(delimiters);
};
-
+
string title = "The Scarlet Letter";
// Use Func instance to call ExtractWords method and display result
foreach (string word in extractMeth(title, 5))
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~3/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~3/cs/Lambda.cs
index c10206f68c8..fee87be7983 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~3/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~3/cs/Lambda.cs
@@ -8,9 +8,9 @@ public class LambdaExpression
public static void Main()
{
char[] separators = new char[] {' '};
- Func extract = (s, i) =>
+ Func extract = (s, i) =>
i > 0 ? s.Split(separators, i) : s.Split(separators) ;
-
+
string title = "The Scarlet Letter";
// Use Func instance to call ExtractWords method and display result
foreach (string word in extract(title, 5))
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Anon.cs
index 6a8322d5833..22deb37623d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Anon.cs
@@ -7,11 +7,11 @@ public class Anonymous
public static void Main()
{
string numericString = "-1,234";
- Func parser =
- delegate(string s, NumberStyles sty, IFormatProvider p)
+ Func parser =
+ delegate(string s, NumberStyles sty, IFormatProvider p)
{ return int.Parse(s, sty, p); };
- Console.WriteLine(parser(numericString,
- NumberStyles.Integer | NumberStyles.AllowThousands,
+ Console.WriteLine(parser(numericString,
+ NumberStyles.Integer | NumberStyles.AllowThousands,
CultureInfo.InvariantCulture));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Delegate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Delegate.cs
index 8c0ee6ea284..ce851b318e9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Delegate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Delegate.cs
@@ -2,17 +2,17 @@
using System;
using System.Globalization;
-delegate T ParseNumber(string input, NumberStyles styles,
+delegate T ParseNumber(string input, NumberStyles styles,
IFormatProvider provider);
-
+
public class DelegateExample
{
public static void Main()
{
string numericString = "-1,234";
ParseNumber parser = int.Parse;
- Console.WriteLine(parser(numericString,
- NumberStyles.Integer | NumberStyles.AllowThousands,
+ Console.WriteLine(parser(numericString,
+ NumberStyles.Integer | NumberStyles.AllowThousands,
CultureInfo.InvariantCulture));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Func4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Func4.cs
index 107b5c92b43..cca8f925697 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Func4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Func4.cs
@@ -8,8 +8,8 @@ public static void Main()
{
string numericString = "-1,234";
Func parser = int.Parse;
- Console.WriteLine(parser(numericString,
- NumberStyles.Integer | NumberStyles.AllowThousands,
+ Console.WriteLine(parser(numericString,
+ NumberStyles.Integer | NumberStyles.AllowThousands,
CultureInfo.InvariantCulture));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Lambda.cs
index 92fd64f8a58..ab55c3e0f08 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~4/cs/Lambda.cs
@@ -9,8 +9,8 @@ public static void Main()
string numericString = "-1,234";
Func parser = (s, sty, p)
=> int.Parse(s, sty, p);
- Console.WriteLine(parser(numericString,
- NumberStyles.Integer | NumberStyles.AllowThousands,
+ Console.WriteLine(parser(numericString,
+ NumberStyles.Integer | NumberStyles.AllowThousands,
CultureInfo.InvariantCulture));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Anon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Anon.cs
index 5d433a6e749..f1c76f65f6d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Anon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Anon.cs
@@ -7,18 +7,18 @@ public static void Main()
{
string title = "The House of the Seven Gables";
int position = 0;
- Func finder =
- delegate(string s, int pos, int chars, StringComparison type)
+ Func finder =
+ delegate(string s, int pos, int chars, StringComparison type)
{ return title.IndexOf(s, pos, chars, type); };
do
{
int characters = title.Length - position;
- position = finder("the", position, characters,
+ position = finder("the", position, characters,
StringComparison.InvariantCultureIgnoreCase);
if (position >= 0)
{
position++;
- Console.WriteLine("'The' found at position {0} in {1}.",
+ Console.WriteLine("'The' found at position {0} in {1}.",
position, title);
}
} while (position > 0);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Delegate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Delegate.cs
index a7f24efc7fc..0e7f12bc8b4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Delegate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Delegate.cs
@@ -1,9 +1,9 @@
//
using System;
-delegate int Searcher(string searchString, int start, int count,
+delegate int Searcher(string searchString, int start, int count,
StringComparison type);
-
+
public class DelegateExample
{
public static void Main()
@@ -14,12 +14,12 @@ public static void Main()
do
{
int characters = title.Length - position;
- position = finder("the", position, characters,
+ position = finder("the", position, characters,
StringComparison.InvariantCultureIgnoreCase);
if (position >= 0)
{
position++;
- Console.WriteLine("'The' found at position {0} in {1}.",
+ Console.WriteLine("'The' found at position {0} in {1}.",
position, title);
}
} while (position > 0);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Func5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Func5.cs
index b1e278daebc..bfe2b90c3b8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Func5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Func5.cs
@@ -11,12 +11,12 @@ public static void Main()
do
{
int characters = title.Length - position;
- position = finder("the", position, characters,
+ position = finder("the", position, characters,
StringComparison.InvariantCultureIgnoreCase);
if (position >= 0)
{
position++;
- Console.WriteLine("'The' found at position {0} in {1}.",
+ Console.WriteLine("'The' found at position {0} in {1}.",
position, title);
}
} while (position > 0);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Lambda.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Lambda.cs
index c00c810ca7d..b660ab2100c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Lambda.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Func~5/cs/Lambda.cs
@@ -7,17 +7,17 @@ public static void Main()
{
string title = "The House of the Seven Gables";
int position = 0;
- Func finder =
- (s, pos, chars, type) => title.IndexOf(s, pos, chars, type);
+ Func finder =
+ (s, pos, chars, type) => title.IndexOf(s, pos, chars, type);
do
{
int characters = title.Length - position;
- position = finder("the", position, characters,
+ position = finder("the", position, characters,
StringComparison.InvariantCultureIgnoreCase);
if (position >= 0)
{
position++;
- Console.WriteLine("'The' found at position {0} in {1}.",
+ Console.WriteLine("'The' found at position {0} in {1}.",
position, title);
}
} while (position > 0);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.Collect Example/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.Collect Example/CS/class1.cs
index 5aaf7d1e850..b0b7bd616db 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.Collect Example/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.Collect Example/CS/class1.cs
@@ -9,12 +9,12 @@ static void Main()
{
// Put some objects in memory.
MyGCCollectClass.MakeSomeGarbage();
- Console.WriteLine("Memory used before collection: {0:N0}",
+ Console.WriteLine("Memory used before collection: {0:N0}",
GC.GetTotalMemory(false));
-
+
// Collect all generations of memory.
GC.Collect();
- Console.WriteLine("Memory used after full collection: {0:N0}",
+ Console.WriteLine("Memory used after full collection: {0:N0}",
GC.GetTotalMemory(true));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.GetGenerationWeak Example/CS/systemgcgetgenerationweak.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.GetGenerationWeak Example/CS/systemgcgetgenerationweak.cs
index d509e445096..acad2939c97 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.GetGenerationWeak Example/CS/systemgcgetgenerationweak.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.GetGenerationWeak Example/CS/systemgcgetgenerationweak.cs
@@ -6,7 +6,7 @@ namespace GCGetGenerationWeakExample
public class MyGCCollectClass
{
private const long maxGarbage = 1000;
-
+
static void Main()
{
// Create a strong reference to an object.
@@ -14,7 +14,7 @@ static void Main()
// Put some objects in memory.
myGCCol.MakeSomeGarbage();
-
+
// Get the generation of managed memory where myGCCol is stored.
Console.WriteLine("The object is in generation: {0}", GC.GetGeneration(myGCCol));
@@ -30,7 +30,7 @@ static void Main()
WeakReference wkref = new WeakReference(myGCCol);
// Remove the strong reference to myGCCol.
myGCCol = null;
-
+
// Get the generation of managed memory where wkref is stored.
Console.WriteLine("The WeakReference to the object is in generation: {0}", GC.GetGeneration(wkref));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.KeepAlive Example2/CS/gckeepalive.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.KeepAlive Example2/CS/gckeepalive.cs
index 34208228efa..eefa3cb16ef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.KeepAlive Example2/CS/gckeepalive.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.KeepAlive Example2/CS/gckeepalive.cs
@@ -5,31 +5,31 @@
// A simple class that exposes two static Win32 functions.
// One is a delegate type and the other is an enumerated type.
-public class MyWin32
+public class MyWin32
{
- // Declare the SetConsoleCtrlHandler function
- // as external and receiving a delegate.
- [DllImport("Kernel32")]
- public static extern Boolean SetConsoleCtrlHandler(HandlerRoutine Handler,
+ // Declare the SetConsoleCtrlHandler function
+ // as external and receiving a delegate.
+ [DllImport("Kernel32")]
+ public static extern Boolean SetConsoleCtrlHandler(HandlerRoutine Handler,
Boolean Add);
- // A delegate type to be used as the handler routine
+ // A delegate type to be used as the handler routine
// for SetConsoleCtrlHandler.
public delegate Boolean HandlerRoutine(CtrlTypes CtrlType);
- // An enumerated type for the control messages
+ // An enumerated type for the control messages
// sent to the handler routine.
- public enum CtrlTypes
+ public enum CtrlTypes
{
CTRL_C_EVENT = 0,
CTRL_BREAK_EVENT,
- CTRL_CLOSE_EVENT,
+ CTRL_CLOSE_EVENT,
CTRL_LOGOFF_EVENT = 5,
CTRL_SHUTDOWN_EVENT
}
}
-public class MyApp
+public class MyApp
{
// A private static handler function in the MyApp class.
static Boolean Handler(MyWin32.CtrlTypes CtrlType)
@@ -45,7 +45,7 @@ static Boolean Handler(MyWin32.CtrlTypes CtrlType)
case MyWin32.CtrlTypes.CTRL_BREAK_EVENT:
message = "A CTRL_BREAK_EVENT was raised by the user.";
break;
- case MyWin32.CtrlTypes.CTRL_CLOSE_EVENT:
+ case MyWin32.CtrlTypes.CTRL_CLOSE_EVENT:
message = "A CTRL_CLOSE_EVENT was raised by the user.";
break;
case MyWin32.CtrlTypes.CTRL_LOGOFF_EVENT:
@@ -63,7 +63,7 @@ static Boolean Handler(MyWin32.CtrlTypes CtrlType)
}
public static void Main()
- {
+ {
// Use interop to set a console control handler.
MyWin32.HandlerRoutine hr = new MyWin32.HandlerRoutine(Handler);
@@ -75,7 +75,7 @@ public static void Main()
// The object hr is not referred to again.
// The garbage collector can detect that the object has no
// more managed references and might clean it up here while
- // the unmanaged SetConsoleCtrlHandler method is still using it.
+ // the unmanaged SetConsoleCtrlHandler method is still using it.
// Force a garbage collection to demonstrate how the hr
// object will be handled.
@@ -89,10 +89,10 @@ public static void Main()
// has finished its work.
Console.WriteLine("Finished!");
- // Call GC.KeepAlive(hr) at this point to maintain a reference to hr.
- // This will prevent the garbage collector from collecting the
+ // Call GC.KeepAlive(hr) at this point to maintain a reference to hr.
+ // This will prevent the garbage collector from collecting the
// object during the execution of the SetConsoleCtrlHandler method.
- GC.KeepAlive(hr);
+ GC.KeepAlive(hr);
Console.Read();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.ReRegisterForFinalize Example/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.ReRegisterForFinalize Example/CS/class1.cs
index 2a26f39cc3b..0e3e853147b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.ReRegisterForFinalize Example/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.ReRegisterForFinalize Example/CS/class1.cs
@@ -36,11 +36,11 @@ class MyFinalizeObject
if(hasFinalized == false)
{
Console.WriteLine("First finalization");
-
+
// Put this object back into a root by creating
// a reference to it.
MyFinalizeObject.currentInstance = this;
-
+
// Indicate that this instance has finalized once.
hasFinalized = true;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.WaitForPendingFinalizers Example/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.WaitForPendingFinalizers Example/CS/class1.cs
index d82d6c89d6d..b6421b9515f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.WaitForPendingFinalizers Example/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GC.WaitForPendingFinalizers Example/CS/class1.cs
@@ -14,23 +14,23 @@ class MyWaitForPendingFinalizersClass
static void Main(string[] args)
{
MyFinalizeObject mfo = null;
-
+
// Create and release a large number of objects
// that require finalization.
for(int j = 0; j < numMfos; j++)
{
mfo = new MyFinalizeObject();
}
-
+
//Release the last object created in the loop.
mfo = null;
//Force garbage collection.
GC.Collect();
-
+
// Wait for all finalizers to complete before continuing.
- // Without this call to GC.WaitForPendingFinalizers,
- // the worker loop below might execute at the same time
+ // Without this call to GC.WaitForPendingFinalizers,
+ // the worker loop below might execute at the same time
// as the finalizers.
// With this call, the worker loop executes only after
// all finalizers have been called.
@@ -49,7 +49,7 @@ class MyFinalizeObject
// Make this number very large to cause the finalizer to
// do more work.
private const int maxIterations = 10000;
-
+
~MyFinalizeObject()
{
Console.WriteLine("Finalizing a MyFinalizeObject");
@@ -57,8 +57,8 @@ class MyFinalizeObject
// Do some work.
for(int i = 0; i < maxIterations; i++)
{
- // This method performs no operation on i, but prevents
- // the JIT compiler from optimizing away the code inside
+ // This method performs no operation on i, but prevents
+ // the JIT compiler from optimizing away the code inside
// the loop.
GC.KeepAlive(i);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/EqualsEx1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/EqualsEx1.cs
index e4ec86499a2..6517c3d0789 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/EqualsEx1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/EqualsEx1.cs
@@ -105,17 +105,17 @@ public static void Main()
// Create a Person object for the final candidate.
Person candidate = new Person("Jones", "199-29-3999");
if (applicants.Contains(candidate))
- Console.WriteLine("Found {0} (SSN {1}).",
+ Console.WriteLine("Found {0} (SSN {1}).",
candidate.LastName, candidate.SSN);
else
Console.WriteLine("Applicant {0} not found.", candidate.SSN);
// Call the shared inherited Equals(Object, Object) method.
// It will in turn call the IEquatable(Of T).Equals implementation.
- Console.WriteLine("{0}({1}) already on file: {2}.",
- applicant2.LastName,
- applicant2.SSN,
- Person.Equals(applicant2, candidate));
+ Console.WriteLine("{0}({1}) already on file: {2}.",
+ applicant2.LastName,
+ applicant2.SSN,
+ Person.Equals(applicant2, candidate));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/EqualsEx2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/EqualsEx2.cs
index 206812294e9..ff2ffdde75e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/EqualsEx2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/EqualsEx2.cs
@@ -100,17 +100,17 @@ public static void Main()
// Create a Person object for the final candidate.
Person candidate = new Person("Jones", "199-29-3999");
if (applicants.Contains(candidate))
- Console.WriteLine("Found {0} (SSN {1}).",
+ Console.WriteLine("Found {0} (SSN {1}).",
candidate.LastName, candidate.SSN);
else
Console.WriteLine("Applicant {0} not found.", candidate.SSN);
// Call the shared inherited Equals(Object, Object) method.
// It will in turn call the IEquatable(Of T).Equals implementation.
- Console.WriteLine("{0}({1}) already on file: {2}.",
- applicant2.LastName,
- applicant2.SSN,
- Person.Equals(applicant2, candidate));
+ Console.WriteLine("{0}({1}) already on file: {2}.",
+ applicant2.LastName,
+ applicant2.SSN,
+ Person.Equals(applicant2, candidate));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/Snippet12.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/Snippet12.cs
index 8b661026fba..c6effdc8e62 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/Snippet12.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.GenericIEquatable.Equals/cs/Snippet12.cs
@@ -103,17 +103,17 @@ public static void Main()
// Create a Person object for the final candidate.
Person candidate = new Person("Jones", "199-29-3999");
if (applicants.Contains(candidate))
- Console.WriteLine("Found {0} (SSN {1}).",
+ Console.WriteLine("Found {0} (SSN {1}).",
candidate.LastName, candidate.SSN);
else
Console.WriteLine("Applicant {0} not found.", candidate.SSN);
// Call the shared inherited Equals(Object, Object) method.
// It will in turn call the IEquatable(Of T).Equals implementation.
- Console.WriteLine("{0}({1}) already on file: {2}.",
- applicant2.LastName,
- applicant2.SSN,
- Person.Equals(applicant2, candidate));
+ Console.WriteLine("{0}({1}) already on file: {2}.",
+ applicant2.LastName,
+ applicant2.SSN,
+ Person.Equals(applicant2, candidate));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar.GetWeekOfYear/CS/getweekofyearex1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar.GetWeekOfYear/CS/getweekofyearex1.cs
index eae44a9970a..517f1724866 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar.GetWeekOfYear/CS/getweekofyearex1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar.GetWeekOfYear/CS/getweekofyearex1.cs
@@ -9,11 +9,11 @@ public static void Main()
DateTimeFormatInfo dfi = DateTimeFormatInfo.CurrentInfo;
DateTime date1 = new DateTime(2011, 1, 1);
Calendar cal = dfi.Calendar;
-
- Console.WriteLine("{0:d}: Week {1} ({2})", date1,
- cal.GetWeekOfYear(date1, dfi.CalendarWeekRule,
+
+ Console.WriteLine("{0:d}: Week {1} ({2})", date1,
+ cal.GetWeekOfYear(date1, dfi.CalendarWeekRule,
dfi.FirstDayOfWeek),
- cal.ToString().Substring(cal.ToString().LastIndexOf(".") + 1));
+ cal.ToString().Substring(cal.ToString().LastIndexOf(".") + 1));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar_Compare/CS/calendar_compare.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar_Compare/CS/calendar_compare.cs
index 576497c11a6..10275dafcac 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar_Compare/CS/calendar_compare.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.Calendar_Compare/CS/calendar_compare.cs
@@ -54,7 +54,7 @@ This code produces the following output. The results vary depending on the date
MonthsInYear: 12
DaysInYear: 365
Days in each month:
- 31 28 31 30 31 30 31 31 30 31 30 31
+ 31 28 31 30 31 30 31 31 30 31 30 31
IsLeapDay: False
IsLeapMonth: False
IsLeapYear: False
@@ -63,7 +63,7 @@ 31 28 31 30 31 30 31 31 30 31 30 31
MonthsInYear: 13
DaysInYear: 385
Days in each month:
- 30 30 30 29 30 30 29 30 29 30 29 30 29
+ 30 30 30 29 30 30 29 30 29 30 29 30 29
IsLeapDay: False
IsLeapMonth: False
IsLeapYear: True
@@ -72,7 +72,7 @@ 30 30 30 29 30 30 29 30 29 30 29 30 29
MonthsInYear: 12
DaysInYear: 355
Days in each month:
- 30 29 30 29 30 29 30 29 30 29 30 30
+ 30 29 30 29 30 29 30 29 30 29 30 30
IsLeapDay: False
IsLeapMonth: False
IsLeapYear: True
@@ -81,7 +81,7 @@ 30 29 30 29 30 29 30 29 30 29 30 30
MonthsInYear: 12
DaysInYear: 365
Days in each month:
- 31 28 31 30 31 30 31 31 30 31 30 31
+ 31 28 31 30 31 30 31 31 30 31 30 31
IsLeapDay: False
IsLeapMonth: False
IsLeapYear: False
@@ -90,7 +90,7 @@ 31 28 31 30 31 30 31 31 30 31 30 31
MonthsInYear: 12
DaysInYear: 365
Days in each month:
- 31 28 31 30 31 30 31 31 30 31 30 31
+ 31 28 31 30 31 30 31 31 30 31 30 31
IsLeapDay: False
IsLeapMonth: False
IsLeapYear: False
@@ -99,7 +99,7 @@ 31 28 31 30 31 30 31 31 30 31 30 31
MonthsInYear: 12
DaysInYear: 365
Days in each month:
- 31 28 31 30 31 30 31 31 30 31 30 31
+ 31 28 31 30 31 30 31 31 30 31 30 31
IsLeapDay: False
IsLeapMonth: False
IsLeapYear: False
@@ -108,7 +108,7 @@ 31 28 31 30 31 30 31 31 30 31 30 31
MonthsInYear: 12
DaysInYear: 365
Days in each month:
- 31 28 31 30 31 30 31 31 30 31 30 31
+ 31 28 31 30 31 30 31 31 30 31 30 31
IsLeapDay: False
IsLeapMonth: False
IsLeapYear: False
@@ -117,7 +117,7 @@ 31 28 31 30 31 30 31 31 30 31 30 31
MonthsInYear: 12
DaysInYear: 365
Days in each month:
- 31 28 31 30 31 30 31 31 30 31 30 31
+ 31 28 31 30 31 30 31 31 30 31 30 31
IsLeapDay: False
IsLeapMonth: False
IsLeapYear: False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrIntIntStrIntInt/CS/comparestrintintstrintint.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrIntIntStrIntInt/CS/comparestrintintstrintint.cs
index 52531de8b4e..e25551f6120 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrIntIntStrIntInt/CS/comparestrintintstrintint.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrIntIntStrIntInt/CS/comparestrintintstrintint.cs
@@ -17,7 +17,7 @@ public static void Main() {
// Uses GetCompareInfo to create the CompareInfo that uses the "es-ES" culture with international sort.
CompareInfo myCompIntl = CompareInfo.GetCompareInfo( "es-ES" );
-
+
// Uses GetCompareInfo to create the CompareInfo that uses the "es-ES" culture with traditional sort.
CompareInfo myCompTrad = CompareInfo.GetCompareInfo( 0x040A );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrIntStrInt/CS/comparestrintstrint.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrIntStrInt/CS/comparestrintstrint.cs
index 7c340c0e05f..8054de25c17 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrIntStrInt/CS/comparestrintstrint.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrIntStrInt/CS/comparestrintstrint.cs
@@ -17,7 +17,7 @@ public static void Main() {
// Uses GetCompareInfo to create the CompareInfo that uses the "es-ES" culture with international sort.
CompareInfo myCompIntl = CompareInfo.GetCompareInfo( "es-ES" );
-
+
// Uses GetCompareInfo to create the CompareInfo that uses the "es-ES" culture with traditional sort.
CompareInfo myCompTrad = CompareInfo.GetCompareInfo( 0x040A );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrStr/CS/comparestrstr.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrStr/CS/comparestrstr.cs
index 6a4b2a4d7ff..40264a736e5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrStr/CS/comparestrstr.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.CompareStrStr/CS/comparestrstr.cs
@@ -17,7 +17,7 @@ public static void Main() {
// Uses GetCompareInfo to create the CompareInfo that uses the "es-ES" culture with international sort.
CompareInfo myCompIntl = CompareInfo.GetCompareInfo( "es-ES" );
-
+
// Uses GetCompareInfo to create the CompareInfo that uses the "es-ES" culture with traditional sort.
CompareInfo myCompTrad = CompareInfo.GetCompareInfo( 0x040A );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable1.cs
index 3b6cb52a731..bec6c0ed7f5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable1.cs
@@ -7,18 +7,18 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the index of the soft hyphen.
Console.WriteLine(ci.IndexOf(s1, "\u00AD"));
Console.WriteLine(ci.IndexOf(s2, "\u00AD"));
-
+
// Find the index of the soft hyphen followed by "n".
Console.WriteLine(ci.IndexOf(s1, "\u00ADn"));
Console.WriteLine(ci.IndexOf(s2, "\u00ADn"));
-
+
// Find the index of the soft hyphen followed by "m".
Console.WriteLine(ci.IndexOf(s1, "\u00ADm"));
Console.WriteLine(ci.IndexOf(s2, "\u00ADm"));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable10.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable10.cs
index da7003e742f..912f5096a10 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable10.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable10.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
int position = 0;
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the index of the soft hyphen.
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -21,9 +21,9 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00AD", position, s2.Length - position));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -32,9 +32,9 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00ADn", position, s2.Length - position));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -43,7 +43,7 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00ADm", position, s2.Length - position));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable11.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable11.cs
index 9e37d5b939d..1ba74e67fef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable11.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable11.cs
@@ -7,36 +7,36 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
int position = 0;
-
+
// Find the index of the soft hyphen using culture-sensitive comparison.
position = ci.IndexOf(s1, 'n');
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s1, '\u00AD', position,
+ Console.WriteLine(ci.IndexOf(s1, '\u00AD', position,
s1.Length - position, CompareOptions.IgnoreCase));
-
+
position = ci.IndexOf(s2, 'n');
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s2, '\u00AD', position,
+ Console.WriteLine(ci.IndexOf(s2, '\u00AD', position,
s2.Length - position, CompareOptions.IgnoreCase));
-
+
// Find the index of the soft hyphen using ordinal comparison.
position = ci.IndexOf(s1, 'n');
Console.WriteLine("'n' at position {0}", position, CompareOptions.Ordinal);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s1, '\u00AD', position,
+ Console.WriteLine(ci.IndexOf(s1, '\u00AD', position,
s1.Length - position, CompareOptions.Ordinal));
-
+
position = ci.IndexOf(s2, 'n');
Console.WriteLine("'n' at position {0}", position, CompareOptions.Ordinal);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s2, '\u00AD', position,
+ Console.WriteLine(ci.IndexOf(s2, '\u00AD', position,
s2.Length - position, CompareOptions.Ordinal));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable12.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable12.cs
index 2a78517489b..efef84fc351 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable12.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable12.cs
@@ -7,92 +7,92 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
int position = 0;
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// All the following comparisons are culture-sensitive.
- Console.WriteLine("Culture-sensitive comparisons:");
+ Console.WriteLine("Culture-sensitive comparisons:");
// Find the index of the soft hyphen.
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s1, "\u00AD", position,
+ Console.WriteLine(ci.IndexOf(s1, "\u00AD", position,
s1.Length - position, CompareOptions.None));
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.IndexOf(s2, "\u00AD", position,
+ if (position >= 0)
+ Console.WriteLine(ci.IndexOf(s2, "\u00AD", position,
s2.Length - position, CompareOptions.None));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s1, "\u00ADn", position,
+ Console.WriteLine(ci.IndexOf(s1, "\u00ADn", position,
s1.Length - position, CompareOptions.IgnoreCase));
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.IndexOf(s2, "\u00ADn", position,
+ if (position >= 0)
+ Console.WriteLine(ci.IndexOf(s2, "\u00ADn", position,
s2.Length - position, CompareOptions.IgnoreCase));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s1, "\u00ADm", position,
+ Console.WriteLine(ci.IndexOf(s1, "\u00ADm", position,
s1.Length - position, CompareOptions.IgnoreCase));
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.IndexOf(s2, "\u00ADm", position,
+ if (position >= 0)
+ Console.WriteLine(ci.IndexOf(s2, "\u00ADm", position,
s2.Length - position, CompareOptions.IgnoreCase));
// All the following comparisons are ordinal.
- Console.WriteLine("\nOrdinal comparisons:");
+ Console.WriteLine("\nOrdinal comparisons:");
// Find the index of the soft hyphen.
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s1, "\u00AD", position,
+ Console.WriteLine(ci.IndexOf(s1, "\u00AD", position,
s1.Length - position, CompareOptions.Ordinal));
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.IndexOf(s2, "\u00AD", position,
+ if (position >= 0)
+ Console.WriteLine(ci.IndexOf(s2, "\u00AD", position,
s2.Length - position, CompareOptions.Ordinal));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s1, "\u00ADn", position,
+ Console.WriteLine(ci.IndexOf(s1, "\u00ADn", position,
s1.Length - position, CompareOptions.Ordinal));
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.IndexOf(s2, "\u00ADn", position,
+ if (position >= 0)
+ Console.WriteLine(ci.IndexOf(s2, "\u00ADn", position,
s2.Length - position, CompareOptions.Ordinal));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.IndexOf(s1, "\u00ADm", position,
+ Console.WriteLine(ci.IndexOf(s1, "\u00ADm", position,
s1.Length - position, CompareOptions.Ordinal));
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.IndexOf(s2, "\u00ADm", position,
+ if (position >= 0)
+ Console.WriteLine(ci.IndexOf(s2, "\u00ADm", position,
s2.Length - position, CompareOptions.Ordinal));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable2.cs
index 75030c530cb..5a615eabb0d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable2.cs
@@ -7,10 +7,10 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the index of the soft hyphen.
Console.WriteLine(ci.IndexOf(s1, '\u00AD'));
Console.WriteLine(ci.IndexOf(s2, '\u00AD'));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable3.cs
index 5266f861171..6b1410aac2f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable3.cs
@@ -7,10 +7,10 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the index of the soft hyphen using culture-sensitive comparison.
Console.WriteLine(ci.IndexOf(s1, '\u00AD', CompareOptions.IgnoreCase));
Console.WriteLine(ci.IndexOf(s2, '\u00AD', CompareOptions.IgnoreCase));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable4.cs
index 615b08a5d84..80de7350b62 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable4.cs
@@ -7,18 +7,18 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
int position = 0;
-
+
// Find the index of the soft hyphen.
position = ci.IndexOf(s1, 'n');
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
Console.WriteLine(ci.IndexOf(s1, '\u00AD', position));
-
+
position = ci.IndexOf(s2, 'n');
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable5.cs
index 5699f193403..a070176e7cd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable5.cs
@@ -7,32 +7,32 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
Console.WriteLine("Culture-sensitive comparison:");
// Use culture-sensitive comparison to find the soft hyphen.
Console.WriteLine(ci.IndexOf(s1, "\u00AD", CompareOptions.None));
Console.WriteLine(ci.IndexOf(s2, "\u00AD", CompareOptions.None));
-
+
// Use culture-sensitive comparison to find the soft hyphen followed by "n".
Console.WriteLine(ci.IndexOf(s1, "\u00ADn", CompareOptions.None));
Console.WriteLine(ci.IndexOf(s2, "\u00ADn", CompareOptions.None));
-
+
// Use culture-sensitive comparison to find the soft hyphen followed by "m".
Console.WriteLine(ci.IndexOf(s1, "\u00ADm", CompareOptions.None));
Console.WriteLine(ci.IndexOf(s2, "\u00ADm", CompareOptions.None));
-
+
Console.WriteLine("Ordinal comparison:");
// Use ordinal comparison to find the soft hyphen.
Console.WriteLine(ci.IndexOf(s1, "\u00AD", CompareOptions.Ordinal));
Console.WriteLine(ci.IndexOf(s2, "\u00AD", CompareOptions.Ordinal));
-
+
// Use ordinal comparison to find the soft hyphen followed by "n".
Console.WriteLine(ci.IndexOf(s1, "\u00ADn", CompareOptions.Ordinal));
Console.WriteLine(ci.IndexOf(s2, "\u00ADn", CompareOptions.Ordinal));
-
+
// Use ordinal comparison to find the soft hyphen followed by "m".
Console.WriteLine(ci.IndexOf(s1, "\u00ADm", CompareOptions.Ordinal));
Console.WriteLine(ci.IndexOf(s2, "\u00ADm", CompareOptions.Ordinal));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable6.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable6.cs
index 32465e14ecb..f34774f3876 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable6.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable6.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
int position = 0;
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the index of the soft hyphen.
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -21,9 +21,9 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00AD", position));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -32,9 +32,9 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00ADn", position));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -43,7 +43,7 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00ADm", position));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable7.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable7.cs
index 5916193557c..445c46bef20 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable7.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable7.cs
@@ -7,29 +7,29 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
int position = 0;
-
+
// Find the index of the soft hyphen using culture-sensitive comparison.
position = ci.IndexOf(s1, 'n');
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
Console.WriteLine(ci.IndexOf(s1, '\u00AD', position, CompareOptions.IgnoreCase));
-
+
position = ci.IndexOf(s2, 'n');
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, '\u00AD', position, CompareOptions.IgnoreCase));
-
+
// Find the index of the soft hyphen using ordinal comparison.
position = ci.IndexOf(s1, 'n');
Console.WriteLine("'n' at position {0}", position, CompareOptions.Ordinal);
if (position >= 0)
Console.WriteLine(ci.IndexOf(s1, '\u00AD', position, CompareOptions.Ordinal));
-
+
position = ci.IndexOf(s2, 'n');
Console.WriteLine("'n' at position {0}", position, CompareOptions.Ordinal);
if (position >= 0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable8.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable8.cs
index 3a85955e4c7..c2908edaea8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable8.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable8.cs
@@ -7,18 +7,18 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
int position = 0;
-
+
// Find the index of the soft hyphen.
position = ci.IndexOf(s1, 'n');
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
Console.WriteLine(ci.IndexOf(s1, '\u00AD', position, s1.Length - position));
-
+
position = ci.IndexOf(s2, 'n');
Console.WriteLine("'n' at position {0}", position);
if (position >= 0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable9.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable9.cs
index c8fd70d76fc..928d19c1f0d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable9.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareInfo.IndexOf/CS/ignorable9.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
int position = 0;
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Use culture-sensitive comparison for the following searches:
Console.WriteLine("Culture-sensitive comparisons:");
// Find the index of the soft hyphen.
@@ -23,9 +23,9 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00AD", position, CompareOptions.None));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -34,9 +34,9 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00ADn", position, CompareOptions.IgnoreCase));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -45,10 +45,10 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00ADm", position, CompareOptions.IgnoreCase));
- Console.WriteLine();
+ Console.WriteLine();
// Use ordinal comparison for the following searches:
Console.WriteLine("Ordinal comparisons:");
// Find the index of the soft hyphen.
@@ -59,9 +59,9 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00AD", position, CompareOptions.Ordinal));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -70,9 +70,9 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00ADn", position, CompareOptions.Ordinal));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.IndexOf(s1, "n");
Console.WriteLine("'n' at position {0}", position);
@@ -81,7 +81,7 @@ public static void Main()
position = ci.IndexOf(s2, "n");
Console.WriteLine("'n' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.IndexOf(s2, "\u00ADm", position, CompareOptions.Ordinal));
}
}
@@ -99,7 +99,7 @@ public static void Main()
// 4
// 'n' at position 1
// 3
-//
+//
// Ordinal comparisons:
// 'n' at position 1
// 3
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareOptions.StringSort/CS/compareoptions_stringsort.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareOptions.StringSort/CS/compareoptions_stringsort.cs
index e3acf858574..9e18d6ac5a0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareOptions.StringSort/CS/compareoptions_stringsort.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CompareOptions.StringSort/CS/compareoptions_stringsort.cs
@@ -8,7 +8,7 @@
public class SamplesCompareOptions {
private class MyStringComparer: IComparer {
- private CompareInfo myComp;
+ private CompareInfo myComp;
private CompareOptions myOptions = CompareOptions.None;
// Constructs a comparer using the specified CompareOptions.
@@ -30,7 +30,7 @@ public int Compare(Object a, Object b) {
throw new ArgumentException("a and b should be strings.");
}
}
-
+
public static void Main() {
// Creates and initializes an array of strings to sort.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.Clone/CS/yslin_cultureinfo_clone.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.Clone/CS/yslin_cultureinfo_clone.cs
index 60329be880e..fd1c771e0fa 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.Clone/CS/yslin_cultureinfo_clone.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.Clone/CS/yslin_cultureinfo_clone.cs
@@ -18,7 +18,7 @@ public static void Main() {
myCIclone.NumberFormat.CurrencySymbol = "USD";
myCIclone.NumberFormat.NumberDecimalDigits = 4;
- // Displays the properties of the DTFI and NFI instances associated with the original and with the clone.
+ // Displays the properties of the DTFI and NFI instances associated with the original and with the clone.
Console.WriteLine( "DTFI/NFI PROPERTY\tORIGINAL\tMODIFIED CLONE" );
Console.WriteLine( "DTFI.AMDesignator\t{0}\t\t{1}", myCI.DateTimeFormat.AMDesignator, myCIclone.DateTimeFormat.AMDesignator );
Console.WriteLine( "DTFI.DateSeparator\t{0}\t\t{1}", myCI.DateTimeFormat.DateSeparator, myCIclone.DateTimeFormat.DateSeparator );
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.CreateSpecificCulture2/CS/createspecificculture2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.CreateSpecificCulture2/CS/createspecificculture2.cs
index 77140a93519..c9a04b1a8f4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.CreateSpecificCulture2/CS/createspecificculture2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.CreateSpecificCulture2/CS/createspecificculture2.cs
@@ -15,24 +15,24 @@ public static void Main()
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.NeutralCultures);
// Sort the returned array by name.
Array.Sort(cultures, new NamePropertyComparer());
-
+
// Determine the specific culture associated with each neutral culture.
- foreach (var culture in cultures)
+ foreach (var culture in cultures)
{
Console.Write("{0,-12} {1,-40}", culture.Name, culture.EnglishName);
try {
Console.WriteLine("{0}", CultureInfo.CreateSpecificCulture(culture.Name).Name);
- }
+ }
catch (ArgumentException) {
Console.WriteLine("(no associated specific culture)");
}
- }
+ }
}
}
public class NamePropertyComparer : IComparer
{
- public int Compare(T x, T y)
+ public int Compare(T x, T y)
{
if (x == null)
if (y == null)
@@ -41,13 +41,13 @@ public int Compare(T x, T y)
return -1;
PropertyInfo pX = x.GetType().GetProperty("Name");
- PropertyInfo pY = y.GetType().GetProperty("Name");
+ PropertyInfo pY = y.GetType().GetProperty("Name");
return String.Compare((string) pX.GetValue(x, null), (string) pY.GetValue(y, null));
}
}
// The example displays the following output on a Windows system. This output has been cropped for brevity.
// CULTURE SPECIFIC CULTURE
-// Invariant Language (Invariant Country)
+// Invariant Language (Invariant Country)
// aa Afar aa-ET
// af Afrikaans af-ZA
// agq Aghem agq-CM
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.CurrentCulture2/CS/currentculture.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.CurrentCulture2/CS/currentculture.cs
index 85ff6693562..aa102112b1e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.CurrentCulture2/CS/currentculture.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.CurrentCulture2/CS/currentculture.cs
@@ -5,7 +5,7 @@
public class Example
{
- public static void Main()
+ public static void Main()
{
// Display the name of the current thread culture.
Console.WriteLine("CurrentCulture is {0}.", CultureInfo.CurrentCulture.Name);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.GetCultures/CS/getcultures.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.GetCultures/CS/getcultures.cs
index dd984f60576..8ab8b3b6470 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.GetCultures/CS/getcultures.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo.GetCultures/CS/getcultures.cs
@@ -29,21 +29,21 @@ public static void Main()
This code produces the following output. This output has been cropped for brevity.
CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
-ar ar ara ARA Arabic Arabic
-bg bg bul BGR Bulgarian Bulgarian
-ca ca cat CAT Catalan Catalan
-zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
-cs cs ces CSY Czech Czech
-da da dan DAN Danish Danish
-de de deu DEU German German
-el el ell ELL Greek Greek
-en en eng ENU English English
-es es spa ESP Spanish Spanish
-fi fi fin FIN Finnish Finnish
-zh zh zho CHS Chinese Chinese
-zh-Hant zh zho CHT Chinese (Traditional) Chinese (Traditional)
-zh-CHS zh zho CHS Chinese (Simplified) Legacy Chinese (Simplified) Legacy
-zh-CHT zh zho CHT Chinese (Traditional) Legacy Chinese (Traditional) Legacy
+ar ar ara ARA Arabic Arabic
+bg bg bul BGR Bulgarian Bulgarian
+ca ca cat CAT Catalan Catalan
+zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
+cs cs ces CSY Czech Czech
+da da dan DAN Danish Danish
+de de deu DEU German German
+el el ell ELL Greek Greek
+en en eng ENU English English
+es es spa ESP Spanish Spanish
+fi fi fin FIN Finnish Finnish
+zh zh zho CHS Chinese Chinese
+zh-Hant zh zho CHT Chinese (Traditional) Chinese (Traditional)
+zh-CHS zh zho CHS Chinese (Simplified) Legacy Chinese (Simplified) Legacy
+zh-CHT zh zho CHT Chinese (Traditional) Legacy Chinese (Traditional) Legacy
*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo_esES/CS/spanishspain.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo_esES/CS/spanishspain.cs
index 8f9565d737a..e13d082c8ca 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo_esES/CS/spanishspain.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.CultureInfo_esES/CS/spanishspain.cs
@@ -44,20 +44,20 @@ public static void Main()
/*
This code produces the following output.
-PROPERTY INTERNATIONAL TRADITIONAL
+PROPERTY INTERNATIONAL TRADITIONAL
CompareInfo CompareInfo - es-ES CompareInfo - es-ES_tradnl
-DisplayName Spanish (Spain) Spanish (Spain)
+DisplayName Spanish (Spain) Spanish (Spain)
EnglishName Spanish (Spain, International Sort) Spanish (Spain, Traditional Sort)
-IsNeutralCulture False False
-IsReadOnly False False
-LCID 3082 1034
-Name es-ES es-ES
+IsNeutralCulture False False
+IsReadOnly False False
+LCID 3082 1034
+Name es-ES es-ES
NativeName Español (España, alfabetización internacional) Español (España, alfabetización tradicional)
-Parent es es
-TextInfo TextInfo - es-ES TextInfo - es-ES_tradnl
-ThreeLetterISOLanguageName spa spa
-ThreeLetterWindowsLanguageName ESN ESP
-TwoLetterISOLanguageName es es
+Parent es es
+TextInfo TextInfo - es-ES TextInfo - es-ES_tradnl
+ThreeLetterISOLanguageName spa spa
+ThreeLetterWindowsLanguageName ESN ESP
+TwoLetterISOLanguageName es es
Comparing "llegar" and "lugar"
With myCIintl.CompareInfo.Compare: -1
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.LongDatePattern/CS/longdatepattern1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.LongDatePattern/CS/longdatepattern1.cs
index 69a742ec81f..a8a55f1ccef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.LongDatePattern/CS/longdatepattern1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.LongDatePattern/CS/longdatepattern1.cs
@@ -11,10 +11,10 @@ public static void Main()
Console.WriteLine("{0,-7} {1,-20} {2:D}\n", "Culture", "Long Date Pattern", "Date");
foreach (var cultureName in cultureNames) {
CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
- Console.WriteLine("{0,-7} {1,-20} {2}",
- culture.Name,
- culture.DateTimeFormat.LongDatePattern,
- date1.ToString("D", culture));
+ Console.WriteLine("{0,-7} {1,-20} {2}",
+ culture.Name,
+ culture.DateTimeFormat.LongDatePattern,
+ date1.ToString("D", culture));
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.LongDatePattern/CS/longdatepattern2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.LongDatePattern/CS/longdatepattern2.cs
index 836b145f761..db5b2d2778e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.LongDatePattern/CS/longdatepattern2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.LongDatePattern/CS/longdatepattern2.cs
@@ -9,16 +9,16 @@ public static void Main()
{
DateTime date1 = new DateTime(2011, 8, 7);
CultureInfo ci = CultureInfo.CreateSpecificCulture("ar-SY");
- StreamWriter sw = new StreamWriter(@".\arSYCalendars.txt");
+ StreamWriter sw = new StreamWriter(@".\arSYCalendars.txt");
- sw.WriteLine("{0,-32} {1,-21} {2}\n",
+ sw.WriteLine("{0,-32} {1,-21} {2}\n",
"Calendar", "Long Date Pattern", "Example Date");
foreach (var cal in ci.OptionalCalendars) {
ci.DateTimeFormat.Calendar = cal;
- sw.WriteLine("{0,-32} {1,-21} {2}", GetCalendarName(cal),
+ sw.WriteLine("{0,-32} {1,-21} {2}", GetCalendarName(cal),
ci.DateTimeFormat.LongDatePattern,
date1.ToString("D", ci));
- }
+ }
sw.Close();
}
@@ -28,14 +28,14 @@ private static string GetCalendarName(Calendar cal)
calName = cal.GetType().Name.Substring(0, cal.GetType().Name.IndexOf("Cal"));
if (calName.Equals("Gregorian")) {
GregorianCalendar grCal = cal as GregorianCalendar;
- calName += String.Format("-{0}", grCal.CalendarType);
+ calName += String.Format("-{0}", grCal.CalendarType);
}
return calName;
}
}
// The example generates the following output:
// Calendar Long Date Pattern Example Date
-//
+//
// Gregorian-Localized dd MMMM, yyyy 07 آب, 2011
// UmAlQura dd/MMMM/yyyy 07/رمضان/1432
// Hijri dd/MM/yyyy 08/09/1432
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortDatePattern/CS/dtfi_shortdatepattern.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortDatePattern/CS/dtfi_shortdatepattern.cs
index 09296993cf6..976609efd11 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortDatePattern/CS/dtfi_shortdatepattern.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortDatePattern/CS/dtfi_shortdatepattern.cs
@@ -1,10 +1,10 @@
//
using System;
using System.Globalization;
-
-public class SamplesDTFI
+
+public class SamplesDTFI
{
- public static void Main()
+ public static void Main()
{
string[] cultures = { "en-US", "ja-JP", "fr-FR" };
DateTime date1 = new DateTime(2011, 5, 1);
@@ -13,15 +13,15 @@ public static void Main()
foreach (var culture in cultures) {
DateTimeFormatInfo dtfi = CultureInfo.CreateSpecificCulture(culture).DateTimeFormat;
- Console.WriteLine(" {0,7} {1,19} {2,10}", culture,
- dtfi.ShortDatePattern,
+ Console.WriteLine(" {0,7} {1,19} {2,10}", culture,
+ dtfi.ShortDatePattern,
date1.ToString("d", dtfi));
}
}
}
// The example displays the following output:
// CULTURE PROPERTY VALUE DATE
-//
+//
// en-US M/d/yyyy 5/1/2011
// ja-JP yyyy/MM/dd 2011/05/01
// fr-FR dd/MM/yyyy 01/05/2011
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortDatePattern/CS/shortdatepattern1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortDatePattern/CS/shortdatepattern1.cs
index 654f2ac5959..58447b28e44 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortDatePattern/CS/shortdatepattern1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Globalization.DateTimeFormatInfo.ShortDatePattern/CS/shortdatepattern1.cs
@@ -9,12 +9,12 @@ public static void Main()
DateTimeFormatInfo dtfi = CultureInfo.CreateSpecificCulture("en-US").DateTimeFormat;
DateTime date1 = new DateTime(2011, 5, 1);
Console.WriteLine("Original Short Date Pattern:");
- Console.WriteLine(" {0}: {1}", dtfi.ShortDatePattern,
+ Console.WriteLine(" {0}: {1}", dtfi.ShortDatePattern,
date1.ToString("d", dtfi));
dtfi.DateSeparator = "-";
dtfi.ShortDatePattern = @"yyyy/MM/dd";
Console.WriteLine("Revised Short Date Pattern:");
- Console.WriteLine(" {0}: {1}", dtfi.ShortDatePattern,
+ Console.WriteLine(" {0}: {1}", dtfi.ShortDatePattern,
date1.ToString("d", dtfi));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/binary1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/binary1.cs
index bee00c5a279..05c27990153 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/binary1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/binary1.cs
@@ -10,14 +10,14 @@ public static void Main()
// Get binary representation of flag.
Byte value = BitConverter.GetBytes(flag)[0];
Console.WriteLine("Original value: {0}", flag);
- Console.WriteLine("Binary value: {0} ({1})", value,
+ Console.WriteLine("Binary value: {0} ({1})", value,
GetBinaryString(value));
// Restore the flag from its binary representation.
bool newFlag = BitConverter.ToBoolean( new Byte[] { value }, 0);
Console.WriteLine("Restored value: {0}\n", flag);
}
}
-
+
private static string GetBinaryString(Byte value)
{
String retVal = Convert.ToString(value, 2);
@@ -28,7 +28,7 @@ private static string GetBinaryString(Byte value)
// Original value: True
// Binary value: 1 (00000001)
// Restored value: True
-//
+//
// Original value: False
// Binary value: 0 (00000000)
// Restored value: False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/conversion3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/conversion3.cs
index 87d770eb28a..aa381a7a5a5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/conversion3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/conversion3.cs
@@ -6,22 +6,22 @@ public class Example
public static void Main()
{
bool flag = true;
-
- byte byteValue;
+
+ byte byteValue;
byteValue = Convert.ToByte(flag);
- Console.WriteLine("{0} -> {1}", flag, byteValue);
-
+ Console.WriteLine("{0} -> {1}", flag, byteValue);
+
sbyte sbyteValue;
sbyteValue = Convert.ToSByte(flag);
- Console.WriteLine("{0} -> {1}", flag, sbyteValue);
+ Console.WriteLine("{0} -> {1}", flag, sbyteValue);
double dblValue;
dblValue = Convert.ToDouble(flag);
- Console.WriteLine("{0} -> {1}", flag, dblValue);
+ Console.WriteLine("{0} -> {1}", flag, dblValue);
int intValue;
intValue = Convert.ToInt32(flag);
- Console.WriteLine("{0} -> {1}", flag, intValue);
+ Console.WriteLine("{0} -> {1}", flag, intValue);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/format3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/format3.cs
index fab8c875b3e..c66bc9ca3da 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/format3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/format3.cs
@@ -11,7 +11,7 @@ public static void Main()
bool value = true;
CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
BooleanFormatter formatter = new BooleanFormatter(culture);
-
+
String result = String.Format(formatter, "Value for '{0}': {1}", culture.Name, value);
Console.WriteLine(result);
}
@@ -19,39 +19,39 @@ public static void Main()
}
public class BooleanFormatter : ICustomFormatter, IFormatProvider
-{
+{
private CultureInfo culture;
-
+
public BooleanFormatter() : this(CultureInfo.CurrentCulture)
{ }
-
+
public BooleanFormatter(CultureInfo culture)
{
- this.culture = culture;
+ this.culture = culture;
}
-
+
public Object GetFormat(Type formatType)
- {
+ {
if (formatType == typeof(ICustomFormatter))
return this;
else
return null;
}
-
+
public String Format(String fmt, Object arg, IFormatProvider formatProvider)
- {
+ {
// Exit if another format provider is used.
if (! formatProvider.Equals(this)) return null;
-
+
// Exit if the type to be formatted is not a Boolean
if (! (arg is Boolean)) return null;
-
+
bool value = (bool) arg;
switch (culture.Name) {
case "en-US":
return value.ToString();
case "fr-FR":
- if (value)
+ if (value)
return "vrai";
else
return "faux";
@@ -61,7 +61,7 @@ public String Format(String fmt, Object arg, IFormatProvider formatProvider)
else
return "неверно";
default:
- return value.ToString();
+ return value.ToString();
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/operations1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/operations1.cs
index aff44565744..b0ba289b6e6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/operations1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/operations1.cs
@@ -9,14 +9,14 @@ public static void Main()
{
// Initialize flag variables.
bool isRedirected = false;
- bool isBoth = false;
+ bool isBoth = false;
String fileName = "";
StreamWriter sw = null;
-
+
// Get any command line arguments.
String[] args = Environment.GetCommandLineArgs();
// Handle any arguments.
- if (args.Length > 1) {
+ if (args.Length > 1) {
for (int ctr = 1; ctr < args.Length; ctr++) {
String arg = args[ctr];
if (arg.StartsWith("/") || arg.StartsWith("-")) {
@@ -35,26 +35,26 @@ public static void Main()
isBoth = true;
break;
default:
- ShowSyntax(String.Format("The {0} switch is not supported",
+ ShowSyntax(String.Format("The {0} switch is not supported",
args[ctr]));
return;
}
- }
+ }
}
}
// If isBoth is True, isRedirected must be True.
- if (isBoth && ! isRedirected) {
+ if (isBoth && ! isRedirected) {
ShowSyntax("The /f switch must be used if /b is used.");
return;
}
// Handle output.
if (isRedirected) {
- sw = new StreamWriter(fileName);
+ sw = new StreamWriter(fileName);
if (!isBoth)
- Console.SetOut(sw);
- }
+ Console.SetOut(sw);
+ }
String msg = String.Format("Application began at {0}", DateTime.Now);
Console.WriteLine(msg);
if (isBoth) sw.WriteLine(msg);
@@ -64,7 +64,7 @@ public static void Main()
if (isBoth) sw.WriteLine(msg);
if (isRedirected) sw.Close();
}
-
+
private static void ShowSyntax(String errMsg)
{
Console.WriteLine(errMsg);
@@ -78,12 +78,12 @@ public class Evaluation
public void SomeMethod()
{
bool booleanValue = false;
-
+
//
if (booleanValue) {
//
}
-
+
//
if (booleanValue) {
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/operations2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/operations2.cs
index cc76d778828..f19c44b1ef7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/operations2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/operations2.cs
@@ -9,12 +9,12 @@ public static void Main()
Decimal subtotal = 120.62m;
Decimal shippingCharge = 2.50m;
Decimal serviceCharge = 5.00m;
-
+
foreach (var hasServiceCharge in hasServiceCharges) {
- Decimal total = subtotal + shippingCharge +
+ Decimal total = subtotal + shippingCharge +
(hasServiceCharge ? serviceCharge : 0);
- Console.WriteLine("hasServiceCharge = {1}: The total is {0:C2}.",
- total, hasServiceCharge);
+ Console.WriteLine("hasServiceCharge = {1}: The total is {0:C2}.",
+ total, hasServiceCharge);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/parse2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/parse2.cs
index 8b9dbccd106..3fe8b739703 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/parse2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/parse2.cs
@@ -5,11 +5,11 @@ public class Example
{
public static void Main()
{
- string[] values = { null, String.Empty, "True", "False",
- "true", "false", " true ",
- "TrUe", "fAlSe", "fa lse", "0",
+ string[] values = { null, String.Empty, "True", "False",
+ "true", "false", " true ",
+ "TrUe", "fAlSe", "fa lse", "0",
"1", "-1", "string" };
- // Parse strings using the Boolean.Parse method.
+ // Parse strings using the Boolean.Parse method.
foreach (var value in values) {
try {
bool flag = Boolean.Parse(value);
@@ -17,20 +17,20 @@ public static void Main()
}
catch (ArgumentException) {
Console.WriteLine("Cannot parse a null string.");
- }
+ }
catch (FormatException) {
Console.WriteLine("Cannot parse '{0}'.", value);
- }
+ }
}
Console.WriteLine();
- // Parse strings using the Boolean.TryParse method.
+ // Parse strings using the Boolean.TryParse method.
foreach (var value in values) {
bool flag = false;
if (Boolean.TryParse(value, out flag))
Console.WriteLine("'{0}' --> {1}", value, flag);
else
Console.WriteLine("Unable to parse '{0}'", value);
- }
+ }
}
}
// The example displays the following output:
@@ -48,7 +48,7 @@ public static void Main()
// Cannot parse '1'.
// Cannot parse '-1'.
// Cannot parse 'string'.
-//
+//
// Unable to parse ''
// Unable to parse ''
// 'True' --> True
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/parse3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/parse3.cs
index 79f3b5eaef0..7feed3bbe83 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/parse3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/parse3.cs
@@ -8,7 +8,7 @@ public static void Main()
String[] values = { "09", "12.6", "0", "-13 " };
foreach (var value in values) {
bool success, result;
- int number;
+ int number;
success = Int32.TryParse(value, out number);
if (success) {
// The method throws no exceptions.
@@ -16,8 +16,8 @@ public static void Main()
Console.WriteLine("Converted '{0}' to {1}", value, result);
}
else {
- Console.WriteLine("Unable to convert '{0}'", value);
- }
+ Console.WriteLine("Unable to convert '{0}'", value);
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/tostring2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/tostring2.cs
index 30b1f591aa8..c3c0259e587 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/tostring2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.structure/cs/tostring2.cs
@@ -8,9 +8,9 @@ public static void Main()
bool raining = false;
bool busLate = true;
- Console.WriteLine("It is raining: {0}",
+ Console.WriteLine("It is raining: {0}",
raining ? "Yes" : "No");
- Console.WriteLine("The bus is late: {0}",
+ Console.WriteLine("The bus is late: {0}",
busLate ? "Yes" : "No" );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.tryparse/cs/tryparseex.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.tryparse/cs/tryparseex.cs
index 5dbb706f4c1..11a7a9b75db 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.tryparse/cs/tryparseex.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.boolean.tryparse/cs/tryparseex.cs
@@ -5,17 +5,17 @@ public class Example
{
public static void Main()
{
- string[] values = { null, String.Empty, "True", "False",
- "true", "false", " true ", "0",
+ string[] values = { null, String.Empty, "True", "False",
+ "true", "false", " true ", "0",
"1", "-1", "string" };
foreach (var value in values) {
bool flag;
if (Boolean.TryParse(value, out flag))
Console.WriteLine("'{0}' --> {1}", value, flag);
else
- Console.WriteLine("Unable to parse '{0}'.",
+ Console.WriteLine("Unable to parse '{0}'.",
value == null ? "" : value);
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.bitwise/cs/bitwise1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.bitwise/cs/bitwise1.cs
index 544922d3084..46486444449 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.bitwise/cs/bitwise1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.bitwise/cs/bitwise1.cs
@@ -6,14 +6,14 @@ public class Example
{
public static void Main()
{
- string[] values = { Convert.ToString(12, 16),
- Convert.ToString(123, 16),
+ string[] values = { Convert.ToString(12, 16),
+ Convert.ToString(123, 16),
Convert.ToString(245, 16) };
-
+
byte mask = 0xFE;
foreach (string value in values) {
Byte byteValue = Byte.Parse(value, NumberStyles.AllowHexSpecifier);
- Console.WriteLine("{0} And {1} = {2}", byteValue, mask,
+ Console.WriteLine("{0} And {1} = {2}", byteValue, mask,
byteValue & mask);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.bitwise/cs/bitwise2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.bitwise/cs/bitwise2.cs
index 79c58c44a89..b40feffc89e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.bitwise/cs/bitwise2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.bitwise/cs/bitwise2.cs
@@ -14,20 +14,20 @@ public class Example
public static void Main()
{
ByteString[] values = CreateArray(-15, 123, 245);
-
+
byte mask = 0x14; // Mask all bits but 2 and 4.
-
+
foreach (ByteString strValue in values) {
byte byteValue = Byte.Parse(strValue.Value, NumberStyles.AllowHexSpecifier);
- Console.WriteLine("{0} ({1}) And {2} ({3}) = {4} ({5})",
- strValue.Sign * byteValue,
- Convert.ToString(byteValue, 2),
- mask, Convert.ToString(mask, 2),
- (strValue.Sign & Math.Sign(mask)) * (byteValue & mask),
+ Console.WriteLine("{0} ({1}) And {2} ({3}) = {4} ({5})",
+ strValue.Sign * byteValue,
+ Convert.ToString(byteValue, 2),
+ mask, Convert.ToString(mask, 2),
+ (strValue.Sign & Math.Sign(mask)) * (byteValue & mask),
Convert.ToString(byteValue & mask, 2));
}
}
-
+
private static ByteString[] CreateArray(params int[] values)
{
List byteStrings = new List();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.equals/cs/eq.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.equals/cs/eq.cs
index 166dc349fb8..dbdfeeb396f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.equals/cs/eq.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.equals/cs/eq.cs
@@ -4,9 +4,9 @@
using System;
-class Sample
+class Sample
{
- public static void Main()
+ public static void Main()
{
byte byteVal1 = 0x7f;
byte byteVal2 = 127;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.formatting/cs/formatting1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.formatting/cs/formatting1.cs
index 2bb8f6bcd4a..c02ab9e80be 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.formatting/cs/formatting1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.formatting/cs/formatting1.cs
@@ -22,15 +22,15 @@ private static void CallToString()
Console.Write(number.ToString("X2") + " ");
// Display value with four hexadecimal digits.
Console.WriteLine(number.ToString("X4"));
- }
+ }
// The example displays the following output:
// 0 --> 000 00 0000
// 16 --> 016 10 0010
// 104 --> 104 68 0068
- // 213 --> 213 D5 00D5
+ // 213 --> 213 D5 00D5
//
}
-
+
private static void CallConvert()
{
//
@@ -42,13 +42,13 @@ private static void CallConvert()
number, Convert.ToString(number, 2),
Convert.ToString(number, 8),
Convert.ToString(number, 16));
- }
+ }
// The example displays the following output:
// Value Binary Octal Hex
// 0 0 0 0
// 16 10000 20 10
// 104 1101000 150 68
- // 213 11010101 325 d5
+ // 213 11010101 325 d5
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.instantiation/cs/byteinstantiation1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.instantiation/cs/byteinstantiation1.cs
index 8a21983c5bb..a4fc84ec76f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.instantiation/cs/byteinstantiation1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.instantiation/cs/byteinstantiation1.cs
@@ -17,7 +17,7 @@ private static void InstantiateByAssignment()
//
Console.WriteLine("{0} {1}", value1, value2);
}
-
+
private static void InstantiateByNarrowingConversion()
{
//
@@ -41,7 +41,7 @@ private static void InstantiateByNarrowingConversion()
// The example displays the following output:
// 128
// 3
- //
+ //
}
private static void Parse()
@@ -58,10 +58,10 @@ private static void Parse()
catch (FormatException) {
Console.WriteLine("'{0}' is out of range of a byte.", string1);
}
-
+
string string2 = "F9";
try {
- byte byte2 = Byte.Parse(string2,
+ byte byte2 = Byte.Parse(string2,
System.Globalization.NumberStyles.HexNumber);
Console.WriteLine(byte2);
}
@@ -74,6 +74,6 @@ private static void Parse()
// The example displays the following output:
// 244
// 249
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/GetUnicodeCategory3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/GetUnicodeCategory3.cs
index 70882a8af95..921e6342140 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/GetUnicodeCategory3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/GetUnicodeCategory3.cs
@@ -10,7 +10,7 @@ public static void Main()
String s = "The red car drove down the long, narrow, secluded road.";
// Determine the category of each character.
foreach (var ch in s)
- Console.WriteLine("'{0}': {1}", ch, Char.GetUnicodeCategory(ch));
+ Console.WriteLine("'{0}': {1}", ch, Char.GetUnicodeCategory(ch));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/grapheme1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/grapheme1.cs
index 9fcc363bacd..41e5d96af13 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/grapheme1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/grapheme1.cs
@@ -9,7 +9,7 @@ public static void Main()
StreamWriter sw = new StreamWriter("chars1.txt");
char[] chars = { '\u0061', '\u0308' };
string strng = new String(chars);
- sw.WriteLine(strng);
+ sw.WriteLine(strng);
sw.Close();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/normalized.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/normalized.cs
index 8d0538ae7c9..b2516ca6ea4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/normalized.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/normalized.cs
@@ -7,7 +7,7 @@ public static void Main()
{
string combining = "\u0061\u0308";
ShowString(combining);
-
+
string normalized = combining.Normalize();
ShowString(normalized);
}
@@ -18,12 +18,12 @@ private static void ShowString(string s)
for (int ctr = 0; ctr < s.Length; ctr++) {
Console.Write("U+{0:X4}", Convert.ToUInt16(s[ctr]));
if (ctr != s.Length - 1) Console.Write(" ");
- }
+ }
Console.WriteLine(")\n");
}
}
// The example displays the following output:
// Length of string: 2 (U+0061 U+0308)
-//
+//
// Length of string: 1 (U+00E4)
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/surrogate1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/surrogate1.cs
index 75364e47bad..aed9f2700ae 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/surrogate1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/surrogate1.cs
@@ -9,9 +9,9 @@ public static void Main()
StreamWriter sw = new StreamWriter(@".\chars2.txt");
int utf32 = 0x1D160;
string surrogate = Char.ConvertFromUtf32(utf32);
- sw.WriteLine("U+{0:X6} UTF-32 = {1} ({2}) UTF-16",
+ sw.WriteLine("U+{0:X6} UTF-32 = {1} ({2}) UTF-16",
utf32, surrogate, ShowCodePoints(surrogate));
- sw.Close();
+ sw.Close();
}
private static string ShowCodePoints(string value)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/textelements2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/textelements2.cs
index 2aaa65cb2e9..f403aa28292 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/textelements2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/textelements2.cs
@@ -9,7 +9,7 @@ public static void Main()
for (int ctr = 0x10107; ctr <= 0x10110; ctr++) // Range of Aegean numbers.
result += Char.ConvertFromUtf32(ctr);
- Console.WriteLine("The string contains {0} characters.", result.Length);
+ Console.WriteLine("The string contains {0} characters.", result.Length);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/textelements2a.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/textelements2a.cs
index 0490c06ec99..b6f74c7b6d6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/textelements2a.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.class/cs/textelements2a.cs
@@ -11,8 +11,8 @@ public static void Main()
result += Char.ConvertFromUtf32(ctr);
StringInfo si = new StringInfo(result);
- Console.WriteLine("The string contains {0} characters.",
- si.LengthInTextElements);
+ Console.WriteLine("The string contains {0} characters.",
+ si.LengthInTextElements);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.toupper/cs/toupper5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.toupper/cs/toupper5.cs
index fd2b44fa9e7..68752c4c94d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.toupper/cs/toupper5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.char.toupper/cs/toupper5.cs
@@ -6,19 +6,19 @@ public class Example
{
public static void Main()
{
- CultureInfo[] cultures= { CultureInfo.CreateSpecificCulture("en-US"),
- CultureInfo.InvariantCulture,
+ CultureInfo[] cultures= { CultureInfo.CreateSpecificCulture("en-US"),
+ CultureInfo.InvariantCulture,
CultureInfo.CreateSpecificCulture("tr-TR") };
Char[] chars = {'ä', 'e', 'E', 'i', 'I' };
Console.WriteLine("Character en-US Invariant tr-TR");
foreach (var ch in chars) {
Console.Write(" {0}", ch);
- foreach (var culture in cultures)
+ foreach (var culture in cultures)
Console.Write("{0,12}", Char.ToUpper(ch, culture));
Console.WriteLine();
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentdictionary/cs/concdictionary.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentdictionary/cs/concdictionary.cs
index adca96f0115..8775c7953fd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentdictionary/cs/concdictionary.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentdictionary/cs/concdictionary.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Concurrent;
using System.Threading.Tasks;
-//
+//
class CD_Ctor
{
@@ -18,7 +18,7 @@ static void Main()
// The higher the concurrencyLevel, the higher the theoretical number of operations
// that could be performed concurrently on the ConcurrentDictionary. However, global
- // operations like resizing the dictionary take longer as the concurrencyLevel rises.
+ // operations like resizing the dictionary take longer as the concurrencyLevel rises.
// For the purposes of this example, we'll compromise at numCores * 2.
int numProcs = Environment.ProcessorCount;
int concurrencyLevel = numProcs * 2;
@@ -69,7 +69,7 @@ static void Main()
numFailures++;
}
- // Try to change the value for key 1 from "eine" to "one"
+ // Try to change the value for key 1 from "eine" to "one"
// -- this shouldn't work, because the current value isn't "eine"
if (cd.TryUpdate(1, "one", "eine"))
{
@@ -114,7 +114,7 @@ static void Main()
// Bombard the ConcurrentDictionary with 10000 competing AddOrUpdates
Parallel.For(0, 10000, i =>
{
- // Initial call will set cd[1] = 1.
+ // Initial call will set cd[1] = 1.
// Ensuing calls will set cd[1] = cd[1] + 1
cd.AddOrUpdate(1, 1, (key, oldValue) => oldValue + 1);
});
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentqueue/cs/concqueue.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentqueue/cs/concqueue.cs
index 8a9eded6b27..cb611c2417b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentqueue/cs/concqueue.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentqueue/cs/concqueue.cs
@@ -35,7 +35,7 @@ static void Main ()
int outerSum = 0;
// An action to consume the ConcurrentQueue.
Action action = () =>
- {
+ {
int localSum = 0;
int localValue;
while (cq.TryDequeue(out localValue)) localSum += localValue;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentstack/cs/concstack_range.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentstack/cs/concstack_range.cs
index a570e831e73..c4076e0c625 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentstack/cs/concstack_range.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.concurrentstack/cs/concstack_range.cs
@@ -55,7 +55,7 @@ await Task.WhenAll(Enumerable.Range(0, numParallelTasks).Select(i => Task.Factor
else
{
Console.WriteLine($"Unexpected consecutive ranges.");
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.iproducerconsumercollection/cs/iprodcon.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.iproducerconsumercollection/cs/iprodcon.cs
index c65b11aac28..e07d4444437 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.iproducerconsumercollection/cs/iprodcon.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.iproducerconsumercollection/cs/iprodcon.cs
@@ -7,7 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
-// Sample implementation of IProducerConsumerCollection(T)
+// Sample implementation of IProducerConsumerCollection(T)
// -- in this case, a thread-safe stack.
public class SafeStack : IProducerConsumerCollection
{
@@ -98,7 +98,7 @@ IEnumerator IEnumerable.GetEnumerator()
return ((IEnumerable)this).GetEnumerator();
}
- //
+ //
// Support for ICollection
//
public bool IsSynchronized
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.orderablepartitioner/cs/orderablepartitioner.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.orderablepartitioner/cs/orderablepartitioner.cs
index f13fa26021d..af3b13e69d3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.orderablepartitioner/cs/orderablepartitioner.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.orderablepartitioner/cs/orderablepartitioner.cs
@@ -10,7 +10,7 @@
namespace OrderablePartitionerDemo
{
- // Simple partitioner that will extract one (index,item) pair at a time,
+ // Simple partitioner that will extract one (index,item) pair at a time,
// in a thread-safe fashion, from the underlying collection.
class SingleElementOrderablePartitioner : OrderablePartitioner
{
@@ -42,7 +42,7 @@ private class InternalEnumerable : IEnumerable>, IDisposab
bool m_downcountEnumerators;
// "downcountEnumerators" will be true for static partitioning, false for
- // dynamic partitioning.
+ // dynamic partitioning.
public InternalEnumerable(IEnumerator reader, bool downcountEnumerators)
{
m_reader = reader;
@@ -95,7 +95,7 @@ public void DisposeEnumerator()
}
}
- // Internal class that serves as a shared enumerator for
+ // Internal class that serves as a shared enumerator for
// the underlying collection.
private class InternalEnumerator : IEnumerator>
{
@@ -129,7 +129,7 @@ void IEnumerator.Reset()
}
// This method is the crux of this class. Under lock, it calls
- // MoveNext() on the underlying enumerator, grabs Current and index,
+ // MoveNext() on the underlying enumerator, grabs Current and index,
// and increments the index.
bool IEnumerator.MoveNext()
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.partitioner/cs/partitioner.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.partitioner/cs/partitioner.cs
index e55d7d37ee0..b1aed19f8e2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.partitioner/cs/partitioner.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrent.partitioner/cs/partitioner.cs
@@ -27,7 +27,7 @@ private class InternalEnumerable : IEnumerable, IDisposable
bool m_downcountEnumerators;
// "downcountEnumerators" will be true for static partitioning, false for
- // dynamic partitioning.
+ // dynamic partitioning.
public InternalEnumerable(IEnumerator reader, bool downcountEnumerators)
{
m_reader = reader;
@@ -79,7 +79,7 @@ public void DisposeEnumerator()
}
}
- // Internal class that serves as a shared enumerator for
+ // Internal class that serves as a shared enumerator for
// the underlying collection.
private class InternalEnumerator : IEnumerator
{
@@ -189,7 +189,7 @@ class Program
static void Main()
{
// Our sample collection
- string[] collection = new string[] {"red", "orange", "yellow", "green", "blue", "indigo",
+ string[] collection = new string[] {"red", "orange", "yellow", "green", "blue", "indigo",
"violet", "black", "white", "grey"};
// Instantiate a partitioner for our collection
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrentcoladdupdate/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrentcoladdupdate/cs/program.cs
index 39790ee5b0a..83a76572a5d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrentcoladdupdate/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.concurrentcoladdupdate/cs/program.cs
@@ -4,33 +4,33 @@
class CD_Ctor
{
- // Demonstrates:
- // ConcurrentDictionary ctor(concurrencyLevel, initialCapacity)
- // ConcurrentDictionary[TKey]
+ // Demonstrates:
+ // ConcurrentDictionary ctor(concurrencyLevel, initialCapacity)
+ // ConcurrentDictionary[TKey]
static void Main()
{
- // We know how many items we want to insert into the ConcurrentDictionary.
- // So set the initial capacity to some prime number above that, to ensure that
- // the ConcurrentDictionary does not need to be resized while initializing it.
+ // We know how many items we want to insert into the ConcurrentDictionary.
+ // So set the initial capacity to some prime number above that, to ensure that
+ // the ConcurrentDictionary does not need to be resized while initializing it.
int HIGHNUMBER = 64;
int initialCapacity = 101;
- // The higher the concurrencyLevel, the higher the theoretical number of operations
- // that could be performed concurrently on the ConcurrentDictionary. However, global
- // operations like resizing the dictionary take longer as the concurrencyLevel rises.
- // For the purposes of this example, we'll compromise at numCores * 2.
+ // The higher the concurrencyLevel, the higher the theoretical number of operations
+ // that could be performed concurrently on the ConcurrentDictionary. However, global
+ // operations like resizing the dictionary take longer as the concurrencyLevel rises.
+ // For the purposes of this example, we'll compromise at numCores * 2.
int numProcs = Environment.ProcessorCount;
int concurrencyLevel = numProcs * 2;
// Construct the dictionary with the desired concurrencyLevel and initialCapacity
ConcurrentDictionary cd = new ConcurrentDictionary(concurrencyLevel, initialCapacity);
- // Initialize the dictionary
+ // Initialize the dictionary
for (int i = 1; i <= HIGHNUMBER; i++) cd[i] = i * i;
Console.WriteLine("The square of 23 is {0} (should be {1})", cd[23], 23 * 23);
- // Now iterate through, adding one to the end of the list. Existing items should be updated to be divided by their
+ // Now iterate through, adding one to the end of the list. Existing items should be updated to be divided by their
// key and a new item will be added that is the square of its key.
for (int i = 1; i <= HIGHNUMBER + 1; i++)
cd.AddOrUpdate(i, i * i, (k,v) => v / i);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.boxcompare/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.boxcompare/cs/program.cs
index 254a307fa31..afb6a9e3936 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.boxcompare/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.boxcompare/cs/program.cs
@@ -39,17 +39,17 @@ static void Main(string[] args)
foreach (Box bx in Boxes)
{
Console.WriteLine("{0}\t{1}\t{2}",
- bx.Height.ToString(), bx.Length.ToString(),
+ bx.Height.ToString(), bx.Length.ToString(),
bx.Width.ToString());
}
//
Console.WriteLine();
- Console.WriteLine("H - L - W");
+ Console.WriteLine("H - L - W");
Console.WriteLine("==========");
//
- // Get the default comparer that
+ // Get the default comparer that
// sorts first by the height.
Comparer defComp = Comparer.Default;
@@ -61,7 +61,7 @@ static void Main(string[] args)
foreach (Box bx in Boxes)
{
Console.WriteLine("{0}\t{1}\t{2}",
- bx.Height.ToString(), bx.Length.ToString(),
+ bx.Height.ToString(), bx.Length.ToString(),
bx.Width.ToString());
}
//
@@ -72,7 +72,7 @@ static void Main(string[] args)
// compares first by the length.
// Returns -1 because the length of BoxA
// is less than the length of BoxB.
- BoxLengthFirst LengthFirst = new BoxLengthFirst();
+ BoxLengthFirst LengthFirst = new BoxLengthFirst();
Comparer bc = (Comparer) LengthFirst;
@@ -86,7 +86,7 @@ static void Main(string[] args)
}
//
-public class BoxLengthFirst : Comparer
+public class BoxLengthFirst : Comparer
{
//
// Compares by Length, Height, and Width.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.boxexamples/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.boxexamples/cs/program.cs
index 5899ae89277..033150f4962 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.boxexamples/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.boxexamples/cs/program.cs
@@ -27,14 +27,14 @@ static void Main(string[] args)
// Test the Contains method.
Box BoxCheck = new Box(8, 12, 10);
- Console.WriteLine("Contains {0}x{1}x{2} by dimensions: {3}",
- BoxCheck.Height.ToString(), BoxCheck.Length.ToString(),
+ Console.WriteLine("Contains {0}x{1}x{2} by dimensions: {3}",
+ BoxCheck.Height.ToString(), BoxCheck.Length.ToString(),
BoxCheck.Width.ToString(), bxList.Contains(BoxCheck).ToString());
// Test the Contains method overload with a specified equality comparer.
- Console.WriteLine("Contains {0}x{1}x{2} by volume: {3}",
- BoxCheck.Height.ToString(), BoxCheck.Length.ToString(),
- BoxCheck.Width.ToString(), bxList.Contains(BoxCheck,
+ Console.WriteLine("Contains {0}x{1}x{2} by volume: {3}",
+ BoxCheck.Height.ToString(), BoxCheck.Length.ToString(),
+ BoxCheck.Width.ToString(), bxList.Contains(BoxCheck,
new BoxSameVol()).ToString());
}
//
@@ -44,7 +44,7 @@ public static void Display(BoxCollection bxList)
foreach (Box bx in bxList)
{
Console.WriteLine("{0}\t{1}\t{2}\t{3}",
- bx.Height.ToString(), bx.Length.ToString(),
+ bx.Height.ToString(), bx.Length.ToString(),
bx.Width.ToString(), bx.GetHashCode().ToString());
}
@@ -56,14 +56,14 @@ public static void Display(BoxCollection bxList)
//{
// Box b = (Box)enumerator.Current;
// Console.WriteLine("{0}\t{1}\t{2}\t{3}",
- // b.Height.ToString(), b.Length.ToString(),
+ // b.Height.ToString(), b.Length.ToString(),
// b.Width.ToString(), b.GetHashCode().ToString());
//}
Console.WriteLine();
}
- //
+ //
}
public class Box : IEquatable
@@ -154,7 +154,7 @@ public bool Contains(Box item)
return found;
}
- // Determines if an item is in the
+ // Determines if an item is in the
// collection by using a specified equality comparer.
public bool Contains(Box item, EqualityComparer comp)
{
@@ -200,7 +200,7 @@ public void CopyTo(Box[] array, int arrayIndex)
throw new ArgumentOutOfRangeException("The starting array index cannot be negative.");
if (Count > array.Length - arrayIndex + 1)
throw new ArgumentException("The destination array has fewer elements than the collection.");
-
+
for (int i = 0; i < innerCol.Count; i++) {
array[i + arrayIndex] = innerCol[i];
}
@@ -223,7 +223,7 @@ public bool Remove(Box item)
{
bool result = false;
- // Iterate the inner collection to
+ // Iterate the inner collection to
// find the box to be removed.
for (int i = 0; i < innerCol.Count; i++)
{
@@ -339,7 +339,7 @@ public override int GetHashCode(Box bx)
}
-/*
+/*
This code example displays the following output:
================================================
@@ -359,7 +359,7 @@ 4 6 10 12289376
12 8 10 55915408
Contains 8x12x10 by dimensions: False
-Contains 8x12x10 by volume: True
+Contains 8x12x10 by volume: True
*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.equalitycomparer.default/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.equalitycomparer.default/cs/program.cs
index cea478a2c62..90581807355 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.equalitycomparer.default/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.equalitycomparer.default/cs/program.cs
@@ -89,7 +89,7 @@ public bool Equals(Box other)
}
/* This example produces the following output:
- *
+ *
Found box 4 x 8 x 8 by dimension.
Found box 8 x 8 x 4 by volume.
*/
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.equalitycomparer/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.equalitycomparer/cs/program.cs
index a4f2fd8e17e..cb65720171b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.equalitycomparer/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.equalitycomparer/cs/program.cs
@@ -105,7 +105,7 @@ public override int GetHashCode(Box bx)
}
}
/* This example produces the following output:
- *
+ *
Boxes equality by dimensions:
Added red, Count = 1, HashCode = 46104728
Added green, Count = 2, HashCode = 12289376
@@ -117,6 +117,6 @@ A box equal to blue is already in the collection.
Added orange, Count = 2, HashCode = 33476626
A box equal to purple is already in the collection.
A box equal to brown is already in the collection.
- *
+ *
*/
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.ienumerableex/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.ienumerableex/cs/program.cs
index 08d66f6ee1f..f2e2252e1f1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.ienumerableex/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.ienumerableex/cs/program.cs
@@ -59,7 +59,7 @@ public static void TestReadingFile()
}
// Check for the string.
- var stringsFound =
+ var stringsFound =
from line in fileContents
where line.Contains("string to search for")
select line;
@@ -69,12 +69,12 @@ where line.Contains("string to search for")
// Check the memory after when the iterator is not used, and output it to the console.
long memoryAfter = GC.GetTotalMemory(false);
- Console.WriteLine("Memory Used Without Iterator = \t" +
+ Console.WriteLine("Memory Used Without Iterator = \t" +
string.Format(((memoryAfter - memoryBefore) / 1000).ToString(), "n") + "kb");
}
}
-// A custom class that implements IEnumerable(T). When you implement IEnumerable(T),
+// A custom class that implements IEnumerable(T). When you implement IEnumerable(T),
// you must also implement IEnumerable and IEnumerator(T).
public class StreamReaderEnumerable : IEnumerable
{
@@ -101,7 +101,7 @@ IEnumerator IEnumerable.GetEnumerator()
}
}
-// When you implement IEnumerable(T), you must also implement IEnumerator(T),
+// When you implement IEnumerable(T), you must also implement IEnumerator(T),
// which will walk through the contents of the file one line at a time.
// Implementing IEnumerator(T) requires that you implement IEnumerator and IDisposable.
public class StreamReaderEnumerator : IEnumerator
@@ -113,7 +113,7 @@ public StreamReaderEnumerator(string filePath)
}
private string _current;
- // Implement the IEnumerator(T).Current publicly, but implement
+ // Implement the IEnumerator(T).Current publicly, but implement
// IEnumerator.Current, which is also required, privately.
public string Current
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.iequalitycomparer/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.iequalitycomparer/cs/program.cs
index 55d82790c73..37339a65ed1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.iequalitycomparer/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.iequalitycomparer/cs/program.cs
@@ -12,14 +12,14 @@ static void Main()
var redBox = new Box(4, 3, 4);
AddBox(boxes, redBox, "red");
-
+
var blueBox = new Box(4, 3, 4);
AddBox(boxes, blueBox, "blue");
-
+
var greenBox = new Box(3, 4, 3);
AddBox(boxes, greenBox, "green");
Console.WriteLine();
-
+
Console.WriteLine("The dictionary contains {0} Box objects.",
boxes.Count);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/cs/program.cs
index caa66d48c39..9f50c96acde 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/cs/program.cs
@@ -1,12 +1,12 @@
//
using System;
using System.Collections.Generic;
-// Simple business object. A PartId is used to identify the type of part
-// but the part name can change.
+// Simple business object. A PartId is used to identify the type of part
+// but the part name can change.
public class Part : IEquatable
{
public string PartName { get; set; }
-
+
public int PartId { get; set; }
public override string ToString()
@@ -93,7 +93,7 @@ public static void Main()
}
/*
-
+
ID: 1234 Name: crank arm
ID: 1334 Name: chain ring
ID: 1434 Name: regular seat
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.capacitycount/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.capacitycount/cs/program.cs
index 1b77163f256..a2d8d48271d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.capacitycount/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.capacitycount/cs/program.cs
@@ -1,7 +1,7 @@
//
using System;
using System.Collections.Generic;
-// Simple business object. A PartId is used to identify a part
+// Simple business object. A PartId is used to identify a part
// but the part name be different for the same Id.
public class Part : IEquatable
{
@@ -64,7 +64,7 @@ public static void Main()
Console.WriteLine("Count: {0}", parts.Count);
}
/*
- This code example produces the following output.
+ This code example produces the following output.
Capacity: 0
ID: 1234 Name: crank arm
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.containsexists/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.containsexists/cs/program.cs
index 201a402f791..eb0b8dd06d5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.containsexists/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.containsexists/cs/program.cs
@@ -1,8 +1,8 @@
//
using System;
using System.Collections.Generic;
-// Simple business object. A PartId is used to identify a part
-// but the part name can change.
+// Simple business object. A PartId is used to identify a part
+// but the part name can change.
public class Part : IEquatable
{
public string PartName { get; set; }
@@ -59,15 +59,15 @@ public static void Main()
parts.Contains(new Part { PartId = 1734, PartName = "" }));
// Find items where name contains "seat".
- Console.WriteLine("\nFind: Part where name contains \"seat\": {0}",
+ Console.WriteLine("\nFind: Part where name contains \"seat\": {0}",
parts.Find(x => x.PartName.Contains("seat")));
-
+
// Check if an item with Id 1444 exists.
- Console.WriteLine("\nExists: Part with Id=1444: {0}",
+ Console.WriteLine("\nExists: Part with Id=1444: {0}",
parts.Exists(x => x.PartId == 1444));
/*This code example produces the following output:
-
+
ID: 1234 Name: crank arm
ID: 1334 Name: chain ring
ID: 1434 Name: regular seat
@@ -79,8 +79,8 @@ public static void Main()
Find: Part where name contains "seat": ID: 1434 Name: regular seat
- Exists: Part with Id=1444: True
+ Exists: Part with Id=1444: True
*/
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.sort/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.sort/cs/program.cs
index 020bf4afe6b..eb16c07ad99 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.sort/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.list.sort/cs/program.cs
@@ -1,8 +1,8 @@
//
using System;
using System.Collections.Generic;
-// Simple business object. A PartId is used to identify the type of part
-// but the part name can change.
+// Simple business object. A PartId is used to identify the type of part
+// but the part name can change.
public class Part : IEquatable , IComparable
{
public string PartName { get; set; }
@@ -22,7 +22,7 @@ public override bool Equals(object obj)
}
public int SortByNameAscending(string name1, string name2)
{
-
+
return name1.CompareTo(name2);
}
@@ -32,7 +32,7 @@ public int CompareTo(Part comparePart)
// A null value means that this object is greater.
if (comparePart == null)
return 1;
-
+
else
return this.PartId.CompareTo(comparePart.PartId);
}
@@ -63,7 +63,7 @@ public static void Main()
parts.Add(new Part() { PartName = "banana seat", PartId = 1444 });
parts.Add(new Part() { PartName = "cassette", PartId = 1534 });
- // Write out the parts in the list. This will call the overridden
+ // Write out the parts in the list. This will call the overridden
// ToString method in the Part class.
Console.WriteLine("\nBefore sort:");
foreach (Part aPart in parts)
@@ -71,8 +71,8 @@ public static void Main()
Console.WriteLine(aPart);
}
- // Call Sort on the list. This will use the
- // default comparer, which is the Compare method
+ // Call Sort on the list. This will use the
+ // default comparer, which is the Compare method
// implemented on Part.
parts.Sort();
@@ -81,9 +81,9 @@ public static void Main()
{
Console.WriteLine(aPart);
}
-
- // This shows calling the Sort(Comparison(T) overload using
- // an anonymous method for the Comparison delegate.
+
+ // This shows calling the Sort(Comparison(T) overload using
+ // an anonymous method for the Comparison delegate.
// This method treats null as the lesser of two values.
parts.Sort(delegate(Part x, Part y)
{
@@ -98,9 +98,9 @@ public static void Main()
{
Console.WriteLine(aPart);
}
-
+
/*
-
+
Before sort:
ID: 1434 Name: regular seat
ID: 1234 Name: crank arm
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.sortedset/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.sortedset/cs/program.cs
index 96acc55dc68..e401fe86191 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.sortedset/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.generic.sortedset/cs/program.cs
@@ -129,11 +129,11 @@ public class ByFileExtension : IComparer
public int Compare(string x, string y)
{
- // Parse the extension from the file name.
+ // Parse the extension from the file name.
xExt = x.Substring(x.LastIndexOf(".") + 1);
yExt = y.Substring(y.LastIndexOf(".") + 1);
- // Compare the file extensions.
+ // Compare the file extensions.
int vExt = caseiComp.Compare(xExt, yExt);
if (vExt != 0)
{
@@ -141,8 +141,8 @@ public int Compare(string x, string y)
}
else
{
- // The extension is the same,
- // so compare the filenames.
+ // The extension is the same,
+ // so compare the filenames.
return caseiComp.Compare(x, y);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.istructuralequatable/cs/nanexample1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.istructuralequatable/cs/nanexample1.cs
index 70e2caa638b..11088e5a041 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.istructuralequatable/cs/nanexample1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.istructuralequatable/cs/nanexample1.cs
@@ -14,7 +14,7 @@ public class NanComparer : IEqualityComparer
else
return EqualityComparer.Default.Equals(x, y);
}
-
+
public int GetHashCode(object obj)
{
return EqualityComparer.Default.GetHashCode(obj);
@@ -29,19 +29,19 @@ public static void Main()
{
var t1 = Tuple.Create(12.3, Double.NaN, 16.4);
var t2 = Tuple.Create(12.3, Double.NaN, 16.4);
-
+
// Call default Equals method.
Console.WriteLine(t1.Equals(t2));
-
+
IStructuralEquatable equ = t1;
// Call IStructuralEquatable.Equals using default comparer.
Console.WriteLine(equ.Equals(t2, EqualityComparer.Default));
-
- // Call IStructuralEquatable.Equals using
+
+ // Call IStructuralEquatable.Equals using
// StructuralComparisons.StructuralEqualityComparer.
- Console.WriteLine(equ.Equals(t2,
+ Console.WriteLine(equ.Equals(t2,
StructuralComparisons.StructuralEqualityComparer));
-
+
// Call IStructuralEquatable.Equals using custom comparer.
Console.WriteLine(equ.Equals(t2, new NanComparer()));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.specialized.nameobjectcollectionbase.keyscollection/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.specialized.nameobjectcollectionbase.keyscollection/cs/source.cs
index f7ccb0923ef..2483db0c27a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.specialized.nameobjectcollectionbase.keyscollection/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.specialized.nameobjectcollectionbase.keyscollection/cs/source.cs
@@ -19,7 +19,7 @@ public DerivedCollection( IDictionary d, Boolean bReadOnly ) {
// Gets a key-and-value pair (DictionaryEntry) using an index.
public DictionaryEntry this[ int index ] {
get {
- return ( new DictionaryEntry(
+ return ( new DictionaryEntry(
this.BaseGetKey(index), this.BaseGet(index) ) );
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.comparison`1/cs/comparisont1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.comparison`1/cs/comparisont1.cs
index c30c14bd045..f427a6cf79b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.comparison`1/cs/comparisont1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.comparison`1/cs/comparisont1.cs
@@ -6,37 +6,37 @@ public class CityInfo
string cityName;
string countryName;
int pop2010;
-
+
public CityInfo(string name, string country, int pop2010)
{
this.cityName = name;
this.countryName = country;
this.pop2010 = pop2010;
}
-
+
public string City
- { get { return this.cityName; } }
-
+ { get { return this.cityName; } }
+
public string Country
{ get { return this.countryName; } }
public int Population
{ get { return this.pop2010; } }
-
+
public static int CompareByName(CityInfo city1, CityInfo city2)
- {
+ {
return String.Compare(city1.City, city2.City);
}
-
+
public static int CompareByPopulation(CityInfo city1, CityInfo city2)
{
return city1.Population.CompareTo(city2.Population);
}
-
+
public static int CompareByNames(CityInfo city1, CityInfo city2)
{
return String.Compare(city1.Country + city1.City, city2.Country + city2.City);
- }
+ }
}
public class Example
@@ -49,25 +49,25 @@ public static void Main()
CityInfo[] cities = { NYC, Det, Paris };
// Display ordered array.
DisplayArray(cities);
-
+
// Sort array by city name.
Array.Sort(cities, CityInfo.CompareByName);
DisplayArray(cities);
-
+
// Sort array by population.
Array.Sort(cities, CityInfo.CompareByPopulation);
DisplayArray(cities);
-
+
// Sort array by country + city name.
Array.Sort(cities, CityInfo.CompareByNames);
DisplayArray(cities);
}
-
+
private static void DisplayArray(CityInfo[] cities)
{
Console.WriteLine("{0,-20} {1,-25} {2,10}", "City", "Country", "Population");
foreach (var city in cities)
- Console.WriteLine("{0,-20} {1,-25} {2,10:N0}", city.City,
+ Console.WriteLine("{0,-20} {1,-25} {2,10:N0}", city.City,
city.Country, city.Population);
Console.WriteLine();
@@ -78,17 +78,17 @@ private static void DisplayArray(CityInfo[] cities)
// New York City United States of America 8,175,133
// Detroit United States of America 713,777
// Paris France 2,193,031
-//
+//
// City Country Population
// Detroit United States of America 713,777
// New York City United States of America 8,175,133
// Paris France 2,193,031
-//
+//
// City Country Population
// Detroit United States of America 713,777
// Paris France 2,193,031
// New York City United States of America 8,175,133
-//
+//
// City Country Population
// Paris France 2,193,031
// Detroit United States of America 713,777
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.backgroundcolor/cs/backgroundcolor1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.backgroundcolor/cs/backgroundcolor1.cs
index 8c99e6f99d6..736e2231b9a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.backgroundcolor/cs/backgroundcolor1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.backgroundcolor/cs/backgroundcolor1.cs
@@ -6,25 +6,25 @@ public class Example
public static void Main()
{
WriteCharacterStrings(1, 26, true);
- Console.MoveBufferArea(0, Console.CursorTop - 10, 30, 1,
+ Console.MoveBufferArea(0, Console.CursorTop - 10, 30, 1,
Console.CursorLeft, Console.CursorTop + 1);
Console.CursorTop = Console.CursorTop + 3;
- Console.WriteLine("Press any key...");
+ Console.WriteLine("Press any key...");
Console.ReadKey();
Console.Clear();
WriteCharacterStrings(1, 26, false);
}
- private static void WriteCharacterStrings(int start, int end,
+ private static void WriteCharacterStrings(int start, int end,
bool changeColor)
- {
+ {
for (int ctr = start; ctr <= end; ctr++) {
if (changeColor)
Console.BackgroundColor = (ConsoleColor) ((ctr - 1) % 16);
Console.WriteLine(new String(Convert.ToChar(ctr + 64), 30));
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class.unsafe/cs/setfont1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class.unsafe/cs/setfont1.cs
index c31794dbbbc..83ce91744e8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class.unsafe/cs/setfont1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class.unsafe/cs/setfont1.cs
@@ -9,21 +9,21 @@ public class Example
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
static extern bool GetCurrentConsoleFontEx(
- IntPtr consoleOutput,
+ IntPtr consoleOutput,
bool maximumWindow,
ref CONSOLE_FONT_INFO_EX lpConsoleCurrentFontEx);
-
+
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool SetCurrentConsoleFontEx(
- IntPtr consoleOutput,
+ IntPtr consoleOutput,
bool maximumWindow,
CONSOLE_FONT_INFO_EX consoleCurrentFontEx);
-
+
private const int STD_OUTPUT_HANDLE = -11;
private const int TMPF_TRUETYPE = 4;
private const int LF_FACESIZE = 32;
private static IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1);
-
+
public static unsafe void Main()
{
string fontName = "Lucida Console";
@@ -41,7 +41,7 @@ public static unsafe void Main()
}
// Set console font to Lucida Console.
CONSOLE_FONT_INFO_EX newInfo = new CONSOLE_FONT_INFO_EX();
- newInfo.cbSize = (uint) Marshal.SizeOf(newInfo);
+ newInfo.cbSize = (uint) Marshal.SizeOf(newInfo);
newInfo.FontFamily = TMPF_TRUETYPE;
IntPtr ptr = new IntPtr(newInfo.FaceName);
Marshal.Copy(fontName.ToCharArray(), 0, ptr, fontName.Length);
@@ -50,24 +50,24 @@ public static unsafe void Main()
newInfo.FontWeight = info.FontWeight;
SetCurrentConsoleFontEx(hnd, false, newInfo);
}
- }
+ }
}
-
+
[StructLayout(LayoutKind.Sequential)]
internal struct COORD
{
internal short X;
internal short Y;
-
+
internal COORD(short x, short y)
{
X = x;
Y = y;
}
}
-
+
[StructLayout(LayoutKind.Sequential)]
- internal unsafe struct CONSOLE_FONT_INFO_EX
+ internal unsafe struct CONSOLE_FONT_INFO_EX
{
internal uint cbSize;
internal uint nFont;
@@ -75,6 +75,6 @@ internal unsafe struct CONSOLE_FONT_INFO_EX
internal int FontFamily;
internal int FontWeight;
internal fixed char FaceName[LF_FACESIZE];
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/example3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/example3.cs
index 5f229c06c81..a8d3b885726 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/example3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/example3.cs
@@ -27,29 +27,29 @@ private static void Main(string[] args)
case 3:
if (! uint.TryParse(args[0], NumberStyles.HexNumber, null, out rangeStart))
throw new ArgumentException(String.Format("{0} is not a valid hexadecimal number.", args[0]));
-
+
if (!uint.TryParse(args[1], NumberStyles.HexNumber, null, out rangeEnd))
throw new ArgumentException(String.Format("{0} is not a valid hexadecimal number.", args[1]));
-
+
bool.TryParse(args[2], out setOutputEncodingToUnicode);
break;
default:
- Console.WriteLine("Usage: {0} <{1}> <{2}> [{3}]",
- Environment.GetCommandLineArgs()[0],
- "startingCodePointInHex",
- "endingCodePointInHex",
+ Console.WriteLine("Usage: {0} <{1}> <{2}> [{3}]",
+ Environment.GetCommandLineArgs()[0],
+ "startingCodePointInHex",
+ "endingCodePointInHex",
"");
return;
}
-
+
if (setOutputEncodingToUnicode) {
// This won't work before .NET Framework 4.5.
try {
// Set encoding using endianness of this system.
- // We're interested in displaying individual Char objects, so
+ // We're interested in displaying individual Char objects, so
// we don't want a Unicode BOM or exceptions to be thrown on
// invalid Char values.
- Console.OutputEncoding = new UnicodeEncoding(! BitConverter.IsLittleEndian, false);
+ Console.OutputEncoding = new UnicodeEncoding(! BitConverter.IsLittleEndian, false);
Console.WriteLine("\nOutput encoding set to UTF-16");
}
catch (IOException) {
@@ -58,7 +58,7 @@ private static void Main(string[] args)
}
}
else {
- Console.WriteLine("The console encoding is {0} (code page {1})",
+ Console.WriteLine("The console encoding is {0} (code page {1})",
Console.OutputEncoding.EncodingName,
Console.OutputEncoding.CodePage);
}
@@ -78,7 +78,7 @@ public static void DisplayRange(uint start, uint end)
const uint upperRange = 0x10FFFF;
const uint surrogateStart = 0xD800;
const uint surrogateEnd = 0xDFFF;
-
+
if (end <= start) {
uint t = start;
start = end;
@@ -88,15 +88,15 @@ public static void DisplayRange(uint start, uint end)
// Check whether the start or end range is outside of last plane.
if (start > upperRange)
throw new ArgumentException(String.Format("0x{0:X5} is outside the upper range of Unicode code points (0x{1:X5})",
- start, upperRange));
+ start, upperRange));
if (end > upperRange)
throw new ArgumentException(String.Format("0x{0:X5} is outside the upper range of Unicode code points (0x{0:X5})",
end, upperRange));
// Since we're using 21-bit code points, we can't use U+D800 to U+DFFF.
if ((start < surrogateStart & end > surrogateStart) || (start >= surrogateStart & start <= surrogateEnd ))
- throw new ArgumentException(String.Format("0x{0:X5}-0x{1:X5} includes the surrogate pair range 0x{2:X5}-0x{3:X5}",
- start, end, surrogateStart, surrogateEnd));
+ throw new ArgumentException(String.Format("0x{0:X5}-0x{1:X5} includes the surrogate pair range 0x{2:X5}-0x{3:X5}",
+ start, end, surrogateStart, surrogateEnd));
uint last = RoundUpToMultipleOf(0x10, end);
uint first = RoundDownToMultipleOf(0x10, start);
@@ -118,7 +118,7 @@ public static void DisplayRange(uint start, uint end)
// the cast to int is safe, since we know that val <= upperRange.
String chars = Char.ConvertFromUtf32( (int) cur);
// Display a space for code points that are not valid characters.
- if (CharUnicodeInfo.GetUnicodeCategory(chars[0]) ==
+ if (CharUnicodeInfo.GetUnicodeCategory(chars[0]) ==
UnicodeCategory.OtherNotAssigned)
Console.Write(" {0} ", Convert.ToChar(0x20));
// Display a space for code points in the private use area.
@@ -128,13 +128,13 @@ public static void DisplayRange(uint start, uint end)
// Is surrogate pair a valid character?
// Note that the console will interpret the high and low surrogate
// as separate (and unrecognizable) characters.
- else if (chars.Length > 1 && CharUnicodeInfo.GetUnicodeCategory(chars, 0) ==
+ else if (chars.Length > 1 && CharUnicodeInfo.GetUnicodeCategory(chars, 0) ==
UnicodeCategory.OtherNotAssigned)
Console.Write(" {0} ", Convert.ToChar(0x20));
else
- Console.Write(" {0} ", chars);
+ Console.Write(" {0} ", chars);
}
-
+
switch (c) {
case 3: case 11:
Console.Write("-");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/fontlink1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/fontlink1.cs
index 83c43894ccd..cf2dd195657 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/fontlink1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/fontlink1.cs
@@ -9,11 +9,11 @@ public static void Main()
string valueName = "Lucida Console";
string newFont = "simsun.ttc,SimSun";
string[] fonts = null;
- RegistryValueKind kind = 0;
+ RegistryValueKind kind = 0;
bool toAdd;
-
- RegistryKey key = Registry.LocalMachine.OpenSubKey(
- @"Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink",
+
+ RegistryKey key = Registry.LocalMachine.OpenSubKey(
+ @"Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink",
true);
if (key == null) {
Console.WriteLine("Font linking is not enabled.");
@@ -21,7 +21,7 @@ public static void Main()
else {
// Determine if the font is a base font.
string[] names = key.GetValueNames();
- if (Array.Exists(names, s => s.Equals(valueName,
+ if (Array.Exists(names, s => s.Equals(valueName,
StringComparison.OrdinalIgnoreCase))) {
// Get the value's type.
kind = key.GetValueKind(valueName);
@@ -30,7 +30,7 @@ public static void Main()
switch (kind) {
case RegistryValueKind.String:
fonts = new string[] { (string) key.GetValue(valueName) };
- break;
+ break;
case RegistryValueKind.MultiString:
fonts = (string[]) key.GetValue(valueName);
break;
@@ -38,9 +38,9 @@ public static void Main()
// Do nothing.
fonts = new string[] { };
break;
- }
+ }
// Determine whether SimSun is a linked font.
- if (Array.FindIndex(fonts, s =>s.IndexOf("SimSun",
+ if (Array.FindIndex(fonts, s =>s.IndexOf("SimSun",
StringComparison.OrdinalIgnoreCase) >=0) >= 0) {
Console.WriteLine("Font is already linked.");
toAdd = false;
@@ -56,7 +56,7 @@ public static void Main()
fonts = new string[] { };
}
- if (toAdd) {
+ if (toAdd) {
Array.Resize(ref fonts, fonts.Length + 1);
fonts[fonts.GetUpperBound(0)] = newFont;
// Change REG_SZ to REG_MULTI_SZ.
@@ -65,9 +65,9 @@ public static void Main()
key.SetValue(valueName, fonts, RegistryValueKind.MultiString);
Console.WriteLine("SimSun added to the list of linked fonts.");
- }
+ }
}
-
+
if (key != null) key.Close();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/normalize1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/normalize1.cs
index 122be8b1c3f..bb29c964660 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/normalize1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/normalize1.cs
@@ -7,10 +7,10 @@ public class Example
public static void Main()
{
char[] chars = { '\u0061', '\u0308' };
-
+
string combining = new String(chars);
Console.WriteLine(combining);
-
+
combining = combining.Normalize();
Console.WriteLine(combining);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/unicode1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/unicode1.cs
index 9eeb9e02fdf..6907ed43d2e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/unicode1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.class/cs/unicode1.cs
@@ -5,7 +5,7 @@ public class Example
{
public static void Main()
{
- // Create a Char array for the modern Cyrillic alphabet,
+ // Create a Char array for the modern Cyrillic alphabet,
// from U+0410 to U+044F.
int nChars = 0x044F - 0x0410 + 1;
char[] chars = new char[nChars];
@@ -13,21 +13,21 @@ public static void Main()
for (int ctr = 0; ctr < chars.Length; ctr++) {
chars[ctr] = Convert.ToChar(codePoint);
codePoint++;
- }
-
- Console.WriteLine("Current code page: {0}\n",
+ }
+
+ Console.WriteLine("Current code page: {0}\n",
Console.OutputEncoding.CodePage);
// Display the characters.
foreach (var ch in chars) {
Console.Write("{0} ", ch);
- if (Console.CursorLeft >= 70)
+ if (Console.CursorLeft >= 70)
Console.WriteLine();
}
}
}
// The example displays the following output:
// Current code page: 437
-//
+//
// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
// ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.clear/cs/clear1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.clear/cs/clear1.cs
index e95f3f7e32c..d8d69348419 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.clear/cs/clear1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.clear/cs/clear1.cs
@@ -10,12 +10,12 @@ public static void Main()
ConsoleColor dftBackColor = Console.BackgroundColor;
bool continueFlag = true;
Console.Clear();
-
- do {
+
+ do {
ConsoleColor newForeColor = ConsoleColor.White;
ConsoleColor newBackColor = ConsoleColor.Black;
-
- Char foreColorSelection = GetKeyPress("Select Text Color (B for Blue, R for Red, Y for Yellow): ",
+
+ Char foreColorSelection = GetKeyPress("Select Text Color (B for Blue, R for Red, Y for Yellow): ",
new Char[] { 'B', 'R', 'Y' } );
switch (foreColorSelection) {
case 'B':
@@ -29,7 +29,7 @@ public static void Main()
case 'Y':
case 'y':
newForeColor = ConsoleColor.DarkYellow;
- break;
+ break;
}
Char backColorSelection = GetKeyPress("Select Background Color (W for White, G for Green, M for Magenta): ",
new Char[] { 'W', 'G', 'M' });
@@ -45,9 +45,9 @@ public static void Main()
case 'M':
case 'm':
newBackColor = ConsoleColor.Magenta;
- break;
+ break;
}
-
+
Console.WriteLine();
Console.Write("Enter a message to display: ");
String textToDisplay = Console.ReadLine();
@@ -66,20 +66,20 @@ public static void Main()
} while (continueFlag);
}
- private static Char GetKeyPress(String msg, Char[] validChars)
+ private static Char GetKeyPress(String msg, Char[] validChars)
{
ConsoleKeyInfo keyPressed;
bool valid = false;
-
+
Console.WriteLine();
do {
Console.Write(msg);
keyPressed = Console.ReadKey();
Console.WriteLine();
- if (Array.Exists(validChars, ch => ch.Equals(Char.ToUpper(keyPressed.KeyChar))))
+ if (Array.Exists(validChars, ch => ch.Equals(Char.ToUpper(keyPressed.KeyChar))))
valid = true;
} while (! valid);
- return keyPressed.KeyChar;
+ return keyPressed.KeyChar;
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.out/cs/out1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.out/cs/out1.cs
index 6898e1dca6e..52c84a9afbb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.out/cs/out1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.out/cs/out1.cs
@@ -9,10 +9,10 @@ public static void Main()
// Get all files in the current directory.
string[] files = Directory.GetFiles(".");
Array.Sort(files);
-
+
// Display the files to the current output source to the console.
Console.Out.WriteLine("First display of filenames to the console:");
- Array.ForEach(files, s => Console.Out.WriteLine(s));
+ Array.ForEach(files, s => Console.Out.WriteLine(s));
Console.Out.WriteLine();
// Redirect output to a file named Files.txt and write file list.
@@ -20,7 +20,7 @@ public static void Main()
sw.AutoFlush = true;
Console.SetOut(sw);
Console.Out.WriteLine("Display filenames to a file:");
- Array.ForEach(files, s => Console.Out.WriteLine(s));
+ Array.ForEach(files, s => Console.Out.WriteLine(s));
Console.Out.WriteLine();
// Close previous output stream and redirect output to standard output.
@@ -28,10 +28,10 @@ public static void Main()
sw = new StreamWriter(Console.OpenStandardOutput());
sw.AutoFlush = true;
Console.SetOut(sw);
-
+
// Display the files to the current output source to the console.
Console.Out.WriteLine("Second display of filenames to the console:");
- Array.ForEach(files, s => Console.Out.WriteLine(s));
- }
+ Array.ForEach(files, s => Console.Out.WriteLine(s));
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.setout/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.setout/cs/source.cs
index 21528ea5878..5dd6149d56a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.setout/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.setout/cs/source.cs
@@ -18,7 +18,7 @@ public static void Main()
Console.WriteLine("Hello World");
sw.Close();
//
- }
+ }
catch (Exception ex)
{
Console.WriteLine(ex.Message);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.windowleft/cs/windowleft1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.windowleft/cs/windowleft1.cs
index bbde693c1b3..8d9b39f6cad 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.windowleft/cs/windowleft1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.windowleft/cs/windowleft1.cs
@@ -7,37 +7,37 @@ public static void Main()
{
ConsoleKeyInfo key;
bool moved = false;
-
+
Console.BufferWidth += 4;
Console.Clear();
-
+
ShowConsoleStatistics();
- do
+ do
{
key = Console.ReadKey(true);
if (key.Key == ConsoleKey.LeftArrow)
{
int pos = Console.WindowLeft - 1;
if (pos >= 0 && pos + Console.WindowWidth <= Console.BufferWidth)
- {
+ {
Console.WindowLeft = pos;
moved = true;
- }
- }
+ }
+ }
else if (key.Key == ConsoleKey.RightArrow)
{
int pos = Console.WindowLeft + 1;
if (pos + Console.WindowWidth <= Console.BufferWidth)
- {
+ {
Console.WindowLeft = pos;
moved = true;
}
}
if (moved)
- {
- ShowConsoleStatistics();
+ {
+ ShowConsoleStatistics();
moved = false;
- }
+ }
Console.WriteLine();
} while (true);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.write/cs/WriteParams1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.write/cs/WriteParams1.cs
index e73b3ed5eff..34dbe35e4bd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.write/cs/WriteParams1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.write/cs/WriteParams1.cs
@@ -9,8 +9,8 @@ public class Person
public Double Weight { get; set; }
public Char Gender { get; set; }
public String Remarks { get; set; }
-
- public object[] GetDescription()
+
+ public object[] GetDescription()
{
return new object[] { Name, Gender, Height, Weight, BirthDate};
}
@@ -21,10 +21,10 @@ public class Example
public static void Main()
{
var p1 = new Person() { Name = "John", Gender = 'M',
- BirthDate = new DateTime(1992, 5, 10),
+ BirthDate = new DateTime(1992, 5, 10),
Height = 73.5, Weight = 207 };
p1.Remarks = "Client since 1/3/2012";
- Console.Write("{0}: {1}, born {4:d} Height {2} inches, Weight {3} lbs ",
+ Console.Write("{0}: {1}, born {4:d} Height {2} inches, Weight {3} lbs ",
p1.GetDescription());
if (String.IsNullOrEmpty(p1.Remarks))
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.write/cs/WriteParams2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.write/cs/WriteParams2.cs
index 4cf3bd6be81..d515ded8c8a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.write/cs/WriteParams2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.console.write/cs/WriteParams2.cs
@@ -9,8 +9,8 @@ public class Person
public Double Weight { get; set; }
public Char Gender { get; set; }
public String Remarks { get; set; }
-
- public object[] GetDescription()
+
+ public object[] GetDescription()
{
return new object[] { Name, Gender, Height, Weight, BirthDate};
}
@@ -21,10 +21,10 @@ public class Example
public static void Main()
{
var p1 = new Person() { Name = "John", Gender = 'M',
- BirthDate = new DateTime(1992, 5, 10),
+ BirthDate = new DateTime(1992, 5, 10),
Height = 73.5, Weight = 207 };
p1.Remarks = "Client since 1/3/2012";
- Console.Write("{0}: {1}, born {2:d} Height {3} inches, Weight {4} lbs ",
+ Console.Write("{0}: {1}, born {2:d} Height {3} inches, Weight {4} lbs ",
p1.Name, p1.Gender, p1.BirthDate, p1.Height, p1.Weight);
if (String.IsNullOrEmpty(p1.Remarks))
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.consolecolor/cs/foregroundcolor3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.consolecolor/cs/foregroundcolor3.cs
index 18dcd71a2cd..3db4257c4fd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.consolecolor/cs/foregroundcolor3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.consolecolor/cs/foregroundcolor3.cs
@@ -3,7 +3,7 @@
class Example
{
- public static void Main()
+ public static void Main()
{
// Get an array with the values of ConsoleColor enumeration members.
ConsoleColor[] colors = (ConsoleColor[]) ConsoleColor.GetValues(typeof(ConsoleColor));
@@ -16,24 +16,24 @@ public static void Main()
currentBackground);
foreach (var color in colors) {
if (color == currentBackground) continue;
-
+
Console.ForegroundColor = color;
Console.WriteLine(" The foreground color is {0}.", color);
}
Console.WriteLine();
// Restore the foreground color.
Console.ForegroundColor = currentForeground;
-
+
// Display each background color except the one that matches the current foreground color.
Console.WriteLine("All the background colors except {0}, the foreground color:",
currentForeground);
foreach (var color in colors) {
if (color == currentForeground) continue;
-
+
Console.BackgroundColor = color;
Console.WriteLine(" The background color is {0}.", color);
}
-
+
// Restore the original console colors.
Console.ResetColor();
Console.WriteLine("\nOriginal colors restored...");
@@ -56,7 +56,7 @@ public static void Main()
// The foreground color is Magenta.
// The foreground color is Yellow.
// The foreground color is White.
-//
+//
// All the background colors except White, the foreground color:
// The background color is Black.
// The background color is DarkBlue.
@@ -73,6 +73,6 @@ public static void Main()
// The background color is Red.
// The background color is Magenta.
// The background color is Yellow.
-//
+//
// Original colors restored...
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.consolekeyinfo.keychar/cs/keychar1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.consolekeyinfo.keychar/cs/keychar1.cs
index 281b3b8b1cc..00d68b46c0b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.consolekeyinfo.keychar/cs/keychar1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.consolekeyinfo.keychar/cs/keychar1.cs
@@ -9,7 +9,7 @@ public static void Main()
Console.BufferWidth = 80;
Console.WindowWidth = Console.BufferWidth;
Console.TreatControlCAsInput = true;
-
+
string inputString = String.Empty;
ConsoleKeyInfo keyInfo;
@@ -17,10 +17,10 @@ public static void Main()
do {
keyInfo = Console.ReadKey(true);
// Ignore if Alt or Ctrl is pressed.
- if ((keyInfo.Modifiers & ConsoleModifiers.Alt) == ConsoleModifiers.Alt)
+ if ((keyInfo.Modifiers & ConsoleModifiers.Alt) == ConsoleModifiers.Alt)
continue;
if ((keyInfo.Modifiers & ConsoleModifiers.Control) == ConsoleModifiers.Control)
- continue;
+ continue;
// Ignore if KeyChar value is \u0000.
if (keyInfo.KeyChar == '\u0000') continue;
// Ignore tab key.
@@ -28,7 +28,7 @@ public static void Main()
// Handle backspace.
if (keyInfo.Key == ConsoleKey.Backspace) {
// Are there any characters to erase?
- if (inputString.Length >= 1) {
+ if (inputString.Length >= 1) {
// Determine where we are in the console buffer.
int cursorCol = Console.CursorLeft - 1;
int oldLength = inputString.Length;
@@ -48,7 +48,7 @@ public static void Main()
Console.Write(keyInfo.KeyChar);
inputString += keyInfo.KeyChar;
} while (keyInfo.Key != ConsoleKey.Enter);
- Console.WriteLine("\n\nYou entered:\n {0}",
+ Console.WriteLine("\n\nYou entered:\n {0}",
String.IsNullOrEmpty(inputString) ? "" : inputString);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype00.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype00.cs
index 27aecfa6489..bc4e85f595a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype00.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype00.cs
@@ -4,12 +4,12 @@
public class InterceptProvider : IFormatProvider
{
- public object GetFormat(Type formatType)
+ public object GetFormat(Type formatType)
{
if (formatType == typeof(NumberFormatInfo)) {
Console.WriteLine(" Returning a fr-FR numeric format provider.");
return new System.Globalization.CultureInfo("fr-FR").NumberFormat;
- }
+ }
else if (formatType == typeof(DateTimeFormatInfo)) {
Console.WriteLine(" Returning an en-US date/time format provider.");
return new System.Globalization.CultureInfo("en-US").DateTimeFormat;
@@ -27,17 +27,17 @@ public static void Main()
{
object[] values = { 103.5d, new DateTime(2010, 12, 26, 14, 34, 0) };
IFormatProvider provider = new InterceptProvider();
-
+
// Convert value to each of the types represented in TypeCode enum.
foreach (object value in values)
{
// Iterate types in TypeCode enum.
foreach (TypeCode enumType in ((TypeCode[]) Enum.GetValues(typeof(TypeCode))))
- {
+ {
if (enumType == TypeCode.DBNull || enumType == TypeCode.Empty) continue;
-
+
try {
- Console.WriteLine("{0} ({1}) --> {2} ({3}).",
+ Console.WriteLine("{0} ({1}) --> {2} ({3}).",
value, value.GetType().Name,
Convert.ChangeType(value, enumType, provider),
enumType.ToString());
@@ -45,7 +45,7 @@ public static void Main()
catch (InvalidCastException) {
Console.WriteLine("Cannot convert a {0} to a {1}",
value.GetType().Name, enumType.ToString());
- }
+ }
catch (OverflowException) {
Console.WriteLine("Overflow: {0} is out of the range of a {1}",
value, enumType.ToString());
@@ -73,7 +73,7 @@ public static void Main()
// Cannot convert a Double to a DateTime
// Returning a fr-FR numeric format provider.
// 103.5 (Double) --> 103,5 (String).
-//
+//
// 12/26/2010 2:34:00 PM (DateTime) --> 12/26/2010 2:34:00 PM (Object).
// Cannot convert a DateTime to a Boolean
// Cannot convert a DateTime to a Char
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype01.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype01.cs
index a8cea853894..470ee3846df 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype01.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype01.cs
@@ -12,7 +12,7 @@ public static void Main() {
string s = "12/12/2009";
DateTime dt = (DateTime)Convert.ChangeType(s, typeof(DateTime));
- Console.WriteLine("The String {0} when converted to a Date is {1}", s, dt);
+ Console.WriteLine("The String {0} when converted to a Date is {1}", s, dt);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype03.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype03.cs
index 2eece142669..c725762157e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype03.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype03.cs
@@ -10,22 +10,22 @@ public Temperature(decimal temperature)
{
this.m_Temp = temperature;
}
-
+
public decimal Celsius
{
- get { return this.m_Temp; }
+ get { return this.m_Temp; }
}
-
+
public decimal Kelvin
{
- get { return this.m_Temp + 273.15m; }
+ get { return this.m_Temp + 273.15m; }
}
-
+
public decimal Fahrenheit
{
get { return Math.Round((decimal) (this.m_Temp * 9 / 5 + 32), 2); }
}
-
+
public override string ToString()
{
return m_Temp.ToString("N2") + "°C";
@@ -36,44 +36,44 @@ public TypeCode GetTypeCode()
{
return TypeCode.Object;
}
-
- public bool ToBoolean(IFormatProvider provider)
+
+ public bool ToBoolean(IFormatProvider provider)
{
if (m_Temp == 0)
return false;
else
return true;
- }
-
+ }
+
public byte ToByte(IFormatProvider provider)
{
if (m_Temp < Byte.MinValue || m_Temp > Byte.MaxValue)
- throw new OverflowException(String.Format("{0} is out of range of the Byte type.",
+ throw new OverflowException(String.Format("{0} is out of range of the Byte type.",
this.m_Temp));
else
return Decimal.ToByte(this.m_Temp);
}
-
+
public char ToChar(IFormatProvider provider)
{
throw new InvalidCastException("Temperature to Char conversion is not supported.");
- }
-
+ }
+
public DateTime ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException("Temperature to DateTime conversion is not supported.");
}
-
+
public decimal ToDecimal(IFormatProvider provider)
{
return this.m_Temp;
}
-
+
public double ToDouble(IFormatProvider provider)
{
return Decimal.ToDouble(this.m_Temp);
- }
-
+ }
+
public short ToInt16(IFormatProvider provider)
{
if (this.m_Temp < Int16.MinValue || this.m_Temp > Int16.MaxValue)
@@ -82,7 +82,7 @@ public short ToInt16(IFormatProvider provider)
else
return Decimal.ToInt16(this.m_Temp);
}
-
+
public int ToInt32(IFormatProvider provider)
{
if (this.m_Temp < Int32.MinValue || this.m_Temp > Int32.MaxValue)
@@ -91,7 +91,7 @@ public int ToInt32(IFormatProvider provider)
else
return Decimal.ToInt32(this.m_Temp);
}
-
+
public long ToInt64(IFormatProvider provider)
{
if (this.m_Temp < Int64.MinValue || this.m_Temp > Int64.MaxValue)
@@ -100,7 +100,7 @@ public long ToInt64(IFormatProvider provider)
else
return Decimal.ToInt64(this.m_Temp);
}
-
+
public sbyte ToSByte(IFormatProvider provider)
{
if (this.m_Temp < SByte.MinValue || this.m_Temp > SByte.MaxValue)
@@ -119,12 +119,12 @@ public string ToString(IFormatProvider provider)
{
return m_Temp.ToString("N2", provider) + "°C";
}
-
+
public object ToType(Type conversionType, IFormatProvider provider)
{
switch (Type.GetTypeCode(conversionType))
{
- case TypeCode.Boolean:
+ case TypeCode.Boolean:
return this.ToBoolean(null);
case TypeCode.Byte:
return this.ToByte(null);
@@ -159,12 +159,12 @@ public object ToType(Type conversionType, IFormatProvider provider)
case TypeCode.UInt32:
return this.ToUInt32(null);
case TypeCode.UInt64:
- return this.ToUInt64(null);
+ return this.ToUInt64(null);
default:
- throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
+ throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
}
}
-
+
public ushort ToUInt16(IFormatProvider provider)
{
if (this.m_Temp < UInt16.MinValue || this.m_Temp > UInt16.MaxValue)
@@ -182,7 +182,7 @@ public uint ToUInt32(IFormatProvider provider)
else
return Decimal.ToUInt32(this.m_Temp);
}
-
+
public ulong ToUInt64(IFormatProvider provider)
{
if (this.m_Temp < UInt64.MinValue || this.m_Temp > UInt64.MaxValue)
@@ -205,7 +205,7 @@ public static void Main()
typeof(UInt32), typeof(UInt64), typeof(Decimal),
typeof(Single), typeof(Double), typeof(String) };
CultureInfo provider = new CultureInfo("fr-FR");
-
+
foreach (Type targetType in targetTypes)
{
try {
@@ -217,7 +217,7 @@ public static void Main()
catch (InvalidCastException) {
Console.WriteLine("Unsupported {0} --> {1} conversion.",
cool.GetType().Name, targetType.Name);
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0} is out of range of the {1} type.",
cool, targetType.Name);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_enum2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_enum2.cs
index 4a62ed576c6..a1432b77a6a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_enum2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_enum2.cs
@@ -3,7 +3,7 @@
public enum Continent
{
- Africa, Antarctica, Asia, Australia, Europe,
+ Africa, Antarctica, Asia, Australia, Europe,
NorthAmerica, SouthAmerica
};
@@ -13,20 +13,20 @@ public static void Main()
{
// Convert a Continent to a Double.
Continent cont = Continent.NorthAmerica;
- Console.WriteLine("{0:N2}",
+ Console.WriteLine("{0:N2}",
Convert.ChangeType(cont, typeof(Double)));
-
+
// Convert a Double to a Continent.
Double number = 6.0;
try {
- Console.WriteLine("{0}",
+ Console.WriteLine("{0}",
Convert.ChangeType(number, typeof(Continent)));
}
catch (InvalidCastException) {
Console.WriteLine("Cannot convert a Double to a Continent");
}
-
- Console.WriteLine("{0}", (Continent) number);
+
+ Console.WriteLine("{0}", (Continent) number);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_enum3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_enum3.cs
index 6520505b264..d748e1c2ae6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_enum3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_enum3.cs
@@ -3,7 +3,7 @@
public enum Continent
{
- Africa, Antarctica, Asia, Australia, Europe,
+ Africa, Antarctica, Asia, Australia, Europe,
NorthAmerica, SouthAmerica
};
@@ -13,20 +13,20 @@ public static void Main()
{
// Convert a Continent to a Double.
Continent cont = Continent.NorthAmerica;
- Console.WriteLine("{0:N2}",
+ Console.WriteLine("{0:N2}",
Convert.ChangeType(cont, typeof(Double), null));
-
+
// Convert a Double to a Continent.
Double number = 6.0;
try {
- Console.WriteLine("{0}",
+ Console.WriteLine("{0}",
Convert.ChangeType(number, typeof(Continent), null));
}
catch (InvalidCastException) {
Console.WriteLine("Cannot convert a Double to a Continent");
}
-
- Console.WriteLine("{0}", (Continent) number);
+
+ Console.WriteLine("{0}", (Continent) number);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_nullable.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_nullable.cs
index 65567f59372..24cd78e2a70 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_nullable.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_nullable.cs
@@ -11,7 +11,7 @@ public static void Main()
dValue1, dValue1.GetType().Name);
float fValue1 = 16.3478f;
- int? intValue2 = (int) fValue1;
+ int? intValue2 = (int) fValue1;
Console.WriteLine("{0} ({1})--> {2} ({3})", fValue1, fValue1.GetType().Name,
intValue2, intValue2.GetType().Name);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_nullable_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_nullable_1.cs
index 3ad8cb05d0a..26f51ad6b8e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_nullable_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.changetype/cs/changetype_nullable_1.cs
@@ -11,7 +11,7 @@ public static void Main()
dValue1, dValue1.GetType().Name);
float fValue1 = 16.3478f;
- int? intValue2 = (int) fValue1;
+ int? intValue2 = (int) fValue1;
Console.WriteLine("{0} ({1})--> {2} ({3})", fValue1, fValue1.GetType().Name,
intValue2, intValue2.GetType().Name);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/ToByte5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/ToByte5.cs
index 7041f540259..8bb4fa9e802 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/ToByte5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/ToByte5.cs
@@ -5,17 +5,17 @@ public class Example
{
public static void Main()
{
- String[] values = { null, "", "0xC9", "C9", "101", "16.3",
+ String[] values = { null, "", "0xC9", "C9", "101", "16.3",
"$12", "$12.01", "-4", "1,032", "255",
" 16 " };
foreach (var value in values) {
try {
byte number = Convert.ToByte(value);
- Console.WriteLine("'{0}' --> {1}",
+ Console.WriteLine("'{0}' --> {1}",
value == null ? "" : value, number);
}
catch (FormatException) {
- Console.WriteLine("Bad Format: '{0}'",
+ Console.WriteLine("Bad Format: '{0}'",
value == null ? "" : value);
}
catch (OverflowException) {
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte1.cs
index c9d54a35942..70bda4c261e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte1.cs
@@ -29,17 +29,17 @@ private static void ConvertBoolean()
//
bool falseFlag = false;
bool trueFlag = true;
-
- Console.WriteLine("{0} converts to {1}.", falseFlag,
+
+ Console.WriteLine("{0} converts to {1}.", falseFlag,
Convert.ToByte(falseFlag));
- Console.WriteLine("{0} converts to {1}.", trueFlag,
+ Console.WriteLine("{0} converts to {1}.", trueFlag,
Convert.ToByte(trueFlag));
// The example displays the following output:
// False converts to 0.
// True converts to 1.
//
}
-
+
private static void ConvertChar()
{
//
@@ -49,20 +49,20 @@ private static void ConvertChar()
try {
byte result = Convert.ToByte(ch);
Console.WriteLine("{0} is converted to {1}.", ch, result);
- }
+ }
catch (OverflowException) {
- Console.WriteLine("Unable to convert u+{0} to a byte.",
+ Console.WriteLine("Unable to convert u+{0} to a byte.",
Convert.ToInt16(ch).ToString("X4"));
}
- }
+ }
// The example displays the following output:
// a is converted to 97.
// z is converted to 122.
// is converted to 7.
- // Unable to convert u+03FF to a byte.
+ // Unable to convert u+03FF to a byte.
//
}
-
+
private static void ConvertInt16()
{
//
@@ -72,12 +72,12 @@ private static void ConvertInt16()
{
try {
result = Convert.ToByte(number);
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
}
catch (OverflowException) {
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
+ Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
number.GetType().Name, number);
}
}
@@ -90,7 +90,7 @@ private static void ConvertInt16()
// The Int16 value 32767 is outside the range of the Byte type.
//
}
-
+
private static void ConvertInt32()
{
//
@@ -100,12 +100,12 @@ private static void ConvertInt32()
{
try {
result = Convert.ToByte(number);
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
+ Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
number.GetType().Name, number);
}
}
@@ -115,10 +115,10 @@ private static void ConvertInt32()
// Converted the Int32 value 0 to the Byte value 0.
// Converted the Int32 value 121 to the Byte value 121.
// The Int32 value 340 is outside the range of the Byte type.
- // The Int32 value 2147483647 is outside the range of the Byte type.
+ // The Int32 value 2147483647 is outside the range of the Byte type.
//
}
-
+
private static void ConvertInt64()
{
//
@@ -128,12 +128,12 @@ private static void ConvertInt64()
{
try {
result = Convert.ToByte(number);
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
+ Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
number.GetType().Name, number);
}
}
@@ -143,40 +143,40 @@ private static void ConvertInt64()
// Converted the Int64 value 0 to the Byte value 0.
// Converted the Int64 value 121 to the Byte value 121.
// The Int64 value 340 is outside the range of the Byte type.
- // The Int64 value 9223372036854775807 is outside the range of the Byte type.
- //
- }
-
+ // The Int64 value 9223372036854775807 is outside the range of the Byte type.
+ //
+ }
+
private static void ConvertObject()
{
//
- object[] values = { true, -12, 163, 935, 'x', "104", "103.0", "-1",
+ object[] values = { true, -12, 163, 935, 'x', "104", "103.0", "-1",
"1.00e2", "One", 1.00e2};
byte result;
foreach (object value in values)
{
try {
result = Convert.ToByte(value);
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- value.GetType().Name, value,
+ Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
+ value.GetType().Name, value,
result.GetType().Name, result);
- }
+ }
catch (OverflowException)
{
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
+ Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
value.GetType().Name, value);
- }
+ }
catch (FormatException)
{
- Console.WriteLine("The {0} value {1} is not in a recognizable format.",
+ Console.WriteLine("The {0} value {1} is not in a recognizable format.",
value.GetType().Name, value);
}
catch (InvalidCastException)
{
- Console.WriteLine("No conversion to a Byte exists for the {0} value {1}.",
+ Console.WriteLine("No conversion to a Byte exists for the {0} value {1}.",
value.GetType().Name, value);
}
- }
+ }
// The example displays the following output:
// Converted the Boolean value True to the Byte value 1.
// The Int32 value -12 is outside the range of the Byte type.
@@ -188,10 +188,10 @@ private static void ConvertObject()
// The String value -1 is outside the range of the Byte type.
// The String value 1.00e2 is not in a recognizable format.
// The String value One is not in a recognizable format.
- // Converted the Double value 100 to the Byte value 100.
+ // Converted the Double value 100 to the Byte value 100.
//
}
-
+
private static void ConvertSByte()
{
//
@@ -201,13 +201,13 @@ private static void ConvertSByte()
{
try {
result = Convert.ToByte(number);
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException)
{
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
+ Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
number.GetType().Name, number);
}
}
@@ -219,7 +219,7 @@ private static void ConvertSByte()
// Converted the SByte value 127 to the Byte value 127.
//
}
-
+
private static void ConvertUInt16()
{
//
@@ -229,12 +229,12 @@ private static void ConvertUInt16()
{
try {
result = Convert.ToByte(number);
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
+ Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
number.GetType().Name, number);
}
}
@@ -245,7 +245,7 @@ private static void ConvertUInt16()
// The UInt16 value 65535 is outside the range of the Byte type.
//
}
-
+
private static void ConvertUInt32()
{
//
@@ -255,12 +255,12 @@ private static void ConvertUInt32()
{
try {
result = Convert.ToByte(number);
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
+ Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
number.GetType().Name, number);
}
}
@@ -271,7 +271,7 @@ private static void ConvertUInt32()
// The UInt32 value 4294967295 is outside the range of the Byte type.
//
}
-
+
private static void ConvertUInt64()
{
//
@@ -281,13 +281,13 @@ private static void ConvertUInt64()
{
try {
result = Convert.ToByte(number);
- Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException)
{
- Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
+ Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
number.GetType().Name, number);
}
}
@@ -296,6 +296,6 @@ private static void ConvertUInt64()
// Converted the UInt64 value 121 to the Byte value 121.
// The UInt64 value 340 is outside the range of the Byte type.
// The UInt64 value 18446744073709551615 is outside the range of the Byte type.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte2.cs
index 5225b2c522a..6eb34178527 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte2.cs
@@ -6,7 +6,7 @@ public class Example
public static void Main()
{
int[] bases = { 2, 8, 10, 16 };
- string[] values = { "-1", "1", "08", "0F", "11" , "12", "30",
+ string[] values = { "-1", "1", "08", "0F", "11" , "12", "30",
"101", "255", "FF", "10000000", "80" };
byte number;
foreach (int numBase in bases)
@@ -17,19 +17,19 @@ public static void Main()
try {
number = Convert.ToByte(value, numBase);
Console.WriteLine(" Converted '{0}' to {1}.", value, number);
- }
+ }
catch (FormatException) {
- Console.WriteLine(" '{0}' is not in the correct format for a base {1} byte value.",
+ Console.WriteLine(" '{0}' is not in the correct format for a base {1} byte value.",
value, numBase);
- }
+ }
catch (OverflowException) {
Console.WriteLine(" '{0}' is outside the range of the Byte type.", value);
- }
+ }
catch (ArgumentException) {
Console.WriteLine(" '{0}' is invalid in base {1}.", value, numBase);
}
- }
- }
+ }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte3.cs
index 8bb6d3c1073..9ddbebdce07 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte3.cs
@@ -8,15 +8,15 @@ public struct ByteString : IConvertible
{
private SignBit signBit;
private string byteString;
-
+
public SignBit Sign
- {
+ {
set { signBit = value; }
get { return signBit; }
}
public string Value
- {
+ {
set {
if (value.Trim().Length > 2)
throw new ArgumentException("The string representation of a byte cannot have more than two characters.");
@@ -25,20 +25,20 @@ public string Value
}
get { return byteString; }
}
-
+
// IConvertible implementations.
public TypeCode GetTypeCode() {
return TypeCode.Object;
}
-
+
public bool ToBoolean(IFormatProvider provider)
{
if (signBit == SignBit.Zero)
return false;
else
return true;
- }
-
+ }
+
public byte ToByte(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -46,61 +46,61 @@ public byte ToByte(IFormatProvider provider)
else
return Byte.Parse(byteString, NumberStyles.HexNumber);
}
-
+
public char ToChar(IFormatProvider provider)
{
- if (signBit == SignBit.Negative) {
+ if (signBit == SignBit.Negative) {
throw new OverflowException(String.Format("{0} is out of range of the Char type.", Convert.ToSByte(byteString, 16)));
}
else {
byte byteValue = Byte.Parse(this.byteString, NumberStyles.HexNumber);
return Convert.ToChar(byteValue);
- }
- }
-
+ }
+ }
+
public DateTime ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException("ByteString to DateTime conversion is not supported.");
}
-
+
public decimal ToDecimal(IFormatProvider provider)
{
- if (signBit == SignBit.Negative)
+ if (signBit == SignBit.Negative)
{
sbyte byteValue = SByte.Parse(byteString, NumberStyles.HexNumber);
return Convert.ToDecimal(byteValue);
}
- else
+ else
{
byte byteValue = Byte.Parse(byteString, NumberStyles.HexNumber);
return Convert.ToDecimal(byteValue);
}
}
-
+
public double ToDouble(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToDouble(SByte.Parse(byteString, NumberStyles.HexNumber));
else
return Convert.ToDouble(Byte.Parse(byteString, NumberStyles.HexNumber));
- }
-
- public short ToInt16(IFormatProvider provider)
+ }
+
+ public short ToInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToInt16(SByte.Parse(byteString, NumberStyles.HexNumber));
else
return Convert.ToInt16(Byte.Parse(byteString, NumberStyles.HexNumber));
}
-
- public int ToInt32(IFormatProvider provider)
+
+ public int ToInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToInt32(SByte.Parse(byteString, NumberStyles.HexNumber));
else
return Convert.ToInt32(Byte.Parse(byteString, NumberStyles.HexNumber));
}
-
+
public long ToInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -108,7 +108,7 @@ public long ToInt64(IFormatProvider provider)
else
return Convert.ToInt64(Byte.Parse(byteString, NumberStyles.HexNumber));
}
-
+
public sbyte ToSByte(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -116,10 +116,10 @@ public sbyte ToSByte(IFormatProvider provider)
return Convert.ToSByte(Byte.Parse(byteString, NumberStyles.HexNumber));
}
catch (OverflowException e) {
- throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
Byte.Parse(byteString, NumberStyles.HexNumber)), e);
}
- else
+ else
return SByte.Parse(byteString, NumberStyles.HexNumber);
}
@@ -135,12 +135,12 @@ public string ToString(IFormatProvider provider)
{
return "0x" + this.byteString;
}
-
+
public object ToType(Type conversionType, IFormatProvider provider)
{
switch (Type.GetTypeCode(conversionType))
{
- case TypeCode.Boolean:
+ case TypeCode.Boolean:
return this.ToBoolean(null);
case TypeCode.Byte:
return this.ToByte(null);
@@ -174,16 +174,16 @@ public object ToType(Type conversionType, IFormatProvider provider)
case TypeCode.UInt32:
return this.ToUInt32(null);
case TypeCode.UInt64:
- return this.ToUInt64(null);
+ return this.ToUInt64(null);
default:
- throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
+ throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
}
}
-
- public UInt16 ToUInt16(IFormatProvider provider)
+
+ public UInt16 ToUInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt16 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt16 type.",
SByte.Parse(byteString, NumberStyles.HexNumber)));
else
return Convert.ToUInt16(Byte.Parse(byteString, NumberStyles.HexNumber));
@@ -192,16 +192,16 @@ public UInt16 ToUInt16(IFormatProvider provider)
public UInt32 ToUInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
SByte.Parse(byteString, NumberStyles.HexNumber)));
else
return Convert.ToUInt32(Byte.Parse(byteString, NumberStyles.HexNumber));
}
-
- public UInt64 ToUInt64(IFormatProvider provider)
+
+ public UInt64 ToUInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
SByte.Parse(byteString, NumberStyles.HexNumber)));
else
return Convert.ToUInt64(Byte.Parse(byteString, NumberStyles.HexNumber));
@@ -220,11 +220,11 @@ public static void Main()
ByteString positiveString = new ByteString();
positiveString.Sign = (SignBit) Math.Sign(positiveByte);
positiveString.Value = positiveByte.ToString("X2");
-
+
ByteString negativeString = new ByteString();
negativeString.Sign = (SignBit) Math.Sign(negativeByte);
negativeString.Value = negativeByte.ToString("X2");
-
+
try {
Console.WriteLine("'{0}' converts to {1}.", positiveString.Value, Convert.ToByte(positiveString));
}
@@ -237,7 +237,7 @@ public static void Main()
}
catch (OverflowException) {
Console.WriteLine("0x{0} is outside the range of the Byte type.", negativeString.Value);
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte4.cs
index dadea2f7576..f785f4c2956 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tobyte/cs/tobyte4.cs
@@ -17,9 +17,9 @@ public static void Main()
// This property does not affect the conversion.
// The input string cannot have a decimal separator.
provider.NumberDecimalSeparator = ".";
-
+
// Define an array of numeric strings.
- string[] numericStrings = { "234", "+234", "pos 234", "234.", "255",
+ string[] numericStrings = { "234", "+234", "pos 234", "234.", "255",
"256", "-1" };
foreach (string numericString in numericStrings)
@@ -28,13 +28,13 @@ public static void Main()
try {
byte number = Convert.ToByte(numericString, provider);
Console.WriteLine(number);
- }
+ }
catch (FormatException) {
Console.WriteLine("Incorrect Format");
- }
+ }
catch (OverflowException) {
Console.WriteLine("Overflows a Byte");
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tochar/cs/tochar1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tochar/cs/tochar1.cs
index a382248760f..b104380e14b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tochar/cs/tochar1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tochar/cs/tochar1.cs
@@ -39,14 +39,14 @@ private static void ConvertByte()
// 80 converts to 'P'.
// 120 converts to 'x'.
// 180 converts to '''.
- // 255 converts to 'ÿ'.
+ // 255 converts to 'ÿ'.
//
}
-
+
private static void ConvertInt16()
{
//
- short[] numbers = { Int16.MinValue, 0, 40, 160, 255, 1028,
+ short[] numbers = { Int16.MinValue, 0, 40, 160, 255, 1028,
2011, Int16.MaxValue };
char result;
foreach (short number in numbers)
@@ -54,12 +54,12 @@ private static void ConvertInt16()
try {
result = Convert.ToChar(number);
Console.WriteLine("{0} converts to '{1}'.", number, result);
- }
+ }
catch (OverflowException) {
- Console.WriteLine("{0} is outside the range of the Char data type.",
+ Console.WriteLine("{0} is outside the range of the Char data type.",
number);
}
- }
+ }
// The example displays the following output:
// -32768 is outside the range of the Char data type.
// 0 converts to ' '.
@@ -68,14 +68,14 @@ private static void ConvertInt16()
// 255 converts to 'ÿ'.
// 1028 converts to '?'.
// 2011 converts to '?'.
- // 32767 converts to '?'.
+ // 32767 converts to '?'.
//
}
-
+
private static void ConvertInt32()
{
//
- int[] numbers = { -1, 0, 40, 160, 255, 1028,
+ int[] numbers = { -1, 0, 40, 160, 255, 1028,
2011, 30001, 207154, Int32.MaxValue };
char result;
foreach (int number in numbers)
@@ -83,12 +83,12 @@ private static void ConvertInt32()
try {
result = Convert.ToChar(number);
Console.WriteLine("{0} converts to '{1}'.", number, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Char data type.",
number);
}
- }
+ }
}
// -1 is outside the range of the Char data type.
// 0 converts to ' '.
@@ -99,7 +99,7 @@ private static void ConvertInt32()
// 2011 converts to '?'.
// 30001 converts to '?'.
// 207154 is outside the range of the Char data type.
- // 2147483647 is outside the range of the Char data type.
+ // 2147483647 is outside the range of the Char data type.
//
private static void ConvertSByte()
@@ -112,7 +112,7 @@ private static void ConvertSByte()
try {
result = Convert.ToChar(number);
Console.WriteLine("{0} converts to '{1}'.", number, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Char data type.",
number);
@@ -127,7 +127,7 @@ private static void ConvertSByte()
// 127 converts to '⌂'.
//
}
-
+
private static void ConvertString()
{
//
@@ -139,7 +139,7 @@ private static void ConvertString()
try {
result = Convert.ToChar(strng);
Console.WriteLine("'{0}' converts to '{1}'.", strng, result);
- }
+ }
catch (FormatException)
{
Console.WriteLine("'{0}' is not in the correct format for conversion to a Char.",
@@ -147,7 +147,7 @@ private static void ConvertString()
}
catch (ArgumentNullException) {
Console.WriteLine("A null string cannot be converted to a Char.");
- }
+ }
}
// The example displays the following output:
// 'A' converts to 'A'.
@@ -156,18 +156,18 @@ private static void ConvertString()
// A null string cannot be converted to a Char.
//
}
-
+
private static void ConvertUInt16()
{
//
- ushort[] numbers = { UInt16.MinValue, 40, 160, 255, 1028,
+ ushort[] numbers = { UInt16.MinValue, 40, 160, 255, 1028,
2011, UInt16.MaxValue };
char result;
foreach (ushort number in numbers)
{
result = Convert.ToChar(number);
Console.WriteLine("{0} converts to '{1}'.", number, result);
- }
+ }
// The example displays the following output:
// 0 converts to ' '.
// 40 converts to '('.
@@ -178,7 +178,7 @@ private static void ConvertUInt16()
// 65535 converts to '?'.
//
}
-
+
private static void ConvertUInt32()
{
//
@@ -190,12 +190,12 @@ private static void ConvertUInt32()
try {
result = Convert.ToChar(number);
Console.WriteLine("{0} converts to '{1}'.", number, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Char data type.",
number);
}
- }
+ }
// The example displays the following output:
// 0 converts to ' '.
// 40 converts to '('.
@@ -225,7 +225,7 @@ private static void ConvertUInt64()
Console.WriteLine("{0} is outside the range of the Char data type.",
number);
}
- }
+ }
// The example displays the following output:
// 0 converts to ' '.
// 40 converts to '('.
@@ -237,21 +237,21 @@ private static void ConvertUInt64()
// 207154 is outside the range of the Char data type.
// 9223372036854775807 is outside the range of the Char data type.
//
- }
+ }
private static void ConvertObject()
{
//
- object[] values = { 'r', "s", "word", (byte) 83, 77, 109324, 335812911,
- new DateTime(2009, 3, 10), (uint) 1934,
+ object[] values = { 'r', "s", "word", (byte) 83, 77, 109324, 335812911,
+ new DateTime(2009, 3, 10), (uint) 1934,
(sbyte) -17, 169.34, 175.6m, null };
char result;
-
+
foreach (object value in values)
{
try {
result = Convert.ToChar(value);
- Console.WriteLine("The {0} value {1} converts to {2}.",
+ Console.WriteLine("The {0} value {1} converts to {2}.",
value.GetType().Name, value, result);
}
catch (FormatException e) {
@@ -282,7 +282,7 @@ private static void ConvertObject()
// The SByte value -17 is outside the range of the Char data type.
// Conversion of the Double value 169.34 to a Char is not supported.
// Conversion of the Decimal value 175.6 to a Char is not supported.
- // Cannot convert a null reference to a Char.
+ // Cannot convert a null reference to a Char.
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal1.cs
index fb7ecb7e8c5..8d9c6640cbf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal1.cs
@@ -28,7 +28,7 @@ private static void ConvertBoolean()
//
bool[] flags = { true, false };
decimal result;
-
+
foreach (bool flag in flags)
{
result = Convert.ToDecimal(flag);
@@ -36,16 +36,16 @@ private static void ConvertBoolean()
}
// The example displays the following output:
// Converted True to 1.
- // Converted False to 0.
+ // Converted False to 0.
//
}
-
+
private static void ConvertInt16()
{
//
short[] numbers = { Int16.MinValue, -1000, 0, 1000, Int16.MaxValue };
decimal result;
-
+
foreach (short number in numbers)
{
result = Convert.ToDecimal(number);
@@ -59,14 +59,14 @@ private static void ConvertInt16()
// Converted the Int16 value 1000 to the Decimal value 1000.
// Converted the Int16 value 32767 to the Decimal value 32767.
//
- }
+ }
private static void ConvertInt32()
{
//
int[] numbers = { Int32.MinValue, -1000, 0, 1000, Int32.MaxValue };
decimal result;
-
+
foreach (int number in numbers)
{
result = Convert.ToDecimal(number);
@@ -78,37 +78,37 @@ private static void ConvertInt32()
// Converted the Int32 value -1000 to the Decimal value -1000.
// Converted the Int32 value 0 to the Decimal value 0.
// Converted the Int32 value 1000 to the Decimal value 1000.
- // Converted the Int32 value 2147483647 to the Decimal value 2147483647.
+ // Converted the Int32 value 2147483647 to the Decimal value 2147483647.
//
- }
+ }
private static void ConvertObject()
{
//
object[] values = { true, 'a', 123, 1.764e32, "9.78", "1e-02",
1.67e03, "A100", "1,033.67", DateTime.Now,
- Double.MaxValue };
+ Double.MaxValue };
decimal result;
-
+
foreach (object value in values)
{
try {
result = Convert.ToDecimal(value);
Console.WriteLine("Converted the {0} value {1} to {2}.",
value.GetType().Name, value, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is out of range of the Decimal type.",
value.GetType().Name, value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not recognized as a valid Decimal value.",
value.GetType().Name, value);
- }
+ }
catch (InvalidCastException) {
Console.WriteLine("Conversion of the {0} value {1} to a Decimal is not supported.",
value.GetType().Name, value);
- }
+ }
}
// The example displays the following output:
// Converted the Boolean value True to 1.
@@ -121,7 +121,7 @@ private static void ConvertObject()
// The String value A100 is not recognized as a valid Decimal value.
// Converted the String value 1,033.67 to 1033.67.
// Conversion of the DateTime value 10/15/2008 05:40:42 PM to a Decimal is not supported.
- // The Double value 1.79769313486232E+308 is out of range of the Decimal type.
+ // The Double value 1.79769313486232E+308 is out of range of the Decimal type.
//
}
@@ -130,7 +130,7 @@ private static void ConvertSByte()
//
sbyte[] numbers = { SByte.MinValue, -23, 0, 17, SByte.MaxValue };
decimal result;
-
+
foreach (sbyte number in numbers)
{
result = Convert.ToDecimal(number);
@@ -143,24 +143,24 @@ private static void ConvertSByte()
// Converted the SByte value 127 to 127.
//
}
-
+
private static void ConvertSingle()
{
//
float[] numbers = { Single.MinValue, -3e10f, -1093.54f, 0f, 1e-03f,
1034.23f, Single.MaxValue };
decimal result;
-
+
foreach (float number in numbers)
{
try {
result = Convert.ToDecimal(number);
Console.WriteLine("Converted the Single value {0} to {1}.", number, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0} is out of range of the Decimal type.", number);
}
- }
+ }
// The example displays the following output:
// -3.402823E+38 is out of range of the Decimal type.
// Converted the Single value -3E+10 to -30000000000.
@@ -171,39 +171,39 @@ private static void ConvertSingle()
// 3.402823E+38 is out of range of the Decimal type.
//
}
-
+
private static void ConvertUInt16()
{
//
ushort[] numbers = { UInt16.MinValue, 121, 12345, UInt16.MaxValue };
decimal result;
-
+
foreach (ushort number in numbers)
{
result = Convert.ToDecimal(number);
Console.WriteLine("Converted the UInt16 value {0} to {1}.",
number, result);
- }
+ }
// The example displays the following output:
// Converted the UInt16 value 0 to 0.
// Converted the UInt16 value 121 to 121.
// Converted the UInt16 value 12345 to 12345.
- // Converted the UInt16 value 65535 to 65535.
+ // Converted the UInt16 value 65535 to 65535.
//
}
-
+
private static void ConvertUInt32()
{
//
uint[] numbers = { UInt32.MinValue, 121, 12345, UInt32.MaxValue };
decimal result;
-
+
foreach (uint number in numbers)
{
result = Convert.ToDecimal(number);
Console.WriteLine("Converted the UInt32 value {0} to {1}.",
number, result);
- }
+ }
// The example displays the following output:
// Converted the UInt32 value 0 to 0.
// Converted the UInt32 value 121 to 121.
@@ -217,13 +217,13 @@ private static void ConvertUInt64()
//
ulong[] numbers = { UInt64.MinValue, 121, 12345, UInt64.MaxValue };
decimal result;
-
+
foreach (ulong number in numbers)
{
result = Convert.ToDecimal(number);
Console.WriteLine("Converted the UInt64 value {0} to {1}.",
number, result);
- }
+ }
// The example displays the following output:
// Converted the UInt64 value 0 to 0.
// Converted the UInt64 value 121 to 121.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal2.cs
index 31e9ca4edc7..6c0cc2dce69 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal2.cs
@@ -10,22 +10,22 @@ public Temperature(decimal temperature)
{
this.m_Temp = temperature;
}
-
+
public decimal Celsius
{
- get { return this.m_Temp; }
+ get { return this.m_Temp; }
}
-
+
public decimal Kelvin
{
- get { return this.m_Temp + 273.15m; }
+ get { return this.m_Temp + 273.15m; }
}
-
+
public decimal Fahrenheit
{
get { return Math.Round((decimal) (this.m_Temp * 9 / 5 + 32), 2); }
}
-
+
public override string ToString()
{
return m_Temp.ToString("N2") + " °C";
@@ -36,44 +36,44 @@ public TypeCode GetTypeCode()
{
return TypeCode.Object;
}
-
- public bool ToBoolean(IFormatProvider provider)
+
+ public bool ToBoolean(IFormatProvider provider)
{
if (m_Temp == 0)
return false;
else
return true;
- }
-
+ }
+
public byte ToByte(IFormatProvider provider)
{
if (m_Temp < Byte.MinValue || m_Temp > Byte.MaxValue)
- throw new OverflowException(String.Format("{0} is out of range of the Byte type.",
+ throw new OverflowException(String.Format("{0} is out of range of the Byte type.",
this.m_Temp));
else
return Decimal.ToByte(this.m_Temp);
}
-
+
public char ToChar(IFormatProvider provider)
{
throw new InvalidCastException("Temperature to Char conversion is not supported.");
- }
-
+ }
+
public DateTime ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException("Temperature to DateTime conversion is not supported.");
}
-
+
public decimal ToDecimal(IFormatProvider provider)
{
return this.m_Temp;
}
-
+
public double ToDouble(IFormatProvider provider)
{
return Decimal.ToDouble(this.m_Temp);
- }
-
+ }
+
public short ToInt16(IFormatProvider provider)
{
if (this.m_Temp < Int16.MinValue || this.m_Temp > Int16.MaxValue)
@@ -82,7 +82,7 @@ public short ToInt16(IFormatProvider provider)
else
return Decimal.ToInt16(this.m_Temp);
}
-
+
public int ToInt32(IFormatProvider provider)
{
if (this.m_Temp < Int32.MinValue || this.m_Temp > Int32.MaxValue)
@@ -91,7 +91,7 @@ public int ToInt32(IFormatProvider provider)
else
return Decimal.ToInt32(this.m_Temp);
}
-
+
public long ToInt64(IFormatProvider provider)
{
if (this.m_Temp < Int64.MinValue || this.m_Temp > Int64.MaxValue)
@@ -100,7 +100,7 @@ public long ToInt64(IFormatProvider provider)
else
return Decimal.ToInt64(this.m_Temp);
}
-
+
public sbyte ToSByte(IFormatProvider provider)
{
if (this.m_Temp < SByte.MinValue || this.m_Temp > SByte.MaxValue)
@@ -119,12 +119,12 @@ public string ToString(IFormatProvider provider)
{
return m_Temp.ToString("N2", provider) + " °C";
}
-
+
public object ToType(Type conversionType, IFormatProvider provider)
{
switch (Type.GetTypeCode(conversionType))
{
- case TypeCode.Boolean:
+ case TypeCode.Boolean:
return this.ToBoolean(null);
case TypeCode.Byte:
return this.ToByte(null);
@@ -159,12 +159,12 @@ public object ToType(Type conversionType, IFormatProvider provider)
case TypeCode.UInt32:
return this.ToUInt32(null);
case TypeCode.UInt64:
- return this.ToUInt64(null);
+ return this.ToUInt64(null);
default:
- throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
+ throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
}
}
-
+
public ushort ToUInt16(IFormatProvider provider)
{
if (this.m_Temp < UInt16.MinValue || this.m_Temp > UInt16.MaxValue)
@@ -182,7 +182,7 @@ public uint ToUInt32(IFormatProvider provider)
else
return Decimal.ToUInt32(this.m_Temp);
}
-
+
public ulong ToUInt64(IFormatProvider provider)
{
if (this.m_Temp < UInt64.MinValue || this.m_Temp > UInt64.MaxValue)
@@ -202,7 +202,7 @@ public static void Main()
Temperature cold = new Temperature(-40);
Temperature freezing = new Temperature(0);
Temperature boiling = new Temperature(100);
-
+
Console.WriteLine(Convert.ToDecimal(cold, null));
Console.WriteLine(Convert.ToDecimal(freezing, null));
Console.WriteLine(Convert.ToDecimal(boiling, null));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal3.cs
index 7234b11aac7..a70c15699a3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todecimal2/cs/todecimal3.cs
@@ -10,7 +10,7 @@ public static void Main()
"123,456.789", "123 456,789", "123,456,789.0123",
"123 456 789,0123" };
CultureInfo[] cultures = { new CultureInfo("en-US"),
- new CultureInfo("fr-FR") };
+ new CultureInfo("fr-FR") };
foreach (CultureInfo culture in cultures)
{
@@ -27,7 +27,7 @@ public static void Main()
}
}
Console.WriteLine();
- }
+ }
}
}
// The example displays the following output:
@@ -39,7 +39,7 @@ public static void Main()
// 123 456,789 -> FormatException
// 123,456,789.0123 -> 123456789.0123
// 123 456 789,0123 -> FormatException
-//
+//
// String -> Decimal Conversion Using the fr-FR Culture
// 123456789 -> 123456789
// 12345.6789 -> FormatException
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/example8.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/example8.cs
index 13414770843..35094053fb6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/example8.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/example8.cs
@@ -5,25 +5,25 @@ public class Example
{
public static void Main()
{
- string[] values= { "-1,035.77219", "1AFF", "1e-35",
- "1,635,592,999,999,999,999,999,999", "-17.455",
+ string[] values= { "-1,035.77219", "1AFF", "1e-35",
+ "1,635,592,999,999,999,999,999,999", "-17.455",
"190.34001", "1.29e325"};
double result;
-
+
foreach (string value in values)
{
try {
result = Convert.ToDouble(value);
Console.WriteLine("Converted '{0}' to {1}.", value, result);
- }
+ }
catch (FormatException) {
Console.WriteLine("Unable to convert '{0}' to a Double.", value);
- }
+ }
catch (OverflowException) {
Console.WriteLine("'{0}' is outside the range of a Double.", value);
}
- }
- }
+ }
+ }
}
// The example displays the following output:
// Converted '-1,035.77219' to -1035.77219.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/todouble1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/todouble1.cs
index 8bebe48c283..21dd58ac9d7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/todouble1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/todouble1.cs
@@ -26,13 +26,13 @@ private static void ConvertInt16()
//
short[] numbers = { Int16.MinValue, -1032, 0, 192, Int16.MaxValue };
double result;
-
+
foreach (short number in numbers)
{
result = Convert.ToDouble(number);
Console.WriteLine("Converted the UInt16 value {0} to {1}.",
number, result);
- }
+ }
// Converted the UInt16 value -32768 to -32768.
// Converted the UInt16 value -1032 to -1032.
// Converted the UInt16 value 0 to 0.
@@ -40,18 +40,18 @@ private static void ConvertInt16()
// Converted the UInt16 value 32767 to 32767.
//
}
-
+
private static void ConvertInt64()
{
//
long[] numbers = { Int64.MinValue, -903, 0, 172, Int64.MaxValue};
double result;
-
+
foreach (long number in numbers)
{
result = Convert.ToDouble(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
}
// The example displays the following output:
@@ -62,30 +62,30 @@ private static void ConvertInt64()
// Converted the Int64 value '9223372036854775807' to the Double value 9.22337203685478E+18.
//
}
-
+
private static void ConvertObject()
{
//
object[] values = { true, 'a', 123, 1.764e32f, "9.78", "1e-02",
1.67e03f, "A100", "1,033.67", DateTime.Now,
- Decimal.MaxValue };
+ Decimal.MaxValue };
double result;
-
+
foreach (object value in values)
{
try {
result = Convert.ToDouble(value);
Console.WriteLine("Converted the {0} value {1} to {2}.",
value.GetType().Name, value, result);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not recognized as a valid Double value.",
value.GetType().Name, value);
- }
+ }
catch (InvalidCastException) {
Console.WriteLine("Conversion of the {0} value {1} to a Double is not supported.",
value.GetType().Name, value);
- }
+ }
}
// The example displays the following output:
// Converted the Boolean value True to 1.
@@ -98,16 +98,16 @@ private static void ConvertObject()
// The String value A100 is not recognized as a valid Double value.
// Converted the String value 1,033.67 to 1033.67.
// Conversion of the DateTime value 10/21/2008 07:12:12 AM to a Double is not supported.
- // Converted the Decimal value 79228162514264337593543950335 to 7.92281625142643E+28.
+ // Converted the Decimal value 79228162514264337593543950335 to 7.92281625142643E+28.
//
- }
-
+ }
+
private static void ConvertSByte()
{
//
sbyte[] numbers = { SByte.MinValue, -23, 0, 17, SByte.MaxValue };
double result;
-
+
foreach (sbyte number in numbers)
{
result = Convert.ToDouble(number);
@@ -126,33 +126,33 @@ private static void ConvertUInt16()
//
ushort[] numbers = { UInt16.MinValue, 121, 12345, UInt16.MaxValue };
double result;
-
+
foreach (ushort number in numbers)
{
result = Convert.ToDouble(number);
Console.WriteLine("Converted the UInt16 value {0} to {1}.",
number, result);
- }
+ }
// The example displays the following output:
// Converted the UInt16 value 0 to 0.
// Converted the UInt16 value 121 to 121.
// Converted the UInt16 value 12345 to 12345.
- // Converted the UInt16 value 65535 to 65535.
+ // Converted the UInt16 value 65535 to 65535.
//
}
-
+
private static void ConvertUInt32()
{
//
uint[] numbers = { UInt32.MinValue, 121, 12345, UInt32.MaxValue };
double result;
-
+
foreach (uint number in numbers)
{
result = Convert.ToDouble(number);
Console.WriteLine("Converted the UInt32 value {0} to {1}.",
number, result);
- }
+ }
// The example displays the following output:
// Converted the UInt32 value 0 to 0.
// Converted the UInt32 value 121 to 121.
@@ -166,13 +166,13 @@ private static void ConvertUInt64()
//
ulong[] numbers = { UInt64.MinValue, 121, 12345, UInt64.MaxValue };
double result;
-
+
foreach (ulong number in numbers)
{
result = Convert.ToDouble(number);
Console.WriteLine("Converted the UInt64 value {0} to {1}.",
number, result);
- }
+ }
// The example displays the following output:
// Converted the UInt64 value 0 to 0.
// Converted the UInt64 value 121 to 121.
@@ -184,24 +184,24 @@ private static void ConvertUInt64()
// unused
private static void ConvertString()
{
- string[] values= { "-1,035.77219", "1AFF", "1e-35",
- "1,635,592,999,999,999,999,999,999", "-17.455",
+ string[] values= { "-1,035.77219", "1AFF", "1e-35",
+ "1,635,592,999,999,999,999,999,999", "-17.455",
"190.34001", "1.29e325"};
double result;
-
+
foreach (string value in values)
{
try {
result = Convert.ToDouble(value);
Console.WriteLine("Converted '{0}' to {1}.", value, result);
- }
+ }
catch (FormatException) {
Console.WriteLine("Unable to convert '{0}' to a Double.", value);
- }
+ }
catch (OverflowException) {
Console.WriteLine("'{0}' is outside the range of a Double.", value);
}
- }
+ }
// The example displays the following output:
// Converted '-1,035.77219' to -1035.77219.
// Unable to convert '1AFF' to a Double.
@@ -210,5 +210,5 @@ private static void ConvertString()
// Converted '-17.455' to -17.455.
// Converted '190.34001' to 190.34001.
// '1.29e325' is outside the range of a Double.
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/todouble2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/todouble2.cs
index fa0a8ac9920..40e8c115943 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/todouble2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.todouble/cs/todouble2.cs
@@ -11,7 +11,7 @@ public static void Main()
{ new System.Globalization.CultureInfo("en-US"),
new System.Globalization.CultureInfo("fr-FR"),
new System.Globalization.CultureInfo("es-ES") };
-
+
foreach (System.Globalization.CultureInfo culture in cultures)
{
Console.WriteLine("Conversions using {0} culture:", culture.Name);
@@ -20,13 +20,13 @@ public static void Main()
Console.Write(" {0,-15} --> ", value);
try {
Console.WriteLine("{0}", Convert.ToDouble(value, culture));
- }
+ }
catch (FormatException) {
Console.WriteLine("Bad Format");
- }
+ }
catch (OverflowException) {
Console.WriteLine("Overflow");
- }
+ }
}
Console.WriteLine();
}
@@ -37,14 +37,14 @@ public static void Main()
// 1,034.1233 --> 1034.1233
// 1,03221 --> 103221
// 1630.34034 --> 1630.34034
- //
+ //
// Conversions using fr-FR culture:
// 1,5304e16 --> 1.5304E+16
// 1.5304e16 --> Bad Format
// 1,034.1233 --> Bad Format
// 1,03221 --> 1.03221
// 1630.34034 --> Bad Format
- //
+ //
// Conversions using es-ES culture:
// 1,5304e16 --> 1.5304E+16
// 1.5304e16 --> 1.5304E+20
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint16/cs/toint16_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint16/cs/toint16_1.cs
index 3ecef5c1d93..de8c74c1ff8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint16/cs/toint16_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint16/cs/toint16_1.cs
@@ -36,7 +36,7 @@ private static void ConvertBoolean()
//
bool falseFlag = false;
bool trueFlag = true;
-
+
Console.WriteLine("{0} converts to {1}.", falseFlag,
Convert.ToInt16(falseFlag));
Console.WriteLine("{0} converts to {1}.", trueFlag,
@@ -46,13 +46,13 @@ private static void ConvertBoolean()
// True converts to 1.
//
}
-
+
private static void ConvertByte()
{
//
byte[] bytes = { Byte.MinValue, 14, 122, Byte.MaxValue};
short result;
-
+
foreach (byte byteValue in bytes)
{
result = Convert.ToInt16(byteValue);
@@ -65,15 +65,15 @@ private static void ConvertByte()
// The Byte value 122 converts to 122.
// The Byte value 255 converts to 255.
//
- }
-
+ }
+
private static void ConvertChar()
{
//
char[] chars = { 'a', 'z', '\x0007', '\x03FF',
'\x7FFF', '\xFFFE' };
short result;
-
+
foreach (char ch in chars)
{
try {
@@ -84,7 +84,7 @@ private static void ConvertChar()
Console.WriteLine("Unable to convert u+{0} to an Int16.",
((int)ch).ToString("X4"));
}
- }
+ }
// The example displays the following output:
// 'a' converts to 97.
// 'z' converts to 122.
@@ -94,26 +94,26 @@ private static void ConvertChar()
// Unable to convert u+FFFE to a UInt16.
//
}
-
+
private static void ConvertDecimal()
{
//
decimal[] values = { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
9214.16m, Decimal.MaxValue };
short result;
-
+
foreach (decimal value in values)
{
try {
result = Convert.ToInt16(value);
Console.WriteLine("Converted {0} to {1}.", value, result);
- }
+ }
catch (OverflowException)
{
Console.WriteLine("{0} is outside the range of the Int16 type.",
value);
- }
- }
+ }
+ }
// The example displays the following output:
// -79228162514264337593543950335 is outside the range of the Int16 type.
// Converted -1034.23 to -1034.
@@ -124,25 +124,25 @@ private static void ConvertDecimal()
// 79228162514264337593543950335 is outside the range of the Int16 type.
//
}
-
+
private static void ConvertDouble()
{
//
double[] values = { Double.MinValue, -1.38e10, -1023.299, -12.98,
0, 9.113e-16, 103.919, 17834.191, Double.MaxValue };
short result;
-
+
foreach (double value in values)
{
try {
result = Convert.ToInt16(value);
Console.WriteLine("Converted {0} to {1}.", value, result);
- }
+ }
catch (OverflowException)
{
Console.WriteLine("{0} is outside the range of the Int16 type.", value);
- }
- }
+ }
+ }
// -1.79769313486232E+308 is outside the range of the Int16 type.
// -13800000000 is outside the range of the Int16 type.
// Converted -1023.299 to -1023.
@@ -154,13 +154,13 @@ private static void ConvertDouble()
// 1.79769313486232E+308 is outside the range of the Int16 type.
//
}
-
+
private static void ConvertInt32()
{
//
int[] numbers = { Int32.MinValue, -1, 0, 121, 340, Int32.MaxValue };
short result;
-
+
foreach (int number in numbers)
{
try {
@@ -168,7 +168,7 @@ private static void ConvertInt32()
Console.WriteLine("Converted the {0} value {1} to a {2} value {3}.",
number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the Int16 type.",
number.GetType().Name, number);
@@ -183,13 +183,13 @@ private static void ConvertInt32()
// The Int32 value 2147483647 is outside the range of the Int16 type.
//
}
-
+
private static void ConvertInt64()
{
//
long[] numbers = { Int64.MinValue, -1, 0, 121, 340, Int64.MaxValue };
short result;
-
+
foreach (long number in numbers)
{
try {
@@ -197,7 +197,7 @@ private static void ConvertInt64()
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the Int16 type.",
number.GetType().Name, number);
@@ -210,16 +210,16 @@ private static void ConvertInt64()
// Converted the Int64 value 121 to the Int16 value 121.
// Converted the Int64 value 340 to the Int16 value 340.
// The Int64 value 9223372036854775807 is outside the range of the Int16 type.
- //
- }
-
+ //
+ }
+
private static void ConvertObject()
{
//
object[] values= { true, -12, 163, 935, 'x', new DateTime(2009, 5, 12),
"104", "103.0", "-1", "1.00e2", "One", 1.00e2};
short result;
-
+
foreach (object value in values)
{
try {
@@ -227,20 +227,20 @@ private static void ConvertObject()
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
value.GetType().Name, value,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the Int16 type.",
value.GetType().Name, value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not in a recognizable format.",
value.GetType().Name, value);
- }
+ }
catch (InvalidCastException) {
Console.WriteLine("No conversion to an Int16 exists for the {0} value {1}.",
value.GetType().Name, value);
}
- }
+ }
// The example displays the following output:
// Converted the Boolean value True to the Int16 value 1.
// Converted the Int32 value -12 to the Int16 value -12.
@@ -256,13 +256,13 @@ private static void ConvertObject()
// Converted the Double value 100 to the Int16 value 100.
//
}
-
+
private static void ConvertSByte()
{
//
sbyte[] numbers = { SByte.MinValue, -1, 0, 10, SByte.MaxValue };
short result;
-
+
foreach (sbyte number in numbers)
{
result = Convert.ToInt16(number);
@@ -278,25 +278,25 @@ private static void ConvertSByte()
// Converted the SByte value 127 to the Int16 value 127.
//
}
-
+
private static void ConvertSingle()
{
//
float[] values = { Single.MinValue, -1.38e10f, -1023.299f, -12.98f,
0f, 9.113e-16f, 103.919f, 17834.191f, Single.MaxValue };
short result;
-
+
foreach (float value in values)
{
try {
result = Convert.ToInt16(value);
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
value.GetType().Name, value, result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int16 type.", value);
- }
- }
+ }
+ }
// The example displays the following output:
// -3.40282346638529E+38 is outside the range of the Int16 type.
// -13799999488 is outside the range of the Int16 type.
@@ -335,13 +335,13 @@ private static void ConvertUInt16()
// The UInt16 value 65535 is outside the range of the Int16 type.
//
}
-
+
private static void ConvertUInt32()
{
//
uint[] numbers = { UInt32.MinValue, 121, 340, UInt32.MaxValue };
short result;
-
+
foreach (uint number in numbers)
{
try {
@@ -362,13 +362,13 @@ private static void ConvertUInt32()
// The UInt32 value 4294967295 is outside the range of the Int16 type.
//
}
-
+
private static void ConvertUInt64()
{
//
ulong[] numbers = { UInt64.MinValue, 121, 340, UInt64.MaxValue };
short result;
-
+
foreach (ulong number in numbers)
{
try {
@@ -387,6 +387,6 @@ private static void ConvertUInt64()
// Converted the UInt64 value 121 to a Int16 value 121.
// Converted the UInt64 value 340 to a Int16 value 340.
// The UInt64 value 18446744073709551615 is outside the range of the Int16 type.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint16/cs/toint16_2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint16/cs/toint16_2.cs
index 3415414f9bb..884e2c3664b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint16/cs/toint16_2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint16/cs/toint16_2.cs
@@ -5,7 +5,7 @@ public class Example
{
public static void Main()
{
- string[] hexStrings = { "8000", "0FFF", "f000", "00A30", "D", "-13",
+ string[] hexStrings = { "8000", "0FFF", "f000", "00A30", "D", "-13",
"9AC61", "GAD" };
foreach (string hexString in hexStrings)
{
@@ -14,7 +14,7 @@ public static void Main()
Console.WriteLine("Converted '{0}' to {1:N0}.", hexString, number);
}
catch (FormatException) {
- Console.WriteLine("'{0}' is not in the correct format for a hexadecimal number.",
+ Console.WriteLine("'{0}' is not in the correct format for a hexadecimal number.",
hexString);
}
catch (OverflowException) {
@@ -23,7 +23,7 @@ public static void Main()
catch (ArgumentException) {
Console.WriteLine("'{0}' is invalid in base 16.", hexString);
}
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs
index 717d42afd78..1fa5180a092 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_1.cs
@@ -24,7 +24,7 @@ public static void Main()
Console.WriteLine("-----");
ConvertSingle();
Console.WriteLine("----");
- ConvertString();
+ ConvertString();
Console.WriteLine("-----");
ConvertUInt16();
Console.WriteLine("-----");
@@ -38,7 +38,7 @@ private static void ConvertBoolean()
//
bool falseFlag = false;
bool trueFlag = true;
-
+
Console.WriteLine("{0} converts to {1}.", falseFlag,
Convert.ToInt32(falseFlag));
Console.WriteLine("{0} converts to {1}.", trueFlag,
@@ -48,13 +48,13 @@ private static void ConvertBoolean()
// True converts to 1.
//
}
-
+
private static void ConvertByte()
{
//
byte[] bytes = { Byte.MinValue, 14, 122, Byte.MaxValue};
int result;
-
+
foreach (byte byteValue in bytes)
{
result = Convert.ToInt32(byteValue);
@@ -68,15 +68,15 @@ private static void ConvertByte()
// Converted the Byte value 122 to the Int32 value 122.
// Converted the Byte value 255 to the Int32 value 255.
//
- }
-
+ }
+
private static void ConvertChar()
{
//
char[] chars = { 'a', 'z', '\u0007', '\u03FF',
'\u7FFF', '\uFFFE' };
int result;
-
+
foreach (char ch in chars)
{
try {
@@ -89,7 +89,7 @@ private static void ConvertChar()
Console.WriteLine("Unable to convert u+{0} to an Int32.",
((int)ch).ToString("X4"));
}
- }
+ }
// The example displays the following output:
// Converted the Char value 'a' to the Int32 value 97.
// Converted the Char value 'z' to the Int32 value 122.
@@ -99,14 +99,14 @@ private static void ConvertChar()
// Converted the Char value '?' to the Int32 value 65534.
//
}
-
+
private static void ConvertDecimal()
{
//
decimal[] values= { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
199.55m, 9214.16m, Decimal.MaxValue };
int result;
-
+
foreach (decimal value in values)
{
try {
@@ -118,8 +118,8 @@ private static void ConvertDecimal()
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int32 type.",
value);
- }
- }
+ }
+ }
// The example displays the following output:
// -79228162514264337593543950335 is outside the range of the Int32 type.
// Converted the Decimal value '-1034.23' to the Int32 value -1034.
@@ -131,14 +131,14 @@ private static void ConvertDecimal()
// 79228162514264337593543950335 is outside the range of the Int32 type.
//
}
-
+
private static void ConvertDouble()
- {
+ {
//
double[] values= { Double.MinValue, -1.38e10, -1023.299, -12.98,
0, 9.113e-16, 103.919, 17834.191, Double.MaxValue };
int result;
-
+
foreach (double value in values)
{
try {
@@ -149,8 +149,8 @@ private static void ConvertDouble()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int32 type.", value);
- }
- }
+ }
+ }
// -1.79769313486232E+308 is outside the range of the Int32 type.
// -13800000000 is outside the range of the Int32 type.
// Converted the Double value '-1023.299' to the Int32 value -1023.
@@ -162,13 +162,13 @@ private static void ConvertDouble()
// 1.79769313486232E+308 is outside the range of the Int32 type.
//
}
-
+
private static void ConvertInt16()
{
//
short[] numbers= { Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue };
int result;
-
+
foreach (short number in numbers)
{
result = Convert.ToInt32(number);
@@ -185,7 +185,7 @@ private static void ConvertInt16()
// Converted the Int16 value 32767 to a Int32 value 32767.
//
}
-
+
private static void ConvertInt64()
{
//
@@ -211,9 +211,9 @@ private static void ConvertInt64()
// Converted the Int64 value 121 to the Int32 value 121.
// Converted the Int64 value 340 to the Int32 value 340.
// The Int64 value 9223372036854775807 is outside the range of the Int32 type.
- //
- }
-
+ //
+ }
+
private static void ConvertObject()
{
//
@@ -221,7 +221,7 @@ private static void ConvertObject()
"104", "103.0", "-1",
"1.00e2", "One", 1.00e2, 16.3e42};
int result;
-
+
foreach (object value in values)
{
try {
@@ -233,7 +233,7 @@ private static void ConvertObject()
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the Int32 type.",
value.GetType().Name, value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not in a recognizable format.",
value.GetType().Name, value);
@@ -242,7 +242,7 @@ private static void ConvertObject()
Console.WriteLine("No conversion to an Int32 exists for the {0} value {1}.",
value.GetType().Name, value);
}
- }
+ }
// The example displays the following output:
// Converted the Boolean value True to the Int32 value 1.
// Converted the Int32 value -12 to the Int32 value -12.
@@ -259,13 +259,13 @@ private static void ConvertObject()
// The Double value 1.63E+43 is outside the range of the Int32 type.
//
}
-
+
private static void ConvertSByte()
{
//
sbyte[] numbers = { SByte.MinValue, -1, 0, 10, SByte.MaxValue };
int result;
-
+
foreach (sbyte number in numbers)
{
result = Convert.ToInt32(number);
@@ -281,14 +281,14 @@ private static void ConvertSByte()
// Converted the SByte value 127 to the Int32 value 127.
//
}
-
+
private static void ConvertSingle()
{
//
float[] values= { Single.MinValue, -1.38e10f, -1023.299f, -12.98f,
0f, 9.113e-16f, 103.919f, 17834.191f, Single.MaxValue };
int result;
-
+
foreach (float value in values)
{
try {
@@ -298,8 +298,8 @@ private static void ConvertSingle()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int32 type.", value);
- }
- }
+ }
+ }
// The example displays the following output:
// -3.40282346638529E+38 is outside the range of the Int32 type.
// -13799999488 is outside the range of the Int32 type.
@@ -319,7 +319,7 @@ private static void ConvertString()
string[] values = { "One", "1.34e28", "-26.87", "-18", "-6.00",
" 0", "137", "1601.9", Int32.MaxValue.ToString() };
int result;
-
+
foreach (string value in values)
{
try {
@@ -329,12 +329,12 @@ private static void ConvertString()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int32 type.", value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value '{1}' is not in a recognizable format.",
value.GetType().Name, value);
- }
- }
+ }
+ }
// The example displays the following output:
// The String value 'One' is not in a recognizable format.
// The String value '1.34e28' is not in a recognizable format.
@@ -349,7 +349,7 @@ private static void ConvertString()
}
private static void ConvertUInt16()
- {
+ {
//
ushort[] numbers = { UInt16.MinValue, 121, 340, UInt16.MaxValue };
int result;
@@ -373,7 +373,7 @@ private static void ConvertUInt16()
// Converted the UInt16 value 65535 to the Int32 value 65535.
//
}
-
+
private static void ConvertUInt32()
{
//
@@ -399,7 +399,7 @@ private static void ConvertUInt32()
// The UInt32 value 4294967295 is outside the range of the Int32 type.
//
}
-
+
private static void ConvertUInt64()
{
//
@@ -423,6 +423,6 @@ private static void ConvertUInt64()
// Converted the UInt64 value 121 to a Int32 value 121.
// Converted the UInt64 value 340 to a Int32 value 340.
// The UInt64 value 18446744073709551615 is outside the range of the Int32 type.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_2.cs
index 01b9f8aae15..9b067a27bfe 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint32/cs/toint32_2.cs
@@ -14,13 +14,13 @@ public static void Main()
// Add custom and invariant provider to an array of providers.
NumberFormatInfo[] providers = { customProvider, NumberFormatInfo.InvariantInfo };
-
+
// Define an array of strings to convert.
string[] numericStrings = { "123456789", "+123456789", "pos 123456789",
"-123456789", "neg 123456789", "123456789.",
"123,456,789", "(123456789)", "2147483648",
- "-2147483649" };
-
+ "-2147483649" };
+
// Use each provider to parse all the numeric strings.
for (int ctr = 0; ctr <= 1; ctr++)
{
@@ -34,13 +34,13 @@ public static void Main()
}
catch (FormatException) {
Console.WriteLine("{0,20}", "FormatException");
- }
+ }
catch (OverflowException) {
- Console.WriteLine("{0,20}", "OverflowException");
+ Console.WriteLine("{0,20}", "OverflowException");
}
}
Console.WriteLine();
- }
+ }
}
}
// The example displays the following output:
@@ -55,7 +55,7 @@ public static void Main()
// (123456789) --> FormatException
// 2147483648 --> OverflowException
// -2147483649 --> FormatException
-//
+//
// Invariant Provider:
// 123456789 --> 123456789
// +123456789 --> 123456789
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_1.cs
index 27f67f04bc7..2f3e5be8486 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_1.cs
@@ -24,7 +24,7 @@ public static void Main()
Console.WriteLine("-----");
ConvertSingle();
Console.WriteLine("----");
- ConvertString();
+ ConvertString();
Console.WriteLine("-----");
ConvertUInt16();
Console.WriteLine("-----");
@@ -38,7 +38,7 @@ private static void ConvertBoolean()
//
bool falseFlag = false;
bool trueFlag = true;
-
+
Console.WriteLine("{0} converts to {1}.", falseFlag,
Convert.ToInt64(falseFlag));
Console.WriteLine("{0} converts to {1}.", trueFlag,
@@ -48,13 +48,13 @@ private static void ConvertBoolean()
// True converts to 1.
//
}
-
+
private static void ConvertByte()
{
//
byte[] bytes = { Byte.MinValue, 14, 122, Byte.MaxValue};
long result;
-
+
foreach (byte byteValue in bytes)
{
result = Convert.ToInt64(byteValue);
@@ -68,22 +68,22 @@ private static void ConvertByte()
// Converted the Byte value 122 to the Int64 value 122.
// Converted the Byte value 255 to the Int64 value 255.
//
- }
-
+ }
+
private static void ConvertChar()
{
//
char[] chars = { 'a', 'z', '\u0007', '\u03FF',
'\u7FFF', '\uFFFE' };
long result;
-
+
foreach (char ch in chars)
{
result = Convert.ToInt64(ch);
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
ch.GetType().Name, ch,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the Char value 'a' to the Int64 value 97.
// Converted the Char value 'z' to the Int64 value 122.
@@ -93,14 +93,14 @@ private static void ConvertChar()
// Converted the Char value '?' to the Int64 value 65534.
//
}
-
+
private static void ConvertDecimal()
{
//
decimal[] values= { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
199.55m, 9214.16m, Decimal.MaxValue };
long result;
-
+
foreach (decimal value in values)
{
try {
@@ -112,8 +112,8 @@ private static void ConvertDecimal()
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int64 type.",
value);
- }
- }
+ }
+ }
// The example displays the following output:
// -79228162514264337593543950335 is outside the range of the Int64 type.
// Converted the Decimal value '-1034.23' to the Int64 value -1034.
@@ -125,14 +125,14 @@ private static void ConvertDecimal()
// 79228162514264337593543950335 is outside the range of the Int64 type.
//
}
-
+
private static void ConvertDouble()
- {
+ {
//
double[] values= { Double.MinValue, -1.38e10, -1023.299, -12.98,
0, 9.113e-16, 103.919, 17834.191, Double.MaxValue };
long result;
-
+
foreach (double value in values)
{
try {
@@ -143,8 +143,8 @@ private static void ConvertDouble()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int64 type.", value);
- }
- }
+ }
+ }
// -1.79769313486232E+308 is outside the range of the Int64 type.
// -13800000000 is outside the range of the Int16 type.
// Converted the Double value '-1023.299' to the Int64 value -1023.
@@ -156,13 +156,13 @@ private static void ConvertDouble()
// 1.79769313486232E+308 is outside the range of the Int64 type.
//
}
-
+
private static void ConvertInt16()
{
//
short[] numbers= { Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue };
long result;
-
+
foreach (short number in numbers)
{
result = Convert.ToInt64(number);
@@ -179,7 +179,7 @@ private static void ConvertInt16()
// Converted the Int16 value 32767 to a Int32 value 32767.
//
}
-
+
private static void ConvertInt32()
{
//
@@ -199,9 +199,9 @@ private static void ConvertInt32()
// Converted the Int32 value 121 to the Int64 value 121.
// Converted the Int32 value 340 to the Int64 value 340.
// Converted the Int32 value 2147483647 to the Int64 value 2147483647.
- //
- }
-
+ //
+ }
+
private static void ConvertObject()
{
//
@@ -209,7 +209,7 @@ private static void ConvertObject()
"104", "103.0", "-1",
"1.00e2", "One", 1.00e2, 16.3e42};
long result;
-
+
foreach (object value in values)
{
try {
@@ -221,7 +221,7 @@ private static void ConvertObject()
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the Int64 type.",
value.GetType().Name, value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not in a recognizable format.",
value.GetType().Name, value);
@@ -230,7 +230,7 @@ private static void ConvertObject()
Console.WriteLine("No conversion to an Int64 exists for the {0} value {1}.",
value.GetType().Name, value);
}
- }
+ }
// The example displays the following output:
// Converted the Boolean value True to the Int64 value 1.
// Converted the Int32 value -12 to the Int64 value -12.
@@ -247,13 +247,13 @@ private static void ConvertObject()
// The Double value 1.63E+43 is outside the range of the Int64 type.
//
}
-
+
private static void ConvertSByte()
{
//
sbyte[] numbers = { SByte.MinValue, -1, 0, 10, SByte.MaxValue };
long result;
-
+
foreach (sbyte number in numbers)
{
result = Convert.ToInt64(number);
@@ -269,14 +269,14 @@ private static void ConvertSByte()
// Converted the SByte value 127 to the Int64 value 127.
//
}
-
+
private static void ConvertSingle()
{
//
float[] values= { Single.MinValue, -1.38e10f, -1023.299f, -12.98f,
0f, 9.113e-16f, 103.919f, 17834.191f, Single.MaxValue };
long result;
-
+
foreach (float value in values)
{
try {
@@ -286,8 +286,8 @@ private static void ConvertSingle()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int64 type.", value);
- }
- }
+ }
+ }
// The example displays the following output:
// -3.40282346638529E+38 is outside the range of the Int64 type.
// -13799999488 is outside the range of the Int64 type.
@@ -307,7 +307,7 @@ private static void ConvertString()
string[] values = { "One", "1.34e28", "-26.87", "-18", "-6.00",
" 0", "137", "1601.9", Int32.MaxValue.ToString() };
long result;
-
+
foreach (string value in values)
{
try {
@@ -317,12 +317,12 @@ private static void ConvertString()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the Int64 type.", value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value '{1}' is not in a recognizable format.",
value.GetType().Name, value);
- }
- }
+ }
+ }
// The example displays the following output:
// The String value 'One' is not in a recognizable format.
// The String value '1.34e28' is not in a recognizable format.
@@ -337,7 +337,7 @@ private static void ConvertString()
}
private static void ConvertUInt16()
- {
+ {
//
ushort[] numbers = { UInt16.MinValue, 121, 340, UInt16.MaxValue };
long result;
@@ -361,7 +361,7 @@ private static void ConvertUInt16()
// Converted the UInt16 value 65535 to the Int64 value 65535.
//
}
-
+
private static void ConvertUInt32()
{
//
@@ -381,7 +381,7 @@ private static void ConvertUInt32()
// Converted the UInt32 value 4,294,967,295 to the Int64 value 4,294,967,295.
//
}
-
+
private static void ConvertUInt64()
{
//
@@ -405,6 +405,6 @@ private static void ConvertUInt64()
// Converted the UInt64 value 121 to a Int32 value 121.
// Converted the UInt64 value 340 to a Int32 value 340.
// The UInt64 value 18446744073709551615 is outside the range of the Int64 type.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_2.cs
index 2bb056963b7..a5a7b002230 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_2.cs
@@ -5,7 +5,7 @@ public class Example
{
public static void Main()
{
- string[] hexStrings = { "8000000000000000", "0FFFFFFFFFFFFFFF",
+ string[] hexStrings = { "8000000000000000", "0FFFFFFFFFFFFFFF",
"f0000000000001000", "00A30", "D", "-13", "GAD" };
foreach (string hexString in hexStrings)
{
@@ -23,7 +23,7 @@ public static void Main()
catch (ArgumentException) {
Console.WriteLine("'{0}' is invalid in base 16.", hexString);
}
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_3.cs
index d39baa13624..86e755b2c4a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.toint64/cs/toint64_3.cs
@@ -16,9 +16,9 @@ public static void Main()
// NumberFormatInfo object for the invariant culture.
NumberFormatInfo[] providers = { customProvider,
NumberFormatInfo.InvariantInfo };
-
+
// Define an array of strings to parse.
- string[] numericStrings = { "123456789", "+123456789", "pos 123456789",
+ string[] numericStrings = { "123456789", "+123456789", "pos 123456789",
"-123456789", "neg 123456789", "123456789.",
"123,456,789", "(123456789)",
"9223372036854775808", "-9223372036854775809" };
@@ -35,7 +35,7 @@ public static void Main()
}
catch (FormatException) {
Console.WriteLine("{0,22}", "Unrecognized Format");
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0,22}", "Overflow");
}
@@ -56,7 +56,7 @@ public static void Main()
// (123456789) --> Unrecognized Format
// 9223372036854775808 --> Overflow
// -9223372036854775809 --> Unrecognized Format
-//
+//
// Invariant Culture:
// 123456789 --> 123456789
// +123456789 --> 123456789
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte1.cs
index 9d2eb8c077e..e92497ca66d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte1.cs
@@ -36,7 +36,7 @@ private static void ConvertBoolean()
//
bool falseFlag = false;
bool trueFlag = true;
-
+
Console.WriteLine("{0} converts to {1}.", falseFlag,
Convert.ToSByte(falseFlag));
Console.WriteLine("{0} converts to {1}.", trueFlag,
@@ -46,13 +46,13 @@ private static void ConvertBoolean()
// true converts to 1.
//
}
-
+
private static void ConvertByte()
{
//
byte[] numbers = { Byte.MinValue, 10, 100, Byte.MaxValue };
sbyte result;
-
+
foreach (byte number in numbers)
{
try {
@@ -60,7 +60,7 @@ private static void ConvertByte()
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the SByte type.",
number.GetType().Name, number);
@@ -73,7 +73,7 @@ private static void ConvertByte()
// The Byte value 255 is outside the range of the SByte type.
//
}
-
+
private static void ConvertChar()
{
//
@@ -83,12 +83,12 @@ private static void ConvertChar()
try {
sbyte result = Convert.ToSByte(ch);
Console.WriteLine("{0} is converted to {1}.", ch, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("Unable to convert u+{0} to a byte.",
Convert.ToInt16(ch).ToString("X4"));
}
- }
+ }
// The example displays the following output:
// a is converted to 97.
// z is converted to 122.
@@ -97,14 +97,14 @@ private static void ConvertChar()
// Unable to convert u+03FF to a byte.
//
}
-
+
private static void ConvertDecimal()
{
//
decimal[] numbers = { Decimal.MinValue, -129.5m, -12.7m, 0m, 16m,
103.6m, 255.0m, Decimal.MaxValue };
sbyte result;
-
+
foreach (decimal number in numbers)
{
try {
@@ -117,7 +117,7 @@ private static void ConvertDecimal()
Console.WriteLine("The {0} value {1} is outside the range of the SByte type.",
number.GetType().Name, number);
}
- }
+ }
// The example displays the following output:
// The Decimal value -79228162514264337593543950335 is outside the range of the SByte type.
// The Decimal value -129.5 is outside the range of the SByte type.
@@ -129,14 +129,14 @@ private static void ConvertDecimal()
// The Decimal value 79228162514264337593543950335 is outside the range of the SByte type.
//
}
-
+
private static void ConvertDouble()
{
//
double[] numbers = { Double.MinValue, -129.5, -12.7, 0, 16,
103.6, 255.0, 1.63509e17, Double.MaxValue};
sbyte result;
-
+
foreach (double number in numbers)
{
try {
@@ -149,7 +149,7 @@ private static void ConvertDouble()
Console.WriteLine("The {0} value {1} is outside the range of the SByte type.",
number.GetType().Name, number);
}
- }
+ }
// The example displays the following output:
// The Double value -1.79769313486232E+308 is outside the range of the SByte type.
// The Double value -129.5 is outside the range of the SByte type.
@@ -162,7 +162,7 @@ private static void ConvertDouble()
// The Double value 1.79769313486232E+308 is outside the range of the SByte type.
//
}
-
+
private static void ConvertInt16()
{
//
@@ -190,13 +190,13 @@ private static void ConvertInt16()
// The Int16 value 32767 is outside the range of the SByte type.
//
}
-
+
private static void ConvertInt32()
{
//
int[] numbers = { Int32.MinValue, -1, 0, 121, 340, Int32.MaxValue };
sbyte result;
-
+
foreach (int number in numbers)
{
try {
@@ -219,7 +219,7 @@ private static void ConvertInt32()
// The Int32 value 2147483647 is outside the range of the SByte type.
//
}
-
+
private static void ConvertInt64()
{
//
@@ -245,16 +245,16 @@ private static void ConvertInt64()
// Converted the Int64 value 121 to the SByte value 121.
// The Int64 value 340 is outside the range of the SByte type.
// The Int64 value 9223372036854775807 is outside the range of the SByte type.
- //
- }
-
+ //
+ }
+
private static void ConvertObject()
{
//
object[] values = { true, -12, 163, 935, 'x', "104", "103.0", "-1",
"1.00e2", "One", 1.00e2};
sbyte result;
-
+
foreach (object value in values)
{
try {
@@ -262,7 +262,7 @@ private static void ConvertObject()
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
value.GetType().Name, value,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the SByte type.",
value.GetType().Name, value);
@@ -275,7 +275,7 @@ private static void ConvertObject()
Console.WriteLine("No conversion to a Byte exists for the {0} value {1}.",
value.GetType().Name, value);
}
- }
+ }
// The example displays the following output:
// Converted the Boolean value true to the SByte value 1.
// Converted the Int32 value -12 to the SByte value -12.
@@ -290,14 +290,14 @@ private static void ConvertObject()
// Converted the Double value 100 to the SByte value 100.
//
}
-
+
private static void ConvertSingle()
{
//
float[] numbers = { Single.MinValue, -129.5f, -12.7f, 0f, 16f,
103.6f, 255.0f, 1.63509e17f, Single.MaxValue };
sbyte result;
-
+
foreach (float number in numbers)
{
try {
@@ -310,7 +310,7 @@ private static void ConvertSingle()
Console.WriteLine("The {0} value {1} is outside the range of the SByte type.",
number.GetType().Name, number);
}
- }
+ }
// The example displays the following output:
// The Single value -3.402823E+38 is outside the range of the SByte type.
// The Single value -129.5 is outside the range of the SByte type.
@@ -320,16 +320,16 @@ private static void ConvertSingle()
// Converted the Single value 103.6 to the SByte value 104.
// The Single value 255 is outside the range of the SByte type.
// The Single value 1.63509E+17 is outside the range of the SByte type.
- // The Single value 3.402823E+38 is outside the range of the SByte type.
+ // The Single value 3.402823E+38 is outside the range of the SByte type.
//
}
-
+
private static void ConvertUInt16()
{
//
ushort[] numbers = { UInt16.MinValue, 121, 340, UInt16.MaxValue };
sbyte result;
-
+
foreach (ushort number in numbers)
{
try {
@@ -337,7 +337,7 @@ private static void ConvertUInt16()
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the SByte type.",
number.GetType().Name, number);
@@ -350,13 +350,13 @@ private static void ConvertUInt16()
// The UInt16 value 65535 is outside the range of the SByte type.
//
}
-
+
private static void ConvertUInt32()
{
//
uint[] numbers = { UInt32.MinValue, 121, 340, UInt32.MaxValue };
sbyte result;
-
+
foreach (uint number in numbers)
{
try {
@@ -377,13 +377,13 @@ private static void ConvertUInt32()
// The UInt32 value 4294967295 is outside the range of the SByte type.
//
}
-
+
private static void ConvertUInt64()
{
//
ulong[] numbers = { UInt64.MinValue, 121, 340, UInt64.MaxValue };
sbyte result;
-
+
foreach (ulong number in numbers)
{
try {
@@ -402,6 +402,6 @@ private static void ConvertUInt64()
// Converted the UInt64 value 121 to the SByte value 121.
// The UInt64 value 340 is outside the range of the SByte type.
// The UInt64 value 18446744073709551615 is outside the range of the SByte type.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte2.cs
index af4f26b69c8..d067c77645d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte2.cs
@@ -8,15 +8,15 @@ public struct ByteString : IConvertible
{
private SignBit signBit;
private string byteString;
-
+
public SignBit Sign
- {
+ {
set { signBit = value; }
get { return signBit; }
}
public string Value
- {
+ {
set {
if (value.Trim().Length > 2)
throw new ArgumentException("The string representation of a byte cannot have more than two characters.");
@@ -25,20 +25,20 @@ public string Value
}
get { return byteString; }
}
-
+
// IConvertible implementations.
public TypeCode GetTypeCode() {
return TypeCode.Object;
}
-
+
public bool ToBoolean(IFormatProvider provider)
{
if (signBit == SignBit.Zero)
return false;
else
return true;
- }
-
+ }
+
public byte ToByte(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -46,61 +46,61 @@ public byte ToByte(IFormatProvider provider)
else
return Byte.Parse(byteString, NumberStyles.HexNumber);
}
-
+
public char ToChar(IFormatProvider provider)
{
- if (signBit == SignBit.Negative) {
+ if (signBit == SignBit.Negative) {
throw new OverflowException(String.Format("{0} is out of range of the Char type.", Convert.ToSByte(byteString, 16)));
}
else {
byte byteValue = Byte.Parse(this.byteString, NumberStyles.HexNumber);
return Convert.ToChar(byteValue);
- }
- }
-
+ }
+ }
+
public DateTime ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException("ByteString to DateTime conversion is not supported.");
}
-
+
public decimal ToDecimal(IFormatProvider provider)
{
- if (signBit == SignBit.Negative)
+ if (signBit == SignBit.Negative)
{
sbyte byteValue = SByte.Parse(byteString, NumberStyles.HexNumber);
return Convert.ToDecimal(byteValue);
}
- else
+ else
{
byte byteValue = Byte.Parse(byteString, NumberStyles.HexNumber);
return Convert.ToDecimal(byteValue);
}
}
-
+
public double ToDouble(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToDouble(SByte.Parse(byteString, NumberStyles.HexNumber));
else
return Convert.ToDouble(Byte.Parse(byteString, NumberStyles.HexNumber));
- }
-
- public short ToInt16(IFormatProvider provider)
+ }
+
+ public short ToInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToInt16(SByte.Parse(byteString, NumberStyles.HexNumber));
else
return Convert.ToInt16(Byte.Parse(byteString, NumberStyles.HexNumber));
}
-
- public int ToInt32(IFormatProvider provider)
+
+ public int ToInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToInt32(SByte.Parse(byteString, NumberStyles.HexNumber));
else
return Convert.ToInt32(Byte.Parse(byteString, NumberStyles.HexNumber));
}
-
+
public long ToInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -108,16 +108,16 @@ public long ToInt64(IFormatProvider provider)
else
return Convert.ToInt64(Byte.Parse(byteString, NumberStyles.HexNumber));
}
-
+
public sbyte ToSByte(IFormatProvider provider)
{
try {
return SByte.Parse(byteString, NumberStyles.HexNumber);
- }
+ }
catch (OverflowException e) {
- throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
Byte.Parse(byteString, NumberStyles.HexNumber)), e);
- }
+ }
}
public float ToSingle(IFormatProvider provider)
@@ -132,12 +132,12 @@ public string ToString(IFormatProvider provider)
{
return "0x" + this.byteString;
}
-
+
public object ToType(Type conversionType, IFormatProvider provider)
{
switch (Type.GetTypeCode(conversionType))
{
- case TypeCode.Boolean:
+ case TypeCode.Boolean:
return this.ToBoolean(null);
case TypeCode.Byte:
return this.ToByte(null);
@@ -171,16 +171,16 @@ public object ToType(Type conversionType, IFormatProvider provider)
case TypeCode.UInt32:
return this.ToUInt32(null);
case TypeCode.UInt64:
- return this.ToUInt64(null);
+ return this.ToUInt64(null);
default:
- throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
+ throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
}
}
-
- public UInt16 ToUInt16(IFormatProvider provider)
+
+ public UInt16 ToUInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt16 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt16 type.",
SByte.Parse(byteString, NumberStyles.HexNumber)));
else
return Convert.ToUInt16(Byte.Parse(byteString, NumberStyles.HexNumber));
@@ -189,16 +189,16 @@ public UInt16 ToUInt16(IFormatProvider provider)
public UInt32 ToUInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
SByte.Parse(byteString, NumberStyles.HexNumber)));
else
return Convert.ToUInt32(Byte.Parse(byteString, NumberStyles.HexNumber));
}
-
- public UInt64 ToUInt64(IFormatProvider provider)
+
+ public UInt64 ToUInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
SByte.Parse(byteString, NumberStyles.HexNumber)));
else
return Convert.ToUInt64(Byte.Parse(byteString, NumberStyles.HexNumber));
@@ -217,11 +217,11 @@ public static void Main()
ByteString positiveString = new ByteString();
positiveString.Sign = (SignBit) Math.Sign(positiveByte);
positiveString.Value = positiveByte.ToString("X2");
-
+
ByteString negativeString = new ByteString();
negativeString.Sign = (SignBit) Math.Sign(negativeByte);
negativeString.Value = negativeByte.ToString("X2");
-
+
try {
Console.WriteLine("'{0}' converts to {1}.", positiveString.Value, Convert.ToSByte(positiveString));
}
@@ -234,7 +234,7 @@ public static void Main()
}
catch (OverflowException) {
Console.WriteLine("0x{0} is outside the range of the Byte type.", negativeString.Value);
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte3.cs
index fc17b52c629..5317b90c3dc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosbyte/cs/tosbyte3.cs
@@ -6,9 +6,9 @@ public class Example
public static void Main()
{
int[] baseValues = { 2, 8, 16};
- string[] values = { "FF", "81", "03", "11", "8F", "01", "1C", "111",
- "123", "18A" };
-
+ string[] values = { "FF", "81", "03", "11", "8F", "01", "1C", "111",
+ "123", "18A" };
+
// Convert to each supported base.
foreach (int baseValue in baseValues)
{
@@ -18,10 +18,10 @@ public static void Main()
Console.Write(" '{0,-5} --> ", value + "'");
try {
Console.WriteLine(Convert.ToSByte(value, baseValue));
- }
+ }
catch (FormatException) {
Console.WriteLine("Bad Format");
- }
+ }
catch (OverflowException) {
Console.WriteLine("Out of Range");
}
@@ -42,7 +42,7 @@ public static void Main()
// '111' --> 7
// '123' --> Bad Format
// '18A' --> Bad Format
-//
+//
// Converting strings in base 8:
// 'FF' --> Bad Format
// '81' --> Bad Format
@@ -54,7 +54,7 @@ public static void Main()
// '111' --> 73
// '123' --> 83
// '18A' --> Bad Format
-//
+//
// Converting strings in base 16:
// 'FF' --> -1
// '81' --> -127
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle1.cs
index 617ccb0f2c8..9927fd13bd0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle1.cs
@@ -36,7 +36,7 @@ private static void ConvertBoolean()
//
bool[] flags = { true, false };
float result;
-
+
foreach (bool flag in flags)
{
result = Convert.ToSingle(flag);
@@ -44,7 +44,7 @@ private static void ConvertBoolean()
}
// The example displays the following output:
// Converted True to 1.
- // Converted False to 0.
+ // Converted False to 0.
//
}
@@ -53,7 +53,7 @@ private static void ConvertByte()
//
byte[] numbers = { Byte.MinValue, 10, 100, Byte.MaxValue };
float result;
-
+
foreach (byte number in numbers)
{
result = Convert.ToSingle(number);
@@ -72,17 +72,17 @@ private static void ConvertByte()
private static void ConvertDecimal()
{
//
- decimal[] values = { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
+ decimal[] values = { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
199.55m, 9214.16m, Decimal.MaxValue };
float result;
-
+
foreach (float value in values)
{
result = Convert.ToSingle(value);
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
value.GetType().Name, value,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the Decimal value '-79228162514264337593543950335' to the Single value -7.922816E+28.
// Converted the Decimal value '-1034.23' to the Single value -1034.23.
@@ -94,21 +94,21 @@ private static void ConvertDecimal()
// Converted the Decimal value '79228162514264337593543950335' to the Single value 7.922816E+28.
//
}
-
+
private static void ConvertDouble()
{
//
- double[] values = { Double.MinValue, -1.38e10, -1023.299, -12.98,
+ double[] values = { Double.MinValue, -1.38e10, -1023.299, -12.98,
0, 9.113e-16, 103.919, 17834.191, Double.MaxValue };
float result;
-
+
foreach (double value in values)
{
result = Convert.ToSingle(value);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- value.GetType().Name, value,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ value.GetType().Name, value,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the Double value '-1.79769313486232E+308' to the Single value -Infinity.
// Converted the Double value '-13800000000' to the Single value -1.38E+10.
@@ -127,14 +127,14 @@ private static void ConvertInt16()
//
short[] numbers = { Int16.MinValue, -1032, 0, 192, Int16.MaxValue };
float result;
-
+
foreach (short number in numbers)
{
result = Convert.ToSingle(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the Int16 value '-32768' to the Single value -32768.
// Converted the Int16 value '-1032' to the Single value -1032.
@@ -143,18 +143,18 @@ private static void ConvertInt16()
// Converted the Int16 value '32767' to the Single value 32767.
//
}
-
+
private static void ConvertInt32()
{
//
int[] numbers = { Int32.MinValue, -1000, 0, 1000, Int32.MaxValue };
float result;
-
+
foreach (int number in numbers)
{
result = Convert.ToSingle(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
}
// The example displays the following output:
@@ -171,12 +171,12 @@ private static void ConvertInt64()
//
long[] numbers = { Int64.MinValue, -903, 0, 172, Int64.MaxValue};
double result;
-
+
foreach (long number in numbers)
{
result = Convert.ToDouble(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
}
// The example displays the following output:
@@ -187,27 +187,27 @@ private static void ConvertInt64()
// Converted the Int64 value '9223372036854775807' to the Single value 9.223372E+18.
//
}
-
+
private static void ConvertObject()
{
//
object[] values = { true, 'a', 123, 1.764e32, "9.78", "1e-02",
1.67e03, "A100", "1,033.67", DateTime.Now,
- Decimal.MaxValue };
+ Decimal.MaxValue };
float result;
-
+
foreach (object value in values)
{
try {
result = Convert.ToSingle(value);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- value.GetType().Name, value,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ value.GetType().Name, value,
result.GetType().Name, result);
}
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not recognized as a valid Single value.",
value.GetType().Name, value);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the Single type.",
value.GetType().Name, value);
@@ -215,7 +215,7 @@ private static void ConvertObject()
catch (InvalidCastException) {
Console.WriteLine("Conversion of the {0} value {1} to a Single is not supported.",
value.GetType().Name, value);
- }
+ }
}
// The example displays the following output:
// Converted the Boolean value 'True' to the Single value 1.
@@ -230,19 +230,19 @@ private static void ConvertObject()
// Conversion of the DateTime value 11/7/2008 08:02:35 AM to a Single is not supported.
// Converted the Decimal value '79228162514264337593543950335' to the Single value 7.922816E+28.
//
- }
-
+ }
+
private static void ConvertSByte()
{
//
sbyte[] numbers = { SByte.MinValue, -23, 0, 17, SByte.MaxValue };
float result;
-
+
foreach (sbyte number in numbers)
{
result = Convert.ToSingle(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
}
// The example displays the following output:
@@ -258,25 +258,25 @@ private static void ConvertString()
{
//
string[] values= { "-1,035.77219", "1AFF", "1e-35", "1.63f",
- "1,635,592,999,999,999,999,999,999", "-17.455",
+ "1,635,592,999,999,999,999,999,999", "-17.455",
"190.34001", "1.29e325"};
float result;
-
+
foreach (string value in values)
{
try {
result = Convert.ToSingle(value);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- value.GetType().Name, value,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ value.GetType().Name, value,
result.GetType().Name, result);
- }
+ }
catch (FormatException) {
Console.WriteLine("Unable to convert '{0}' to a Single.", value);
- }
+ }
catch (OverflowException) {
Console.WriteLine("'{0}' is outside the range of a Single.", value);
}
- }
+ }
// The example displays the following output:
// Converted the String value '-1,035.77219' to the Single value -1035.772.
// Unable to convert '1AFF' to a Single.
@@ -294,14 +294,14 @@ private static void ConvertUInt16()
//
ushort[] numbers = { UInt16.MinValue, 121, 12345, UInt16.MaxValue };
float result;
-
+
foreach (ushort number in numbers)
{
result = Convert.ToSingle(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the UInt16 value '0' to the Single value 0.
// Converted the UInt16 value '121' to the Single value 121.
@@ -309,20 +309,20 @@ private static void ConvertUInt16()
// Converted the UInt16 value '65535' to the Single value 65535.
//
}
-
+
private static void ConvertUInt32()
{
//
uint[] numbers = { UInt32.MinValue, 121, 12345, UInt32.MaxValue };
float result;
-
+
foreach (uint number in numbers)
{
result = Convert.ToSingle(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the UInt32 value '0' to the Single value 0.
// Converted the UInt32 value '121' to the Single value 121.
@@ -336,14 +336,14 @@ private static void ConvertUInt64()
//
ulong[] numbers = { UInt64.MinValue, 121, 12345, UInt64.MaxValue };
float result;
-
+
foreach (ulong number in numbers)
{
result = Convert.ToSingle(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the UInt64 value '0' to the Single value 0.
// Converted the UInt64 value '121' to the Single value 121.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle2.cs
index 16f0f29e433..9f44aaea388 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle2.cs
@@ -10,22 +10,22 @@ public Temperature(float temperature)
{
this.m_Temp = temperature;
}
-
+
public float Celsius
{
- get { return this.m_Temp; }
+ get { return this.m_Temp; }
}
-
+
public float Kelvin
{
- get { return this.m_Temp + 273.15f; }
+ get { return this.m_Temp + 273.15f; }
}
-
+
public float Fahrenheit
{
get { return (float) Math.Round(this.m_Temp * 9 / 5 + 32, 2); }
}
-
+
public override string ToString()
{
return m_Temp.ToString("N2") + " °C";
@@ -36,44 +36,44 @@ public TypeCode GetTypeCode()
{
return TypeCode.Object;
}
-
- public bool ToBoolean(IFormatProvider provider)
+
+ public bool ToBoolean(IFormatProvider provider)
{
if (m_Temp == 0)
return false;
else
return true;
- }
-
+ }
+
public byte ToByte(IFormatProvider provider)
{
if (m_Temp < Byte.MinValue || m_Temp > Byte.MaxValue)
- throw new OverflowException(String.Format("{0} is out of range of the Byte type.",
+ throw new OverflowException(String.Format("{0} is out of range of the Byte type.",
this.m_Temp));
else
return Convert.ToByte(this.m_Temp);
}
-
+
public char ToChar(IFormatProvider provider)
{
throw new InvalidCastException("Temperature to Char conversion is not supported.");
- }
-
+ }
+
public DateTime ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException("Temperature to DateTime conversion is not supported.");
}
-
+
public decimal ToDecimal(IFormatProvider provider)
{
return Convert.ToDecimal(this.m_Temp);
}
-
+
public double ToDouble(IFormatProvider provider)
{
return Convert.ToDouble(this.m_Temp);
- }
-
+ }
+
public short ToInt16(IFormatProvider provider)
{
if (this.m_Temp < Int16.MinValue || this.m_Temp > Int16.MaxValue)
@@ -82,7 +82,7 @@ public short ToInt16(IFormatProvider provider)
else
return Convert.ToInt16(this.m_Temp);
}
-
+
public int ToInt32(IFormatProvider provider)
{
if (this.m_Temp < Int32.MinValue || this.m_Temp > Int32.MaxValue)
@@ -91,7 +91,7 @@ public int ToInt32(IFormatProvider provider)
else
return Convert.ToInt32(this.m_Temp);
}
-
+
public long ToInt64(IFormatProvider provider)
{
if (this.m_Temp < Int64.MinValue || this.m_Temp > Int64.MaxValue)
@@ -100,7 +100,7 @@ public long ToInt64(IFormatProvider provider)
else
return Convert.ToInt64(this.m_Temp);
}
-
+
public sbyte ToSByte(IFormatProvider provider)
{
if (this.m_Temp < SByte.MinValue || this.m_Temp > SByte.MaxValue)
@@ -119,12 +119,12 @@ public string ToString(IFormatProvider provider)
{
return m_Temp.ToString("N2", provider) + " °C";
}
-
+
public object ToType(Type conversionType, IFormatProvider provider)
{
switch (Type.GetTypeCode(conversionType))
{
- case TypeCode.Boolean:
+ case TypeCode.Boolean:
return this.ToBoolean(null);
case TypeCode.Byte:
return this.ToByte(null);
@@ -159,12 +159,12 @@ public object ToType(Type conversionType, IFormatProvider provider)
case TypeCode.UInt32:
return this.ToUInt32(null);
case TypeCode.UInt64:
- return this.ToUInt64(null);
+ return this.ToUInt64(null);
default:
- throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
+ throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
}
}
-
+
public ushort ToUInt16(IFormatProvider provider)
{
if (this.m_Temp < UInt16.MinValue || this.m_Temp > UInt16.MaxValue)
@@ -182,7 +182,7 @@ public uint ToUInt32(IFormatProvider provider)
else
return Convert.ToUInt32(this.m_Temp);
}
-
+
public ulong ToUInt64(IFormatProvider provider)
{
if (this.m_Temp < UInt64.MinValue || this.m_Temp > UInt64.MaxValue)
@@ -202,7 +202,7 @@ public static void Main()
Temperature cold = new Temperature(-40);
Temperature freezing = new Temperature(0);
Temperature boiling = new Temperature(100);
-
+
Console.WriteLine(Convert.ToInt32(cold, null));
Console.WriteLine(Convert.ToInt32(freezing, null));
Console.WriteLine(Convert.ToDouble(boiling, null));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle3.cs
index 464d0ad18a1..4badfb79f33 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tosingle/cs/tosingle3.cs
@@ -8,10 +8,10 @@ public static void Main()
{
string[] values = { "123456789", "12345.6789", "12 345,6789",
"123,456.789", "123 456,789", "123,456,789.0123",
- "123 456 789,0123", "1.235e12", "1.03221e-05",
+ "123 456 789,0123", "1.235e12", "1.03221e-05",
Double.MaxValue.ToString() };
CultureInfo[] cultures = { new CultureInfo("en-US"),
- new CultureInfo("fr-FR") };
+ new CultureInfo("fr-FR") };
foreach (CultureInfo culture in cultures)
{
@@ -31,7 +31,7 @@ public static void Main()
}
}
Console.WriteLine();
- }
+ }
}
}
// The example displays the following output:
@@ -46,7 +46,7 @@ public static void Main()
// 1.235e12 -> 1.235E+12
// 1.03221e-05 -> 1.03221E-05
// 1.79769313486232E+308 -> Overflow
-//
+//
// String -> Single Conversion Using the fr-FR Culture
// 123456789 -> 1.234568E+08
// 12345.6789 -> FormatException
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring1.cs
index c490878ecd7..cb9ac334881 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring1.cs
@@ -24,11 +24,11 @@ public static void Main()
private static void ConvertDateTime()
{
//
- DateTime[] dates = { new DateTime(2009, 7, 14),
- new DateTime(1, 1, 1, 18, 32, 0),
+ DateTime[] dates = { new DateTime(2009, 7, 14),
+ new DateTime(1, 1, 1, 18, 32, 0),
new DateTime(2009, 2, 12, 7, 16, 0) };
string result;
-
+
foreach (DateTime dateValue in dates)
{
result = Convert.ToString(dateValue);
@@ -42,20 +42,20 @@ private static void ConvertDateTime()
// Converted the DateTime value 2/12/2009 07:16:00 AM to a String value 2/12/2009 07:16:00 AM.
//
}
-
+
private static void ConvertInt16()
{
//
short[] numbers = { Int16.MinValue, -138, 0, 19, Int16.MaxValue };
string result;
-
+
foreach (short number in numbers)
{
result = Convert.ToString(number);
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the Int16 value -32768 to the String value -32768.
// Converted the Int16 value -138 to the String value -138.
@@ -71,7 +71,7 @@ private static void ConvertObject()
object[] values = { false, 12.63m, new DateTime(2009, 6, 1, 6, 32, 15), 16.09e-12,
'Z', 15.15322, SByte.MinValue, Int32.MaxValue };
string result;
-
+
foreach (object value in values)
{
result = Convert.ToString(value);
@@ -87,16 +87,16 @@ private static void ConvertObject()
// Converted the Char value Z to the String value Z.
// Converted the Double value 15.15322 to the String value 15.15322.
// Converted the SByte value -128 to the String value -128.
- // Converted the Int32 value 2147483647 to the String value 2147483647.
+ // Converted the Int32 value 2147483647 to the String value 2147483647.
//
- }
+ }
private static void ConvertSByte()
{
//
sbyte[] numbers = { SByte.MinValue, -12, 0, 16, SByte.MaxValue };
string result;
-
+
foreach (sbyte number in numbers)
{
result = Convert.ToString(number);
@@ -112,21 +112,21 @@ private static void ConvertSByte()
// Converted the SByte value 127 to the String value 127.
//
}
-
+
private static void ConvertSingle()
{
//
float[] numbers = { Single.MinValue, -1011.351f, -17.45f, -3e-16f,
0f, 4.56e-12f, 16.0001f, 10345.1221f, Single.MaxValue };
string result;
-
+
foreach (float number in numbers)
{
result = Convert.ToString(number);
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the Single value -3.402823E+38 to the String value -3.402823E+38.
// Converted the Single value -1011.351 to the String value -1011.351.
@@ -139,13 +139,13 @@ private static void ConvertSingle()
// Converted the Single value 3.402823E+38 to the String value 3.402823E+38.
//
}
-
+
private static void ConvertUInt16()
{
//
ushort[] numbers = { UInt16.MinValue, 103, 1045, UInt16.MaxValue };
string result;
-
+
foreach (ushort number in numbers)
{
result = Convert.ToString(number);
@@ -160,13 +160,13 @@ private static void ConvertUInt16()
// Converted the UInt16 value 65535 to the String value 65535.
//
}
-
+
private static void ConvertUInt32()
{
//
uint[] numbers = { UInt32.MinValue, 103, 1045, 119543, UInt32.MaxValue };
string result;
-
+
foreach (uint number in numbers)
{
result = Convert.ToString(number);
@@ -182,13 +182,13 @@ private static void ConvertUInt32()
// Converted the UInt32 value 4294967295 to the String value 4294967295.
//
}
-
+
private static void ConvertUInt64()
{
//
ulong[] numbers = { UInt64.MinValue, 1031, 189045, UInt64.MaxValue };
string result;
-
+
foreach (ulong number in numbers)
{
result = Convert.ToString(number);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring2.cs
index ea8136d86c0..43809cbb279 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring2.cs
@@ -18,13 +18,13 @@ private static void ConvertByte()
//
int[] bases = { 2, 8, 10, 16};
byte[] numbers = { Byte.MinValue, 12, 103, Byte.MaxValue};
-
+
foreach (int baseValue in bases)
{
Console.WriteLine("Base {0} conversion:", baseValue);
foreach (byte number in numbers)
{
- Console.WriteLine(" {0,-5} --> 0x{1}",
+ Console.WriteLine(" {0,-5} --> 0x{1}",
number, Convert.ToString(number, baseValue));
}
}
@@ -57,13 +57,13 @@ private static void ConvertShort()
//
int[] bases = { 2, 8, 10, 16};
short[] numbers = { Int16.MinValue, -13621, -18, 12, 19142, Int16.MaxValue };
-
+
foreach (int baseValue in bases)
{
Console.WriteLine("Base {0} conversion:", baseValue);
foreach (short number in numbers)
{
- Console.WriteLine(" {0,-8} --> 0x{1}",
+ Console.WriteLine(" {0,-8} --> 0x{1}",
number, Convert.ToString(number, baseValue));
}
}
@@ -103,15 +103,15 @@ private static void ConvertInt()
{
//
int[] bases = { 2, 8, 10, 16};
- int[] numbers = { Int32.MinValue, -19327543, -13621, -18, 12,
+ int[] numbers = { Int32.MinValue, -19327543, -13621, -18, 12,
19142, Int32.MaxValue };
-
+
foreach (int baseValue in bases)
{
Console.WriteLine("Base {0} conversion:", baseValue);
foreach (int number in numbers)
{
- Console.WriteLine(" {0,-15} --> 0x{1}",
+ Console.WriteLine(" {0,-15} --> 0x{1}",
number, Convert.ToString(number, baseValue));
}
}
@@ -147,7 +147,7 @@ private static void ConvertInt()
// -18 --> 0xffffffee
// 12 --> 0xc
// 19142 --> 0x4ac6
- // 2147483647 --> 0x7fffffff
+ // 2147483647 --> 0x7fffffff
//
}
@@ -155,7 +155,7 @@ private static void ConvertLong()
{
//
int[] bases = { 2, 8, 10, 16};
- long[] numbers = { Int64.MinValue, -193275430, -13621, -18, 12,
+ long[] numbers = { Int64.MinValue, -193275430, -13621, -18, 12,
1914206117, Int64.MaxValue };
foreach (int baseValue in bases)
@@ -163,7 +163,7 @@ private static void ConvertLong()
Console.WriteLine("Base {0} conversion:", baseValue);
foreach (long number in numbers)
{
- Console.WriteLine(" {0,-23} --> 0x{1}",
+ Console.WriteLine(" {0,-23} --> 0x{1}",
number, Convert.ToString(number, baseValue));
}
}
@@ -202,4 +202,4 @@ private static void ConvertLong()
// 9223372036854775807 --> 0x7fffffffffffffff
//
}
-}
+}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring3.cs
index 7c4e266efe5..dc3e6bc160a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring3.cs
@@ -25,7 +25,7 @@ public static void Main()
Console.WriteLine("-----");
ConvertUInt32WithProvider();
Console.WriteLine("-----");
- ConvertUInt64WithProvider();
+ ConvertUInt64WithProvider();
}
private static void ConvertDateTimeWithProvider()
@@ -36,18 +36,18 @@ private static void ConvertDateTimeWithProvider()
// Specify the cultures.
string[] cultureNames = { "en-US", "es-AR", "fr-FR", "hi-IN",
"ja-JP", "nl-NL", "ru-RU", "ur-PK" };
-
- Console.WriteLine("Converting the date {0}: ",
- Convert.ToString(tDate,
+
+ Console.WriteLine("Converting the date {0}: ",
+ Convert.ToString(tDate,
System.Globalization.CultureInfo.InvariantCulture));
foreach (string cultureName in cultureNames)
{
System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo(cultureName);
string dateString = Convert.ToString(tDate, culture);
- Console.WriteLine(" {0}: {1,-12}",
+ Console.WriteLine(" {0}: {1,-12}",
culture.Name, dateString);
- }
+ }
// The example displays the following output:
// Converting the date 04/15/2010 20:30:40:
// en-US: 4/15/2010 8:30:40 PM
@@ -57,7 +57,7 @@ private static void ConvertDateTimeWithProvider()
// ja-JP: 2010/04/15 20:30:40
// nl-NL: 15-4-2010 20:30:40
// ru-RU: 15.04.2010 20:30:40
- // ur-PK: 15/04/2010 8:30:40 PM
+ // ur-PK: 15/04/2010 8:30:40 PM
//
}
@@ -69,7 +69,7 @@ private static void ConvertDecimalWithProvider()
3193.23m, 98012368321.684m };
// Define the culture names used to display them.
string[] cultureNames = { "en-US", "fr-FR", "ja-JP", "ru-RU" };
-
+
foreach (decimal number in numbers)
{
Console.WriteLine("{0}:", Convert.ToString(number,
@@ -81,26 +81,26 @@ private static void ConvertDecimalWithProvider()
culture.Name, Convert.ToString(number, culture));
}
Console.WriteLine();
- }
+ }
// The example displays the following output:
// 1734231911290.16:
// en-US: 1734231911290.16
// fr-FR: 1734231911290,16
// ja-JP: 1734231911290.16
// ru-RU: 1734231911290,16
- //
+ //
// -17394.32921:
// en-US: -17394.32921
// fr-FR: -17394,32921
// ja-JP: -17394.32921
// ru-RU: -17394,32921
- //
+ //
// 3193.23:
// en-US: 3193.23
// fr-FR: 3193,23
// ja-JP: 3193.23
// ru-RU: 3193,23
- //
+ //
// 98012368321.684:
// en-US: 98012368321.684
// fr-FR: 98012368321,684
@@ -108,7 +108,7 @@ private static void ConvertDecimalWithProvider()
// ru-RU: 98012368321,684
//
}
-
+
private static void ConvertDoubleWithProvider()
{
//
@@ -116,7 +116,7 @@ private static void ConvertDoubleWithProvider()
double[] numbers = { -1.5345e16, -123.4321, 19092.123, 1.1734231911290e16 };
// Define the culture names used to display them.
string[] cultureNames = { "en-US", "fr-FR", "ja-JP", "ru-RU" };
-
+
foreach (double number in numbers)
{
Console.WriteLine("{0}:", Convert.ToString(number,
@@ -128,32 +128,32 @@ private static void ConvertDoubleWithProvider()
culture.Name, Convert.ToString(number, culture));
}
Console.WriteLine();
- }
+ }
// The example displays the following output:
// -1.5345E+16:
// en-US: -1.5345E+16
// fr-FR: -1,5345E+16
// ja-JP: -1.5345E+16
// ru-RU: -1,5345E+16
- //
+ //
// -123.4321:
// en-US: -123.4321
// fr-FR: -123,4321
// ja-JP: -123.4321
// ru-RU: -123,4321
- //
+ //
// 19092.123:
// en-US: 19092.123
// fr-FR: 19092,123
// ja-JP: 19092.123
// ru-RU: 19092,123
- //
+ //
// 1.173423191129E+16:
// en-US: 1.173423191129E+16
// fr-FR: 1,173423191129E+16
// ja-JP: 1.173423191129E+16
// ru-RU: 1,173423191129E+16
- //
+ //
}
private static void ConvertByteWithProvider()
@@ -162,7 +162,7 @@ private static void ConvertByteWithProvider()
byte[] numbers = { 12, 100, Byte.MaxValue };
// Define the culture names used to display them.
string[] cultureNames = { "en-US", "fr-FR" };
-
+
foreach (byte number in numbers)
{
Console.WriteLine("{0}:", Convert.ToString(number,
@@ -174,19 +174,19 @@ private static void ConvertByteWithProvider()
culture.Name, Convert.ToString(number, culture));
}
Console.WriteLine();
- }
+ }
// The example displays the following output:
// 12:
// en-US: 12
// fr-FR: 12
- //
+ //
// 100:
// en-US: 100
// fr-FR: 100
- //
+ //
// 255:
// en-US: 255
- // fr-FR: 255
+ // fr-FR: 255
//
}
@@ -203,7 +203,7 @@ private static void ConvertSByteWithProvider()
// ~128
// ~12
// 17
- // 127
+ // 127
//
}
@@ -214,7 +214,7 @@ private static void ConvertSingleWithProvider()
float[] numbers = { -1.5345e16f, -123.4321f, 19092.123f, 1.1734231911290e16f };
// Define the culture names used to display them.
string[] cultureNames = { "en-US", "fr-FR", "ja-JP", "ru-RU" };
-
+
foreach (float number in numbers)
{
Console.WriteLine("{0}:", Convert.ToString(number,
@@ -226,32 +226,32 @@ private static void ConvertSingleWithProvider()
culture.Name, Convert.ToString(number, culture));
}
Console.WriteLine();
- }
+ }
// The example displays the following output:
// -1.5345E+16:
// en-US: -1.5345E+16
// fr-FR: -1,5345E+16
// ja-JP: -1.5345E+16
// ru-RU: -1,5345E+16
- //
+ //
// -123.4321:
// en-US: -123.4321
// fr-FR: -123,4321
// ja-JP: -123.4321
// ru-RU: -123,4321
- //
+ //
// 19092.123:
// en-US: 19092.123
// fr-FR: 19092,123
// ja-JP: 19092.123
// ru-RU: 19092,123
- //
+ //
// 1.173423191129E+16:
// en-US: 1.173423191129E+16
// fr-FR: 1,173423191129E+16
// ja-JP: 1.173423191129E+16
// ru-RU: 1,173423191129E+16
- //
+ //
}
private static void ConvertInt16WithProvider()
@@ -261,10 +261,10 @@ private static void ConvertInt16WithProvider()
System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
nfi.NegativeSign = "~";
nfi.PositiveSign = "!";
-
+
foreach (short number in numbers)
- Console.WriteLine("{0,-8} --> {1,8}",
- Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture),
+ Console.WriteLine("{0,-8} --> {1,8}",
+ Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture),
Convert.ToString(number, nfi));
// The example displays the following output:
// -32768 --> ~32768
@@ -279,10 +279,10 @@ private static void ConvertInt32WithProvider()
System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
nfi.NegativeSign = "~";
nfi.PositiveSign = "!";
-
+
foreach (int number in numbers)
- Console.WriteLine("{0,-12} --> {1,12}",
- Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture),
+ Console.WriteLine("{0,-12} --> {1,12}",
+ Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture),
Convert.ToString(number, nfi));
// The example displays the following output:
// -2147483648 --> ~2147483648
@@ -297,10 +297,10 @@ private static void ConvertInt64WithProvider()
System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
nfi.NegativeSign = "~";
nfi.PositiveSign = "!";
-
+
foreach (long number in numbers)
- Console.WriteLine("{0,-12} --> {1,12}",
- Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture),
+ Console.WriteLine("{0,-12} --> {1,12}",
+ Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture),
Convert.ToString(number, nfi));
// The example displays the following output:
// -4294967296 --> ~4294967296
@@ -315,15 +315,15 @@ private static void ConvertUInt16WithProvider()
System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
nfi.NegativeSign = "~";
nfi.PositiveSign = "!";
-
+
Console.WriteLine("{0,-6} --> {1,6}",
Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture),
Convert.ToString(number, nfi));
// The example displays the following output:
// 65535 --> 65535
//
- }
-
+ }
+
private static void ConvertUInt32WithProvider()
{
//
@@ -331,15 +331,15 @@ private static void ConvertUInt32WithProvider()
System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
nfi.NegativeSign = "~";
nfi.PositiveSign = "!";
-
+
Console.WriteLine("{0,-8} --> {1,8}",
Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture),
Convert.ToString(number, nfi));
// The example displays the following output:
// 4294967295 --> 4294967295
//
- }
-
+ }
+
private static void ConvertUInt64WithProvider()
{
//
@@ -347,12 +347,12 @@ private static void ConvertUInt64WithProvider()
System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
nfi.NegativeSign = "~";
nfi.PositiveSign = "!";
-
+
Console.WriteLine("{0,-12} --> {1,12}",
Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture),
Convert.ToString(number, nfi));
// The example displays the following output:
// 18446744073709551615 --> 18446744073709551615
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring4.cs
index 6b7b70952c3..5a977818bd1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring4.cs
@@ -5,13 +5,13 @@
public class DummyProvider : IFormatProvider
{
// Normally, GetFormat returns an object of the requested type
- // (usually itself) if it is able; otherwise, it returns Nothing.
+ // (usually itself) if it is able; otherwise, it returns Nothing.
public object GetFormat(Type argType)
{
// Display the type of argType and return null.
Console.Write( "{0,-25}", argType.Name);
return null;
- }
+ }
}
public class Example
@@ -22,7 +22,7 @@ public static void Main()
IFormatProvider provider = new DummyProvider();
// Values to convert using DummyProvider.
- int int32A = -252645135;
+ int int32A = -252645135;
double doubleA = 61680.3855;
object objDouble = (object) -98765.4321;
DateTime dayTimeA = new DateTime(2009, 9, 11, 13, 45, 0);
@@ -32,13 +32,13 @@ public static void Main()
TimeSpan tSpanA = new TimeSpan(0, 18, 0);
object objOther = provider;
- object[] objects= { int32A, doubleA, objDouble, dayTimeA,
+ object[] objects= { int32A, doubleA, objDouble, dayTimeA,
boolA, stringA, charA, tSpanA, objOther };
-
+
// Call Convert.ToString(Object, provider) method for each value.
- foreach (object value in objects)
- Console.WriteLine("{0,-20} --> {1,20}",
- value, Convert.ToString(value, provider));
+ foreach (object value in objects)
+ Console.WriteLine("{0,-20} --> {1,20}",
+ value, Convert.ToString(value, provider));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring5.cs
index 238a9593015..cc410d458a8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring5.cs
@@ -9,22 +9,22 @@ public Temperature(decimal temperature)
{
this.m_Temp = temperature;
}
-
+
public decimal Celsius
{
- get { return this.m_Temp; }
+ get { return this.m_Temp; }
}
-
+
public decimal Kelvin
{
- get { return this.m_Temp + 273.15m; }
+ get { return this.m_Temp + 273.15m; }
}
-
+
public decimal Fahrenheit
{
get { return Math.Round((decimal) (this.m_Temp * 9 / 5 + 32), 2); }
}
-
+
public override string ToString()
{
return m_Temp.ToString("N2") + " °C";
@@ -38,7 +38,7 @@ public static void Main()
Temperature cold = new Temperature(-40);
Temperature freezing = new Temperature(0);
Temperature boiling = new Temperature(100);
-
+
Console.WriteLine(Convert.ToString(cold, null));
Console.WriteLine(Convert.ToString(freezing, null));
Console.WriteLine(Convert.ToString(boiling, null));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring6.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring6.cs
index 4e5db5e7989..f42e8cf8c21 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring6.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring6.cs
@@ -17,16 +17,16 @@ private static void ConvertInt32()
provider.NegativeSign = "minus ";
int[] values = { -20, 0, 100 };
-
+
foreach (int value in values)
- Console.WriteLine("{0,-5} --> {1,8}",
+ Console.WriteLine("{0,-5} --> {1,8}",
value, Convert.ToString(value, provider));
// The example displays the following output:
// -20 --> minus 20
// 0 --> 0
// 100 --> 100
}
-
+
private static void ConvertInt64()
{
//
@@ -36,9 +36,9 @@ private static void ConvertInt64()
provider.NegativeSign = "minus ";
long[] values = { -200, 0, 1000 };
-
+
foreach (long value in values)
- Console.WriteLine("{0,-6} --> {1,10}",
+ Console.WriteLine("{0,-6} --> {1,10}",
value, Convert.ToString(value, provider));
// The example displays the following output:
// -200 --> minus 200
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring7.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring7.cs
index 2eaef1077d8..bd1372572d0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring7.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring7.cs
@@ -12,7 +12,7 @@ public static void Main()
provider.NegativeSign = "minus ";
int[] values = { -20, 0, 100 };
-
+
Console.WriteLine("{0,-8} --> {1,10} {2,10}\n", "Value",
CultureInfo.CurrentCulture.Name,
"Custom");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring_obj30.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring_obj30.cs
index c5848977491..6c9ba4b6d7b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring_obj30.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.tostring2/cs/tostring_obj30.cs
@@ -1,38 +1,38 @@
//
using System;
-public class Temperature : IFormattable
+public class Temperature : IFormattable
{
- private decimal m_Temp;
+ private decimal m_Temp;
public Temperature(decimal temperature)
{
this.m_Temp = temperature;
- }
+ }
- public decimal Celsius
- { get { return this.m_Temp; } }
+ public decimal Celsius
+ { get { return this.m_Temp; } }
- public decimal Kelvin
- { get { return this.m_Temp + 273.15m; } }
+ public decimal Kelvin
+ { get { return this.m_Temp + 273.15m; } }
public decimal Fahrenheit
{ get { return Math.Round(this.m_Temp * 9m / 5m + 32m, 2); } }
- public override String ToString()
- {
- return ToString("G", null);
- }
-
- public String ToString(String fmt, IFormatProvider provider)
+ public override String ToString()
+ {
+ return ToString("G", null);
+ }
+
+ public String ToString(String fmt, IFormatProvider provider)
{
TemperatureProvider formatter = null;
- if (provider != null)
- formatter = provider.GetFormat(typeof(TemperatureProvider))
+ if (provider != null)
+ formatter = provider.GetFormat(typeof(TemperatureProvider))
as TemperatureProvider;
if (String.IsNullOrWhiteSpace(fmt)) {
- if (formatter != null)
+ if (formatter != null)
fmt = formatter.Format;
else
fmt = "G";
@@ -41,7 +41,7 @@ public String ToString(String fmt, IFormatProvider provider)
switch (fmt.ToUpper()) {
case "G":
case "C":
- return m_Temp.ToString("N2") + " °C";
+ return m_Temp.ToString("N2") + " °C";
case "F":
return Fahrenheit.ToString("N2") + " °F";
case "K":
@@ -49,19 +49,19 @@ public String ToString(String fmt, IFormatProvider provider)
default:
throw new FormatException(String.Format("'{0}' is not a valid format specifier.", fmt));
}
- }
-}
+ }
+}
public class TemperatureProvider : IFormatProvider
{
private String[] fmtStrings = { "C", "G", "F", "K" };
private Random rnd = new Random();
-
- public Object GetFormat(Type formatType)
- {
- return this;
+
+ public Object GetFormat(Type formatType)
+ {
+ return this;
}
-
+
public String Format
{ get { return fmtStrings[rnd.Next(0, fmtStrings.Length)]; } }
}
@@ -75,7 +75,7 @@ public static void Main()
Temperature boiling = new Temperature (100);
TemperatureProvider tp = new TemperatureProvider();
-
+
Console.WriteLine(Convert.ToString(cold, tp));
Console.WriteLine(Convert.ToString(freezing, tp));
Console.WriteLine(Convert.ToString(boiling, tp));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_1.cs
index 208e740349c..13ca065b536 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_1.cs
@@ -38,7 +38,7 @@ private static void ConvertBoolean()
//
bool falseFlag = false;
bool trueFlag = true;
-
+
Console.WriteLine("{0} converts to {1}.", falseFlag,
Convert.ToInt16(falseFlag));
Console.WriteLine("{0} converts to {1}.", trueFlag,
@@ -48,18 +48,18 @@ private static void ConvertBoolean()
// True converts to 1.
//
}
-
+
private static void ConvertByte()
{
//
byte[] bytes = { Byte.MinValue, 14, 122, Byte.MaxValue};
ushort result;
-
+
foreach (byte byteValue in bytes)
{
result = Convert.ToUInt16(byteValue);
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- byteValue.GetType().Name, byteValue,
+ byteValue.GetType().Name, byteValue,
result.GetType().Name, result);
}
// The example displays the following output:
@@ -68,28 +68,28 @@ private static void ConvertByte()
// Converted the Byte value '122' to the UInt16 value 122.
// Converted the Byte value '255' to the UInt16 value 255.
//
- }
-
+ }
+
private static void ConvertChar()
{
//
char[] chars = { 'a', 'z', '\x0007', '\x03FF',
'\x7FFF', '\xFFFE' };
ushort result;
-
+
foreach (char ch in chars)
{
try {
result = Convert.ToUInt16(ch);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- ch.GetType().Name, ch,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ ch.GetType().Name, ch,
result.GetType().Name, result);
}
catch (OverflowException) {
Console.WriteLine("Unable to convert u+{0} to a UInt16.",
((int)ch).ToString("X4"));
}
- }
+ }
// The example displays the following output:
// Converted the Char value 'a' to the UInt16 value 97.
// Converted the Char value 'z' to the UInt16 value 122.
@@ -99,28 +99,28 @@ private static void ConvertChar()
// Converted the Char value '?' to the UInt16 value 65534.
//
}
-
+
private static void ConvertDecimal()
{
//
decimal[] numbers = { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
9214.16m, Decimal.MaxValue };
ushort result;
-
+
foreach (decimal number in numbers)
{
try {
result = Convert.ToUInt16(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException)
{
Console.WriteLine("{0} is outside the range of the UInt16 type.",
number);
- }
- }
+ }
+ }
// The example displays the following output:
// -79228162514264337593543950335 is outside the range of the UInt16 type.
// -1034.23 is outside the range of the UInt16 type.
@@ -131,27 +131,27 @@ private static void ConvertDecimal()
// 79228162514264337593543950335 is outside the range of the UInt16 type.
//
}
-
+
private static void ConvertDouble()
{
//
double[] numbers = { Double.MinValue, -1.38e10, -1023.299, -12.98,
0, 9.113e-16, 103.919, 17834.191, Double.MaxValue };
ushort result;
-
+
foreach (double number in numbers)
{
try {
result = Convert.ToUInt16(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException)
{
Console.WriteLine("{0} is outside the range of the UInt16 type.", number);
- }
- }
+ }
+ }
// The example displays the following output:
// -1.79769313486232E+308 is outside the range of the UInt16 type.
// -13800000000 is outside the range of the UInt16 type.
@@ -164,19 +164,19 @@ private static void ConvertDouble()
// 1.79769313486232E+308 is outside the range of the UInt16 type.
//
}
-
+
private static void ConvertInt16()
{
//
short[] numbers = { Int16.MinValue, -132, 0, 121, 16103, Int16.MaxValue };
ushort result;
-
+
foreach (short number in numbers)
{
try {
result = Convert.ToUInt16(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
}
catch (OverflowException) {
@@ -193,21 +193,21 @@ private static void ConvertInt16()
// Converted the Int16 value '32767' to the UInt16 value 32767.
//
}
-
+
private static void ConvertInt32()
{
//
int[] numbers = { Int32.MinValue, -1, 0, 121, 340, Int32.MaxValue };
ushort result;
-
+
foreach (int number in numbers)
{
try {
result = Convert.ToUInt16(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt16 type.",
number.GetType().Name, number);
@@ -222,21 +222,21 @@ private static void ConvertInt32()
// The Int32 value 2147483647 is outside the range of the UInt16 type.
//
}
-
+
private static void ConvertInt64()
{
//
long[] numbers = { Int64.MinValue, -1, 0, 121, 340, Int64.MaxValue };
ushort result;
-
+
foreach (long number in numbers)
{
try {
result = Convert.ToUInt16(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt16 type.",
number.GetType().Name, number);
@@ -249,37 +249,37 @@ private static void ConvertInt64()
// Converted the Int64 value '121' to the UInt16 value 121.
// Converted the Int64 value '340' to the UInt16 value 340.
// The Int64 value 9223372036854775807 is outside the range of the UInt16 type.
- //
- }
-
+ //
+ }
+
private static void ConvertObject()
{
//
object[] values= { true, -12, 163, 935, 'x', new DateTime(2009, 5, 12),
"104", "103.0", "-1", "1.00e2", "One", 1.00e2};
ushort result;
-
+
foreach (object value in values)
{
try {
result = Convert.ToUInt16(value);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- value.GetType().Name, value,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ value.GetType().Name, value,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt16 type.",
value.GetType().Name, value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not in a recognizable format.",
value.GetType().Name, value);
- }
+ }
catch (InvalidCastException) {
Console.WriteLine("No conversion to a UInt16 exists for the {0} value {1}.",
value.GetType().Name, value);
}
- }
+ }
// The example displays the following output:
// Converted the Boolean value 'True' to the UInt16 value 1.
// The Int32 value -12 is outside the range of the UInt16 type.
@@ -295,19 +295,19 @@ private static void ConvertObject()
// Converted the Double value '100' to the UInt16 value 100.
//
}
-
+
private static void ConvertSByte()
{
//
sbyte[] numbers = { SByte.MinValue, -1, 0, 10, SByte.MaxValue };
ushort result;
-
+
foreach (sbyte number in numbers)
{
try {
result = Convert.ToUInt16(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
}
catch (OverflowException) {
@@ -322,26 +322,26 @@ private static void ConvertSByte()
// Converted the SByte value '127' to the UInt16 value 127.
//
}
-
+
private static void ConvertSingle()
{
//
float[] numbers = { Single.MinValue, -1.38e10f, -1023.299f, -12.98f,
0f, 9.113e-16f, 103.919f, 17834.191f, Single.MaxValue };
ushort result;
-
+
foreach (float number in numbers)
{
try {
result = Convert.ToUInt16(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the UInt16 type.", number);
- }
- }
+ }
+ }
// The example displays the following output:
// -3.402823E+38 is outside the range of the UInt16 type.
// -1.38E+10 is outside the range of the UInt16 type.
@@ -358,10 +358,10 @@ private static void ConvertSingle()
private static void ConvertString()
{
//
- string[] values = { "1603", "1,603", "one", "1.6e03", "1.2e-02",
+ string[] values = { "1603", "1,603", "one", "1.6e03", "1.2e-02",
"-1326", "1074122" };
ushort result;
-
+
foreach (string value in values)
{
try {
@@ -369,14 +369,14 @@ private static void ConvertString()
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
value.GetType().Name, value,
result.GetType().Name, result);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not in a recognizable format.",
value.GetType().Name, value);
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the UInt16 type.", value);
- }
+ }
}
// The example displays the following output:
// Converted the String value '1603' to the UInt16 value 1603.
@@ -385,7 +385,7 @@ private static void ConvertString()
// The String value 1.6e03 is not in a recognizable format.
// The String value 1.2e-02 is not in a recognizable format.
// -1326 is outside the range of the UInt16 type.
- // 1074122 is outside the range of the UInt16 type.
+ // 1074122 is outside the range of the UInt16 type.
//
}
@@ -394,13 +394,13 @@ private static void ConvertUInt32()
//
uint[] numbers = { UInt32.MinValue, 121, 340, UInt32.MaxValue };
ushort result;
-
+
foreach (uint number in numbers)
{
try {
result = Convert.ToUInt16(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
}
catch (OverflowException) {
@@ -415,19 +415,19 @@ private static void ConvertUInt32()
// The UInt32 value 4294967295 is outside the range of the UInt16 type.
//
}
-
+
private static void ConvertUInt64()
{
//
ulong[] numbers = { UInt64.MinValue, 121, 340, UInt64.MaxValue };
ushort result;
-
+
foreach (ulong number in numbers)
{
try {
result = Convert.ToUInt16(number);
- Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- number.GetType().Name, number,
+ Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
+ number.GetType().Name, number,
result.GetType().Name, result);
}
catch (OverflowException) {
@@ -440,6 +440,6 @@ private static void ConvertUInt64()
// Converted the UInt64 value '121' to the UInt16 value 121.
// Converted the UInt64 value '340' to the UInt16 value 340.
// The UInt64 value 18446744073709551615 is outside the range of the UInt16 type.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_2.cs
index c1b6c861d17..48ea9d7f5c0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_2.cs
@@ -5,7 +5,7 @@ public class Example
{
public static void Main()
{
- string[] hexStrings = { "8000", "0FFF", "f000", "00A30", "D", "-13",
+ string[] hexStrings = { "8000", "0FFF", "f000", "00A30", "D", "-13",
"9AC61", "GAD" };
foreach (string hexString in hexStrings)
{
@@ -14,7 +14,7 @@ public static void Main()
Console.WriteLine("Converted '{0}' to {1:N0}.", hexString, number);
}
catch (FormatException) {
- Console.WriteLine("'{0}' is not in the correct format for a hexadecimal number.",
+ Console.WriteLine("'{0}' is not in the correct format for a hexadecimal number.",
hexString);
}
catch (OverflowException) {
@@ -23,7 +23,7 @@ public static void Main()
catch (ArgumentException) {
Console.WriteLine("'{0}' is invalid in base 16.", hexString);
}
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_3.cs
index 5a7db2a19ed..4964bb77a97 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_3.cs
@@ -9,15 +9,15 @@ public struct HexString : IConvertible
{
private SignBit signBit;
private string hexString;
-
+
public SignBit Sign
- {
+ {
set { signBit = value; }
get { return signBit; }
}
public string Value
- {
+ {
set {
if (value.Trim().Length > 4)
throw new ArgumentException("The string representation of a 160bit integer cannot have more than four characters.");
@@ -28,17 +28,17 @@ public string Value
}
get { return hexString; }
}
-
+
// IConvertible implementations.
public TypeCode GetTypeCode() {
return TypeCode.Object;
}
-
+
public bool ToBoolean(IFormatProvider provider)
{
return signBit != SignBit.Zero;
- }
-
+ }
+
public byte ToByte(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -51,45 +51,45 @@ public byte ToByte(IFormatProvider provider)
throw new OverflowException(String.Format("{0} is out of range of the UInt16 type.", Convert.ToUInt16(hexString, 16)), e);
}
}
-
+
public char ToChar(IFormatProvider provider)
{
- if (signBit == SignBit.Negative) {
+ if (signBit == SignBit.Negative) {
throw new OverflowException(String.Format("{0} is out of range of the Char type.", Convert.ToInt16(hexString, 16)));
}
-
+
UInt16 codePoint = UInt16.Parse(this.hexString, NumberStyles.HexNumber);
return Convert.ToChar(codePoint);
- }
-
+ }
+
public DateTime ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException("Hexadecimal to DateTime conversion is not supported.");
}
-
+
public decimal ToDecimal(IFormatProvider provider)
{
- if (signBit == SignBit.Negative)
+ if (signBit == SignBit.Negative)
{
short hexValue = Int16.Parse(hexString, NumberStyles.HexNumber);
return Convert.ToDecimal(hexValue);
}
- else
+ else
{
ushort hexValue = UInt16.Parse(hexString, NumberStyles.HexNumber);
return Convert.ToDecimal(hexValue);
}
}
-
+
public double ToDouble(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToDouble(Int16.Parse(hexString, NumberStyles.HexNumber));
else
return Convert.ToDouble(UInt16.Parse(hexString, NumberStyles.HexNumber));
- }
-
- public short ToInt16(IFormatProvider provider)
+ }
+
+ public short ToInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Int16.Parse(hexString, NumberStyles.HexNumber);
@@ -98,19 +98,19 @@ public short ToInt16(IFormatProvider provider)
return Convert.ToInt16(UInt16.Parse(hexString, NumberStyles.HexNumber));
}
catch (OverflowException e) {
- throw new OverflowException(String.Format("{0} is out of range of the Int16 type.",
+ throw new OverflowException(String.Format("{0} is out of range of the Int16 type.",
Convert.ToUInt16(hexString, 16)), e);
}
}
-
- public int ToInt32(IFormatProvider provider)
+
+ public int ToInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToInt32(Int16.Parse(hexString, NumberStyles.HexNumber));
else
return Convert.ToInt32(UInt16.Parse(hexString, NumberStyles.HexNumber));
}
-
+
public long ToInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -118,7 +118,7 @@ public long ToInt64(IFormatProvider provider)
else
return Int64.Parse(hexString, NumberStyles.HexNumber);
}
-
+
public sbyte ToSByte(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -126,17 +126,17 @@ public sbyte ToSByte(IFormatProvider provider)
return Convert.ToSByte(Int16.Parse(hexString, NumberStyles.HexNumber));
}
catch (OverflowException e) {
- throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
Int16.Parse(hexString, NumberStyles.HexNumber), e));
}
else
try {
return Convert.ToSByte(UInt16.Parse(hexString, NumberStyles.HexNumber));
- }
+ }
catch (OverflowException e) {
- throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
UInt16.Parse(hexString, NumberStyles.HexNumber)), e);
- }
+ }
}
public float ToSingle(IFormatProvider provider)
@@ -151,12 +151,12 @@ public string ToString(IFormatProvider provider)
{
return "0x" + this.hexString;
}
-
+
public object ToType(Type conversionType, IFormatProvider provider)
{
switch (Type.GetTypeCode(conversionType))
{
- case TypeCode.Boolean:
+ case TypeCode.Boolean:
return this.ToBoolean(null);
case TypeCode.Byte:
return this.ToByte(null);
@@ -190,16 +190,16 @@ public object ToType(Type conversionType, IFormatProvider provider)
case TypeCode.UInt32:
return this.ToUInt32(null);
case TypeCode.UInt64:
- return this.ToUInt64(null);
+ return this.ToUInt64(null);
default:
- throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
+ throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
}
}
-
- public UInt16 ToUInt16(IFormatProvider provider)
+
+ public UInt16 ToUInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt16 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt16 type.",
Int16.Parse(hexString, NumberStyles.HexNumber)));
else
return UInt16.Parse(hexString, NumberStyles.HexNumber);
@@ -208,16 +208,16 @@ public UInt16 ToUInt16(IFormatProvider provider)
public UInt32 ToUInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
Int16.Parse(hexString, NumberStyles.HexNumber)));
else
return Convert.ToUInt32(hexString, 16);
}
-
- public UInt64 ToUInt64(IFormatProvider provider)
+
+ public UInt64 ToUInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
Int64.Parse(hexString, NumberStyles.HexNumber)));
else
return Convert.ToUInt64(hexString, 16);
@@ -232,20 +232,20 @@ public static void Main()
{
ushort positiveValue = 32000;
short negativeValue = -1;
-
+
HexString positiveString = new HexString();
positiveString.Sign = (SignBit) Math.Sign(positiveValue);
positiveString.Value = positiveValue.ToString("X2");
-
+
HexString negativeString = new HexString();
negativeString.Sign = (SignBit) Math.Sign(negativeValue);
negativeString.Value = negativeValue.ToString("X2");
-
+
try {
Console.WriteLine("0x{0} converts to {1}.", positiveString.Value, Convert.ToUInt16(positiveString));
}
catch (OverflowException) {
- Console.WriteLine("{0} is outside the range of the UInt16 type.",
+ Console.WriteLine("{0} is outside the range of the UInt16 type.",
Int16.Parse(negativeString.Value, NumberStyles.HexNumber));
}
@@ -253,9 +253,9 @@ public static void Main()
Console.WriteLine("0x{0} converts to {1}.", negativeString.Value, Convert.ToUInt16(negativeString));
}
catch (OverflowException) {
- Console.WriteLine("{0} is outside the range of the UInt16 type.",
+ Console.WriteLine("{0} is outside the range of the UInt16 type.",
Int16.Parse(negativeString.Value, NumberStyles.HexNumber));
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_4.cs
index e39f37f71a5..e0933d1fb49 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint16/cs/touint16_4.cs
@@ -13,8 +13,8 @@ public static void Main()
provider.NegativeSign = "neg ";
// Define an array of strings to convert to UInt16 values.
- string[] values= { "34567", "+34567", "pos 34567", "34567.",
- "34567.", "65535", "65535", "65535" };
+ string[] values= { "34567", "+34567", "pos 34567", "34567.",
+ "34567.", "65535", "65535", "65535" };
foreach (string value in values)
{
@@ -22,9 +22,9 @@ public static void Main()
try {
Console.WriteLine("{0,17}", Convert.ToUInt16(value, provider));
}
- catch (FormatException e) {
+ catch (FormatException e) {
Console.WriteLine("{0,17}", e.GetType().Name);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_1.cs
index 0de34a49a06..f6d435ac054 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_1.cs
@@ -26,7 +26,7 @@ public static void Main()
Console.WriteLine("-----");
ConvertSingle();
Console.WriteLine("----");
- ConvertString();
+ ConvertString();
Console.WriteLine("-----");
ConvertUInt16();
Console.WriteLine("-----");
@@ -38,7 +38,7 @@ private static void ConvertBoolean()
//
bool falseFlag = false;
bool trueFlag = true;
-
+
Console.WriteLine("{0} converts to {1}.", falseFlag,
Convert.ToUInt32(falseFlag));
Console.WriteLine("{0} converts to {1}.", trueFlag,
@@ -48,13 +48,13 @@ private static void ConvertBoolean()
// True converts to 1.
//
}
-
+
private static void ConvertByte()
{
//
byte[] bytes = { Byte.MinValue, 14, 122, Byte.MaxValue};
uint result;
-
+
foreach (byte byteValue in bytes)
{
result = Convert.ToUInt32(byteValue);
@@ -68,22 +68,22 @@ private static void ConvertByte()
// Converted the Byte value 122 to the UInt32 value 122.
// Converted the Byte value 255 to the UInt32 value 255.
//
- }
-
+ }
+
private static void ConvertChar()
{
//
char[] chars = { 'a', 'z', '\u0007', '\u03FF',
'\u7FFF', '\uFFFE' };
uint result;
-
+
foreach (char ch in chars)
{
result = Convert.ToUInt32(ch);
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
ch.GetType().Name, ch,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the Char value 'a' to the UInt32 value 97.
// Converted the Char value 'z' to the UInt32 value 122.
@@ -93,14 +93,14 @@ private static void ConvertChar()
// Converted the Char value '?' to the UInt32 value 65534.
//
}
-
+
private static void ConvertDecimal()
{
//
decimal[] values= { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
199.55m, 9214.16m, Decimal.MaxValue };
uint result;
-
+
foreach (decimal value in values)
{
try {
@@ -112,8 +112,8 @@ private static void ConvertDecimal()
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt32 type.",
value.GetType().Name, value);
- }
- }
+ }
+ }
// The example displays the following output:
// The Decimal value -79228162514264337593543950335 is outside the range of the UInt32 type.
// The Decimal value -1034.23 is outside the range of the UInt32 type.
@@ -125,14 +125,14 @@ private static void ConvertDecimal()
// The Decimal value 79228162514264337593543950335 is outside the range of the UInt32 type.
//
}
-
+
private static void ConvertDouble()
- {
+ {
//
double[] values= { Double.MinValue, -1.38e10, -1023.299, -12.98,
0, 9.113e-16, 103.919, 17834.191, Double.MaxValue };
uint result;
-
+
foreach (double value in values)
{
try {
@@ -144,8 +144,8 @@ private static void ConvertDouble()
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt32 type.",
value.GetType().Name, value);
- }
- }
+ }
+ }
// The example displays the following output:
// The Double value -1.79769313486232E+308 is outside the range of the UInt32 type.
// The Double value -13800000000 is outside the range of the UInt32 type.
@@ -158,13 +158,13 @@ private static void ConvertDouble()
// The Double value 1.79769313486232E+308 is outside the range of the UInt32 type.
//
}
-
+
private static void ConvertInt16()
{
//
short[] numbers= { Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue };
uint result;
-
+
foreach (short number in numbers)
{
try {
@@ -187,7 +187,7 @@ private static void ConvertInt16()
// Converted the Int16 value 32767 to the UInt32 value 32767.
//
}
-
+
private static void ConvertInt32()
{
//
@@ -215,7 +215,7 @@ private static void ConvertInt32()
// Converted the Int32 value 2147483647 to the UInt32 value 2147483647.
//
}
-
+
private static void ConvertInt64()
{
//
@@ -241,9 +241,9 @@ private static void ConvertInt64()
// Converted the Int64 value 121 to the UInt32 value 121.
// Converted the Int64 value 340 to the UInt32 value 340.
// The Int64 value 9223372036854775807 is outside the range of the UInt32 type.
- //
- }
-
+ //
+ }
+
private static void ConvertObject()
{
//
@@ -251,7 +251,7 @@ private static void ConvertObject()
"104", "103.0", "-1",
"1.00e2", "One", 1.00e2, 16.3e42};
uint result;
-
+
foreach (object value in values)
{
try {
@@ -263,7 +263,7 @@ private static void ConvertObject()
catch (OverflowException) {
Console.WriteLine("The {0} value '{1}' is outside the range of the UInt32 type.",
value.GetType().Name, value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not in a recognizable format.",
value.GetType().Name, value);
@@ -272,7 +272,7 @@ private static void ConvertObject()
Console.WriteLine("No conversion to a UInt32 exists for the {0} value '{1}'.",
value.GetType().Name, value);
}
- }
+ }
// The example displays the following output:
// Converted the Boolean value True to the UInt32 value 1.
// The Int32 value '-12' is outside the range of the UInt32 type.
@@ -289,13 +289,13 @@ private static void ConvertObject()
// The Double value '1.63E+43' is outside the range of the UInt32 type.
//
}
-
+
private static void ConvertSByte()
{
//
sbyte[] numbers = { SByte.MinValue, -1, 0, 10, SByte.MaxValue };
uint result;
-
+
foreach (sbyte number in numbers)
{
try {
@@ -307,7 +307,7 @@ private static void ConvertSByte()
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt32 type.",
number.GetType().Name, number);
- }
+ }
}
// The example displays the following output:
// The SByte value -128 is outside the range of the UInt32 type.
@@ -317,27 +317,27 @@ private static void ConvertSByte()
// Converted the SByte value 127 to the UInt32 value 127.
//
}
-
+
private static void ConvertSingle()
{
//
float[] values= { Single.MinValue, -1.38e10f, -1023.299f, -12.98f,
0f, 9.113e-16f, 103.919f, 17834.191f, Single.MaxValue };
uint result;
-
+
foreach (float value in values)
{
try {
result = Convert.ToUInt32(value);
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
- value.GetType().Name, value,
+ value.GetType().Name, value,
result.GetType().Name, result);
}
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt32 type.",
value.GetType().Name, value);
- }
- }
+ }
+ }
// The example displays the following output:
// The Single value -3.402823E+38 is outside the range of the UInt32 type.
// The Single value -1.38E+10 is outside the range of the UInt32 type.
@@ -357,24 +357,24 @@ private static void ConvertString()
string[] values = { "One", "1.34e28", "-26.87", "-18", "-6.00",
" 0", "137", "1601.9", Int32.MaxValue.ToString() };
uint result;
-
+
foreach (string value in values)
{
try {
result = Convert.ToUInt32(value);
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
- value.GetType().Name, value,
+ value.GetType().Name, value,
result.GetType().Name, result);
}
catch (OverflowException) {
Console.WriteLine("The {0} value '{1}' is outside the range of the UInt32 type.",
value.GetType().Name, value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value '{1}' is not in a recognizable format.",
value.GetType().Name, value);
- }
- }
+ }
+ }
// The example displays the following output:
// The String value 'One' is not in a recognizable format.
// The String value '1.34e28' is not in a recognizable format.
@@ -389,7 +389,7 @@ private static void ConvertString()
}
private static void ConvertUInt16()
- {
+ {
//
ushort[] numbers = { UInt16.MinValue, 121, 340, UInt16.MaxValue };
uint result;
@@ -407,7 +407,7 @@ private static void ConvertUInt16()
// Converted the UInt16 value 65535 to the UInt32 value 65535.
//
}
-
+
private static void ConvertUInt64()
{
//
@@ -431,6 +431,6 @@ private static void ConvertUInt64()
// Converted the UInt64 value 121 to the UInt32 value 121.
// Converted the UInt64 value 340 to the UInt32 value 340.
// The UInt64 value 18446744073709551615 is outside the range of the UInt32 type.
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_2.cs
index 9dc3724feb3..72bc59b13e8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_2.cs
@@ -8,13 +8,13 @@ public static void Main()
{
// Create a NumberFormatInfo object and set several of its
// properties that apply to numbers.
- NumberFormatInfo provider = new NumberFormatInfo();
+ NumberFormatInfo provider = new NumberFormatInfo();
provider.PositiveSign = "pos ";
provider.NegativeSign = "neg ";
// Define an array of numeric strings.
- string[] values = { "123456789", "+123456789", "pos 123456789",
- "123456789.", "123,456,789", "4294967295",
+ string[] values = { "123456789", "+123456789", "pos 123456789",
+ "123456789.", "123,456,789", "4294967295",
"4294967296", "-1", "neg 1" };
foreach (string value in values)
@@ -22,13 +22,13 @@ public static void Main()
Console.Write("{0,-20} -->", value);
try {
Console.WriteLine("{0,20}", Convert.ToUInt32(value, provider));
- }
+ }
catch (FormatException) {
Console.WriteLine("{0,20}", "Bad Format");
}
catch (OverflowException) {
Console.WriteLine("{0,20}", "Numeric Overflow");
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_3.cs
index f80d72d1380..c7c75c05f0e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_3.cs
@@ -5,9 +5,9 @@ public class Example
{
public static void Main()
{
- string[] hexStrings = { "80000000", "0FFFFFFF", "F0000000", "00A3000", "D",
+ string[] hexStrings = { "80000000", "0FFFFFFF", "F0000000", "00A3000", "D",
"-13", "9AC61", "GAD", "FFFFFFFFFF" };
-
+
foreach (string hexString in hexStrings)
{
Console.Write("{0,-12} --> ", hexString);
@@ -17,15 +17,15 @@ public static void Main()
}
catch (FormatException) {
Console.WriteLine("{0,18}", "Bad Format");
- }
+ }
catch (OverflowException)
{
Console.WriteLine("{0,18}", "Numeric Overflow");
- }
+ }
catch (ArgumentException) {
Console.WriteLine("{0,18}", "Invalid in Base 16");
}
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_4.cs
index 9b02cfc565d..47a75c8ad62 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint32/cs/touint32_4.cs
@@ -9,69 +9,69 @@ public struct HexString : IConvertible
{
private SignBit signBit;
private string hexString;
-
+
public SignBit Sign
{
set { signBit = value; }
- get { return signBit; }
+ get { return signBit; }
}
-
+
public string Value
{
set {
if (value.Trim().Length > 8)
throw new ArgumentException("The string representation of a 32-bit integer cannot have more than 8 characters.");
else if (! Regex.IsMatch(value, "([0-9,A-F]){1,8}", RegexOptions.IgnoreCase))
- throw new ArgumentException("The hexadecimal representation of a 32-bit integer contains invalid characters.");
+ throw new ArgumentException("The hexadecimal representation of a 32-bit integer contains invalid characters.");
else
hexString = value;
}
get { return hexString; }
}
-
+
// IConvertible implementations.
public TypeCode GetTypeCode()
{
return TypeCode.Object;
}
-
+
public bool ToBoolean(IFormatProvider provider)
{
return signBit != SignBit.Zero;
- }
-
+ }
+
public byte ToByte(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is out of range of the Byte type.", Convert.ToInt32(hexString, 16)));
+ throw new OverflowException(String.Format("{0} is out of range of the Byte type.", Convert.ToInt32(hexString, 16)));
else
try {
return Byte.Parse(hexString, NumberStyles.HexNumber);
}
catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the Byte type.", Convert.ToUInt32(hexString, 16)), e);
- }
+ }
}
-
+
public char ToChar(IFormatProvider provider)
{
- if (signBit == SignBit.Negative)
+ if (signBit == SignBit.Negative)
throw new OverflowException(String.Format("{0} is out of range of the Char type.", Convert.ToInt32(hexString, 16)));
-
+
try {
ushort codePoint = UInt16.Parse(this.hexString, NumberStyles.HexNumber);
return Convert.ToChar(codePoint);
}
catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the Char type.", Convert.ToUInt32(hexString, 16)), e);
- }
- }
-
+ }
+ }
+
public DateTime ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException("Hexadecimal to DateTime conversion is not supported.");
}
-
+
public decimal ToDecimal(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -85,15 +85,15 @@ public decimal ToDecimal(IFormatProvider provider)
return Convert.ToDecimal(hexValue);
}
}
-
+
public double ToDouble(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToDouble(Int32.Parse(hexString, NumberStyles.HexNumber));
else
return Convert.ToDouble(UInt32.Parse(hexString, NumberStyles.HexNumber));
- }
-
+ }
+
public short ToInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -111,7 +111,7 @@ public short ToInt16(IFormatProvider provider)
throw new OverflowException(String.Format("{0} is out of range of the Int16 type.", Convert.ToUInt32(hexString, 16)), e);
}
}
-
+
public int ToInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -122,25 +122,25 @@ public int ToInt32(IFormatProvider provider)
}
catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the Int32 type.", Convert.ToUInt32(hexString, 16)), e);
- }
+ }
}
-
- public long ToInt64(IFormatProvider provider)
+
+ public long ToInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToInt64(Int32.Parse(hexString, NumberStyles.HexNumber));
else
return Int64.Parse(hexString, NumberStyles.HexNumber);
}
-
- public sbyte ToSByte(IFormatProvider provider)
+
+ public sbyte ToSByte(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
try {
return Convert.ToSByte(Int32.Parse(hexString, NumberStyles.HexNumber));
}
catch (OverflowException e) {
- throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
Int32.Parse(hexString, NumberStyles.HexNumber), e));
}
else
@@ -148,9 +148,9 @@ public sbyte ToSByte(IFormatProvider provider)
return Convert.ToSByte(UInt32.Parse(hexString, NumberStyles.HexNumber));
}
catch (OverflowException e) {
- throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
UInt32.Parse(hexString, NumberStyles.HexNumber)), e);
- }
+ }
}
public float ToSingle(IFormatProvider provider)
@@ -165,12 +165,12 @@ public string ToString(IFormatProvider provider)
{
return "0x" + this.hexString;
}
-
+
public object ToType(Type conversionType, IFormatProvider provider)
{
switch (Type.GetTypeCode(conversionType))
{
- case TypeCode.Boolean:
+ case TypeCode.Boolean:
return this.ToBoolean(null);
case TypeCode.Byte:
return this.ToByte(null);
@@ -204,13 +204,13 @@ public object ToType(Type conversionType, IFormatProvider provider)
case TypeCode.UInt32:
return this.ToUInt32(null);
case TypeCode.UInt64:
- return this.ToUInt64(null);
+ return this.ToUInt64(null);
default:
- throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
+ throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
}
}
-
- public ushort ToUInt16(IFormatProvider provider)
+
+ public ushort ToUInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
throw new OverflowException(String.Format("{0} is outside the range of the UInt16 type.",
@@ -218,25 +218,25 @@ public ushort ToUInt16(IFormatProvider provider)
else
try {
return Convert.ToUInt16(UInt32.Parse(hexString, NumberStyles.HexNumber));
- }
+ }
catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the UInt16 type.", Convert.ToUInt32(hexString, 16)), e);
- }
+ }
}
public uint ToUInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
Int32.Parse(hexString, NumberStyles.HexNumber)));
else
return Convert.ToUInt32(hexString, 16);
}
-
- public ulong ToUInt64(IFormatProvider provider)
+
+ public ulong ToUInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
Int32.Parse(hexString, NumberStyles.HexNumber)));
else
return Convert.ToUInt64(hexString, 16);
@@ -251,20 +251,20 @@ public static void Main()
{
uint positiveValue = 320000000;
int negativeValue = -1;
-
+
HexString positiveString = new HexString();
positiveString.Sign = (SignBit) Math.Sign(positiveValue);
positiveString.Value = positiveValue.ToString("X4");
-
+
HexString negativeString = new HexString();
negativeString.Sign = (SignBit) Math.Sign(negativeValue);
negativeString.Value = negativeValue.ToString("X4");
-
+
try {
Console.WriteLine("0x{0} converts to {1}.", positiveString.Value, Convert.ToUInt32(positiveString));
}
catch (OverflowException) {
- Console.WriteLine("{0} is outside the range of the UInt32 type.",
+ Console.WriteLine("{0} is outside the range of the UInt32 type.",
Int32.Parse(positiveString.Value, NumberStyles.HexNumber));
}
@@ -274,7 +274,7 @@ public static void Main()
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the UInt32 type.",
Int32.Parse(negativeString.Value, NumberStyles.HexNumber));
- }
+ }
}
}
// The example dosplays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_1.cs
index 02e664d7e33..abb31583c30 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_1.cs
@@ -26,7 +26,7 @@ public static void Main()
Console.WriteLine("-----");
ConvertSingle();
Console.WriteLine("----");
- ConvertString();
+ ConvertString();
Console.WriteLine("-----");
ConvertUInt16();
Console.WriteLine("-----");
@@ -38,7 +38,7 @@ private static void ConvertBoolean()
//
bool falseFlag = false;
bool trueFlag = true;
-
+
Console.WriteLine("{0} converts to {1}.", falseFlag,
Convert.ToUInt64(falseFlag));
Console.WriteLine("{0} converts to {1}.", trueFlag,
@@ -48,13 +48,13 @@ private static void ConvertBoolean()
// True converts to 1.
//
}
-
+
private static void ConvertByte()
{
//
byte[] bytes = { Byte.MinValue, 14, 122, Byte.MaxValue};
ulong result;
-
+
foreach (byte byteValue in bytes)
{
result = Convert.ToUInt64(byteValue);
@@ -68,22 +68,22 @@ private static void ConvertByte()
// Converted the Byte value 122 to the UInt64 value 122.
// Converted the Byte value 255 to the UInt64 value 255.
//
- }
-
+ }
+
private static void ConvertChar()
{
//
char[] chars = { 'a', 'z', '\u0007', '\u03FF',
'\u7FFF', '\uFFFE' };
ulong result;
-
+
foreach (char ch in chars)
{
result = Convert.ToUInt64(ch);
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
ch.GetType().Name, ch,
result.GetType().Name, result);
- }
+ }
// The example displays the following output:
// Converted the Char value 'a' to the UInt64 value 97.
// Converted the Char value 'z' to the UInt64 value 122.
@@ -93,14 +93,14 @@ private static void ConvertChar()
// Converted the Char value '?' to the UInt64 value 65534.
//
}
-
+
private static void ConvertDecimal()
{
//
decimal[] values= { Decimal.MinValue, -1034.23m, -12m, 0m, 147m,
199.55m, 9214.16m, Decimal.MaxValue };
ulong result;
-
+
foreach (decimal value in values)
{
try {
@@ -112,8 +112,8 @@ private static void ConvertDecimal()
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the UInt64 type.",
value);
- }
- }
+ }
+ }
// The example displays the following output:
// -79228162514264337593543950335 is outside the range of the UInt64 type.
// -1034.23 is outside the range of the UInt64 type.
@@ -125,14 +125,14 @@ private static void ConvertDecimal()
// 79228162514264337593543950335 is outside the range of the UInt64 type.
//
}
-
+
private static void ConvertDouble()
- {
+ {
//
double[] values= { Double.MinValue, -1.38e10, -1023.299, -12.98,
0, 9.113e-16, 103.919, 17834.191, Double.MaxValue };
ulong result;
-
+
foreach (double value in values)
{
try {
@@ -143,8 +143,8 @@ private static void ConvertDouble()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the UInt64 type.", value);
- }
- }
+ }
+ }
// The example displays the following output:
// -1.79769313486232E+308 is outside the range of the UInt64 type.
// -13800000000 is outside the range of the UInt64 type.
@@ -157,13 +157,13 @@ private static void ConvertDouble()
// 1.79769313486232E+308 is outside the range of the UInt64 type.
//
}
-
+
private static void ConvertInt16()
{
//
short[] numbers= { Int16.MinValue, -1, 0, 121, 340, Int16.MaxValue };
ulong result;
-
+
foreach (short number in numbers)
{
try {
@@ -174,7 +174,7 @@ private static void ConvertInt16()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the UInt64 type.", number);
- }
+ }
}
// The example displays the following output:
// -32768 is outside the range of the UInt64 type.
@@ -185,7 +185,7 @@ private static void ConvertInt16()
// Converted the Int16 value 32767 to a UInt64 value 32767.
//
}
-
+
private static void ConvertInt32()
{
//
@@ -199,11 +199,11 @@ private static void ConvertInt32()
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
number.GetType().Name, number,
result.GetType().Name, result);
- }
+ }
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt64 type.",
number.GetType().Name, number);
- }
+ }
}
// The example displays the following output:
// The Int32 value -2147483648 is outside the range of the UInt64 type.
@@ -212,9 +212,9 @@ private static void ConvertInt32()
// Converted the Int32 value 121 to the UInt64 value 121.
// Converted the Int32 value 340 to the UInt64 value 340.
// Converted the Int32 value 2147483647 to the UInt64 value 2147483647.
- //
- }
-
+ //
+ }
+
private static void ConvertInt64()
{
//
@@ -241,9 +241,9 @@ private static void ConvertInt64()
// Converted the Int64 value 121 to the UInt64 value 121.
// Converted the Int64 value 340 to the UInt64 value 340.
// Converted the Int64 value 9223372036854775807 to a UInt64 value 9223372036854775807.
- //
+ //
}
-
+
private static void ConvertObject()
{
//
@@ -251,7 +251,7 @@ private static void ConvertObject()
"104", "103.0", "-1",
"1.00e2", "One", 1.00e2, 16.3e42};
ulong result;
-
+
foreach (object value in values)
{
try {
@@ -263,7 +263,7 @@ private static void ConvertObject()
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt64 type.",
value.GetType().Name, value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value {1} is not in a recognizable format.",
value.GetType().Name, value);
@@ -272,7 +272,7 @@ private static void ConvertObject()
Console.WriteLine("No conversion to a UInt64 exists for the {0} value {1}.",
value.GetType().Name, value);
}
- }
+ }
// The example displays the following output:
// Converted the Boolean value True to the UInt64 value 1.
// The Int32 value -12 is outside the range of the UInt64 type.
@@ -289,13 +289,13 @@ private static void ConvertObject()
// The Double value 1.63E+43 is outside the range of the UInt64 type.
//
}
-
+
private static void ConvertSByte()
{
//
sbyte[] numbers = { SByte.MinValue, -1, 0, 10, SByte.MaxValue };
ulong result;
-
+
foreach (sbyte number in numbers)
{
try {
@@ -307,7 +307,7 @@ private static void ConvertSByte()
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt64 type.",
number.GetType().Name, number);
- }
+ }
}
// The example displays the following output:
// The SByte value -128 is outside the range of the UInt64 type.
@@ -317,14 +317,14 @@ private static void ConvertSByte()
// Converted the SByte value 127 to the UInt64 value 127.
//
}
-
+
private static void ConvertSingle()
{
//
float[] values= { Single.MinValue, -1.38e10f, -1023.299f, -12.98f,
0f, 9.113e-16f, 103.919f, 17834.191f, Single.MaxValue };
ulong result;
-
+
foreach (float value in values)
{
try {
@@ -334,8 +334,8 @@ private static void ConvertSingle()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the UInt64 type.", value);
- }
- }
+ }
+ }
// The example displays the following output:
// -3.402823E+38 is outside the range of the UInt64 type.
// -1.38E+10 is outside the range of the UInt64 type.
@@ -355,7 +355,7 @@ private static void ConvertString()
string[] values = { "One", "1.34e28", "-26.87", "-18", "-6.00",
" 0", "137", "1601.9", Int32.MaxValue.ToString() };
ulong result;
-
+
foreach (string value in values)
{
try {
@@ -365,12 +365,12 @@ private static void ConvertString()
}
catch (OverflowException) {
Console.WriteLine("{0} is outside the range of the UInt64 type.", value);
- }
+ }
catch (FormatException) {
Console.WriteLine("The {0} value '{1}' is not in a recognizable format.",
value.GetType().Name, value);
- }
- }
+ }
+ }
// The example displays the following output:
// The String value 'One' is not in a recognizable format.
// The String value '1.34e28' is not in a recognizable format.
@@ -385,11 +385,11 @@ private static void ConvertString()
}
private static void ConvertUInt16()
- {
+ {
//
ushort[] numbers = { UInt16.MinValue, 121, 340, UInt16.MaxValue };
ulong result;
-
+
foreach (ushort number in numbers)
{
try {
@@ -410,13 +410,13 @@ private static void ConvertUInt16()
// Converted the UInt16 value 65535 to the UInt64 value 65535.
//
}
-
+
private static void ConvertUInt32()
{
//
uint[] numbers = { UInt32.MinValue, 121, 340, UInt32.MaxValue };
ulong result;
-
+
foreach (uint number in numbers)
{
try {
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_2.cs
index d98eb61955d..8d0fcb6bf2e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_2.cs
@@ -25,10 +25,10 @@ public static void Main()
}
catch (FormatException) {
Console.WriteLine("{0,20}", "Invalid Format");
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0,20}", "Numeric Overflow");
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_3.cs
index 258a7672ff7..395d3a64eb7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_3.cs
@@ -9,24 +9,24 @@ public static void Main()
"F000000000000000", "00A3000000000000",
"D", "-13", "9AC61", "GAD",
"FFFFFFFFFFFFFFFFF" };
-
+
foreach (string hexString in hexStrings)
{
Console.Write("{0,-18} --> ", hexString);
try {
ulong number = Convert.ToUInt64(hexString, 16);
Console.WriteLine("{0,26:N0}", number);
- }
+ }
catch (FormatException) {
Console.WriteLine("{0,26}", "Bad Format");
- }
+ }
catch (OverflowException) {
Console.WriteLine("{0,26}", "Numeric Overflow");
- }
+ }
catch (ArgumentException) {
Console.WriteLine("{0,26}", "Invalid in Base 16");
}
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_4.cs
index b617c268ce9..2b0d814e9c3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.convert.touint64/cs/touint64_4.cs
@@ -9,99 +9,99 @@ public struct HexString : IConvertible
{
private SignBit signBit;
private string hexString;
-
+
public SignBit Sign
{
set { signBit = value; }
get { return signBit; }
}
-
+
public string Value
{
- set
- {
+ set
+ {
if (value.Trim().Length > 16)
throw new ArgumentException("The hexadecimal representation of a 64-bit integer cannot have more than 16 characters.");
else if (! Regex.IsMatch(value, "([0-9,A-F]){1,8}", RegexOptions.IgnoreCase))
- throw new ArgumentException("The hexadecimal representation of a 64-bit integer contains invalid characters.");
+ throw new ArgumentException("The hexadecimal representation of a 64-bit integer contains invalid characters.");
else
hexString = value;
- }
+ }
get { return hexString; }
}
-
+
// IConvertible implementations.
- public TypeCode GetTypeCode()
+ public TypeCode GetTypeCode()
{
return TypeCode.Object;
}
-
+
public bool ToBoolean(IFormatProvider provider)
{
return signBit != SignBit.Zero;
- }
-
+ }
+
public byte ToByte(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is out of range of the Byte type.", Convert.ToInt64(hexString, 16)));
+ throw new OverflowException(String.Format("{0} is out of range of the Byte type.", Convert.ToInt64(hexString, 16)));
else
try {
return Byte.Parse(hexString, NumberStyles.HexNumber);
- }
+ }
catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the Byte type.", Convert.ToUInt64(hexString, 16)), e);
- }
+ }
}
-
+
public char ToChar(IFormatProvider provider)
{
- if (signBit == SignBit.Negative)
+ if (signBit == SignBit.Negative)
throw new OverflowException(String.Format("{0} is out of range of the Char type.", Convert.ToInt64(hexString, 16)));
-
+
try {
ushort codePoint = UInt16.Parse(this.hexString, NumberStyles.HexNumber);
return Convert.ToChar(codePoint);
- }
+ }
catch (OverflowException) {
throw new OverflowException(String.Format("{0} is out of range of the Char type.", Convert.ToUInt64(hexString, 16)));
- }
- }
-
+ }
+ }
+
public DateTime ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException("Hexadecimal to DateTime conversion is not supported.");
}
-
+
public decimal ToDecimal(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
{
long hexValue = Int64.Parse(hexString, NumberStyles.HexNumber);
return Convert.ToDecimal(hexValue);
- }
+ }
else
{
ulong hexValue = UInt64.Parse(hexString, NumberStyles.HexNumber);
return Convert.ToDecimal(hexValue);
}
}
-
- public double ToDouble(IFormatProvider provider)
+
+ public double ToDouble(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToDouble(Int64.Parse(hexString, NumberStyles.HexNumber));
else
return Convert.ToDouble(UInt64.Parse(hexString, NumberStyles.HexNumber));
- }
-
- public short ToInt16(IFormatProvider provider)
+ }
+
+ public short ToInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
try {
return Convert.ToInt16(Int64.Parse(hexString, NumberStyles.HexNumber));
- }
- catch (OverflowException e) {
+ }
+ catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the Int16 type.", Convert.ToInt64(hexString, 16)), e);
}
else
@@ -112,7 +112,7 @@ public short ToInt16(IFormatProvider provider)
throw new OverflowException(String.Format("{0} is out of range of the Int16 type.", Convert.ToUInt64(hexString, 16)), e);
}
}
-
+
public int ToInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
@@ -121,50 +121,50 @@ public int ToInt32(IFormatProvider provider)
}
catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the Int32 type.", Convert.ToUInt64(hexString, 16)), e);
- }
+ }
else
try {
return Convert.ToInt32(UInt64.Parse(hexString, NumberStyles.HexNumber));
- }
+ }
catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the Int32 type.", Convert.ToUInt64(hexString, 16)), e);
- }
+ }
}
-
- public long ToInt64(IFormatProvider provider)
+
+ public long ToInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Int64.Parse(hexString, NumberStyles.HexNumber);
else
try {
return Convert.ToInt64(UInt64.Parse(hexString, NumberStyles.HexNumber));
- }
+ }
catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the Int64 type.", Convert.ToUInt64(hexString, 16)), e);
}
}
-
- public sbyte ToSByte(IFormatProvider provider)
+
+ public sbyte ToSByte(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
try {
return Convert.ToSByte(Int64.Parse(hexString, NumberStyles.HexNumber));
- }
+ }
catch (OverflowException e) {
- throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
Int64.Parse(hexString, NumberStyles.HexNumber), e));
}
else
try {
return Convert.ToSByte(UInt64.Parse(hexString, NumberStyles.HexNumber));
- }
+ }
catch (OverflowException e) {
- throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the SByte type.",
UInt64.Parse(hexString, NumberStyles.HexNumber)), e);
- }
+ }
}
- public float ToSingle(IFormatProvider provider)
+ public float ToSingle(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
return Convert.ToSingle(Int64.Parse(hexString, NumberStyles.HexNumber));
@@ -176,12 +176,12 @@ public string ToString(IFormatProvider provider)
{
return "0x" + this.hexString;
}
-
+
public object ToType(Type conversionType, IFormatProvider provider)
{
switch (Type.GetTypeCode(conversionType))
{
- case TypeCode.Boolean:
+ case TypeCode.Boolean:
return this.ToBoolean(null);
case TypeCode.Byte:
return this.ToByte(null);
@@ -215,16 +215,16 @@ public object ToType(Type conversionType, IFormatProvider provider)
case TypeCode.UInt32:
return this.ToUInt32(null);
case TypeCode.UInt64:
- return this.ToUInt64(null);
+ return this.ToUInt64(null);
default:
- throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
+ throw new InvalidCastException(String.Format("Conversion to {0} is not supported.", conversionType.Name));
}
}
-
- public ushort ToUInt16(IFormatProvider provider)
+
+ public ushort ToUInt16(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt16 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt16 type.",
Int64.Parse(hexString, NumberStyles.HexNumber)));
else
try {
@@ -232,28 +232,28 @@ public ushort ToUInt16(IFormatProvider provider)
}
catch (OverflowException e) {
throw new OverflowException(String.Format("{0} is out of range of the UInt16 type.", Convert.ToUInt64(hexString, 16)), e);
- }
+ }
}
- public uint ToUInt32(IFormatProvider provider)
+ public uint ToUInt32(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
Int64.Parse(hexString, NumberStyles.HexNumber)));
else
try {
return Convert.ToUInt32(UInt64.Parse(hexString, NumberStyles.HexNumber));
}
catch (OverflowException) {
- throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt32 type.",
UInt64.Parse(hexString, NumberStyles.HexNumber)));
- }
+ }
}
-
- public ulong ToUInt64(IFormatProvider provider)
+
+ public ulong ToUInt64(IFormatProvider provider)
{
if (signBit == SignBit.Negative)
- throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
+ throw new OverflowException(String.Format("{0} is outside the range of the UInt64 type.",
Int64.Parse(hexString, NumberStyles.HexNumber)));
else
return Convert.ToUInt64(hexString, 16);
@@ -272,26 +272,26 @@ public static void Main()
HexString positiveString = new HexString();
positiveString.Sign = (SignBit) Math.Sign((decimal)positiveValue);
positiveString.Value = positiveValue.ToString("X");
-
+
HexString negativeString = new HexString();
negativeString.Sign = (SignBit) Math.Sign(negativeValue);
negativeString.Value = negativeValue.ToString("X");
-
+
try {
Console.WriteLine("0x{0} converts to {1}.", positiveString.Value, Convert.ToUInt64(positiveString));
}
catch (OverflowException) {
- Console.WriteLine("{0} is outside the range of the UInt64 type.",
+ Console.WriteLine("{0} is outside the range of the UInt64 type.",
Int64.Parse(positiveString.Value, NumberStyles.HexNumber));
- }
+ }
try {
Console.WriteLine("0x{0} converts to {1}.", negativeString.Value, Convert.ToUInt64(negativeString));
- }
+ }
catch (OverflowException) {
- Console.WriteLine("{0} is outside the range of the UInt64 type.",
+ Console.WriteLine("{0} is outside the range of the UInt64 type.",
Int64.Parse(negativeString.Value, NumberStyles.HexNumber));
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addmilliseconds/cs/addmilliseconds2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addmilliseconds/cs/addmilliseconds2.cs
index 0681e469d67..8ab94a9cfff 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addmilliseconds/cs/addmilliseconds2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addmilliseconds/cs/addmilliseconds2.cs
@@ -5,30 +5,30 @@ public class Example
public static void Main()
{
//
- string dateFormat = "MM/dd/yyyy hh:mm:ss.fffffff";
+ string dateFormat = "MM/dd/yyyy hh:mm:ss.fffffff";
DateTime date1 = new DateTime(2010, 9, 8, 16, 0, 0);
Console.WriteLine("Original date: {0} ({1:N0} ticks)\n",
date1.ToString(dateFormat), date1.Ticks);
-
+
DateTime date2 = date1.AddMilliseconds(1);
Console.WriteLine("Second date: {0} ({1:N0} ticks)",
date2.ToString(dateFormat), date2.Ticks);
Console.WriteLine("Difference between dates: {0} ({1:N0} ticks)\n",
- date2 - date1, date2.Ticks - date1.Ticks);
-
+ date2 - date1, date2.Ticks - date1.Ticks);
+
DateTime date3 = date1.AddMilliseconds(1.5);
Console.WriteLine("Third date: {0} ({1:N0} ticks)",
date3.ToString(dateFormat), date3.Ticks);
Console.WriteLine("Difference between dates: {0} ({1:N0} ticks)",
- date3 - date1, date3.Ticks - date1.Ticks);
+ date3 - date1, date3.Ticks - date1.Ticks);
// The example displays the following output:
// Original date: 09/08/2010 04:00:00.0000000 (634,195,584,000,000,000 ticks)
- //
+ //
// Second date: 09/08/2010 04:00:00.0010000 (634,195,584,000,010,000 ticks)
// Difference between dates: 00:00:00.0010000 (10,000 ticks)
- //
+ //
// Third date: 09/08/2010 04:00:00.0020000 (634,195,584,000,020,000 ticks)
- // Difference between dates: 00:00:00.0020000 (20,000 ticks)
+ // Difference between dates: 00:00:00.0020000 (20,000 ticks)
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addminutes/cs/addminutes1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addminutes/cs/addminutes1.cs
index 6caa5e26a30..5a1e78db2cf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addminutes/cs/addminutes1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addminutes/cs/addminutes1.cs
@@ -6,13 +6,13 @@ public class Example
public static void Main()
{
DateTime dateValue = new DateTime(2013, 9, 15, 12, 0, 0);
-
- double[] minutes = { .01667, .08333, .16667, .25, .33333,
- .5, .66667, 1, 2, 15, 30, 17, 45,
+
+ double[] minutes = { .01667, .08333, .16667, .25, .33333,
+ .5, .66667, 1, 2, 15, 30, 17, 45,
60, 180, 60 * 24 };
-
+
foreach (double minute in minutes)
- Console.WriteLine("{0} + {1} minute(s) = {2}", dateValue, minute,
+ Console.WriteLine("{0} + {1} minute(s) = {2}", dateValue, minute,
dateValue.AddMinutes(minute));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addseconds/cs/addseconds1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addseconds/cs/addseconds1.cs
index f68613560c4..fc41f3bc6fc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addseconds/cs/addseconds1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addseconds/cs/addseconds1.cs
@@ -9,19 +9,19 @@ public static void Main()
DateTime date1 = new DateTime(2014, 9, 8, 16, 0, 0);
Console.WriteLine("Original date: {0} ({1:N0} ticks)\n",
date1.ToString(dateFormat), date1.Ticks);
-
+
DateTime date2 = date1.AddSeconds(30);
Console.WriteLine("Second date: {0} ({1:N0} ticks)",
date2.ToString(dateFormat), date2.Ticks);
Console.WriteLine("Difference between dates: {0} ({1:N0} ticks)\n",
- date2 - date1, date2.Ticks - date1.Ticks);
-
+ date2 - date1, date2.Ticks - date1.Ticks);
+
// Add 1 day's worth of seconds (60 secs. * 60 mins * 24 hrs.
DateTime date3 = date1.AddSeconds(60 * 60 * 24);
Console.WriteLine("Third date: {0} ({1:N0} ticks)",
date3.ToString(dateFormat), date3.Ticks);
Console.WriteLine("Difference between dates: {0} ({1:N0} ticks)",
- date3 - date1, date3.Ticks - date1.Ticks);
+ date3 - date1, date3.Ticks - date1.Ticks);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addyears/cs/addyears1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addyears/cs/addyears1.cs
index 5d072017098..1eba84b29c1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addyears/cs/addyears1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.addyears/cs/addyears1.cs
@@ -7,22 +7,22 @@ public static void Main()
{
DateTime baseDate = new DateTime(2000, 2, 29);
Console.WriteLine(" Base Date: {0:d}\n", baseDate);
-
+
// Show dates of previous fifteen years.
for (int ctr = -1; ctr >= -15; ctr--)
- Console.WriteLine("{0,2} year(s) ago: {1:d}",
+ Console.WriteLine("{0,2} year(s) ago: {1:d}",
Math.Abs(ctr), baseDate.AddYears(ctr));
Console.WriteLine();
// Show dates of next fifteen years.
for (int ctr = 1; ctr <= 15; ctr++)
- Console.WriteLine("{0,2} year(s) from now: {1:d}",
+ Console.WriteLine("{0,2} year(s) from now: {1:d}",
ctr, baseDate.AddYears(ctr));
}
}
// The example displays the following output:
// Base Date: 2/29/2000
-//
+//
// 1 year(s) ago: 2/28/1999
// 2 year(s) ago: 2/28/1998
// 3 year(s) ago: 2/28/1997
@@ -38,7 +38,7 @@ public static void Main()
// 13 year(s) ago: 2/28/1987
// 14 year(s) ago: 2/28/1986
// 15 year(s) ago: 2/28/1985
-//
+//
// 1 year(s) from now: 2/28/2001
// 2 year(s) from now: 2/28/2002
// 3 year(s) from now: 2/28/2003
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.compare/cs/compare1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.compare/cs/compare1.cs
index 41dccb3a62f..71207ff8885 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.compare/cs/compare1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.compare/cs/compare1.cs
@@ -9,11 +9,11 @@ public static void Main()
DateTime date2 = new DateTime(2009, 8, 1, 12, 0, 0);
int result = DateTime.Compare(date1, date2);
string relationship;
-
+
if (result < 0)
relationship = "is earlier than";
else if (result == 0)
- relationship = "is the same time as";
+ relationship = "is the same time as";
else
relationship = "is later than";
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample1.cs
index fdc7efcf7c3..4b5c93f2520 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample1.cs
@@ -20,7 +20,7 @@ void ShowYMD()
DateTime date1 = new DateTime(2010, 8, 18);
Console.WriteLine(date1.ToString());
// The example displays the following output:
- // 8/18/2010 12:00:00 AM
+ // 8/18/2010 12:00:00 AM
//
}
@@ -57,7 +57,7 @@ void ShowYMDHMSKind()
void ShowYMDHMSMsKind()
{
//
- DateTime date1 = new DateTime(2010, 8, 18, 16, 32, 18, 500,
+ DateTime date1 = new DateTime(2010, 8, 18, 16, 32, 18, 500,
DateTimeKind.Local);
Console.WriteLine("{0:M/dd/yyyy h:mm:ss.fff tt} {1}", date1, date1.Kind);
// The example displays the following output, in this case for en-us culture:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample2.cs
index f83278f3b1d..67198dab95c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample2.cs
@@ -12,14 +12,14 @@ public static void Main()
PersianCalendar persian = new PersianCalendar();
DateTime date1 = new DateTime(1389, 5, 27, persian);
Console.WriteLine(date1.ToString());
- Console.WriteLine("{0}/{1}/{2}\n", persian.GetMonth(date1),
- persian.GetDayOfMonth(date1),
+ Console.WriteLine("{0}/{1}/{2}\n", persian.GetMonth(date1),
+ persian.GetDayOfMonth(date1),
persian.GetYear(date1));
-
+
Console.WriteLine("Using the Hijri Calendar:");
// Get current culture so it can later be restored.
CultureInfo dftCulture = Thread.CurrentThread.CurrentCulture;
-
+
// Define Hijri calendar.
HijriCalendar hijri = new HijriCalendar();
// Make ar-SY the current culture and Hijri the current calendar.
@@ -31,17 +31,17 @@ public static void Main()
dFormat = Regex.Replace(dFormat, "/yy$", "/yyyy");
current.DateTimeFormat.ShortDatePattern = dFormat;
DateTime date2 = new DateTime(1431, 9, 9, hijri);
- Console.WriteLine("{0} culture using the {1} calendar: {2:d}", current,
+ Console.WriteLine("{0} culture using the {1} calendar: {2:d}", current,
GetCalendarName(hijri), date2);
-
+
// Restore previous culture.
Thread.CurrentThread.CurrentCulture = dftCulture;
- Console.WriteLine("{0} culture using the {1} calendar: {2:d}",
- CultureInfo.CurrentCulture,
- GetCalendarName(CultureInfo.CurrentCulture.Calendar),
- date2);
+ Console.WriteLine("{0} culture using the {1} calendar: {2:d}",
+ CultureInfo.CurrentCulture,
+ GetCalendarName(CultureInfo.CurrentCulture.Calendar),
+ date2);
}
-
+
private static string GetCalendarName(Calendar cal)
{
return Regex.Match(cal.ToString(), "\\.(\\w+)Calendar").Groups[1].Value;
@@ -51,7 +51,7 @@ private static string GetCalendarName(Calendar cal)
// Using the Persian Calendar:
// 8/18/2010 12:00:00 AM
// 5/27/1389
-//
+//
// Using the Hijri Calendar:
// ar-SY culture using the Hijri calendar: 09/09/1431
// en-US culture using the Gregorian calendar: 8/18/2010
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample4.cs
index 35732163b89..2ea6251dc20 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample4.cs
@@ -12,19 +12,19 @@ public static void Main()
PersianCalendar persian = new PersianCalendar();
DateTime date1 = new DateTime(1389, 5, 27, 16, 32, 0, persian);
Console.WriteLine(date1.ToString());
- Console.WriteLine("{0}/{1}/{2} {3}{6}{4:D2}{6}{5:D2}\n",
- persian.GetMonth(date1),
- persian.GetDayOfMonth(date1),
- persian.GetYear(date1),
- persian.GetHour(date1),
- persian.GetMinute(date1),
- persian.GetSecond(date1),
+ Console.WriteLine("{0}/{1}/{2} {3}{6}{4:D2}{6}{5:D2}\n",
+ persian.GetMonth(date1),
+ persian.GetDayOfMonth(date1),
+ persian.GetYear(date1),
+ persian.GetHour(date1),
+ persian.GetMinute(date1),
+ persian.GetSecond(date1),
DateTimeFormatInfo.CurrentInfo.TimeSeparator);
Console.WriteLine("Using the Hijri Calendar:");
// Get current culture so it can later be restored.
CultureInfo dftCulture = Thread.CurrentThread.CurrentCulture;
-
+
// Define Hijri calendar.
HijriCalendar hijri = new HijriCalendar();
// Make ar-SY the current culture and Hijri the current calendar.
@@ -36,17 +36,17 @@ public static void Main()
dFormat = Regex.Replace(dFormat, "/yy$", "/yyyy");
current.DateTimeFormat.ShortDatePattern = dFormat;
DateTime date2 = new DateTime(1431, 9, 9, 16, 32, 18, hijri);
- Console.WriteLine("{0} culture using the {1} calendar: {2:g}", current,
+ Console.WriteLine("{0} culture using the {1} calendar: {2:g}", current,
GetCalendarName(hijri), date2);
-
+
// Restore previous culture.
Thread.CurrentThread.CurrentCulture = dftCulture;
- Console.WriteLine("{0} culture using the {1} calendar: {2:g}",
- CultureInfo.CurrentCulture,
- GetCalendarName(CultureInfo.CurrentCulture.Calendar),
- date2);
+ Console.WriteLine("{0} culture using the {1} calendar: {2:g}",
+ CultureInfo.CurrentCulture,
+ GetCalendarName(CultureInfo.CurrentCulture.Calendar),
+ date2);
}
-
+
private static string GetCalendarName(Calendar cal)
{
return Regex.Match(cal.ToString(), "\\.(\\w+)Calendar").Groups[1].Value;
@@ -56,7 +56,7 @@ private static string GetCalendarName(Calendar cal)
// Using the Persian Calendar:
// 8/18/2010 4:32:00 PM
// 5/27/1389 16:32:00
-//
+//
// Using the Hijri Calendar:
// ar-SY culture using the Hijri calendar: 09/09/1431 04:32 م
// en-US culture using the Gregorian calendar: 8/18/2010 4:32 PM
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample6.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample6.cs
index 5c2d9b79c85..cc41b3ef3c8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample6.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample6.cs
@@ -12,23 +12,23 @@ public static void Main()
PersianCalendar persian = new PersianCalendar();
DateTime date1 = new DateTime(1389, 5, 27, 16, 32, 18, 500, persian);
Console.WriteLine(date1.ToString("M/dd/yyyy h:mm:ss.fff tt"));
- Console.WriteLine("{0}/{1}/{2} {3}{7}{4:D2}{7}{5:D2}.{6:G3}\n",
- persian.GetMonth(date1),
- persian.GetDayOfMonth(date1),
- persian.GetYear(date1),
- persian.GetHour(date1),
- persian.GetMinute(date1),
- persian.GetSecond(date1),
- persian.GetMilliseconds(date1),
+ Console.WriteLine("{0}/{1}/{2} {3}{7}{4:D2}{7}{5:D2}.{6:G3}\n",
+ persian.GetMonth(date1),
+ persian.GetDayOfMonth(date1),
+ persian.GetYear(date1),
+ persian.GetHour(date1),
+ persian.GetMinute(date1),
+ persian.GetSecond(date1),
+ persian.GetMilliseconds(date1),
DateTimeFormatInfo.CurrentInfo.TimeSeparator);
Console.WriteLine("Using the Hijri Calendar:");
// Get current culture so it can later be restored.
CultureInfo dftCulture = Thread.CurrentThread.CurrentCulture;
-
+
// Define strings for use in composite formatting.
- string dFormat;
- string fmtString;
+ string dFormat;
+ string fmtString;
// Define Hijri calendar.
HijriCalendar hijri = new HijriCalendar();
// Make ar-SY the current culture and Hijri the current calendar.
@@ -41,17 +41,17 @@ public static void Main()
fmtString = "{0} culture using the {1} calendar: {2:" + dFormat + "}";
DateTime date2 = new DateTime(1431, 9, 9, 16, 32, 18, 500, hijri);
Console.WriteLine(fmtString, current, GetCalendarName(hijri), date2);
-
+
// Restore previous culture.
Thread.CurrentThread.CurrentCulture = dftCulture;
dFormat = DateTimeFormatInfo.CurrentInfo.ShortDatePattern +" H:mm:ss.fff";
fmtString = "{0} culture using the {1} calendar: {2:" + dFormat + "}";
- Console.WriteLine(fmtString,
- CultureInfo.CurrentCulture,
- GetCalendarName(CultureInfo.CurrentCulture.Calendar),
- date2);
+ Console.WriteLine(fmtString,
+ CultureInfo.CurrentCulture,
+ GetCalendarName(CultureInfo.CurrentCulture.Calendar),
+ date2);
}
-
+
private static string GetCalendarName(Calendar cal)
{
return Regex.Match(cal.ToString(), "\\.(\\w+)Calendar").Groups[1].Value;
@@ -60,7 +60,7 @@ private static string GetCalendarName(Calendar cal)
// The example displays the following output:
// 8/18/2010 4:32:18.500 PM
// 5/27/1389 16:32:18.500
-//
+//
// Using the Hijri Calendar:
// ar-SY culture using the Hijri calendar: 09/09/1431 16:32:18.500
// en-US culture using the Gregorian calendar: 8/18/2010 16:32:18.500
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample9.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample9.cs
index 12b428f0db5..d034810c5f8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample9.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.constructor/cs/ctorexample9.cs
@@ -10,27 +10,27 @@ public static void Main()
{
Console.WriteLine("Using the Persian Calendar:");
PersianCalendar persian = new PersianCalendar();
- DateTime date1 = new DateTime(1389, 5, 27, 16, 32, 18, 500,
+ DateTime date1 = new DateTime(1389, 5, 27, 16, 32, 18, 500,
persian, DateTimeKind.Local);
Console.WriteLine("{0:M/dd/yyyy h:mm:ss.fff tt} {1}", date1, date1.Kind);
- Console.WriteLine("{0}/{1}/{2} {3}{8}{4:D2}{8}{5:D2}.{6:G3} {7}\n",
- persian.GetMonth(date1),
- persian.GetDayOfMonth(date1),
- persian.GetYear(date1),
- persian.GetHour(date1),
- persian.GetMinute(date1),
- persian.GetSecond(date1),
- persian.GetMilliseconds(date1),
- date1.Kind,
+ Console.WriteLine("{0}/{1}/{2} {3}{8}{4:D2}{8}{5:D2}.{6:G3} {7}\n",
+ persian.GetMonth(date1),
+ persian.GetDayOfMonth(date1),
+ persian.GetYear(date1),
+ persian.GetHour(date1),
+ persian.GetMinute(date1),
+ persian.GetSecond(date1),
+ persian.GetMilliseconds(date1),
+ date1.Kind,
DateTimeFormatInfo.CurrentInfo.TimeSeparator);
Console.WriteLine("Using the Hijri Calendar:");
// Get current culture so it can later be restored.
CultureInfo dftCulture = Thread.CurrentThread.CurrentCulture;
-
+
// Define strings for use in composite formatting.
- string dFormat;
- string fmtString;
+ string dFormat;
+ string fmtString;
// Define Hijri calendar.
HijriCalendar hijri = new HijriCalendar();
// Make ar-SY the current culture and Hijri the current calendar.
@@ -41,21 +41,21 @@ public static void Main()
// Ensure year is displayed as four digits.
dFormat = Regex.Replace(dFormat, "/yy$", "/yyyy") + " H:mm:ss.fff";
fmtString = "{0} culture using the {1} calendar: {2:" + dFormat + "} {3}";
- DateTime date2 = new DateTime(1431, 9, 9, 16, 32, 18, 500,
+ DateTime date2 = new DateTime(1431, 9, 9, 16, 32, 18, 500,
hijri, DateTimeKind.Local);
- Console.WriteLine(fmtString, current, GetCalendarName(hijri),
+ Console.WriteLine(fmtString, current, GetCalendarName(hijri),
date2, date2.Kind);
-
+
// Restore previous culture.
Thread.CurrentThread.CurrentCulture = dftCulture;
dFormat = DateTimeFormatInfo.CurrentInfo.ShortDatePattern +" H:mm:ss.fff";
fmtString = "{0} culture using the {1} calendar: {2:" + dFormat + "} {3}";
- Console.WriteLine(fmtString,
- CultureInfo.CurrentCulture,
- GetCalendarName(CultureInfo.CurrentCulture.Calendar),
- date2, date2.Kind);
+ Console.WriteLine(fmtString,
+ CultureInfo.CurrentCulture,
+ GetCalendarName(CultureInfo.CurrentCulture.Calendar),
+ date2, date2.Kind);
}
-
+
private static string GetCalendarName(Calendar cal)
{
return Regex.Match(cal.ToString(), "\\.(\\w+)Calendar").Groups[1].Value;
@@ -65,7 +65,7 @@ private static string GetCalendarName(Calendar cal)
// Using the Persian Calendar:
// 8/18/2010 4:32:18.500 PM Local
// 5/27/1389 16:32:18.500 Local
-//
+//
// Using the Hijri Calendar:
// ar-SY culture using the Hijri calendar: 09/09/1431 16:32:18.500 Local
// en-US culture using the Gregorian calendar: 8/18/2010 16:32:18.500 Local
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.dayofyear/cs/dayofyear2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.dayofyear/cs/dayofyear2.cs
index 7ec3d78eb9f..d023badf902 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.dayofyear/cs/dayofyear2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.dayofyear/cs/dayofyear2.cs
@@ -8,12 +8,12 @@ public static void Main()
DateTime dec31 = new DateTime(2010, 12, 31);
for (int ctr = 0; ctr <= 10; ctr++) {
DateTime dateToDisplay = dec31.AddYears(ctr);
- Console.WriteLine("{0:d}: day {1} of {2} {3}", dateToDisplay,
+ Console.WriteLine("{0:d}: day {1} of {2} {3}", dateToDisplay,
dateToDisplay.DayOfYear,
- dateToDisplay.Year,
- DateTime.IsLeapYear(dateToDisplay.Year) ?
- "(Leap Year)" : "");
- }
+ dateToDisplay.Year,
+ DateTime.IsLeapYear(dateToDisplay.Year) ?
+ "(Leap Year)" : "");
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.daysinmonth/cs/daysinmonth3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.daysinmonth/cs/daysinmonth3.cs
index 068d9a1207c..84a33723975 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.daysinmonth/cs/daysinmonth3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.daysinmonth/cs/daysinmonth3.cs
@@ -9,29 +9,29 @@ public static void Main()
int[] years = { 2012, 2014 };
DateTimeFormatInfo dtfi = DateTimeFormatInfo.CurrentInfo;
Console.WriteLine("Days in the Month for the {0} culture " +
- "using the {1} calendar\n",
- CultureInfo.CurrentCulture.Name,
+ "using the {1} calendar\n",
+ CultureInfo.CurrentCulture.Name,
dtfi.Calendar.GetType().Name.Replace("Calendar", ""));
Console.WriteLine("{0,-10}{1,-15}{2,4}\n", "Year", "Month", "Days");
-
+
foreach (var year in years) {
for (int ctr = 0; ctr <= dtfi.MonthNames.Length - 1; ctr++) {
- if (String.IsNullOrEmpty(dtfi.MonthNames[ctr]))
+ if (String.IsNullOrEmpty(dtfi.MonthNames[ctr]))
continue;
-
- Console.WriteLine("{0,-10}{1,-15}{2,4}", year,
- dtfi.MonthNames[ctr],
+
+ Console.WriteLine("{0,-10}{1,-15}{2,4}", year,
+ dtfi.MonthNames[ctr],
DateTime.DaysInMonth(year, ctr + 1));
}
- Console.WriteLine();
+ Console.WriteLine();
}
}
}
// The example displays the following output:
// Days in the Month for the en-US culture using the Gregorian calendar
-//
+//
// Year Month Days
-//
+//
// 2012 January 31
// 2012 February 29
// 2012 March 31
@@ -44,7 +44,7 @@ public static void Main()
// 2012 October 31
// 2012 November 30
// 2012 December 31
-//
+//
// 2014 January 31
// 2014 February 28
// 2014 March 31
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.frombinary/cs/frombinary1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.frombinary/cs/frombinary1.cs
index 4d023efaa2b..89eac447d01 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.frombinary/cs/frombinary1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.frombinary/cs/frombinary1.cs
@@ -8,12 +8,12 @@ public static void Main()
DateTime localDate = new DateTime(2010, 3, 14, 2, 30, 0, DateTimeKind.Local);
long binLocal = localDate.ToBinary();
if (TimeZoneInfo.Local.IsInvalidTime(localDate))
- Console.WriteLine("{0} is an invalid time in the {1} zone.",
- localDate,
+ Console.WriteLine("{0} is an invalid time in the {1} zone.",
+ localDate,
TimeZoneInfo.Local.StandardName);
DateTime localDate2 = DateTime.FromBinary(binLocal);
- Console.WriteLine("{0} = {1}: {2}",
+ Console.WriteLine("{0} = {1}: {2}",
localDate, localDate2, localDate.Equals(localDate2));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.fromfiletime/cs/fromfiletime1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.fromfiletime/cs/fromfiletime1.cs
index c4ce5f079e3..47551a60693 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.fromfiletime/cs/fromfiletime1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.fromfiletime/cs/fromfiletime1.cs
@@ -6,11 +6,11 @@ public class Example
public static void Main()
{
DateTime date1 = new DateTime(2010, 3, 14, 2, 30, 00);
- Console.WriteLine("Invalid Time: {0}",
+ Console.WriteLine("Invalid Time: {0}",
TimeZoneInfo.Local.IsInvalidTime(date1));
long ft = date1.ToFileTime();
DateTime date2 = DateTime.FromFileTime(ft);
- Console.WriteLine("{0} -> {1}", date1, date2);
+ Console.WriteLine("{0} -> {1}", date1, date2);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.timeofday/cs/timeofday1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.timeofday/cs/timeofday1.cs
index 1418dfd89c9..7fc056bd7da 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.timeofday/cs/timeofday1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.timeofday/cs/timeofday1.cs
@@ -5,26 +5,26 @@ public class Example
{
public static void Main()
{
- DateTime[] dates = { DateTime.Now,
+ DateTime[] dates = { DateTime.Now,
new DateTime(2013, 9, 14, 9, 28, 0),
new DateTime(2011, 5, 28, 10, 35, 0),
new DateTime(1979, 12, 25, 14, 30, 0) };
foreach (var date in dates) {
Console.WriteLine("Day: {0:d} Time: {1:g}", date.Date, date.TimeOfDay);
Console.WriteLine("Day: {0:d} Time: {0:t}\n", date);
- }
+ }
}
}
// The example displays output like the following:
// Day: 7/25/2012 Time: 10:08:12.9713744
// Day: 7/25/2012 Time: 10:08 AM
-//
+//
// Day: 9/14/2013 Time: 9:28:00
// Day: 9/14/2013 Time: 9:28 AM
-//
+//
// Day: 5/28/2011 Time: 10:35:00
// Day: 5/28/2011 Time: 10:35 AM
-//
+//
// Day: 12/25/1979 Time: 14:30:00
// Day: 12/25/1979 Time: 2:30 PM
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tolocaltime/cs/tolocaltime1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tolocaltime/cs/tolocaltime1.cs
index 0b2ef37f350..02e3080c794 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tolocaltime/cs/tolocaltime1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tolocaltime/cs/tolocaltime1.cs
@@ -6,11 +6,11 @@ public class Example
public static void Main()
{
DateTime date1 = new DateTime(2010, 3, 14, 2, 30, 0, DateTimeKind.Local);
- Console.WriteLine("Invalid time: {0}",
+ Console.WriteLine("Invalid time: {0}",
TimeZoneInfo.Local.IsInvalidTime(date1));
DateTime utcDate1 = date1.ToUniversalTime();
DateTime date2 = utcDate1.ToLocalTime();
- Console.WriteLine("{0} --> {1}", date1, date2);
+ Console.WriteLine("{0} --> {1}", date1, date2);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tolongtimestring/cs/sls.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tolongtimestring/cs/sls.cs
index 68d273c55aa..bdb1c06f2f9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tolongtimestring/cs/sls.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tolongtimestring/cs/sls.cs
@@ -3,9 +3,9 @@
using System.Threading;
using System.Globalization;
-public class Sample
+public class Sample
{
- public static void Main()
+ public static void Main()
{
// Create an array of culture names.
String[] names = { "en-US", "en-GB", "fr-FR", "de-DE" };
@@ -18,13 +18,13 @@ public static void Main()
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(name);
// Display the name of the current culture and the date.
Console.WriteLine("Current culture: {0}", CultureInfo.CurrentCulture.Name);
- Console.WriteLine("Date: {0:G}", dateValue);
+ Console.WriteLine("Date: {0:G}", dateValue);
// Display the long time pattern and the long time.
- Console.WriteLine("Long time pattern: '{0}'",
+ Console.WriteLine("Long time pattern: '{0}'",
DateTimeFormatInfo.CurrentInfo.LongTimePattern);
Console.WriteLine("Long time with format string: {0:T}", dateValue);
- Console.WriteLine("Long time with ToLongTimeString: {0}\n",
+ Console.WriteLine("Long time with ToLongTimeString: {0}\n",
dateValue.ToLongTimeString());
}
}
@@ -35,19 +35,19 @@ public static void Main()
// Long time pattern: 'h:mm:ss tt'
// Long time with format string: 10:30:15 AM
// Long time with ToLongTimeString: 10:30:15 AM
-//
+//
// Current culture: en-GB
// Date: 28/05/2013 10:30:15
// Long time pattern: 'HH:mm:ss'
// Long time with format string: 10:30:15
// Long time with ToLongTimeString: 10:30:15
-//
+//
// Current culture: fr-FR
// Date: 28/05/2013 10:30:15
// Long time pattern: 'HH:mm:ss'
// Long time with format string: 10:30:15
// Long time with ToLongTimeString: 10:30:15
-//
+//
// Current culture: de-DE
// Date: 28.05.2013 10:30:15
// Long time pattern: 'HH:mm:ss'
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception1.cs
index 4c859ec6520..db64b0f283f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception1.cs
@@ -7,17 +7,17 @@ public class Example
public static void Main()
{
CultureInfo jaJP = new CultureInfo("ja-JP");
- jaJP.DateTimeFormat.Calendar = new JapaneseCalendar();
+ jaJP.DateTimeFormat.Calendar = new JapaneseCalendar();
DateTime date1 = new DateTime(1867, 1, 1);
try {
Console.WriteLine(date1.ToString(jaJP));
}
catch (ArgumentOutOfRangeException) {
- Console.WriteLine("{0:d} is earlier than {1:d} or later than {2:d}",
- date1,
- jaJP.DateTimeFormat.Calendar.MinSupportedDateTime,
- jaJP.DateTimeFormat.Calendar.MaxSupportedDateTime);
+ Console.WriteLine("{0:d} is earlier than {1:d} or later than {2:d}",
+ date1,
+ jaJP.DateTimeFormat.Calendar.MinSupportedDateTime,
+ jaJP.DateTimeFormat.Calendar.MaxSupportedDateTime);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception2.cs
index 6fb0bd9e7ea..0637f88a609 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception2.cs
@@ -11,22 +11,22 @@ public static void Main()
CultureInfo dft;
CultureInfo arSY = new CultureInfo("ar-SY");
arSY.DateTimeFormat.Calendar = new HijriCalendar();
-
+
// Change current culture to ar-SY.
dft = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = arSY;
-
- // Display the date using the current culture's calendar.
+
+ // Display the date using the current culture's calendar.
try {
Console.WriteLine(date1.ToString());
}
catch (ArgumentOutOfRangeException) {
- Console.WriteLine("{0} is earlier than {1} or later than {2}",
- date1.ToString("d", CultureInfo.InvariantCulture),
- arSY.DateTimeFormat.Calendar.MinSupportedDateTime.ToString("d", CultureInfo.InvariantCulture),
- arSY.DateTimeFormat.Calendar.MaxSupportedDateTime.ToString("d", CultureInfo.InvariantCulture));
+ Console.WriteLine("{0} is earlier than {1} or later than {2}",
+ date1.ToString("d", CultureInfo.InvariantCulture),
+ arSY.DateTimeFormat.Calendar.MinSupportedDateTime.ToString("d", CultureInfo.InvariantCulture),
+ arSY.DateTimeFormat.Calendar.MaxSupportedDateTime.ToString("d", CultureInfo.InvariantCulture));
}
-
+
// Restore the default culture.
Thread.CurrentThread.CurrentCulture = dft;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception3.cs
index e1a122882ce..19e6980d550 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception3.cs
@@ -11,22 +11,22 @@ public static void Main()
CultureInfo dft;
CultureInfo heIL = new CultureInfo("he-IL");
heIL.DateTimeFormat.Calendar = new HebrewCalendar();
-
+
// Change current culture to he-IL.
dft = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = heIL;
-
- // Display the date using the current culture's calendar.
+
+ // Display the date using the current culture's calendar.
try {
Console.WriteLine(date1.ToString("G"));
- }
+ }
catch (ArgumentOutOfRangeException) {
- Console.WriteLine("{0} is earlier than {1} or later than {2}",
- date1.ToString("d", CultureInfo.InvariantCulture),
- heIL.DateTimeFormat.Calendar.MinSupportedDateTime.ToString("d", CultureInfo.InvariantCulture),
- heIL.DateTimeFormat.Calendar.MaxSupportedDateTime.ToString("d", CultureInfo.InvariantCulture));
+ Console.WriteLine("{0} is earlier than {1} or later than {2}",
+ date1.ToString("d", CultureInfo.InvariantCulture),
+ heIL.DateTimeFormat.Calendar.MinSupportedDateTime.ToString("d", CultureInfo.InvariantCulture),
+ heIL.DateTimeFormat.Calendar.MaxSupportedDateTime.ToString("d", CultureInfo.InvariantCulture));
}
-
+
// Restore the default culture.
Thread.CurrentThread.CurrentCulture = dft;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception4.cs
index eb66d5477ab..b51ea155916 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.tostring.argumentoutofrangeexception/cs/datetime.tostring.argumentoutofrangeexception4.cs
@@ -7,17 +7,17 @@ public class Example
public static void Main()
{
CultureInfo arSA = new CultureInfo("ar-SA");
- arSA.DateTimeFormat.Calendar = new UmAlQuraCalendar();
+ arSA.DateTimeFormat.Calendar = new UmAlQuraCalendar();
DateTime date1 = new DateTime(1890, 9, 10);
try {
Console.WriteLine(date1.ToString("d", arSA));
- }
+ }
catch (ArgumentOutOfRangeException) {
- Console.WriteLine("{0:d} is earlier than {1:d} or later than {2:d}",
- date1,
- arSA.DateTimeFormat.Calendar.MinSupportedDateTime,
- arSA.DateTimeFormat.Calendar.MaxSupportedDateTime);
+ Console.WriteLine("{0:d} is earlier than {1:d} or later than {2:d}",
+ date1,
+ arSA.DateTimeFormat.Calendar.MinSupportedDateTime,
+ arSA.DateTimeFormat.Calendar.MaxSupportedDateTime);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.touniversaltime/cs/touniversaltime.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.touniversaltime/cs/touniversaltime.cs
index e3f9cc21bd2..d41fd89a97b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.touniversaltime/cs/touniversaltime.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetime.touniversaltime/cs/touniversaltime.cs
@@ -6,12 +6,12 @@ public class Example
public static void Main()
{
DateTime date1 = new DateTime(2006, 3, 21, 2, 0, 0);
-
+
Console.WriteLine(date1.ToUniversalTime());
Console.WriteLine(TimeZoneInfo.ConvertTimeToUtc(date1));
-
- TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
- Console.WriteLine(TimeZoneInfo.ConvertTimeToUtc(date1, tz));
+
+ TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
+ Console.WriteLine(TimeZoneInfo.ConvertTimeToUtc(date1, tz));
}
}
// The example displays the following output on Windows XP systems:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.now/cs/now1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.now/cs/now1.cs
index 6f13cf49fd9..67df3738cd3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.now/cs/now1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.now/cs/now1.cs
@@ -5,23 +5,23 @@ public class Example
{
public static void Main()
{
- String[] fmtStrings = { "d", "D", "f", "F", "g", "G", "M",
+ String[] fmtStrings = { "d", "D", "f", "F", "g", "G", "M",
"R", "s", "t", "T", "u", "y" };
-
+
DateTimeOffset value = DateTimeOffset.Now;
// Display date in default format.
Console.WriteLine(value);
Console.WriteLine();
-
+
// Display date using each of the specified formats.
foreach (var fmtString in fmtStrings)
- Console.WriteLine("{0} --> {1}",
+ Console.WriteLine("{0} --> {1}",
fmtString, value.ToString(fmtString));
}
}
// The example displays output similar to the following:
// 11/19/2012 10:57:11 AM -08:00
-//
+//
// d --> 11/19/2012
// D --> Monday, November 19, 2012
// f --> Monday, November 19, 2012 10:57 AM
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception1.cs
index 40eb43c6087..389ef73e0c7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception1.cs
@@ -7,7 +7,7 @@ public class Example
public static void Main()
{
CultureInfo jaJP = new CultureInfo("ja-JP");
- jaJP.DateTimeFormat.Calendar = new JapaneseCalendar();
+ jaJP.DateTimeFormat.Calendar = new JapaneseCalendar();
DateTimeOffset date1 = new DateTimeOffset(new DateTime(1867, 1, 1),
TimeSpan.Zero);
@@ -15,10 +15,10 @@ public static void Main()
Console.WriteLine(date1.ToString(jaJP));
}
catch (ArgumentOutOfRangeException) {
- Console.WriteLine("{0:d} is earlier than {1:d} or later than {2:d}",
- date1,
- jaJP.DateTimeFormat.Calendar.MinSupportedDateTime,
- jaJP.DateTimeFormat.Calendar.MaxSupportedDateTime);
+ Console.WriteLine("{0:d} is earlier than {1:d} or later than {2:d}",
+ date1,
+ jaJP.DateTimeFormat.Calendar.MinSupportedDateTime,
+ jaJP.DateTimeFormat.Calendar.MaxSupportedDateTime);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception2.cs
index 944500b8d07..84720917ad1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception2.cs
@@ -12,22 +12,22 @@ public static void Main()
CultureInfo dft;
CultureInfo arSY = new CultureInfo("ar-SY");
arSY.DateTimeFormat.Calendar = new HijriCalendar();
-
+
// Change current culture to ar-SY.
dft = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = arSY;
-
- // Display the date using the current culture's calendar.
+
+ // Display the date using the current culture's calendar.
try {
Console.WriteLine(date1.ToString());
}
catch (ArgumentOutOfRangeException) {
- Console.WriteLine("{0} is earlier than {1} or later than {2}",
- date1.ToString("d", CultureInfo.InvariantCulture),
- arSY.DateTimeFormat.Calendar.MinSupportedDateTime.ToString("d", CultureInfo.InvariantCulture),
- arSY.DateTimeFormat.Calendar.MaxSupportedDateTime.ToString("d", CultureInfo.InvariantCulture));
+ Console.WriteLine("{0} is earlier than {1} or later than {2}",
+ date1.ToString("d", CultureInfo.InvariantCulture),
+ arSY.DateTimeFormat.Calendar.MinSupportedDateTime.ToString("d", CultureInfo.InvariantCulture),
+ arSY.DateTimeFormat.Calendar.MaxSupportedDateTime.ToString("d", CultureInfo.InvariantCulture));
}
-
+
// Restore the default culture.
Thread.CurrentThread.CurrentCulture = dft;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception3.cs
index 8b487e5fe03..adaa8536748 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception3.cs
@@ -12,22 +12,22 @@ public static void Main()
CultureInfo dft;
CultureInfo heIL = new CultureInfo("he-IL");
heIL.DateTimeFormat.Calendar = new HebrewCalendar();
-
+
// Change current culture to he-IL.
dft = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = heIL;
-
- // Display the date using the current culture's calendar.
+
+ // Display the date using the current culture's calendar.
try {
Console.WriteLine(date1.ToString("G"));
- }
+ }
catch (ArgumentOutOfRangeException) {
- Console.WriteLine("{0} is earlier than {1} or later than {2}",
- date1.ToString("d", CultureInfo.InvariantCulture),
- heIL.DateTimeFormat.Calendar.MinSupportedDateTime.ToString("d", CultureInfo.InvariantCulture),
- heIL.DateTimeFormat.Calendar.MaxSupportedDateTime.ToString("d", CultureInfo.InvariantCulture));
+ Console.WriteLine("{0} is earlier than {1} or later than {2}",
+ date1.ToString("d", CultureInfo.InvariantCulture),
+ heIL.DateTimeFormat.Calendar.MinSupportedDateTime.ToString("d", CultureInfo.InvariantCulture),
+ heIL.DateTimeFormat.Calendar.MaxSupportedDateTime.ToString("d", CultureInfo.InvariantCulture));
}
-
+
// Restore the default culture.
Thread.CurrentThread.CurrentCulture = dft;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception4.cs
index a3ce7243df0..2250a669052 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tostring.argumentoutofrangeexception/cs/datetimeoffset.tostring.argumentoutofrangeexception4.cs
@@ -7,18 +7,18 @@ public class Example
public static void Main()
{
CultureInfo arSA = new CultureInfo("ar-SA");
- arSA.DateTimeFormat.Calendar = new UmAlQuraCalendar();
+ arSA.DateTimeFormat.Calendar = new UmAlQuraCalendar();
DateTimeOffset date1 = new DateTimeOffset(new DateTime(1890, 9, 10),
TimeSpan.Zero);
try {
Console.WriteLine(date1.ToString("d", arSA));
- }
+ }
catch (ArgumentOutOfRangeException) {
- Console.WriteLine("{0:d} is earlier than {1:d} or later than {2:d}",
- date1,
- arSA.DateTimeFormat.Calendar.MinSupportedDateTime,
- arSA.DateTimeFormat.Calendar.MaxSupportedDateTime);
+ Console.WriteLine("{0:d} is earlier than {1:d} or later than {2:d}",
+ date1,
+ arSA.DateTimeFormat.Calendar.MinSupportedDateTime,
+ arSA.DateTimeFormat.Calendar.MaxSupportedDateTime);
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tounixtimeseconds/cs/tounixtimeseconds1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tounixtimeseconds/cs/tounixtimeseconds1.cs
index 0354ff80a29..fcf3d371067 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tounixtimeseconds/cs/tounixtimeseconds1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.datetimeoffset.tounixtimeseconds/cs/tounixtimeseconds1.cs
@@ -39,12 +39,12 @@ public class DateTimeOffset2
private const long UnixEpochMilliseconds = UnixEpochTicks / TimeSpan.TicksPerMillisecond; // 62,135,596,800,000
private DateTimeOffset dto;
-
+
public DateTimeOffset2(DateTimeOffset dto)
{
this.dto = dto;
}
-
+
public long ToUnixTimeSeconds() {
// Truncate sub-second precision before offsetting by the Unix Epoch to avoid
// the last digit being off by one for dates that result in negative Unix times.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.ctor/cs/ctor2a.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.ctor/cs/ctor2a.cs
index 2128d69ee04..934ebf018d3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.ctor/cs/ctor2a.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.ctor/cs/ctor2a.cs
@@ -9,8 +9,8 @@ public static void Main()
foreach (var value in values) {
int[] parts = Decimal.GetBits(value);
bool sign = (parts[3] & 0x80000000) != 0;
-
- byte scale = (byte) ((parts[3] >> 16) & 0x7F);
+
+ byte scale = (byte) ((parts[3] >> 16) & 0x7F);
Decimal newValue = new Decimal(parts[0], parts[1], parts[2], sign, scale);
Console.WriteLine("{0} --> {1}", value, newValue);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.equals/cs/equalsoverl.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.equals/cs/equalsoverl.cs
index db75384d216..6d726636897 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.equals/cs/equalsoverl.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.equals/cs/equalsoverl.cs
@@ -4,7 +4,7 @@
public class Example
{
static decimal value = 112m;
-
+
public static void Main()
{
byte byte1= 112;
@@ -22,7 +22,7 @@ public static void Main()
long long1 = 112;
Console.WriteLine("value = long1: {0,18}", value.Equals(long1));
TestObjectForEquality(long1);
-
+
sbyte sbyte1 = 112;
Console.WriteLine("value = sbyte1: {0,17}", value.Equals(sbyte1));
TestObjectForEquality(sbyte1);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators.explicit/cs/tosbyte.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators.explicit/cs/tosbyte.cs
index a46c9ce81ff..7f012cfa526 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators.explicit/cs/tosbyte.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators.explicit/cs/tosbyte.cs
@@ -8,19 +8,19 @@ public static void Main()
// Define an array of decimal values.
decimal[] values = { 78m, new Decimal(78000, 0, 0, false, 3),
78.999m, 255.999m, 256m, 127.999m,
- 128m, -0.999m, -1m, -128.999m, -129m };
+ 128m, -0.999m, -1m, -128.999m, -129m };
foreach (var value in values) {
- try {
+ try {
SByte byteValue = (SByte) value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
- value.GetType().Name, byteValue,
+ value.GetType().Name, byteValue,
byteValue.GetType().Name);
}
catch (OverflowException) {
Console.WriteLine("OverflowException: Cannot convert {0}",
value);
}
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators.explicit/cs/tosingle1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators.explicit/cs/tosingle1.cs
index e8ba7432dec..f9dde59be08 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators.explicit/cs/tosingle1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators.explicit/cs/tosingle1.cs
@@ -6,19 +6,19 @@ class Example
public static void Main( )
{
// Define an array of decimal values.
- decimal[] values = { 0.0000000000000000000000000001M,
+ decimal[] values = { 0.0000000000000000000000000001M,
0.0000000000123456789123456789M,
123M, new decimal(123000000, 0, 0, false, 6),
- 123456789.123456789M,
- 123456789123456789123456789M,
+ 123456789.123456789M,
+ 123456789123456789123456789M,
decimal.MinValue, decimal.MaxValue };
// Convert each value to a double.
foreach (var value in values) {
float dblValue = (float) value;
Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
- value.GetType().Name, dblValue,
+ value.GetType().Name, dblValue,
dblValue.GetType().Name);
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/addition1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/addition1.cs
index f251e9ba742..7ee62a43391 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/addition1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/addition1.cs
@@ -8,7 +8,7 @@ public static void Main()
Decimal number1 = 120.07m;
Decimal number2 = 163.19m;
Decimal number3 = number1 + number2;
- Console.WriteLine("{0} + {1} = {2}",
+ Console.WriteLine("{0} + {1} = {2}",
number1, number2, number3);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/decrement1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/decrement1.cs
index e19149ddffc..227674dce58 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/decrement1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/decrement1.cs
@@ -7,7 +7,7 @@ public static void Main()
{
Decimal number = 1079.8m;
Console.WriteLine("Original value: {0:N}", number);
- Console.WriteLine("Decremented value: {0:N}", --number);
+ Console.WriteLine("Decremented value: {0:N}", --number);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/decrement2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/decrement2.cs
index 2b15050fdbb..7a9f036610a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/decrement2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/decrement2.cs
@@ -7,7 +7,7 @@ public static void Main()
{
Decimal number = 1079.8m;
Console.WriteLine("Original value: {0:N}", number);
- Console.WriteLine("Decremented value: {0:N}", Decimal.Subtract(number, 1));
+ Console.WriteLine("Decremented value: {0:N}", Decimal.Subtract(number, 1));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/division1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/division1.cs
index 96e6571ebbe..45acd8f154e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/division1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/division1.cs
@@ -8,7 +8,7 @@ public static void Main()
Decimal number1 = 16.8m;
Decimal number2 = 4.1m;
Decimal number3 = number1 / number2;
- Console.WriteLine("{0:N2} / {1:N2} = {2:N2}",
+ Console.WriteLine("{0:N2} / {1:N2} = {2:N2}",
number1, number2, number3);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/equality1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/equality1.cs
index 54f5bdb761d..4e914b9abdb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/equality1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/equality1.cs
@@ -7,12 +7,12 @@ public static void Main()
{
Decimal number1 = 16354.0695m;
Decimal number2 = 16354.0699m;
- Console.WriteLine("{0} = {1}: {2}", number1,
+ Console.WriteLine("{0} = {1}: {2}", number1,
number2, number1 == number2);
number1 = Decimal.Round(number1, 2);
number2 = Decimal.Round(number2, 2);
- Console.WriteLine("{0} = {1}: {2}", number1,
+ Console.WriteLine("{0} = {1}: {2}", number1,
number2, number1 == number2);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/greaterthan1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/greaterthan1.cs
index c7e653eaccb..85acc1bc19c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/greaterthan1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/greaterthan1.cs
@@ -7,12 +7,12 @@ public static void Main()
{
Decimal number1 = 16354.0699m;
Decimal number2 = 16354.0695m;
- Console.WriteLine("{0} > {1}: {2}", number1,
+ Console.WriteLine("{0} > {1}: {2}", number1,
number2, number1 > number2);
number1 = Decimal.Round(number1, 2);
number2 = Decimal.Round(number2, 2);
- Console.WriteLine("{0} > {1}: {2}", number1,
+ Console.WriteLine("{0} > {1}: {2}", number1,
number2, number1 > number2);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/greaterthanorequal1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/greaterthanorequal1.cs
index a1ce1504675..f192569c79b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/greaterthanorequal1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/greaterthanorequal1.cs
@@ -7,12 +7,12 @@ public static void Main()
{
Decimal number1 = 16354.0699m;
Decimal number2 = 16354.0695m;
- Console.WriteLine("{0} >= {1}: {2}", number1,
+ Console.WriteLine("{0} >= {1}: {2}", number1,
number2, number1 >= number2);
number1 = Decimal.Round(number1, 2);
number2 = Decimal.Round(number2, 2);
- Console.WriteLine("{0} >= {1}: {2}", number1,
+ Console.WriteLine("{0} >= {1}: {2}", number1,
number2, number1 >= number2);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/increment1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/increment1.cs
index 9e68d23fb4e..b5cf3da4d5f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/increment1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/increment1.cs
@@ -7,7 +7,7 @@ public static void Main()
{
Decimal number = 1079.8m;
Console.WriteLine("Original value: {0:N}", number);
- Console.WriteLine("Incremented value: {0:N}", ++number);
+ Console.WriteLine("Incremented value: {0:N}", ++number);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/increment2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/increment2.cs
index b9b68bfff72..f42773f7e9a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/increment2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/increment2.cs
@@ -7,7 +7,7 @@ public static void Main()
{
Decimal number = 1079.8m;
Console.WriteLine("Original value: {0:N}", number);
- Console.WriteLine("Incremented value: {0:N}", Decimal.Add(number, 1));
+ Console.WriteLine("Incremented value: {0:N}", Decimal.Add(number, 1));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/inequality1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/inequality1.cs
index d9fd4fa809a..74f36c052ff 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/inequality1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/inequality1.cs
@@ -7,12 +7,12 @@ public static void Main()
{
Decimal number1 = 16354.0695m;
Decimal number2 = 16354.0699m;
- Console.WriteLine("{0} <> {1}: {2}", number1,
+ Console.WriteLine("{0} <> {1}: {2}", number1,
number2, number1 != number2);
number1 = Decimal.Round(number1, 2);
number2 = Decimal.Round(number2, 2);
- Console.WriteLine("{0} <> {1}: {2}", number1,
+ Console.WriteLine("{0} <> {1}: {2}", number1,
number2, number1 != number2);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/lessthan1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/lessthan1.cs
index 60f1aa5516e..3b29ca233b9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/lessthan1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/lessthan1.cs
@@ -7,12 +7,12 @@ public static void Main()
{
Decimal number1 = 16354.0699m;
Decimal number2 = 16354.0695m;
- Console.WriteLine("{0} < {1}: {2}", number1,
+ Console.WriteLine("{0} < {1}: {2}", number1,
number2, number1 < number2);
number1 = Decimal.Round(number1, 2);
number2 = Decimal.Round(number2, 2);
- Console.WriteLine("{0} < {1}: {2}", number1,
+ Console.WriteLine("{0} < {1}: {2}", number1,
number2, number1 < number2);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/lessthanorequal1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/lessthanorequal1.cs
index adf8a53d7aa..fab34328b3d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/lessthanorequal1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/lessthanorequal1.cs
@@ -7,12 +7,12 @@ public static void Main()
{
Decimal number1 = 16354.0699m;
Decimal number2 = 16354.0695m;
- Console.WriteLine("{0} <= {1}: {2}", number1,
+ Console.WriteLine("{0} <= {1}: {2}", number1,
number2, number1 <= number2);
number1 = Decimal.Round(number1, 2);
number2 = Decimal.Round(number2, 2);
- Console.WriteLine("{0} <= {1}: {2}", number1,
+ Console.WriteLine("{0} <= {1}: {2}", number1,
number2, number1 <= number2);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/modulus1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/modulus1.cs
index b1fb8c9d8ea..c06fa607a0d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/modulus1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/modulus1.cs
@@ -8,7 +8,7 @@ public static void Main()
Decimal number1 = 16.8m;
Decimal number2 = 4.1m;
Decimal number3 = number1 % number2;
- Console.WriteLine("{0:N2} % {1:N2} = {2:N2}",
+ Console.WriteLine("{0:N2} % {1:N2} = {2:N2}",
number1, number2, number3);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/multiply1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/multiply1.cs
index 3a037143c82..5ade92a15b3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/multiply1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/multiply1.cs
@@ -8,7 +8,7 @@ public static void Main()
Decimal number1 = 16.8m;
Decimal number2 = 4.1m;
Decimal number3 = number1 * number2;
- Console.WriteLine("{0:N2} x {1:N2} = {2:N2}",
+ Console.WriteLine("{0:N2} x {1:N2} = {2:N2}",
number1, number2, number3);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/subtraction1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/subtraction1.cs
index 61ad4ed75dd..af08abdd7af 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/subtraction1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.operators/cs/subtraction1.cs
@@ -8,7 +8,7 @@ public static void Main()
Decimal number1 = 120.07m;
Decimal number2 = 163.19m;
Decimal number3 = number1 - number2;
- Console.WriteLine("{0} - {1} = {2}",
+ Console.WriteLine("{0} - {1} = {2}",
number1, number2, number3);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.remainder/cs/remainder.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.remainder/cs/remainder.cs
index a6b99cd335e..e01f2e8bed4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.remainder/cs/remainder.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.remainder/cs/remainder.cs
@@ -9,17 +9,17 @@ public static void Main()
Decimal[] dividends = { 79m, 1000m, -1000m, 123m, 1234567800000m,
1234.0123m };
Decimal[] divisors = { 11m, 7m, 7m, .00123m, 0.12345678m, 1234.5678m };
-
- for (int ctr = 0; ctr < dividends.Length; ctr++)
+
+ for (int ctr = 0; ctr < dividends.Length; ctr++)
{
Decimal dividend = dividends[ctr];
Decimal divisor = divisors[ctr];
Console.WriteLine("{0:N3} / {1:N3} = {2:N3} Remainder {3:N3}", dividend,
divisor, Decimal.Divide(dividend, divisor),
- Decimal.Remainder(dividend, divisor));
+ Decimal.Remainder(dividend, divisor));
}
}
-}
+}
// The example displays the following output:
// 79.000 / 11.000 = 7.182 Remainder 2.000
// 1,000.000 / 7.000 = 142.857 Remainder 6.000
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.tobyte/cs/tobyte_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.tobyte/cs/tobyte_1.cs
index 1d6283451c7..74f445c1551 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.tobyte/cs/tobyte_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.tobyte/cs/tobyte_1.cs
@@ -6,19 +6,19 @@ class Example
public static void Main( )
{
decimal[] values = { 123m, new Decimal(78000, 0, 0, false, 3),
- 78.999m, 255.999m, 256m,
- 127.999m, 128m, -0.999m,
+ 78.999m, 255.999m, 256m,
+ 127.999m, 128m, -0.999m,
-1m, -128.999m, -129m };
foreach (var value in values) {
try {
byte number = Decimal.ToByte(value);
- Console.WriteLine("{0} --> {1}", value, number);
+ Console.WriteLine("{0} --> {1}", value, number);
}
catch (OverflowException e)
{
Console.WriteLine("{0}: {1}", e.GetType().Name, value);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint16/cs/toint16_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint16/cs/toint16_1.cs
index ecb152d4c3d..a488f46b95d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint16/cs/toint16_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint16/cs/toint16_1.cs
@@ -6,19 +6,19 @@ class Example
public static void Main( )
{
decimal[] values = { 123m, new Decimal(123000, 0, 0, false, 3),
- 123.999m, 65535.999m, 65536m,
- 32767.999m, 32768m, -0.999m,
+ 123.999m, 65535.999m, 65536m,
+ 32767.999m, 32768m, -0.999m,
-1m, -32768.999m, -32769m };
foreach (var value in values) {
try {
short number = Decimal.ToInt16(value);
- Console.WriteLine("{0} --> {1}", value, number);
+ Console.WriteLine("{0} --> {1}", value, number);
}
catch (OverflowException e)
{
Console.WriteLine("{0}: {1}", e.GetType().Name, value);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint32/cs/toint32_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint32/cs/toint32_1.cs
index 643cdd623ab..b7b58bb070e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint32/cs/toint32_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint32/cs/toint32_1.cs
@@ -5,20 +5,20 @@ class Example
{
public static void Main( )
{
- decimal[] values = { 123m, new decimal(123000, 0, 0, false, 3),
+ decimal[] values = { 123m, new decimal(123000, 0, 0, false, 3),
123.999m, 4294967295.999m, 4294967296m,
- 4294967296m, 2147483647.999m, 2147483648m,
+ 4294967296m, 2147483647.999m, 2147483648m,
-0.999m, -1m, -2147483648.999m, -2147483649m };
foreach (var value in values) {
try {
int number = Decimal.ToInt32(value);
- Console.WriteLine("{0} --> {1}", value, number);
+ Console.WriteLine("{0} --> {1}", value, number);
}
catch (OverflowException e)
{
Console.WriteLine("{0}: {1}", e.GetType().Name, value);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint64/cs/toint64_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint64/cs/toint64_1.cs
index 63d60547a94..b80df5c24a0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint64/cs/toint64_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.toint64/cs/toint64_1.cs
@@ -5,22 +5,22 @@ class Example
{
public static void Main( )
{
- decimal[] values = { 123m, new Decimal(123000, 0, 0, false, 3),
- 123.999m, 18446744073709551615.999m,
- 18446744073709551616m, 9223372036854775807.999m,
- 9223372036854775808m, -0.999m, -1m,
- -9223372036854775808.999m,
+ decimal[] values = { 123m, new Decimal(123000, 0, 0, false, 3),
+ 123.999m, 18446744073709551615.999m,
+ 18446744073709551616m, 9223372036854775807.999m,
+ 9223372036854775808m, -0.999m, -1m,
+ -9223372036854775808.999m,
-9223372036854775809m };
-
+
foreach (var value in values) {
- try {
+ try {
long number = Decimal.ToInt64(value);
- Console.WriteLine("{0} --> {1}", value, number);
+ Console.WriteLine("{0} --> {1}", value, number);
}
catch (OverflowException e)
{
Console.WriteLine("{0}: {1}", e.GetType().Name, value);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.tosbyte/cs/tosbyte1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.tosbyte/cs/tosbyte1.cs
index e339fd62966..1c1f2dbe909 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.tosbyte/cs/tosbyte1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.tosbyte/cs/tosbyte1.cs
@@ -6,19 +6,19 @@ class Example
public static void Main( )
{
decimal[] values = { 123m, new Decimal(78000, 0, 0, false, 3),
- 78.999m, 255.999m, 256m,
- 127.999m, 128m, -0.999m,
+ 78.999m, 255.999m, 256m,
+ 127.999m, 128m, -0.999m,
-1m, -128.999m, -129m };
foreach (var value in values) {
try {
sbyte number = Decimal.ToSByte(value);
- Console.WriteLine("{0} --> {1}", value, number);
+ Console.WriteLine("{0} --> {1}", value, number);
}
catch (OverflowException e)
{
Console.WriteLine("{0}: {1}", e.GetType().Name, value);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint16/cs/touint16_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint16/cs/touint16_1.cs
index 229bd7d8fda..3a761d52f6c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint16/cs/touint16_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint16/cs/touint16_1.cs
@@ -6,19 +6,19 @@ class Example
public static void Main( )
{
decimal[] values = { 123m, new Decimal(123000, 0, 0, false, 3),
- 123.999m, 65535.999m, 65536m,
- 32767.999m, 32768m, -0.999m,
+ 123.999m, 65535.999m, 65536m,
+ 32767.999m, 32768m, -0.999m,
-1m, -32768.999m, -32769m };
foreach (var value in values) {
try {
ushort number = Decimal.ToUInt16(value);
- Console.WriteLine("{0} --> {1}", value, number);
+ Console.WriteLine("{0} --> {1}", value, number);
}
catch (OverflowException e)
{
Console.WriteLine("{0}: {1}", e.GetType().Name, value);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint32/cs/touint32_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint32/cs/touint32_1.cs
index 3356852976e..d65c7514af5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint32/cs/touint32_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint32/cs/touint32_1.cs
@@ -5,20 +5,20 @@ class Example
{
public static void Main( )
{
- decimal[] values = { 123m, new decimal(123000, 0, 0, false, 3),
+ decimal[] values = { 123m, new decimal(123000, 0, 0, false, 3),
123.999m, 4294967295.999m, 4294967296m,
- 4294967296m, 2147483647.999m, 2147483648m,
+ 4294967296m, 2147483647.999m, 2147483648m,
-0.999m, -1m, -2147483648.999m, -2147483649m };
foreach (var value in values) {
try {
uint number = Decimal.ToUInt32(value);
- Console.WriteLine("{0} --> {1}", value, number);
+ Console.WriteLine("{0} --> {1}", value, number);
}
catch (OverflowException e)
{
Console.WriteLine("{0}: {1}", e.GetType().Name, value);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint64/cs/touint64_1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint64/cs/touint64_1.cs
index cc27ded7778..342f1383c82 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint64/cs/touint64_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.decimal.touint64/cs/touint64_1.cs
@@ -5,22 +5,22 @@ class Example
{
public static void Main( )
{
- decimal[] values = { 123m, new Decimal(123000, 0, 0, false, 3),
- 123.999m, 18446744073709551615.999m,
- 18446744073709551616m, 9223372036854775807.999m,
- 9223372036854775808m, -0.999m, -1m,
- -9223372036854775808.999m,
+ decimal[] values = { 123m, new Decimal(123000, 0, 0, false, 3),
+ 123.999m, 18446744073709551615.999m,
+ 18446744073709551616m, 9223372036854775807.999m,
+ 9223372036854775808m, -0.999m, -1m,
+ -9223372036854775808.999m,
-9223372036854775809m };
-
+
foreach (var value in values) {
- try {
+ try {
ulong number = Decimal.ToUInt64(value);
- Console.WriteLine("{0} --> {1}", value, number);
+ Console.WriteLine("{0} --> {1}", value, number);
}
catch (OverflowException e)
{
Console.WriteLine("{0}: {1}", e.GetType().Name, value);
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow1.cs
index 1e25c8bd378..304699bcc70 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow1.cs
@@ -1,21 +1,21 @@
//
using System;
-static class ValidationHelper
+static class ValidationHelper
{
- public static void NotNull(object argument, string parameterName)
+ public static void NotNull(object argument, string parameterName)
{
- if (argument == null) throw new ArgumentNullException(parameterName,
+ if (argument == null) throw new ArgumentNullException(parameterName,
"The parameter cannot be null.");
}
}
public class Example
{
- public void Execute(string value)
+ public void Execute(string value)
{
ValidationHelper.NotNull(value, "value");
-
+
// Body of method goes here.
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow2.cs
index 86077f549bc..df5e32c76d4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow2.cs
@@ -2,12 +2,12 @@
using System;
using System.Diagnostics.Contracts;
-static class ValidationHelper
+static class ValidationHelper
{
[ContractArgumentValidator]
- public static void NotNull(object argument, string parameterName)
+ public static void NotNull(object argument, string parameterName)
{
- if (argument == null) throw new ArgumentNullException(parameterName,
+ if (argument == null) throw new ArgumentNullException(parameterName,
"The parameter cannot be null.");
Contract.EndContractBlock();
}
@@ -16,10 +16,10 @@ public static void NotNull(object argument, string parameterName)
public class Example
{
- public void Execute(string value)
+ public void Execute(string value)
{
ValidationHelper.NotNull(value , "value");
-
+
// Body of method goes here.
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow3.cs
index ed5b40d4316..3ed118234fc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.diagnostics.contracts.contractargumentvalidatorattribute/cs/ifthenthrow3.cs
@@ -2,12 +2,12 @@
using System;
using System.Diagnostics.Contracts;
-static class ValidationHelper
+static class ValidationHelper
{
[ContractArgumentValidator]
- public static void NotNull(object argument, string parameterName)
+ public static void NotNull(object argument, string parameterName)
{
- if (argument == null) throw new ArgumentNullException(parameterName,
+ if (argument == null) throw new ArgumentNullException(parameterName,
"The parameter cannot be null.");
Contract.EndContractBlock();
}
@@ -16,20 +16,20 @@ public static void NotNull(object argument, string parameterName)
public static void InRange(object[] array, int index, string arrayName, string indexName)
{
NotNull(array, arrayName);
-
- if (index < 0)
- throw new ArgumentOutOfRangeException(indexName,
+
+ if (index < 0)
+ throw new ArgumentOutOfRangeException(indexName,
"The index cannot be negative.");
- if (index >= array.Length)
- throw new ArgumentOutOfRangeException(indexName,
- "The index is outside the bounds of the array.");
+ if (index >= array.Length)
+ throw new ArgumentOutOfRangeException(indexName,
+ "The index is outside the bounds of the array.");
Contract.EndContractBlock();
}
}
public class Example
{
- public void Execute(object[] data, int position)
+ public void Execute(object[] data, int position)
{
ValidationHelper.InRange(data, position, "data", "position");
@@ -46,5 +46,5 @@ public static void Main()
Example ex = new Example();
ex.Execute(numbers, 3);
Console.WriteLine("No exception!");
- }
+ }
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.class.precision/cs/precision1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.class.precision/cs/precision1.cs
index c2470ce50f6..715415cd9fc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.class.precision/cs/precision1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.class.precision/cs/precision1.cs
@@ -6,14 +6,14 @@ public static void Main()
{
//
double value = -4.42330604244772E-305;
-
+
double fromLiteral = -4.42330604244772E-305;
double fromVariable = value;
double fromParse = Double.Parse("-4.42330604244772E-305");
-
+
Console.WriteLine("Double value from literal: {0,29:R}", fromLiteral);
Console.WriteLine("Double value from variable: {0,28:R}", fromVariable);
- Console.WriteLine("Double value from Parse method: {0,24:R}", fromParse);
+ Console.WriteLine("Double value from Parse method: {0,24:R}", fromParse);
// On 32-bit versions of the .NET Framework, the output is:
// Double value from literal: -4.42330604244772E-305
// Double value from variable: -4.42330604244772E-305
@@ -22,7 +22,7 @@ public static void Main()
// On other versions of the .NET Framework, the output is:
// Double value from literal: -4.4233060424477198E-305
// Double value from variable: -4.4233060424477198E-305
- // Double value from Parse method: -4.42330604244772E-305
+ // Double value from Parse method: -4.42330604244772E-305
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto2.cs
index 4dd616bdf2c..ef98c25736a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto2.cs
@@ -15,6 +15,6 @@ public static void Main()
}
// The example displays the following output:
// Comparing 6.185 and 6.185: -1
-//
+//
// Comparing 6.185 and 6.1850000000000005: -1
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto3.cs
index 9ec91168cbf..3b780ec6473 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.compareto/cs/compareto3.cs
@@ -15,6 +15,6 @@ public static void Main()
}
// The example displays the following output:
// Comparing 6.185 and 6.185: -1
-//
+//
// Comparing 6.185 and 6.1850000000000005: -1
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.equals/cs/equalsabs1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.equals/cs/equalsabs1.cs
index b8266175d43..405533fef24 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.equals/cs/equalsabs1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.equals/cs/equalsabs1.cs
@@ -9,7 +9,7 @@ public static void Main()
double value2 = 0;
for (int ctr = 0; ctr < 10; ctr++)
value2 += .1;
-
+
Console.WriteLine("{0:R} = {1:R}: {2}", value1, value2,
HasMinimalDifference(value1, value2, 1));
}
@@ -18,13 +18,13 @@ public static bool HasMinimalDifference(double value1, double value2, int units)
{
long lValue1 = BitConverter.DoubleToInt64Bits(value1);
long lValue2 = BitConverter.DoubleToInt64Bits(value2);
-
+
// If the signs are different, return false except for +0 and -0.
if ((lValue1 >> 63) != (lValue2 >> 63))
{
if (value1 == value2)
return true;
-
+
return false;
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.equals/cs/equalsoverl.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.equals/cs/equalsoverl.cs
index 3ca86767095..8a2fab62a45 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.equals/cs/equalsoverl.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.equals/cs/equalsoverl.cs
@@ -4,7 +4,7 @@
public class Example
{
static double value = 112;
-
+
public static void Main()
{
byte byte1= 112;
@@ -22,7 +22,7 @@ public static void Main()
long long1 = 112;
Console.WriteLine("value = long1: {0,17}", value.Equals(long1));
TestObjectForEquality(long1);
-
+
sbyte sbyte1 = 112;
Console.WriteLine("value = sbyte1: {0,16}", value.Equals(sbyte1));
TestObjectForEquality(sbyte1);
@@ -38,7 +38,7 @@ public static void Main()
ulong ulong1 = 112;
Console.WriteLine("value = ulong1: {0,17}", value.Equals(ulong1));
TestObjectForEquality(ulong1);
-
+
decimal dec1 = 112m;
Console.WriteLine("value = dec1: {0,21}", value.Equals(dec1));
TestObjectForEquality(dec1);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.maxvalue/cs/maxvalueex.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.maxvalue/cs/maxvalueex.cs
index 3219e3a07e8..e058257805e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.maxvalue/cs/maxvalueex.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.maxvalue/cs/maxvalueex.cs
@@ -6,15 +6,15 @@ public class Example
public static void Main()
{
double result1 = 7.997e307 + 9.985e307;
- Console.WriteLine("{0} (Positive Infinity: {1})",
+ Console.WriteLine("{0} (Positive Infinity: {1})",
result1, Double.IsPositiveInfinity(result1));
-
+
double result2 = 1.5935e250 * 7.948e110;
- Console.WriteLine("{0} (Positive Infinity: {1})",
+ Console.WriteLine("{0} (Positive Infinity: {1})",
result2, Double.IsPositiveInfinity(result2));
-
+
double result3 = Math.Pow(1.256e100, 1.34e20);
- Console.WriteLine("{0} (Positive Infinity: {1})",
+ Console.WriteLine("{0} (Positive Infinity: {1})",
result3, Double.IsPositiveInfinity(result3));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.minvalue/cs/minvalueex.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.minvalue/cs/minvalueex.cs
index 96f1321eec4..472ba350b59 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.minvalue/cs/minvalueex.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.minvalue/cs/minvalueex.cs
@@ -6,11 +6,11 @@ public class Example
public static void Main()
{
double result1 = -7.997e307 + -9.985e307;
- Console.WriteLine("{0} (Negative Infinity: {1})",
+ Console.WriteLine("{0} (Negative Infinity: {1})",
result1, Double.IsNegativeInfinity(result1));
-
+
double result2 = -1.5935e250 * 7.948e110;
- Console.WriteLine("{0} (Negative Infinity: {1})",
+ Console.WriteLine("{0} (Negative Infinity: {1})",
result2, Double.IsNegativeInfinity(result2));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.nan/cs/double.nan4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.nan/cs/double.nan4.cs
index 37820afb6ee..cb88724f360 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.nan/cs/double.nan4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.nan/cs/double.nan4.cs
@@ -5,21 +5,21 @@ public class Example
{
public static void Main()
{
- Console.WriteLine("NaN == NaN: {0}", Double.NaN == Double.NaN);
- Console.WriteLine("NaN != NaN: {0}", Double.NaN != Double.NaN);
- Console.WriteLine("NaN.Equals(NaN): {0}", Double.NaN.Equals(Double.NaN));
- Console.WriteLine("! NaN.Equals(NaN): {0}", ! Double.NaN.Equals(Double.NaN));
+ Console.WriteLine("NaN == NaN: {0}", Double.NaN == Double.NaN);
+ Console.WriteLine("NaN != NaN: {0}", Double.NaN != Double.NaN);
+ Console.WriteLine("NaN.Equals(NaN): {0}", Double.NaN.Equals(Double.NaN));
+ Console.WriteLine("! NaN.Equals(NaN): {0}", ! Double.NaN.Equals(Double.NaN));
Console.WriteLine("IsNaN: {0}", Double.IsNaN(Double.NaN));
- Console.WriteLine("\nNaN > NaN: {0}", Double.NaN > Double.NaN);
- Console.WriteLine("NaN >= NaN: {0}", Double.NaN >= Double.NaN);
+ Console.WriteLine("\nNaN > NaN: {0}", Double.NaN > Double.NaN);
+ Console.WriteLine("NaN >= NaN: {0}", Double.NaN >= Double.NaN);
Console.WriteLine("NaN < NaN: {0}", Double.NaN < Double.NaN);
- Console.WriteLine("NaN < 100.0: {0}", Double.NaN < 100.0);
- Console.WriteLine("NaN <= 100.0: {0}", Double.NaN <= 100.0);
+ Console.WriteLine("NaN < 100.0: {0}", Double.NaN < 100.0);
+ Console.WriteLine("NaN <= 100.0: {0}", Double.NaN <= 100.0);
Console.WriteLine("NaN >= 100.0: {0}", Double.NaN > 100.0);
- Console.WriteLine("NaN.CompareTo(NaN): {0}", Double.NaN.CompareTo(Double.NaN));
- Console.WriteLine("NaN.CompareTo(100.0): {0}", Double.NaN.CompareTo(100.0));
- Console.WriteLine("(100.0).CompareTo(Double.NaN): {0}", (100.0).CompareTo(Double.NaN));
+ Console.WriteLine("NaN.CompareTo(NaN): {0}", Double.NaN.CompareTo(Double.NaN));
+ Console.WriteLine("NaN.CompareTo(100.0): {0}", Double.NaN.CompareTo(100.0));
+ Console.WriteLine("(100.0).CompareTo(Double.NaN): {0}", (100.0).CompareTo(Double.NaN));
}
}
// The example displays the following output:
@@ -28,7 +28,7 @@ public static void Main()
// NaN.Equals(NaN): True
// ! NaN.Equals(NaN): False
// IsNaN: True
-//
+//
// NaN > NaN: False
// NaN >= NaN: False
// NaN < NaN: False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.nan/cs/nan1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.nan/cs/nan1.cs
index feec0332bca..af444d8712e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.nan/cs/nan1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.nan/cs/nan1.cs
@@ -8,26 +8,26 @@ public static void Main()
double zero = 0.0;
Console.WriteLine("{0} / {1} = {2}", zero, zero, zero/zero);
// The example displays the following output:
- // 0 / 0 = NaN
- //
+ // 0 / 0 = NaN
+ //
//
double nan1 = Double.NaN;
-
+
Console.WriteLine("{0} + {1} = {2}", 3, nan1, 3 + nan1);
Console.WriteLine("Abs({0}) = {1}", nan1, Math.Abs(nan1));
// The example displays the following output:
// 3 + NaN = NaN
// Abs(NaN) = NaN
- //
+ //
Console.WriteLine();
-
+
//
double result = Double.NaN;
- Console.WriteLine("{0} = Double.Nan: {1}",
+ Console.WriteLine("{0} = Double.Nan: {1}",
result, result == Double.NaN);
// The example displays the following output:
// NaN = Double.Nan: False
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/comparison2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/comparison2.cs
index c5d00b08ce9..2289c9bd6c8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/comparison2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/comparison2.cs
@@ -9,13 +9,13 @@ public static void Main()
value1 = Math.Sqrt(Math.Pow(value1, 2));
double value2 = Math.Pow(value1 * 3.51, 2);
value2 = Math.Sqrt(value2) / 3.51;
- Console.WriteLine("{0} = {1}: {2}\n",
- value1, value2, value1.Equals(value2));
- Console.WriteLine("{0:R} = {1:R}", value1, value2);
+ Console.WriteLine("{0} = {1}: {2}\n",
+ value1, value2, value1.Equals(value2));
+ Console.WriteLine("{0:R} = {1:R}", value1, value2);
}
}
// The example displays the following output:
// 100.10142 = 100.10142: False
-//
+//
// 100.10142 = 100.10141999999999
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/comparison4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/comparison4.cs
index adf721f5dae..84e0a8a4b4c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/comparison4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/comparison4.cs
@@ -11,9 +11,9 @@ public static void Main()
one2 += .1;
Console.WriteLine("{0:R} = {1:R}: {2}", one1, one2, one1.Equals(one2));
- Console.WriteLine("{0:R} is approximately equal to {1:R}: {2}",
- one1, one2,
- IsApproximatelyEqual(one1, one2, .000000001));
+ Console.WriteLine("{0:R} is approximately equal to {1:R}: {2}",
+ one1, one2,
+ IsApproximatelyEqual(one1, one2, .000000001));
}
static bool IsApproximatelyEqual(double value1, double value2, double epsilon)
@@ -30,11 +30,11 @@ static bool IsApproximatelyEqual(double value1, double value2, double epsilon)
// Handle zero to avoid division by zero
double divisor = Math.Max(value1, value2);
- if (divisor.Equals(0))
+ if (divisor.Equals(0))
divisor = Math.Min(value1, value2);
-
- return Math.Abs((value1 - value2) / divisor) <= epsilon;
- }
+
+ return Math.Abs((value1 - value2) / divisor) <= epsilon;
+ }
}
// The example displays the following output:
// 1 = 0.99999999999999989: False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/exceptional2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/exceptional2.cs
index 2fd2fdb2aca..c5be229f23a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/exceptional2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/exceptional2.cs
@@ -8,24 +8,24 @@ public static void Main()
Double value1 = 4.565e153;
Double value2 = 6.9375e172;
Double result = value1 * value2;
- Console.WriteLine("PositiveInfinity: {0}",
+ Console.WriteLine("PositiveInfinity: {0}",
Double.IsPositiveInfinity(result));
- Console.WriteLine("NegativeInfinity: {0}\n",
+ Console.WriteLine("NegativeInfinity: {0}\n",
Double.IsNegativeInfinity(result));
value1 = -value1;
result = value1 * value2;
- Console.WriteLine("PositiveInfinity: {0}",
+ Console.WriteLine("PositiveInfinity: {0}",
Double.IsPositiveInfinity(result));
- Console.WriteLine("NegativeInfinity: {0}",
+ Console.WriteLine("NegativeInfinity: {0}",
Double.IsNegativeInfinity(result));
}
-}
+}
// The example displays the following output:
// PositiveInfinity: True
// NegativeInfinity: False
-//
+//
// PositiveInfinity: False
// NegativeInfinity: True
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist1.cs
index 8fdd96ee6e3..7bf2b888dae 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist1.cs
@@ -8,7 +8,7 @@ public static void Main()
Double value1 = 1/3.0;
Single sValue2 = 1/3.0f;
Double value2 = (Double) sValue2;
- Console.WriteLine("{0:R} = {1:R}: {2}", value1, value2,
+ Console.WriteLine("{0:R} = {1:R}: {2}", value1, value2,
value1.Equals(value2));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist3.cs
index b0db795d350..2d8b774c755 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist3.cs
@@ -15,13 +15,13 @@ public static void Main()
Console.WriteLine("The sum of the values equals the total.");
else
Console.WriteLine("The sum of the values ({0}) does not equal the total ({1}).",
- total, result);
+ total, result);
}
}
// The example displays the following output:
-// The sum of the values (36.64) does not equal the total (36.64).
+// The sum of the values (36.64) does not equal the total (36.64).
//
// If the index items in the Console.WriteLine statement are changed to {0:R},
// the example displays the following output:
-// The sum of the values (27.639999999999997) does not equal the total (27.64).
+// The sum of the values (27.639999999999997) does not equal the total (27.64).
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist4.cs
index 86e1388ad32..aa5f6ff2cbe 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist4.cs
@@ -12,18 +12,18 @@ public static void Main()
sw.Write(values[ctr].ToString());
if (ctr != values.Length - 1)
sw.Write("|");
- }
+ }
sw.Close();
-
+
Double[] restoredValues = new Double[values.Length];
StreamReader sr = new StreamReader(@".\Doubles.dat");
string temp = sr.ReadToEnd();
string[] tempStrings = temp.Split('|');
for (int ctr = 0; ctr < tempStrings.Length; ctr++)
- restoredValues[ctr] = Double.Parse(tempStrings[ctr]);
+ restoredValues[ctr] = Double.Parse(tempStrings[ctr]);
for (int ctr = 0; ctr < values.Length; ctr++)
- Console.WriteLine("{0} {2} {1}", values[ctr],
+ Console.WriteLine("{0} {2} {1}", values[ctr],
restoredValues[ctr],
values[ctr].Equals(restoredValues[ctr]) ? "=" : "<>");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist5.cs
index 1f1ea2f8881..b5e940d98f7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/precisionlist5.cs
@@ -8,20 +8,20 @@ public static void Main()
{
StreamWriter sw = new StreamWriter(@".\Doubles.dat");
Double[] values = { 2.2/1.01, 1.0/3, Math.PI };
- for (int ctr = 0; ctr < values.Length; ctr++)
+ for (int ctr = 0; ctr < values.Length; ctr++)
sw.Write("{0:G17}{1}", values[ctr], ctr < values.Length - 1 ? "|" : "" );
sw.Close();
-
+
Double[] restoredValues = new Double[values.Length];
StreamReader sr = new StreamReader(@".\Doubles.dat");
string temp = sr.ReadToEnd();
string[] tempStrings = temp.Split('|');
for (int ctr = 0; ctr < tempStrings.Length; ctr++)
- restoredValues[ctr] = Double.Parse(tempStrings[ctr]);
+ restoredValues[ctr] = Double.Parse(tempStrings[ctr]);
for (int ctr = 0; ctr < values.Length; ctr++)
- Console.WriteLine("{0} {2} {1}", values[ctr],
+ Console.WriteLine("{0} {2} {1}", values[ctr],
restoredValues[ctr],
values[ctr].Equals(restoredValues[ctr]) ? "=" : "<>");
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/representation2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/representation2.cs
index 8ff23a136c6..debe1026d88 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/representation2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.double.structure/cs/representation2.cs
@@ -7,7 +7,7 @@ public static void Main()
{
Double value = 123456789012.34567;
Double additional = Double.Epsilon * 1e15;
- Console.WriteLine("{0} + {1} = {2}", value, additional,
+ Console.WriteLine("{0} + {1} = {2}", value, additional,
value + additional);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.dynamic.dynamicobject/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.dynamic.dynamicobject/cs/program.cs
index 8ec661cdf7e..eee73b1ed97 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.dynamic.dynamicobject/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.dynamic.dynamicobject/cs/program.cs
@@ -8,7 +8,7 @@
// Class description, TrySetMember, TryGetMember
namespace Test1
-{
+{
//
// The class derived from DynamicObject.
public class DynamicDictionary : DynamicObject
@@ -27,7 +27,7 @@ public int Count
}
}
- // If you try to get a value of a property
+ // If you try to get a value of a property
// not defined in the class, this method is called.
public override bool TryGetMember(
GetMemberBinder binder, out object result)
@@ -64,7 +64,7 @@ static void Main(string[] args)
// Creating a dynamic dictionary.
dynamic person = new DynamicDictionary();
- // Adding new dynamic properties.
+ // Adding new dynamic properties.
// The TrySetMember method is called.
person.FirstName = "Ellen";
person.LastName = "Adams";
@@ -75,7 +75,7 @@ static void Main(string[] args)
Console.WriteLine(person.firstname + " " + person.lastname);
// Getting the value of the Count property.
- // The TryGetMember is not called,
+ // The TryGetMember is not called,
// because the property is defined in the class.
Console.WriteLine(
"Number of dynamic properties:" + person.Count);
@@ -123,12 +123,12 @@ public override bool TrySetMember(
return true;
}
- // Perform the binary operation.
+ // Perform the binary operation.
public override bool TryBinaryOperation(
BinaryOperationBinder binder, object arg, out object result)
{
- // The Textual property contains the textual representaion
- // of two numbers, in addition to the name
+ // The Textual property contains the textual representaion
+ // of two numbers, in addition to the name
// of the binary operation.
string resultTextual =
dictionary["Textual"].ToString() + " "
@@ -156,7 +156,7 @@ public override bool TryBinaryOperation(
// In case of any other binary operation,
// print out the type of operation and return false,
- // which means that the language should determine
+ // which means that the language should determine
// what to do.
// (Usually the language just throws an exception.)
default:
@@ -258,7 +258,7 @@ public override bool TrySetMember(
public override bool TryConvert(
ConvertBinder binder, out object result)
{
- // Converting to string.
+ // Converting to string.
if (binder.Type == typeof(String))
{
result = dictionary["Textual"];
@@ -272,7 +272,7 @@ public override bool TryConvert(
return true;
}
- // In case of any other type, the binder
+ // In case of any other type, the binder
// attempts to perform the conversion itself.
// In most cases, a run-time exception is thrown.
return base.TryConvert(binder, out result);
@@ -372,7 +372,7 @@ static void Test(string[] args)
// Creating a dynamic object.
dynamic sampleObject = new SampleDynamicObject();
- // Creating Property0.
+ // Creating Property0.
// The TrySetMember method is called.
sampleObject.Property0 = "Zero";
@@ -438,7 +438,7 @@ public override bool TryInvoke(
(args[0].GetType() == typeof(int)) &&
(args[1].GetType() == typeof(String)))
{
- // If the property already exists,
+ // If the property already exists,
// its value is changed.
// Otherwise, a new property is created.
if (dictionary.ContainsKey("Numeric"))
@@ -487,7 +487,7 @@ static void Test(string[] args)
Console.WriteLine(number.Numeric + " " + number.Textual);
// The following statement produces a run-time exception
- // because in this example the method invocation
+ // because in this example the method invocation
// expects two arguments.
// number(0);
}
@@ -586,15 +586,15 @@ static void Main(string[] args)
person.Print();
// The following statement throws an exception at run time.
- // There is no Sample method
+ // There is no Sample method
// in the dictionary or in the DynamicDictionary class.
- // person.Sample();
+ // person.Sample();
}
}
// This example has the following output:
- // FirstName Ellen
+ // FirstName Ellen
// LastName Adams
// Removing all the elements from the dictionary.
// No elements in the dictionary.
@@ -629,12 +629,12 @@ public override bool TrySetMember(
return true;
}
- // Perform the unary operation.
+ // Perform the unary operation.
public override bool TryUnaryOperation(
UnaryOperationBinder binder, out object result)
{
- // The Textual property contains
- // the name of the unary operation in addition
+ // The Textual property contains
+ // the name of the unary operation in addition
// to the textual representaion of the number.
string resultTextual =
binder.Operation + " " +
@@ -651,9 +651,9 @@ public override bool TryUnaryOperation(
default:
// In case of any other unary operation,
// print out the type of operation and return false,
- // which means that the language should determine
+ // which means that the language should determine
// what to do.
- // (Usually the language just throws an exception.)
+ // (Usually the language just throws an exception.)
Console.WriteLine(
binder.Operation +
": This unary operation is not implemented");
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.dynamic.expandoobject/cs/program.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.dynamic.expandoobject/cs/program.cs
index 0456f64c6bb..24ff78602fa 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.dynamic.expandoobject/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.dynamic.expandoobject/cs/program.cs
@@ -24,7 +24,7 @@ static void Test(string[] args)
// System.String
//
- //
+ //
sampleObject.number = 10;
sampleObject.Increment = (Action)(() => { sampleObject.number++; });
@@ -105,7 +105,7 @@ private static void WritePerson(dynamic person)
namespace n3
{
//
- // Add "using System.ComponentModel;" line
+ // Add "using System.ComponentModel;" line
// to the beginning of the file.
class Program
{
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/badcall1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/badcall1.cs
index 2d61667a0a6..c0e492dc5b3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/badcall1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/badcall1.cs
@@ -6,7 +6,7 @@ public class Example
{
[DllImport("user32.dll", CharSet = CharSet.Unicode, ExactSpelling = true )]
public static extern int MessageBox(IntPtr hwnd, String text, String caption, uint type);
-
+
[DllImport("user32.dll", CharSet = CharSet.Unicode, ExactSpelling = true )]
public static extern int MessageBoxW(IntPtr hwnd, String text, String caption, uint type);
@@ -16,7 +16,7 @@ public static void Main()
MessageBox(new IntPtr(0), "Calling the MessageBox Function", "Example", 0);
}
catch (EntryPointNotFoundException e) {
- Console.WriteLine("{0}:\n {1}", e.GetType().Name,
+ Console.WriteLine("{0}:\n {1}", e.GetType().Name,
e.Message);
}
@@ -24,7 +24,7 @@ public static void Main()
MessageBoxW(new IntPtr(0), "Calling the MessageBox Function", "Example", 0);
}
catch (EntryPointNotFoundException e) {
- Console.WriteLine("{0}:\n {1}", e.GetType().Name,
+ Console.WriteLine("{0}:\n {1}", e.GetType().Name,
e.Message);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/importassembly1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/importassembly1.cs
index 557b8cf1728..2bfcb3036b3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/importassembly1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/importassembly1.cs
@@ -13,7 +13,7 @@ public static void Main()
}
}
// The example displays the following output:
-// Unhandled Exception: System.EntryPointNotFoundException: Unable to find an entry point
+// Unhandled Exception: System.EntryPointNotFoundException: Unable to find an entry point
// named 'GoodMorning' in DLL 'StringUtilities.dll'.
// at Example.GoodMorning(String& name)
// at Example.Main()
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/mangle1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/mangle1.cs
index 48d1730a1e2..b5f577764a4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/mangle1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/mangle1.cs
@@ -13,7 +13,7 @@ public static void Main()
}
}
// The example displays the following output:
-// Unhandled Exception: System.EntryPointNotFoundException: Unable to find
+// Unhandled Exception: System.EntryPointNotFoundException: Unable to find
// an entry point named 'Double' in DLL '.\TestDll.dll'.
// at Example.Double(Int32 number)
// at Example.Main()
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/nofunction1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/nofunction1.cs
index cd5de9c45a9..6e34c71308c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/nofunction1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cs/nofunction1.cs
@@ -6,16 +6,16 @@ public class Example
{
[DllImport("user32.dll")]
public static extern int GetMyNumber();
-
+
public static void Main()
{
try {
int number = GetMyNumber();
}
catch (EntryPointNotFoundException e) {
- Console.WriteLine("{0}:\n {1}", e.GetType().Name,
+ Console.WriteLine("{0}:\n {1}", e.GetType().Name,
e.Message);
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/Extensions.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/Extensions.cs
index 16599aa06f3..6c035229044 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/Extensions.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/Extensions.cs
@@ -6,7 +6,7 @@ public enum Grades { F = 0, D = 1, C = 2, B = 3, A = 4 };
// Define an extension method for the Grades enumeration.
public static class Extensions
-{
+{
public static Grades minPassing = Grades.D;
public static bool Passing(this Grades grade)
@@ -16,7 +16,7 @@ public static bool Passing(this Grades grade)
}
class Example
-{
+{
static void Main()
{
Grades g1 = Grades.D;
@@ -33,9 +33,9 @@ static void Main()
// The exmaple displays the following output:
// D is a passing grade.
// F is not a passing grade.
-//
+//
// Raising the bar!
-//
+//
// D is not a passing grade.
// F is not a passing grade.
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/class2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/class2.cs
index f5b9d937acf..e77567250bb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/class2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/class2.cs
@@ -23,10 +23,10 @@ public static void Main()
//
int value3 = 2;
ArrivalStatus status3 = (ArrivalStatus) value3;
-
+
int value4 = (int) status3;
//
-
+
//
int number = -1;
ArrivalStatus arrived = (ArrivalStatus) ArrivalStatus.ToObject(typeof(ArrivalStatus), number);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classbitwise1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classbitwise1.cs
index 516fe39a439..183415bd13c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classbitwise1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classbitwise1.cs
@@ -14,7 +14,7 @@ public static void Main()
Pets familyPets = Pets.Dog | Pets.Cat;
Console.WriteLine("Pets: {0:G} ({0:D})", familyPets);
// The example displays the following output:
- // Pets: Dog, Cat (3)
+ // Pets: Dog, Cat (3)
//
ShowHasFlag();
@@ -29,10 +29,10 @@ private static void ShowHasFlag()
if (familyPets.HasFlag(Pets.Dog))
Console.WriteLine("The family has a dog.");
// The example displays the following output:
- // The family has a dog.
+ // The family has a dog.
//
}
-
+
private static void ShowIfSet()
{
//
@@ -40,7 +40,7 @@ private static void ShowIfSet()
if ((familyPets & Pets.Dog) == Pets.Dog)
Console.WriteLine("The family has a dog.");
// The example displays the following output:
- // The family has a dog.
+ // The family has a dog.
//
}
@@ -51,9 +51,9 @@ private static void TestForNone()
if (familyPets == Pets.None)
Console.WriteLine("The family has no pets.");
else
- Console.WriteLine("The family has pets.");
+ Console.WriteLine("The family has pets.");
// The example displays the following output:
- // The family has pets.
+ // The family has pets.
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classiterate.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classiterate.cs
index 2ea3200456b..488b1858d47 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classiterate.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classiterate.cs
@@ -13,7 +13,7 @@ public static void Main()
private static void GetEnumByName()
{
- //
+ //
string[] names = Enum.GetNames(typeof(ArrivalStatus));
Console.WriteLine("Members of {0}:", typeof(ArrivalStatus).Name);
Array.Sort(names);
@@ -26,10 +26,10 @@ private static void GetEnumByName()
// Early (1)
// Late (-1)
// OnTime (0)
- // Unknown (-3)
- //
+ // Unknown (-3)
+ //
}
-
+
private static void GetEnumByValue()
{
//
@@ -37,7 +37,7 @@ private static void GetEnumByValue()
Console.WriteLine("Members of {0}:", typeof(ArrivalStatus).Name);
foreach (ArrivalStatus status in values) {
Console.WriteLine(" {0} ({0:D})", status);
- }
+ }
// The example displays the following output:
// Members of ArrivalStatus:
// OnTime (0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classparse1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classparse1.cs
index c08e526abe0..ce81323869c 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classparse1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.class/cs/classparse1.cs
@@ -9,7 +9,7 @@ public static void Main()
//
string number = "-1";
string name = "Early";
-
+
try {
ArrivalStatus status1 = (ArrivalStatus) Enum.Parse(typeof(ArrivalStatus), number);
if (!(Enum.IsDefined(typeof(ArrivalStatus), status1)))
@@ -17,10 +17,10 @@ public static void Main()
Console.WriteLine("Converted '{0}' to {1}", number, status1);
}
catch (FormatException) {
- Console.WriteLine("Unable to convert '{0}' to an ArrivalStatus value.",
+ Console.WriteLine("Unable to convert '{0}' to an ArrivalStatus value.",
number);
- }
-
+ }
+
ArrivalStatus status2;
if (Enum.TryParse(name, out status2)) {
if (!(Enum.IsDefined(typeof(ArrivalStatus), status2)))
@@ -28,12 +28,12 @@ public static void Main()
Console.WriteLine("Converted '{0}' to {1}", name, status2);
}
else {
- Console.WriteLine("Unable to convert '{0}' to an ArrivalStatus value.",
+ Console.WriteLine("Unable to convert '{0}' to an ArrivalStatus value.",
number);
}
// The example displays the following output:
// Converted '-1' to Late
// Converted 'Early' to Early
- //
+ //
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.equals/cs/enumequals.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.equals/cs/enumequals.cs
index 4c8d4d39095..7f13b10464f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.equals/cs/enumequals.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.equals/cs/enumequals.cs
@@ -1,7 +1,7 @@
//
using System;
-public enum SledDog { Unknown=0, AlaskanMalamute=1, Malamute=1,
+public enum SledDog { Unknown=0, AlaskanMalamute=1, Malamute=1,
Husky=2, SiberianHusky=2 };
public enum WorkDog { Unknown=0, Newfoundland=1, GreatPyrennes=2 };
@@ -13,8 +13,8 @@ public static void Main()
SledDog dog1 = SledDog.Malamute;
SledDog dog2 = SledDog.AlaskanMalamute;
WorkDog dog3 = WorkDog.Newfoundland;
-
- Console.WriteLine("{0:F} ({0:D}) = {1:F} ({1:D}): {2}",
+
+ Console.WriteLine("{0:F} ({0:D}) = {1:F} ({1:D}): {2}",
dog1, dog2, dog1.Equals(dog2));
Console.WriteLine("{0:F} ({0:D}) = {1:F} ({1:D}): {2}",
dog1, dog3, dog1.Equals(dog3));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getnames/cs/getnames1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getnames/cs/getnames1.cs
index faa2649593f..d022b2cb1cc 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getnames/cs/getnames1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getnames/cs/getnames1.cs
@@ -2,7 +2,7 @@
using System;
enum SignMagnitude { Negative = -1, Zero = 0, Positive = 1 };
-
+
public class Example
{
public static void Main()
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getunderlyingtype/cs/getunderlyingtype1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getunderlyingtype/cs/getunderlyingtype1.cs
index 7aff49bbd78..3da0bd520fa 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getunderlyingtype/cs/getunderlyingtype1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getunderlyingtype/cs/getunderlyingtype1.cs
@@ -5,10 +5,10 @@ public class Example
{
public static void Main()
{
- Enum[] enumValues = { ConsoleColor.Red, DayOfWeek.Monday,
- MidpointRounding.ToEven, PlatformID.Win32NT,
+ Enum[] enumValues = { ConsoleColor.Red, DayOfWeek.Monday,
+ MidpointRounding.ToEven, PlatformID.Win32NT,
DateTimeKind.Utc, StringComparison.Ordinal };
- Console.WriteLine("{0,-10} {1, 18} {2,15}\n",
+ Console.WriteLine("{0,-10} {1, 18} {2,15}\n",
"Member", "Enumeration", "Underlying Type");
foreach (var enumValue in enumValues)
DisplayEnumInfo(enumValue);
@@ -19,12 +19,12 @@ static void DisplayEnumInfo(Enum enumValue)
Type enumType = enumValue.GetType();
Type underlyingType = Enum.GetUnderlyingType(enumType);
Console.WriteLine("{0,-10} {1, 18} {2,15}",
- enumValue, enumType.Name, underlyingType.Name);
+ enumValue, enumType.Name, underlyingType.Name);
}
}
// The example displays the following output:
// Member Enumeration Underlying Type
-//
+//
// Red ConsoleColor Int32
// Monday DayOfWeek Int32
// ToEven MidpointRounding Int32
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getvalues/cs/getvalues1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getvalues/cs/getvalues1.cs
index 9f7c2a445a8..8350f8cec7f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getvalues/cs/getvalues1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getvalues/cs/getvalues1.cs
@@ -2,7 +2,7 @@
using System;
enum SignMagnitude { Negative = -1, Zero = 0, Positive = 1 };
-
+
public class Example
{
public static void Main()
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getvalues/cs/getvalues_reflectiononly.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getvalues/cs/getvalues_reflectiononly.cs
index 44adb44f69e..b0efd60821a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getvalues/cs/getvalues_reflectiononly.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.getvalues/cs/getvalues_reflectiononly.cs
@@ -12,8 +12,8 @@ public static void Main()
foreach (var field in fields) {
if (field.Name.Equals("value__")) continue;
-
- Console.WriteLine("{0,-9} {1}", field.Name + ":",
+
+ Console.WriteLine("{0,-9} {1}", field.Name + ":",
field.GetRawConstantValue());
}
}
@@ -30,6 +30,6 @@ public static void Main()
//
//
-[Flags] enum Pets { None=0, Dog=1, Cat=2, Rodent=4, Bird=8,
+[Flags] enum Pets { None=0, Dog=1, Cat=2, Rodent=4, Bird=8,
Fish=16, Reptile=32, Other=64 };
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.hasflag/cs/hasflag0.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.hasflag/cs/hasflag0.cs
index f9698b49f66..e956822dacf 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.hasflag/cs/hasflag0.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.hasflag/cs/hasflag0.cs
@@ -27,10 +27,10 @@ public static void Main()
else if (petsInFamily.HasFlag(Pets.Dog))
familiesWithDog++;
}
- Console.WriteLine("{0} of {1} families in the sample have no pets.",
- familiesWithoutPets, petsInFamilies.Length);
- Console.WriteLine("{0} of {1} families in the sample have a dog.",
- familiesWithDog, petsInFamilies.Length);
+ Console.WriteLine("{0} of {1} families in the sample have no pets.",
+ familiesWithoutPets, petsInFamilies.Length);
+ Console.WriteLine("{0} of {1} families in the sample have a dog.",
+ familiesWithDog, petsInFamilies.Length);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.hasflag/cs/hasflag1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.hasflag/cs/hasflag1.cs
index f2c485d5840..d42ca1aa5ae 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.hasflag/cs/hasflag1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.hasflag/cs/hasflag1.cs
@@ -7,7 +7,7 @@ [Flags] public enum DinnerItems {
Appetizer = 2,
Side = 4,
Dessert = 8,
- Beverage = 16,
+ Beverage = 16,
BarBeverage = 32
}
@@ -18,7 +18,7 @@ public static void Main()
DinnerItems myOrder = DinnerItems.Appetizer | DinnerItems.Entree |
DinnerItems.Beverage | DinnerItems.Dessert;
DinnerItems flagValue = DinnerItems.Entree | DinnerItems.Beverage;
- Console.WriteLine("{0} includes {1}: {2}",
+ Console.WriteLine("{0} includes {1}: {2}",
myOrder, flagValue, myOrder.HasFlag(flagValue));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tostring/cs/tostringbyvalue1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tostring/cs/tostringbyvalue1.cs
index e193636e99b..a87fce7459a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tostring/cs/tostringbyvalue1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tostring/cs/tostringbyvalue1.cs
@@ -3,7 +3,7 @@
//
enum Shade
{
- White = 0, Gray = 1, Grey = 1, Black = 2
+ White = 0, Gray = 1, Grey = 1, Black = 2
}
//
@@ -16,13 +16,13 @@ public static void Main()
}
private static void CallDefault()
- {
+ {
//
- string shadeName = ((Shade) 1).ToString();
+ string shadeName = ((Shade) 1).ToString();
//
Console.WriteLine(shadeName);
}
-
+
private static void CallWithFormatString()
{
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tryparse/cs/tryparse1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tryparse/cs/tryparse1.cs
index c347c1200fb..3482877cf98 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tryparse/cs/tryparse1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tryparse/cs/tryparse1.cs
@@ -2,7 +2,7 @@
using System;
[Flags] enum Colors { None=0, Red = 1, Green = 2, Blue = 4 };
-
+
public class Example
{
public static void Main()
@@ -11,8 +11,8 @@ public static void Main()
foreach (string colorString in colorStrings)
{
Colors colorValue;
- if (Enum.TryParse(colorString, out colorValue))
- if (Enum.IsDefined(typeof(Colors), colorValue) | colorValue.ToString().Contains(","))
+ if (Enum.TryParse(colorString, out colorValue))
+ if (Enum.IsDefined(typeof(Colors), colorValue) | colorValue.ToString().Contains(","))
Console.WriteLine("Converted '{0}' to {1}.", colorString, colorValue.ToString());
else
Console.WriteLine("{0} is not an underlying value of the Colors enumeration.", colorString);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tryparse/cs/tryparse2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tryparse/cs/tryparse2.cs
index 7ceee87e218..5dbbd37dec6 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tryparse/cs/tryparse2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.enum.tryparse/cs/tryparse2.cs
@@ -2,7 +2,7 @@
using System;
[Flags] enum Colors { None=0, Red = 1, Green = 2, Blue = 4 };
-
+
public class Example
{
public static void Main()
@@ -11,8 +11,8 @@ public static void Main()
foreach (string colorString in colorStrings)
{
Colors colorValue;
- if (Enum.TryParse(colorString, true, out colorValue))
- if (Enum.IsDefined(typeof(Colors), colorValue) | colorValue.ToString().Contains(","))
+ if (Enum.TryParse(colorString, true, out colorValue))
+ if (Enum.IsDefined(typeof(Colors), colorValue) | colorValue.ToString().Contains(","))
Console.WriteLine("Converted '{0}' to {1}.", colorString, colorValue.ToString());
else
Console.WriteLine("{0} is not an underlying value of the Colors enumeration.", colorString);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.exitcode/cs/double.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.exitcode/cs/double.cs
index 60a5025bb46..9b745f19c15 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.exitcode/cs/double.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.exitcode/cs/double.cs
@@ -12,7 +12,7 @@ public static void Main()
{
string[] args = Environment.GetCommandLineArgs();
if (args.Length == 1) {
- Environment.ExitCode = ERROR_INVALID_COMMAND_LINE;
+ Environment.ExitCode = ERROR_INVALID_COMMAND_LINE;
}
else {
BigInteger value = 0;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.exitcode/cs/double1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.exitcode/cs/double1.cs
index a9a16db3e53..d54df5a6bff 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.exitcode/cs/double1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.exitcode/cs/double1.cs
@@ -13,7 +13,7 @@ public static int Main()
{
string[] args = Environment.GetCommandLineArgs();
if (args.Length == 1) {
- return ERROR_INVALID_COMMAND_LINE;
+ return ERROR_INVALID_COMMAND_LINE;
}
else {
BigInteger value = 0;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.getenvironmentvariable/cs/getenvironmentvariableex1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.getenvironmentvariable/cs/getenvironmentvariableex1.cs
index f75e9e94e0a..d29bb64a1cb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.getenvironmentvariable/cs/getenvironmentvariableex1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.getenvironmentvariable/cs/getenvironmentvariableex1.cs
@@ -6,27 +6,27 @@ public static void Main()
{
string value;
bool toDelete = false;
-
+
// Check whether the environment variable exists.
value = Environment.GetEnvironmentVariable("Test1");
// If necessary, create it.
- if (value == null)
+ if (value == null)
{
Environment.SetEnvironmentVariable("Test1", "Value1");
toDelete = true;
-
+
// Now retrieve it.
value = Environment.GetEnvironmentVariable("Test1");
}
// Display the value.
Console.WriteLine($"Test1: {value}\n");
-
+
// Confirm that the value can only be retrieved from the process
// environment block if running on a Windows system.
- if (Environment.OSVersion.Platform == PlatformID.Win32NT)
+ if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
Console.WriteLine("Attempting to retrieve Test1 from:");
- foreach (EnvironmentVariableTarget enumValue in
+ foreach (EnvironmentVariableTarget enumValue in
Enum.GetValues(typeof(EnvironmentVariableTarget))) {
value = Environment.GetEnvironmentVariable("Test1", enumValue);
Console.WriteLine($" {enumValue}: {(value != null ? "found" : "not found")}");
@@ -35,12 +35,12 @@ public static void Main()
}
// If we've created it, now delete it.
- if (toDelete) {
+ if (toDelete) {
Environment.SetEnvironmentVariable("Test1", null);
// Confirm the deletion.
if (Environment.GetEnvironmentVariable("Test1") == null)
Console.WriteLine("Test1 has been deleted.");
- }
+ }
}
}
// The example displays the following output if run on a Windows system:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.getenvironmentvariable/cs/setenvironmentvariable1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.getenvironmentvariable/cs/setenvironmentvariable1.cs
index fd5baa997f6..bb579ae8ff9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.getenvironmentvariable/cs/setenvironmentvariable1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.environment.getenvironmentvariable/cs/setenvironmentvariable1.cs
@@ -7,25 +7,25 @@ public static void Main()
{
String envName = "AppDomain";
String envValue = "True";
-
+
// Determine whether the environment variable exists.
if (Environment.GetEnvironmentVariable(envName) == null)
// If it doesn't exist, create it.
Environment.SetEnvironmentVariable(envName, envValue);
-
+
bool createAppDomain;
Message msg;
if (Boolean.TryParse(Environment.GetEnvironmentVariable(envName),
out createAppDomain) && createAppDomain) {
AppDomain domain = AppDomain.CreateDomain("Domain2");
- msg = (Message) domain.CreateInstanceAndUnwrap(typeof(Example).Assembly.FullName,
+ msg = (Message) domain.CreateInstanceAndUnwrap(typeof(Example).Assembly.FullName,
"Message");
- msg.Display();
- }
+ msg.Display();
+ }
else {
msg = new Message();
- msg.Display();
- }
+ msg.Display();
+ }
}
}
@@ -33,7 +33,7 @@ public class Message : MarshalByRefObject
{
public void Display()
{
- Console.WriteLine("Executing in domain {0}",
+ Console.WriteLine("Executing in domain {0}",
AppDomain.CurrentDomain.FriendlyName);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/rethrow1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/rethrow1.cs
index 590a9e937a1..1cfb0e42244 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/rethrow1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/rethrow1.cs
@@ -37,7 +37,7 @@ public static void Main()
int[] indexes = s.FindOccurrences("a");
ShowOccurrences(s, "a", indexes);
Console.WriteLine();
-
+
String toFind = null;
try {
indexes = s.FindOccurrences(toFind);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/rethrow3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/rethrow3.cs
index c077ac589fa..b64f1035a46 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/rethrow3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/rethrow3.cs
@@ -36,7 +36,7 @@ public static void Main()
int[] indexes = s.FindOccurrences("a");
ShowOccurrences(s, "a", indexes);
Console.WriteLine();
-
+
String toFind = null;
//
try {
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/usageerrors1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/usageerrors1.cs
index 1b1de6052a0..30518a8bb80 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/usageerrors1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/usageerrors1.cs
@@ -4,18 +4,18 @@
public class Person
{
private string _name;
-
- public string Name
+
+ public string Name
{
- get { return _name; }
+ get { return _name; }
set { _name = value; }
}
-
+
public override int GetHashCode()
{
- return this.Name.GetHashCode();
- }
-
+ return this.Name.GetHashCode();
+ }
+
public override bool Equals(object obj)
{
// This implementation contains an error in program logic:
@@ -31,10 +31,10 @@ public static void Main()
{
Person p1 = new Person();
p1.Name = "John";
- Person p2 = null;
-
+ Person p2 = null;
+
// The following throws a NullReferenceException.
- Console.WriteLine("p1 = p2: {0}", p1.Equals(p2));
+ Console.WriteLine("p1 = p2: {0}", p1.Equals(p2));
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/usageerrors2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/usageerrors2.cs
index ada7ed5265c..1b0fca5d2a9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/usageerrors2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.class/cs/usageerrors2.cs
@@ -4,23 +4,23 @@
public class Person
{
private string _name;
-
- public string Name
+
+ public string Name
{
- get { return _name; }
+ get { return _name; }
set { _name = value; }
}
-
+
public override int GetHashCode()
{
- return this.Name.GetHashCode();
- }
-
+ return this.Name.GetHashCode();
+ }
+
public override bool Equals(object obj)
{
// This implementation handles a null obj argument.
- Person p = obj as Person;
- if (p == null)
+ Person p = obj as Person;
+ if (p == null)
return false;
else
return this.Name.Equals(p.Name);
@@ -33,9 +33,9 @@ public static void Main()
{
Person p1 = new Person();
p1.Name = "John";
- Person p2 = null;
-
- Console.WriteLine("p1 = p2: {0}", p1.Equals(p2));
+ Person p2 = null;
+
+ Console.WriteLine("p1 = p2: {0}", p1.Equals(p2));
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.serializeobjectstate/cs/example2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.serializeobjectstate/cs/example2.cs
index 50d30af8012..9a635d803e9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.serializeobjectstate/cs/example2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.serializeobjectstate/cs/example2.cs
@@ -15,12 +15,12 @@ public static void Main()
foreach (var value in values) {
try {
BadDivisionException ex = null;
- if (divisor == 0) {
+ if (divisor == 0) {
if (! serialized) {
// Instantiate the exception object.
ex = new BadDivisionException(0);
// Serialize the exception object.
- var fs = new FileStream("BadDivision1.dat",
+ var fs = new FileStream("BadDivision1.dat",
FileMode.Create);
formatter.Serialize(fs, ex);
fs.Close();
@@ -35,17 +35,17 @@ public static void Main()
fs.Position = 0;
formatter.Serialize(fs, ex);
fs.Close();
- Console.WriteLine("Reserialized the exception...");
- }
- throw ex;
- }
+ Console.WriteLine("Reserialized the exception...");
+ }
+ throw ex;
+ }
Console.WriteLine("{0} / {1} = {1}", value, divisor, value/divisor);
- }
+ }
catch (BadDivisionException e) {
Console.WriteLine("Bad divisor from a {0} exception: {1}",
- serialized ? "deserialized" : "new", e.Divisor);
+ serialized ? "deserialized" : "new", e.Divisor);
serialized = true;
- }
+ }
}
}
}
@@ -58,33 +58,33 @@ public static void Main()
public BadDivisionException(Double divisor)
{
state.Divisor = divisor;
- HandleSerialization();
+ HandleSerialization();
}
-
+
private void HandleSerialization()
{
- SerializeObjectState += delegate(object exception, SafeSerializationEventArgs eventArgs)
- {
+ SerializeObjectState += delegate(object exception, SafeSerializationEventArgs eventArgs)
+ {
eventArgs.AddSerializedState(state);
};
}
-
+
public Double Divisor
{ get { return state.Divisor; } }
- [Serializable] private struct BadDivisionExceptionState : ISafeSerializationData
+ [Serializable] private struct BadDivisionExceptionState : ISafeSerializationData
{
private Double badDivisor;
-
+
public Double Divisor
- { get { return badDivisor; }
+ { get { return badDivisor; }
set { badDivisor = value; } }
void ISafeSerializationData.CompleteDeserialization(object deserialized)
- {
+ {
var ex = deserialized as BadDivisionException;
ex.HandleSerialization();
- ex.state = this;
+ ex.state = this;
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.tostring/cs/ToStringEx1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.tostring/cs/ToStringEx1.cs
index 7d323710337..599b0582942 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.tostring/cs/ToStringEx1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.exception.tostring/cs/ToStringEx1.cs
@@ -4,7 +4,7 @@
public class TestClass
{}
-public class Example
+public class Example
{
public static void Main()
{
@@ -34,17 +34,17 @@ public static void Main()
// Exception information: System.ArgumentException: Object must be of type String.
// at System.String.CompareTo(Object value)
// at Example.Main()
-//
+//
// Comparing 'some text' with 'TestClass': -1
-//
+//
// Bad argument: 123 (type Int32)
// Exception information: System.ArgumentException: Object must be of type String.
// at System.String.CompareTo(Object value)
// at Example.Main()
-//
+//
// Comparing 'some text' with '123': 1
-//
+//
// Comparing 'some text' with 'some text': 0
-//
+//
// Comparing 'some text' with 'Some Text': -1
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example1.cs
index 34c06f0f28f..a3c78ccc7c2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example1.cs
@@ -3,7 +3,7 @@
public class Example
{
- public enum TemperatureScale
+ public enum TemperatureScale
{ Celsius, Fahrenheit, Kelvin }
public static void Main()
@@ -18,9 +18,9 @@ private static String GetCurrentTemperature()
Decimal temp = 20.6m;
TemperatureScale scale = TemperatureScale.Celsius;
String result;
-
+
result = String.Format("At {0:t} on {1:D}, the temperature is {2:F1} {3:G}",
- dat, temp, scale);
+ dat, temp, scale);
return result;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example2.cs
index 3ff1f0d7e1a..6da89ee16c2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example2.cs
@@ -3,7 +3,7 @@
public class Example
{
- public enum TemperatureScale
+ public enum TemperatureScale
{ Celsius, Fahrenheit, Kelvin }
public static void Main()
@@ -18,9 +18,9 @@ private static String GetCurrentTemperature()
Decimal temp = 20.6m;
TemperatureScale scale = TemperatureScale.Celsius;
String result;
-
+
result = String.Format("At {0:t} on {0:D}, the temperature is {1:F1} {2:G}",
- dat, temp, scale);
+ dat, temp, scale);
return result;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example3.cs
index e97e3cae5f7..05ca92cc6fb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/example3.cs
@@ -7,7 +7,7 @@ public static void Main()
int n1 = 10;
int n2 = 20;
//
- String result = String.Format("{0} + {1} = {2}",
+ String result = String.Format("{0} + {1} = {2}",
n1, n2, n1 + n2);
//
Console.WriteLine(result);
@@ -19,7 +19,7 @@ public static void Main2()
//
int n1 = 10;
int n2 = 20;
- String result = String.Format("{0 + {1] = {2}",
+ String result = String.Format("{0 + {1] = {2}",
n1, n2, n1 + n2);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/iformattable3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/iformattable3.cs
index 3f47d8e297c..da08b5c919f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/iformattable3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/iformattable3.cs
@@ -10,7 +10,7 @@ public static void Main()
}
}
// The example displays the following output:
-// Unhandled Exception: System.FormatException:
+// Unhandled Exception: System.FormatException:
// Format String can be only "D", "d", "N", "n", "P", "p", "B", "b", "X" or "x".
// at System.Guid.ParseExact(String input, String format)
// at Example.Main()
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/qa1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/qa1.cs
index 49b6847ba68..5ed49a01c3a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/qa1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/qa1.cs
@@ -13,14 +13,14 @@ public static void Main()
int number = rnd.Next(1001);
numbers[ctr] = number;
total += number;
- }
+ }
numbers[3] = total;
- Console.WriteLine("{0} + {1} + {2} = {3}", numbers);
+ Console.WriteLine("{0} + {1} + {2} = {3}", numbers);
}
}
// The example displays the following output:
-// Unhandled Exception:
-// System.FormatException:
+// Unhandled Exception:
+// System.FormatException:
// Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
// at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
// at System.IO.TextWriter.WriteLine(String format, Object arg0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/qa2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/qa2.cs
index e05c6dbbd23..57ea94cad88 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/qa2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.formatexception/cs/qa2.cs
@@ -13,11 +13,11 @@ public static void Main()
int number = rnd.Next(1001);
numbers[ctr] = number;
total += number;
- }
+ }
numbers[3] = total;
object[] values = new object[numbers.Length];
numbers.CopyTo(values, 0);
- Console.WriteLine("{0} + {1} + {2} = {3}", values);
+ Console.WriteLine("{0} + {1} + {2} = {3}", values);
}
}
// The example displays output like the following:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.gc.collect int example/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.gc.collect int example/CS/class1.cs
index 890beb3db00..e7a6b207854 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.gc.collect int example/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.gc.collect int example/CS/class1.cs
@@ -6,7 +6,7 @@ namespace GCCollectIntExample
class MyGCCollectClass
{
private const long maxGarbage = 1000;
-
+
static void Main()
{
MyGCCollectClass myGCCol = new MyGCCollectClass();
@@ -14,27 +14,27 @@ static void Main()
// Determine the maximum number of generations the system
// garbage collector currently supports.
Console.WriteLine("The highest generation is {0}", GC.MaxGeneration);
-
+
myGCCol.MakeSomeGarbage();
// Determine which generation myGCCol object is stored in.
Console.WriteLine("Generation: {0}", GC.GetGeneration(myGCCol));
-
- // Determine the best available approximation of the number
+
+ // Determine the best available approximation of the number
// of bytes currently allocated in managed memory.
Console.WriteLine("Total Memory: {0}", GC.GetTotalMemory(false));
-
+
// Perform a collection of generation 0 only.
GC.Collect(0);
-
+
// Determine which generation myGCCol object is stored in.
Console.WriteLine("Generation: {0}", GC.GetGeneration(myGCCol));
-
+
Console.WriteLine("Total Memory: {0}", GC.GetTotalMemory(false));
-
+
// Perform a collection of all generations up to and including 2.
GC.Collect(2);
-
+
// Determine which generation myGCCol object is stored in.
Console.WriteLine("Generation: {0}", GC.GetGeneration(myGCCol));
Console.WriteLine("Total Memory: {0}", GC.GetTotalMemory(false));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.gc.suppressfinalize/cs/suppressfinalize1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.gc.suppressfinalize/cs/suppressfinalize1.cs
index c05d06d2799..784b847e675 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.gc.suppressfinalize/cs/suppressfinalize1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.gc.suppressfinalize/cs/suppressfinalize1.cs
@@ -10,20 +10,20 @@ public class ConsoleMonitor : IDisposable
const int STD_ERROR_HANDLE = -12;
[DllImport("kernel32.dll", SetLastError = true)]
- static extern IntPtr GetStdHandle(int nStdHandle);
+ static extern IntPtr GetStdHandle(int nStdHandle);
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool WriteConsole(IntPtr hConsoleOutput, string lpBuffer,
uint nNumberOfCharsToWrite, out uint lpNumberOfCharsWritten,
- IntPtr lpReserved);
+ IntPtr lpReserved);
[DllImport("kernel32.dll", SetLastError = true)]
- static extern bool CloseHandle(IntPtr handle);
-
+ static extern bool CloseHandle(IntPtr handle);
+
private bool disposed = false;
private IntPtr handle;
private Component component;
-
+
public ConsoleMonitor()
{
handle = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -31,7 +31,7 @@ public ConsoleMonitor()
throw new InvalidOperationException("A console handle is not available.");
component = new Component();
-
+
string output = "The ConsoleMonitor class constructor.\n";
uint written = 0;
WriteConsole(handle, output, (uint) output.Length, out written, IntPtr.Zero);
@@ -45,7 +45,7 @@ public ConsoleMonitor()
uint written = 0;
WriteConsole(handle, output, (uint) output.Length, out written, IntPtr.Zero);
}
- else {
+ else {
Console.Error.WriteLine("Object finalization.");
}
// Call Dispose with disposing = false.
@@ -66,7 +66,7 @@ public void Dispose()
WriteConsole(handle, output, (uint) output.Length, out written, IntPtr.Zero);
Dispose(true);
- GC.SuppressFinalize(this);
+ GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
@@ -86,11 +86,11 @@ private void Dispose(bool disposing)
// Free unmanaged resources.
output = "Disposing of unmanaged resources.";
WriteConsole(handle, output, (uint) output.Length, out written, IntPtr.Zero);
-
+
if (handle != IntPtr.Zero) {
if (! CloseHandle(handle))
- Console.Error.WriteLine("Handle cannot be closed.");
- }
+ Console.Error.WriteLine("Handle cannot be closed.");
+ }
}
disposed = true;
}
@@ -113,7 +113,7 @@ public static void Main()
// The ConsoleMonitor finalizer.
// The Dispose(False) method.
// Disposing of unmanaged resources.
-//
+//
// If the monitor.Dispose method is called, the example displays the following output:
// ConsoleMonitor instance....
// The ConsoleMonitor class constructor.
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.addmethods/cs/add1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.addmethods/cs/add1.cs
index cc42ad05fd1..1274409f5a1 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.addmethods/cs/add1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.addmethods/cs/add1.cs
@@ -5,7 +5,7 @@ public class Example
{
static DateTime date1 = DateTime.SpecifyKind(new DateTime(2009, 6, 1, 7, 42, 0), DateTimeKind.Local);
static DateTime time, returnTime;
-
+
public static void Main()
{
Calendar[] calendars = { new ChineseLunisolarCalendar(),
@@ -42,18 +42,18 @@ public static void Main()
AddYears(cal);
}
}
-
+
private static void AddDays(Calendar cal)
{
int days = 3;
Example.time = date1;
-
+
//
returnTime = DateTime.SpecifyKind(cal.AddDays(time, days), time.Kind);
//
Console.WriteLine(returnTime.Kind == time.Kind);
}
-
+
private static void AddHours(Calendar cal)
{
int hours = 3;
@@ -63,7 +63,7 @@ private static void AddHours(Calendar cal)
returnTime = DateTime.SpecifyKind(cal.AddHours(time, hours), time.Kind);
//
}
-
+
private static void AddMilliseconds(Calendar cal)
{
int milliseconds = 100000;
@@ -74,7 +74,7 @@ private static void AddMilliseconds(Calendar cal)
//
Console.WriteLine(returnTime.Kind == time.Kind);
}
-
+
private static void AddMinutes(Calendar cal)
{
int minutes = 90;
@@ -85,7 +85,7 @@ private static void AddMinutes(Calendar cal)
//
Console.WriteLine(returnTime.Kind == time.Kind);
}
-
+
private static void AddMonths(Calendar cal)
{
int months = 11;
@@ -96,7 +96,7 @@ private static void AddMonths(Calendar cal)
//
Console.WriteLine(returnTime.Kind == time.Kind);
}
-
+
private static void AddSeconds(Calendar cal)
{
int seconds = 90;
@@ -107,7 +107,7 @@ private static void AddSeconds(Calendar cal)
//
Console.WriteLine(returnTime.Kind == time.Kind);
}
-
+
private static void AddWeeks(Calendar cal)
{
int weeks = 12;
@@ -118,7 +118,7 @@ private static void AddWeeks(Calendar cal)
//
Console.WriteLine(returnTime.Kind == time.Kind);
}
-
+
private static void AddYears(Calendar cal)
{
int years = 12;
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.algorithmtype/cs/algorithmtype1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.algorithmtype/cs/algorithmtype1.cs
index 1b0c32f24d9..0a1b40131ef 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.algorithmtype/cs/algorithmtype1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendar.algorithmtype/cs/algorithmtype1.cs
@@ -17,11 +17,11 @@ public static void Main()
foreach (var cal in calendars) {
// Instantiate a calendar object.
ConstructorInfo ctor = cal.GetConstructor( new Type[] {} );
- Calendar calObj = (Calendar) ctor.Invoke( new Type[] {} );
+ Calendar calObj = (Calendar) ctor.Invoke( new Type[] {} );
- Console.WriteLine("{0,-30} {1}",
+ Console.WriteLine("{0,-30} {1}",
cal.ToString().Replace("System.Globalization.", ""),
- cal.InvokeMember("AlgorithmType",
+ cal.InvokeMember("AlgorithmType",
BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty,
null, calObj, null));
}
@@ -51,7 +51,7 @@ public int Compare(object x, object y)
}
// The example displays the following output:
// Calendar Algorithm Type
-//
+//
// ChineseLunisolarCalendar LunisolarCalendar
// GregorianCalendar SolarCalendar
// HebrewCalendar LunisolarCalendar
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendarweekrule/cs/calendarweekruleex.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendarweekrule/cs/calendarweekruleex.cs
index 9bc84977213..a8b4eb24e98 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendarweekrule/cs/calendarweekruleex.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.calendarweekrule/cs/calendarweekruleex.cs
@@ -5,34 +5,34 @@
public class Example
{
static Calendar cal = new GregorianCalendar();
-
+
public static void Main()
{
DateTime date = new DateTime(2013, 1, 5);
DayOfWeek firstDay = DayOfWeek.Sunday;
CalendarWeekRule rule;
-
+
rule = CalendarWeekRule.FirstFullWeek;
ShowWeekNumber(date, rule, firstDay);
-
+
rule = CalendarWeekRule.FirstFourDayWeek;
ShowWeekNumber(date, rule, firstDay);
-
+
Console.WriteLine();
date = new DateTime(2010, 1, 3);
ShowWeekNumber(date, rule, firstDay);
}
- private static void ShowWeekNumber(DateTime dat, CalendarWeekRule rule,
+ private static void ShowWeekNumber(DateTime dat, CalendarWeekRule rule,
DayOfWeek firstDay)
- {
+ {
Console.WriteLine("{0:d} with {1:F} rule and {2:F} as first day of week: week {3}",
dat, rule, firstDay, cal.GetWeekOfYear(dat, rule, firstDay));
- }
+ }
}
// The example displays the following output:
// 1/5/2013 with FirstFullWeek rule and Sunday as first day of week: week 53
// 1/5/2013 with FirstFourDayWeek rule and Sunday as first day of week: week 1
-//
+//
// 1/3/2010 with FirstFourDayWeek rule and Sunday as first day of week: week 1
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.charunicodeinfo.getnumericvalue/cs/getnumericvalue1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.charunicodeinfo.getnumericvalue/cs/getnumericvalue1.cs
index cc073543087..76d7d47a56a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.charunicodeinfo.getnumericvalue/cs/getnumericvalue1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.charunicodeinfo.getnumericvalue/cs/getnumericvalue1.cs
@@ -15,7 +15,7 @@ private static void Overload1()
int utf32 = 0x10107; // AEGEAN NUMBER ONE
string surrogate = Char.ConvertFromUtf32(utf32);
foreach (var ch in surrogate)
- Console.WriteLine("U+{0:X4}: {1} ", Convert.ToUInt16(ch),
+ Console.WriteLine("U+{0:X4}: {1} ", Convert.ToUInt16(ch),
System.Globalization.CharUnicodeInfo.GetNumericValue(ch));
// The example displays the following output:
@@ -23,21 +23,21 @@ private static void Overload1()
// U+DD07: -1
//
}
-
+
private static void Overload2()
{
//
- // Define a UTF32 value for each character in the
+ // Define a UTF32 value for each character in the
// Aegean numbering system.
for (int utf32 = 0x10107; utf32 <= 0x10133; utf32++) {
string surrogate = Char.ConvertFromUtf32(utf32);
- for (int ctr = 0; ctr < surrogate.Length; ctr++)
- Console.Write("U+{0:X4} at position {1}: {2} ",
- Convert.ToUInt16(surrogate[ctr]), ctr,
+ for (int ctr = 0; ctr < surrogate.Length; ctr++)
+ Console.Write("U+{0:X4} at position {1}: {2} ",
+ Convert.ToUInt16(surrogate[ctr]), ctr,
System.Globalization.CharUnicodeInfo.GetNumericValue(surrogate, ctr));
Console.WriteLine();
- }
+ }
// The example displays the following output:
// U+D800 at position 0: 1 U+DD07 at position 1: -1
// U+D800 at position 0: 2 U+DD08 at position 1: -1
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.charunicodeinfo.getunicodecategory/cs/getunicodecategory1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.charunicodeinfo.getunicodecategory/cs/getunicodecategory1.cs
index f49dd985f4b..657f8944eeb 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.charunicodeinfo.getunicodecategory/cs/getunicodecategory1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.charunicodeinfo.getunicodecategory/cs/getunicodecategory1.cs
@@ -15,27 +15,27 @@ private static void Overload1()
int utf32 = 0x10380; // UGARITIC LETTER ALPA
string surrogate = Char.ConvertFromUtf32(utf32);
foreach (var ch in surrogate)
- Console.WriteLine("U+{0:X4}: {1:G}",
- Convert.ToUInt16(ch),
+ Console.WriteLine("U+{0:X4}: {1:G}",
+ Convert.ToUInt16(ch),
System.Globalization.CharUnicodeInfo.GetUnicodeCategory(ch));
// The example displays the following output:
// U+D800: Surrogate
// U+DF80: Surrogate
//
}
-
+
private static void Overload2()
{
//
int utf32 = 0x10380; // UGARITIC LETTER ALPA
string surrogate = Char.ConvertFromUtf32(utf32);
for (int ctr = 0; ctr < surrogate.Length; ctr++)
- Console.WriteLine("U+{0:X4}: {1:G}",
- Convert.ToUInt16(surrogate[ctr]),
+ Console.WriteLine("U+{0:X4}: {1:G}",
+ Convert.ToUInt16(surrogate[ctr]),
System.Globalization.CharUnicodeInfo.GetUnicodeCategory(surrogate, ctr));
// The example displays the following output:
// U+D800: OtherLetter
- // U+DF80: Surrogate
+ // U+DF80: Surrogate
//
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable1.cs
index e0dfbd00867..a5836a615ff 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable1.cs
@@ -7,18 +7,18 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the index of the last soft hyphen.
Console.WriteLine(ci.LastIndexOf(s1, "\u00AD"));
Console.WriteLine(ci.LastIndexOf(s2, "\u00AD"));
-
+
// Find the index of the last soft hyphen followed by "n".
Console.WriteLine(ci.LastIndexOf(s1, "\u00ADn"));
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn"));
-
+
// Find the index of the last soft hyphen followed by "m".
Console.WriteLine(ci.LastIndexOf(s1, "\u00ADm"));
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm"));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable10.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable10.cs
index 37584d7eea7..25c89c8aa1f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable10.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable10.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
int position = 0;
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the index of the soft hyphen.
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -21,9 +21,9 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", position, position + 1));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -32,9 +32,9 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", position, position + 1));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -43,7 +43,7 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", position, position + 1));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable11.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable11.cs
index fed805e3856..c3b0f789868 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable11.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable11.cs
@@ -7,36 +7,36 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
int position = 0;
-
+
// Find the index of the soft hyphen using culture-sensitive comparison.
position = ci.LastIndexOf(s1, 'm');
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s1, '\u00AD', position,
+ Console.WriteLine(ci.LastIndexOf(s1, '\u00AD', position,
position + 1, CompareOptions.IgnoreCase));
-
+
position = ci.LastIndexOf(s2, 'm');
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s2, '\u00AD', position,
+ Console.WriteLine(ci.LastIndexOf(s2, '\u00AD', position,
position + 1, CompareOptions.IgnoreCase));
-
+
// Find the index of the soft hyphen using ordinal comparison.
position = ci.LastIndexOf(s1, 'm');
Console.WriteLine("'m' at position {0}", position, CompareOptions.Ordinal);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s1, '\u00AD', position,
+ Console.WriteLine(ci.LastIndexOf(s1, '\u00AD', position,
position + 1, CompareOptions.Ordinal));
-
+
position = ci.LastIndexOf(s2, 'm');
Console.WriteLine("'m' at position {0}", position, CompareOptions.Ordinal);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s2, '\u00AD', position,
+ Console.WriteLine(ci.LastIndexOf(s2, '\u00AD', position,
position + 1, CompareOptions.Ordinal));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable12.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable12.cs
index ed18beba1a5..eabe6c7dff5 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable12.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable12.cs
@@ -7,92 +7,92 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
int position = 0;
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// All the following comparisons are culture-sensitive.
- Console.WriteLine("Culture-sensitive comparisons:");
+ Console.WriteLine("Culture-sensitive comparisons:");
// Find the index of the soft hyphen.
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s1, "\u00AD", position,
+ Console.WriteLine(ci.LastIndexOf(s1, "\u00AD", position,
position + 1, CompareOptions.None));
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", position,
+ if (position >= 0)
+ Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", position,
position + 1, CompareOptions.None));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s1, "\u00ADn", position,
+ Console.WriteLine(ci.LastIndexOf(s1, "\u00ADn", position,
position + 1, CompareOptions.IgnoreCase));
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", position,
+ if (position >= 0)
+ Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", position,
position + 1, CompareOptions.IgnoreCase));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s1, "\u00ADm", position,
+ Console.WriteLine(ci.LastIndexOf(s1, "\u00ADm", position,
position + 1, CompareOptions.IgnoreCase));
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", position,
+ if (position >= 0)
+ Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", position,
position + 1, CompareOptions.IgnoreCase));
// All the following comparisons are ordinal.
- Console.WriteLine("\nOrdinal comparisons:");
+ Console.WriteLine("\nOrdinal comparisons:");
// Find the index of the soft hyphen.
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s1, "\u00AD", position,
+ Console.WriteLine(ci.LastIndexOf(s1, "\u00AD", position,
position + 1, CompareOptions.Ordinal));
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", position,
+ if (position >= 0)
+ Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", position,
position + 1, CompareOptions.Ordinal));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s1, "\u00ADn", position,
+ Console.WriteLine(ci.LastIndexOf(s1, "\u00ADn", position,
position + 1, CompareOptions.Ordinal));
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", position,
+ if (position >= 0)
+ Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", position,
position + 1, CompareOptions.Ordinal));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s1, "\u00ADm", position,
+ Console.WriteLine(ci.LastIndexOf(s1, "\u00ADm", position,
position + 1, CompareOptions.Ordinal));
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
- Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", position,
+ if (position >= 0)
+ Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", position,
position + 1, CompareOptions.Ordinal));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable14.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable14.cs
index 287acde98f6..ec9e2b8d398 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable14.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable14.cs
@@ -18,7 +18,7 @@ public static void Main()
Console.WriteLine(ci.LastIndexOf(s1, searchString, position, CompareOptions.None));
Console.WriteLine(ci.LastIndexOf(s1, searchString, position, CompareOptions.Ordinal));
}
-
+
position = ci.LastIndexOf(s2, 'm');
if (position >= 0) {
Console.WriteLine(ci.LastIndexOf(s2, searchString, position, CompareOptions.None));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable16.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable16.cs
index 718bd289494..b13dc64f95a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable16.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable16.cs
@@ -18,7 +18,7 @@ public static void Main()
Console.WriteLine(ci.LastIndexOf(s1, searchString, position, 3, CompareOptions.None));
Console.WriteLine(ci.LastIndexOf(s1, searchString, position, 3, CompareOptions.Ordinal));
}
-
+
position = ci.LastIndexOf(s2, 'm');
if (position >= 0) {
Console.WriteLine(ci.LastIndexOf(s2, searchString, position, 3, CompareOptions.None));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable2.cs
index 3fe9f7954c3..67e9bbae6f0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable2.cs
@@ -7,10 +7,10 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the index of the last soft hyphen.
Console.WriteLine(ci.LastIndexOf(s1, '\u00AD'));
Console.WriteLine(ci.LastIndexOf(s2, '\u00AD'));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable3.cs
index d5b1165ad0f..c006c1016f7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable3.cs
@@ -7,10 +7,10 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the last index of the soft hyphen using culture-sensitive comparison.
Console.WriteLine(ci.LastIndexOf(s1, '\u00AD', CompareOptions.IgnoreCase));
Console.WriteLine(ci.LastIndexOf(s2, '\u00AD', CompareOptions.IgnoreCase));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable4.cs
index 5267df115b3..648e4cd2770 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable4.cs
@@ -7,18 +7,18 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
int position = 0;
-
+
// Find the last index of the soft hyphen.
position = ci.LastIndexOf(s1, 'm');
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s1, '\u00AD', position));
-
+
position = ci.LastIndexOf(s2, 'm');
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable5.cs
index 3cb3b732fdb..03ce1445f60 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable5.cs
@@ -7,32 +7,32 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
Console.WriteLine("Culture-sensitive comparison:");
// Use culture-sensitive comparison to find the last soft hyphen.
Console.WriteLine(ci.LastIndexOf(s1, "\u00AD", CompareOptions.None));
Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", CompareOptions.None));
-
+
// Use culture-sensitive comparison to find the last soft hyphen followed by "n".
Console.WriteLine(ci.LastIndexOf(s1, "\u00ADn", CompareOptions.None));
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", CompareOptions.None));
-
+
// Use culture-sensitive comparison to find the last soft hyphen followed by "m".
Console.WriteLine(ci.LastIndexOf(s1, "\u00ADm", CompareOptions.None));
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", CompareOptions.None));
-
+
Console.WriteLine("Ordinal comparison:");
// Use ordinal comparison to find the last soft hyphen.
Console.WriteLine(ci.LastIndexOf(s1, "\u00AD", CompareOptions.Ordinal));
Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", CompareOptions.Ordinal));
-
+
// Use ordinal comparison to find the last soft hyphen followed by "n".
Console.WriteLine(ci.LastIndexOf(s1, "\u00ADn", CompareOptions.Ordinal));
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", CompareOptions.Ordinal));
-
+
// Use ordinal comparison to find the last soft hyphen followed by "m".
Console.WriteLine(ci.LastIndexOf(s1, "\u00ADm", CompareOptions.Ordinal));
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", CompareOptions.Ordinal));
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable6.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable6.cs
index 13e383dbbe9..7b196884e00 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable6.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable6.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
int position = 0;
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Find the index of the soft hyphen.
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -21,9 +21,9 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", position));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -32,9 +32,9 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", position));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -43,7 +43,7 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", position));
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable7.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable7.cs
index 91b0f6d894d..6dc774ee361 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable7.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable7.cs
@@ -7,29 +7,29 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
int position = 0;
-
+
// Find the index of the soft hyphen using culture-sensitive comparison.
position = ci.LastIndexOf(s1, 'm');
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s1, '\u00AD', position, CompareOptions.IgnoreCase));
-
+
position = ci.LastIndexOf(s2, 'm');
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, '\u00AD', position, CompareOptions.IgnoreCase));
-
+
// Find the index of the soft hyphen using ordinal comparison.
position = ci.LastIndexOf(s1, 'm');
Console.WriteLine("'m' at position {0}", position, CompareOptions.Ordinal);
if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s1, '\u00AD', position, CompareOptions.Ordinal));
-
+
position = ci.LastIndexOf(s2, 'm');
Console.WriteLine("'m' at position {0}", position, CompareOptions.Ordinal);
if (position >= 0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable8.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable8.cs
index 2b82846cf3e..905d4309754 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable8.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable8.cs
@@ -7,18 +7,18 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
int position = 0;
-
+
// Find the index of the soft hyphen.
position = ci.IndexOf(s1, 'm');
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s1, '\u00AD', position, position + 1));
-
+
position = ci.IndexOf(s2, 'm');
Console.WriteLine("'m' at position {0}", position);
if (position >= 0)
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable9.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable9.cs
index 458907c238c..ddce1524068 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable9.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.compareinfo.lastindexof/cs/lastignorable9.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
-
+
int position = 0;
string s1 = "ani\u00ADmal";
string s2 = "animal";
-
+
// Use culture-sensitive comparison for the following searches:
Console.WriteLine("Culture-sensitive comparisons:");
// Find the index of the soft hyphen.
@@ -23,9 +23,9 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", position, CompareOptions.None));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -34,9 +34,9 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", position, CompareOptions.IgnoreCase));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -45,10 +45,10 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", position, CompareOptions.IgnoreCase));
- Console.WriteLine();
+ Console.WriteLine();
// Use ordinal comparison for the following searches:
Console.WriteLine("Ordinal comparisons:");
// Find the index of the soft hyphen.
@@ -59,9 +59,9 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00AD", position, CompareOptions.Ordinal));
-
+
// Find the index of the soft hyphen followed by "n".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -70,9 +70,9 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADn", position, CompareOptions.Ordinal));
-
+
// Find the index of the soft hyphen followed by "m".
position = ci.LastIndexOf(s1, "m");
Console.WriteLine("'m' at position {0}", position);
@@ -81,7 +81,7 @@ public static void Main()
position = ci.LastIndexOf(s2, "m");
Console.WriteLine("'m' at position {0}", position);
- if (position >= 0)
+ if (position >= 0)
Console.WriteLine(ci.LastIndexOf(s2, "\u00ADm", position, CompareOptions.Ordinal));
}
}
@@ -99,7 +99,7 @@ public static void Main()
// 4
// 'm' at position 3
// 3
-//
+//
// Ordinal comparisons:
// 'm' at position 4
// 3
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureTypes/cs/ct.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureTypes/cs/ct.cs
index 7d02e3669f9..9eb0ca94518 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureTypes/cs/ct.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureTypes/cs/ct.cs
@@ -17,7 +17,7 @@ public static void Main()
Console.Write(" NeutralCulture");
if (ci.CultureTypes.HasFlag(CultureTypes.SpecificCultures))
Console.Write(" SpecificCulture");
- Console.WriteLine();
+ Console.WriteLine();
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureandregioninfobuilder.class/cs/car.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureandregioninfobuilder.class/cs/car.cs
index 35eabba93e0..c02e3cb0516 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureandregioninfobuilder.class/cs/car.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureandregioninfobuilder.class/cs/car.cs
@@ -8,11 +8,11 @@ public class Example
public static void Main()
{
// Create a custom culture for ru-US.
- CultureAndRegionInfoBuilder car1 = new CultureAndRegionInfoBuilder("ru-US",
+ CultureAndRegionInfoBuilder car1 = new CultureAndRegionInfoBuilder("ru-US",
CultureAndRegionModifiers.None);
car1.LoadDataFromCultureInfo(CultureInfo.CreateSpecificCulture("ru-RU"));
car1.LoadDataFromRegionInfo(new RegionInfo("en-US"));
-
+
car1.CultureEnglishName = "Russian (United States)";
car1.CultureNativeName = "русский (США)";
car1.CurrencyNativeName = "Доллар (США)";
@@ -21,17 +21,17 @@ public static void Main()
// Register the culture.
try {
car1.Register();
- }
+ }
catch (InvalidOperationException) {
// Swallow the exception: the culture already is registered.
}
-
+
// Use the custom culture.
CultureInfo ci = CultureInfo.CreateSpecificCulture("ru-US");
Thread.CurrentThread.CurrentCulture = ci;
- Console.WriteLine("Current Culture: {0}",
+ Console.WriteLine("Current Culture: {0}",
Thread.CurrentThread.CurrentCulture.Name);
- Console.WriteLine("Writing System: {0}",
+ Console.WriteLine("Writing System: {0}",
Thread.CurrentThread.CurrentCulture.TextInfo);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.appdomain/cs/appdomainex1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.appdomain/cs/appdomainex1.cs
index b2a7008452f..98d18944048 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.appdomain/cs/appdomainex1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.appdomain/cs/appdomainex1.cs
@@ -11,29 +11,29 @@ public static void Main()
// Set the default culture and display the current date in the current application domain.
Info info1 = new Info();
SetAppDomainCultures("fr-FR");
-
+
// Create a second application domain.
AppDomainSetup setup = new AppDomainSetup();
setup.AppDomainInitializer = SetAppDomainCultures;
setup.AppDomainInitializerArguments = new string[] { "ru-RU" };
AppDomain domain = AppDomain.CreateDomain("Domain2", null, setup);
// Create an Info object in the new application domain.
- Info info2 = (Info) domain.CreateInstanceAndUnwrap(typeof(Example).Assembly.FullName,
- "Info");
+ Info info2 = (Info) domain.CreateInstanceAndUnwrap(typeof(Example).Assembly.FullName,
+ "Info");
// Execute methods in the two application domains.
info2.DisplayDate();
info2.DisplayCultures();
-
+
info1.DisplayDate();
- info1.DisplayCultures();
+ info1.DisplayCultures();
}
public static void SetAppDomainCultures(string[] names)
{
SetAppDomainCultures(names[0]);
}
-
+
public static void SetAppDomainCultures(string name)
{
try {
@@ -43,10 +43,10 @@ public static void SetAppDomainCultures(string name)
// If an exception occurs, we'll just fall back to the system default.
catch (CultureNotFoundException) {
return;
- }
+ }
catch (ArgumentException) {
return;
- }
+ }
}
}
@@ -56,7 +56,7 @@ public void DisplayDate()
{
Console.WriteLine("Today is {0:D}", DateTime.Now);
}
-
+
public void DisplayCultures()
{
Console.WriteLine("Application domain is {0}", AppDomain.CurrentDomain.Id);
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture1.cs
index 78eba78765e..981cc5597f2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture1.cs
@@ -10,7 +10,7 @@
public class Example
{
-
+
public static void Main()
{
decimal[] values = { 163025412.32m, 18905365.59m };
@@ -20,15 +20,15 @@ public static void Main()
Thread.CurrentThread.ManagedThreadId);
foreach (var value in values)
output += String.Format("{0} ", value.ToString(formatString));
-
+
output += Environment.NewLine;
return output;
};
-
- Console.WriteLine("The example is running on thread {0}",
+
+ Console.WriteLine("The example is running on thread {0}",
Thread.CurrentThread.ManagedThreadId);
// Make the current culture different from the system culture.
- Console.WriteLine("The current culture is {0}",
+ Console.WriteLine("The current culture is {0}",
CultureInfo.CurrentCulture.Name);
if (CultureInfo.CurrentCulture.Name == "fr-FR")
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
@@ -37,18 +37,18 @@ public static void Main()
Console.WriteLine("Changed the current culture to {0}.\n",
CultureInfo.CurrentCulture.Name);
-
+
// Execute the delegate synchronously.
Console.WriteLine("Executing the delegate synchronously:");
Console.WriteLine(formatDelegate());
-
+
// Call an async delegate to format the values using one format string.
- Console.WriteLine("Executing a task asynchronously:");
+ Console.WriteLine("Executing a task asynchronously:");
var t1 = Task.Run(formatDelegate);
Console.WriteLine(t1.Result);
-
+
Console.WriteLine("Executing a task synchronously:");
- var t2 = new Task(formatDelegate);
+ var t2 = new Task(formatDelegate);
t2.RunSynchronously();
Console.WriteLine(t2.Result);
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture2.cs
index 22cca5a4ed9..5ac539a52a0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture2.cs
@@ -16,15 +16,15 @@ public static void Main()
Thread.CurrentThread.ManagedThreadId);
foreach (var value in values)
output += String.Format("{0} ", value.ToString(formatString));
-
+
output += Environment.NewLine;
return output;
};
-
- Console.WriteLine("The example is running on thread {0}",
+
+ Console.WriteLine("The example is running on thread {0}",
Thread.CurrentThread.ManagedThreadId);
// Make the current culture different from the system culture.
- Console.WriteLine("The current culture is {0}",
+ Console.WriteLine("The current culture is {0}",
CultureInfo.CurrentCulture.Name);
if (CultureInfo.CurrentCulture.Name == "fr-FR")
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
@@ -33,18 +33,18 @@ public static void Main()
Console.WriteLine("Changed the current culture to {0}.\n",
CultureInfo.CurrentCulture.Name);
-
+
// Execute the delegate synchronously.
Console.WriteLine("Executing the delegate synchronously:");
Console.WriteLine(formatDelegate());
-
+
// Call an async delegate to format the values using one format string.
- Console.WriteLine("Executing a task asynchronously:");
+ Console.WriteLine("Executing a task asynchronously:");
var t1 = Task.Run(formatDelegate);
Console.WriteLine(t1.Result);
-
+
Console.WriteLine("Executing a task synchronously:");
- var t2 = new Task(formatDelegate);
+ var t2 = new Task(formatDelegate);
t2.RunSynchronously();
Console.WriteLine(t2.Result);
}
@@ -53,15 +53,15 @@ public static void Main()
// The example is running on thread 1
// The current culture is en-US
// Changed the current culture to fr-FR.
-//
+//
// Executing the delegate synchronously:
// Formatting using the fr-FR culture on thread 1.
// 163 025 412,32 € 18 905 365,59 €
-//
+//
// Executing a task asynchronously:
// Formatting using the en-US culture on thread 3.
// $163,025,412.32 $18,905,365.59
-//
+//
// Executing a task synchronously:
// Formatting using the fr-FR culture on thread 1.
// 163 025 412,32 € 18 905 365,59 €
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture3.cs
index c44da7dc7c7..b60ce3a7bc9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture3.cs
@@ -16,15 +16,15 @@ public static void Main()
Thread.CurrentThread.ManagedThreadId);
foreach (var value in values)
output += String.Format("{0} ", value.ToString(formatString));
-
+
output += Environment.NewLine;
return output;
};
-
- Console.WriteLine("The example is running on thread {0}",
+
+ Console.WriteLine("The example is running on thread {0}",
Thread.CurrentThread.ManagedThreadId);
// Make the current culture different from the system culture.
- Console.WriteLine("The current culture is {0}",
+ Console.WriteLine("The current culture is {0}",
CultureInfo.CurrentCulture.Name);
if (CultureInfo.CurrentCulture.Name == "fr-FR")
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
@@ -34,18 +34,18 @@ public static void Main()
Console.WriteLine("Changed the current culture to {0}.\n",
CultureInfo.CurrentCulture.Name);
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CurrentCulture;
-
+
// Execute the delegate synchronously.
Console.WriteLine("Executing the delegate synchronously:");
Console.WriteLine(formatDelegate());
-
+
// Call an async delegate to format the values using one format string.
- Console.WriteLine("Executing a task asynchronously:");
+ Console.WriteLine("Executing a task asynchronously:");
var t1 = Task.Run(formatDelegate);
Console.WriteLine(t1.Result);
-
+
Console.WriteLine("Executing a task synchronously:");
- var t2 = new Task(formatDelegate);
+ var t2 = new Task(formatDelegate);
t2.RunSynchronously();
Console.WriteLine(t2.Result);
}
@@ -54,15 +54,15 @@ public static void Main()
// The example is running on thread 1
// The current culture is en-US
// Changed the current culture to fr-FR.
-//
+//
// Executing the delegate synchronously:
// Formatting using the fr-FR culture on thread 1.
// 163 025 412,32 € 18 905 365,59 €
-//
+//
// Executing a task asynchronously:
// Formatting using the fr-FR culture on thread 3.
// 163 025 412,32 € 18 905 365,59 €
-//
+//
// Executing a task synchronously:
// Formatting using the fr-FR culture on thread 1.
// 163 025 412,32 € 18 905 365,59 €
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture4.cs
index aeccbf67fdf..9f57b4093a8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.async/cs/asyncculture4.cs
@@ -12,10 +12,10 @@ public class Example
public static void Main()
{
string formatString = "C2";
- Console.WriteLine("The example is running on thread {0}",
+ Console.WriteLine("The example is running on thread {0}",
Thread.CurrentThread.ManagedThreadId);
// Make the current culture different from the system culture.
- Console.WriteLine("The current culture is {0}",
+ Console.WriteLine("The current culture is {0}",
CultureInfo.CurrentCulture.Name);
if (CultureInfo.CurrentCulture.Name == "fr-FR")
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
@@ -24,24 +24,24 @@ public static void Main()
Console.WriteLine("Changed the current culture to {0}.\n",
CultureInfo.CurrentCulture.Name);
-
+
// Call an async delegate to format the values using one format string.
- Console.WriteLine("Executing a task asynchronously in the main appdomain:");
+ Console.WriteLine("Executing a task asynchronously in the main appdomain:");
var t1 = Task.Run(() => { DataRetriever d = new DataRetriever();
return d.GetFormattedNumber(formatString);
});
Console.WriteLine(t1.Result);
- Console.WriteLine();
-
+ Console.WriteLine();
+
Console.WriteLine("Executing a task synchronously in two appdomains:");
- var t2 = Task.Run(() => { Console.WriteLine("Thread {0} is running in app domain '{1}'",
- Thread.CurrentThread.ManagedThreadId,
+ var t2 = Task.Run(() => { Console.WriteLine("Thread {0} is running in app domain '{1}'",
+ Thread.CurrentThread.ManagedThreadId,
AppDomain.CurrentDomain.FriendlyName);
AppDomain domain = AppDomain.CreateDomain("Domain2");
DataRetriever d = (DataRetriever) domain.CreateInstanceAndUnwrap(typeof(Example).Assembly.FullName,
"DataRetriever");
- return d.GetFormattedNumber(formatString);
- });
+ return d.GetFormattedNumber(formatString);
+ });
Console.WriteLine(t2.Result);
}
}
@@ -52,8 +52,8 @@ public string GetFormattedNumber(String format)
{
Thread thread = Thread.CurrentThread;
Console.WriteLine("Current culture is {0}", thread.CurrentCulture);
- Console.WriteLine("Thread {0} is running in app domain '{1}'",
- thread.ManagedThreadId,
+ Console.WriteLine("Thread {0} is running in app domain '{1}'",
+ thread.ManagedThreadId,
AppDomain.CurrentDomain.FriendlyName);
Random rnd = new Random();
Double value = rnd.NextDouble() * 1000;
@@ -64,12 +64,12 @@ public string GetFormattedNumber(String format)
// The example is running on thread 1
// The current culture is en-US
// Changed the current culture to fr-FR.
-//
+//
// Executing a task asynchronously in a single appdomain:
// Current culture is fr-FR
// Thread 3 is running in app domain 'AsyncCulture4.exe'
// 93,48 €
-//
+//
// Executing a task synchronously in two appdomains:
// Thread 4 is running in app domain 'AsyncCulture4.exe'
// Current culture is fr-FR
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/defaultthread1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/defaultthread1.cs
index c7a5972e844..ce8054178aa 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/defaultthread1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/defaultthread1.cs
@@ -6,7 +6,7 @@
public class Example
{
static Random rnd = new Random();
-
+
public static void Main()
{
if (Thread.CurrentThread.CurrentCulture.Name != "fr-FR") {
@@ -20,29 +20,29 @@ public static void Main()
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("en-US");
}
ThreadProc();
-
+
Thread worker = new Thread(ThreadProc);
worker.Name = "WorkerThread";
worker.Start();
}
-
+
private static void DisplayThreadInfo()
{
- Console.WriteLine("\nCurrent Thread Name: '{0}'",
+ Console.WriteLine("\nCurrent Thread Name: '{0}'",
Thread.CurrentThread.Name);
- Console.WriteLine("Current Thread Culture/UI Culture: {0}/{1}",
+ Console.WriteLine("Current Thread Culture/UI Culture: {0}/{1}",
Thread.CurrentThread.CurrentCulture.Name,
- Thread.CurrentThread.CurrentUICulture.Name);
+ Thread.CurrentThread.CurrentUICulture.Name);
}
-
+
private static void DisplayValues()
{
// Create new thread and display three random numbers.
Console.WriteLine("Some currency values:");
for (int ctr = 0; ctr <= 3; ctr++)
- Console.WriteLine(" {0:C2}", rnd.NextDouble() * 10);
+ Console.WriteLine(" {0:C2}", rnd.NextDouble() * 10);
}
-
+
private static void ThreadProc()
{
DisplayThreadInfo();
@@ -57,7 +57,7 @@ private static void ThreadProc()
// 1,48 €
// 8,99 €
// 9,04 €
-//
+//
// Current Thread Name: 'WorkerThread'
// Current Thread Culture/UI Culture: en-US/en-US
// Some currency values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/perthread1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/perthread1.cs
index 39632876f58..9b51d065ce4 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/perthread1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/perthread1.cs
@@ -6,14 +6,14 @@
public class Example
{
static Random rnd = new Random();
-
+
public static void Main()
{
if (Thread.CurrentThread.CurrentCulture.Name != "fr-FR") {
// If current culture is not fr-FR, set culture to fr-FR.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr-FR");
- }
+ }
else {
// Set culture to en-US.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
@@ -21,30 +21,30 @@ public static void Main()
}
DisplayThreadInfo();
DisplayValues();
-
+
Thread worker = new Thread(Example.ThreadProc);
worker.Name = "WorkerThread";
worker.Start(Thread.CurrentThread.CurrentCulture);
}
-
+
private static void DisplayThreadInfo()
{
- Console.WriteLine("\nCurrent Thread Name: '{0}'",
+ Console.WriteLine("\nCurrent Thread Name: '{0}'",
Thread.CurrentThread.Name);
- Console.WriteLine("Current Thread Culture/UI Culture: {0}/{1}",
+ Console.WriteLine("Current Thread Culture/UI Culture: {0}/{1}",
Thread.CurrentThread.CurrentCulture.Name,
- Thread.CurrentThread.CurrentUICulture.Name);
+ Thread.CurrentThread.CurrentUICulture.Name);
}
-
+
private static void DisplayValues()
{
// Create new thread and display three random numbers.
Console.WriteLine("Some currency values:");
for (int ctr = 0; ctr <= 3; ctr++)
- Console.WriteLine(" {0:C2}", rnd.NextDouble() * 10);
+ Console.WriteLine(" {0:C2}", rnd.NextDouble() * 10);
}
-
- private static void ThreadProc(Object obj)
+
+ private static void ThreadProc(Object obj)
{
Thread.CurrentThread.CurrentCulture = (CultureInfo) obj;
Thread.CurrentThread.CurrentUICulture = (CultureInfo) obj;
@@ -60,7 +60,7 @@ private static void ThreadProc(Object obj)
// 3,47 €
// 6,07 €
// 1,70 €
-//
+//
// Current Thread Name: 'WorkerThread'
// Current Thread Culture/UI Culture: fr-FR/fr-FR
// Some currency values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/setthreads1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/setthreads1.cs
index 3839592185d..f9b06fef95d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/setthreads1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.class.thread/cs/setthreads1.cs
@@ -6,44 +6,44 @@
public class Example
{
static Random rnd = new Random();
-
+
public static void Main()
{
if (Thread.CurrentThread.CurrentCulture.Name != "fr-FR") {
// If current culture is not fr-FR, set culture to fr-FR.
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CreateSpecificCulture("fr-FR");
- }
+ }
else {
// Set culture to en-US.
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CreateSpecificCulture("en-US");
}
ThreadProc();
-
+
Thread worker = new Thread(Example.ThreadProc);
worker.Name = "WorkerThread";
worker.Start();
}
-
+
private static void DisplayThreadInfo()
{
- Console.WriteLine("\nCurrent Thread Name: '{0}'",
+ Console.WriteLine("\nCurrent Thread Name: '{0}'",
Thread.CurrentThread.Name);
- Console.WriteLine("Current Thread Culture/UI Culture: {0}/{1}",
+ Console.WriteLine("Current Thread Culture/UI Culture: {0}/{1}",
Thread.CurrentThread.CurrentCulture.Name,
- Thread.CurrentThread.CurrentUICulture.Name);
+ Thread.CurrentThread.CurrentUICulture.Name);
}
-
+
private static void DisplayValues()
{
// Create new thread and display three random numbers.
Console.WriteLine("Some currency values:");
for (int ctr = 0; ctr <= 3; ctr++)
- Console.WriteLine(" {0:C2}", rnd.NextDouble() * 10);
+ Console.WriteLine(" {0:C2}", rnd.NextDouble() * 10);
}
-
- private static void ThreadProc()
+
+ private static void ThreadProc()
{
DisplayThreadInfo();
DisplayValues();
@@ -57,7 +57,7 @@ private static void ThreadProc()
// 3,47 €
// 6,07 €
// 1,70 €
-//
+//
// Current Thread Name: 'WorkerThread'
// Current Thread Culture/UI Culture: fr-FR/fr-FR
// Some currency values:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/Async1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/Async1.cs
index 2135a49e4f5..3cd121f7f81 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/Async1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/Async1.cs
@@ -13,7 +13,7 @@ public class Example
public static async Task Main()
{
var tasks = new List();
- Console.WriteLine("The current culture is {0}",
+ Console.WriteLine("The current culture is {0}",
Thread.CurrentThread.CurrentCulture.Name);
Thread.CurrentThread.CurrentCulture = new CultureInfo("pt-BR");
// Change the current culture to Portuguese (Brazil).
@@ -25,10 +25,10 @@ public static async Task Main()
for (int ctr = 0; ctr <= 5; ctr++)
tasks.Add(Task.Run( () => {
Console.WriteLine("Culture of task {0} on thread {1} is {2}",
- Task.CurrentId,
+ Task.CurrentId,
Thread.CurrentThread.ManagedThreadId,
Thread.CurrentThread.CurrentCulture.Name);
- } ));
+ } ));
await Task.WhenAll(tasks.ToArray());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/aspculture1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/aspculture1.cs
index ed3a9514946..f7db72e86ce 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/aspculture1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/aspculture1.cs
@@ -15,6 +15,6 @@ public static void Main()
public class Request
{
private static string[] langs = new string[3];
-
+
public static string[] UserLanguages { get { return langs; } }
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/aspculture13.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/aspculture13.cs
index ac9590df56b..ef252d99251 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/aspculture13.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/aspculture13.cs
@@ -15,6 +15,6 @@ public static void Main()
public class Request
{
private static string[] langs = new string[3];
-
+
public static string[] UserLanguages { get { return langs; } }
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/changeculture1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/changeculture1.cs
index be2ea32a539..a836cc9cd99 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/changeculture1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/changeculture1.cs
@@ -23,11 +23,11 @@ public static void Main()
Thread.CurrentThread.Name = "MainThread";
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("nl-NL");
inf.ShowCurrentCulture();
-
+
// Create a new application domain.
AppDomain ad = AppDomain.CreateDomain("Domain2");
Info inf2 = (Info) ad.CreateInstanceAndUnwrap(typeof(Info).Assembly.FullName, "Info");
- inf2.ShowCurrentCulture();
+ inf2.ShowCurrentCulture();
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/changeculture11.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/changeculture11.cs
index 0917e4890f0..41fdf3a679d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/changeculture11.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/changeculture11.cs
@@ -23,11 +23,11 @@ public static void Main()
Thread.CurrentThread.Name = "MainThread";
CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("nl-NL");
inf.ShowCurrentCulture();
-
+
// Create a new application domain.
AppDomain ad = AppDomain.CreateDomain("Domain2");
Info inf2 = (Info) ad.CreateInstanceAndUnwrap(typeof(Info).Assembly.FullName, "Info");
- inf2.ShowCurrentCulture();
+ inf2.ShowCurrentCulture();
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/specific1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/specific1.cs
index 5e07e9a4f6a..a1c99516852 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/specific1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/specific1.cs
@@ -9,12 +9,12 @@ public static void Main()
{
double value = 1634.92;
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-CA");
- Console.WriteLine("Current Culture: {0}",
+ Console.WriteLine("Current Culture: {0}",
CultureInfo.CurrentCulture.Name);
Console.WriteLine("{0:C2}\n", value);
-
+
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr");
- Console.WriteLine("Current Culture: {0}",
+ Console.WriteLine("Current Culture: {0}",
CultureInfo.CurrentCulture.Name);
Console.WriteLine("{0:C2}", value);
}
@@ -22,7 +22,7 @@ public static void Main()
// The example displays the following output:
// Current Culture: fr-CA
// 1 634,92 $
-//
+//
// Current Culture: fr
// 1 634,92 €
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/specific12.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/specific12.cs
index 640544ec2b2..ebc940ec8da 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/specific12.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentculture/cs/specific12.cs
@@ -9,12 +9,12 @@ public static void Main()
{
double value = 1634.92;
CultureInfo.CurrentCulture = new CultureInfo("fr-CA");
- Console.WriteLine("Current Culture: {0}",
+ Console.WriteLine("Current Culture: {0}",
CultureInfo.CurrentCulture.Name);
Console.WriteLine("{0:C2}\n", value);
-
+
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr");
- Console.WriteLine("Current Culture: {0}",
+ Console.WriteLine("Current Culture: {0}",
CultureInfo.CurrentCulture.Name);
Console.WriteLine("{0:C2}", value);
}
@@ -22,7 +22,7 @@ public static void Main()
// The example displays the following output:
// Current Culture: fr-CA
// 1 634,92 $
-//
+//
// Current Culture: fr
// 1 634,92 €
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentuiculture/cs/Async1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentuiculture/cs/Async1.cs
index 4ee2872256b..bef9f691ae2 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentuiculture/cs/Async1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentuiculture/cs/Async1.cs
@@ -13,7 +13,7 @@ public class Example
public static async Task Main()
{
var tasks = new List();
- Console.WriteLine("The current UI culture is {0}",
+ Console.WriteLine("The current UI culture is {0}",
Thread.CurrentThread.CurrentUICulture.Name);
Thread.CurrentThread.CurrentUICulture = new CultureInfo("pt-BR");
// Change the current UI culture to Portuguese (Brazil).
@@ -25,10 +25,10 @@ public static async Task Main()
for (int ctr = 0; ctr <= 5; ctr++)
tasks.Add(Task.Run( () => {
Console.WriteLine("UI Culture of task {0} on thread {1} is {2}",
- Task.CurrentId,
+ Task.CurrentId,
Thread.CurrentThread.ManagedThreadId,
Thread.CurrentThread.CurrentUICulture.Name);
- } ));
+ } ));
await Task.WhenAll(tasks.ToArray());
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentuiculture/cs/currentuiculture1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentuiculture/cs/currentuiculture1.cs
index 32b394142f8..69a9ed5ddb0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentuiculture/cs/currentuiculture1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.currentuiculture/cs/currentuiculture1.cs
@@ -6,11 +6,11 @@ public class Example
{
public static void Main()
{
- Console.WriteLine("The current UI culture: {0}",
+ Console.WriteLine("The current UI culture: {0}",
CultureInfo.CurrentUICulture.Name);
-
+
CultureInfo.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr-FR");
- Console.WriteLine("The current UI culture: {0}",
+ Console.WriteLine("The current UI culture: {0}",
CultureInfo.CurrentUICulture.Name);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentculture/cs/defaultculture1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentculture/cs/defaultculture1.cs
index 5bbf9eb7eac..3779d257322 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentculture/cs/defaultculture1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentculture/cs/defaultculture1.cs
@@ -8,7 +8,7 @@ public class Example
{
public static void Main()
{
- Console.OutputEncoding = Encoding.UTF8;
+ Console.OutputEncoding = Encoding.UTF8;
// Change current culture
CultureInfo culture;
if (Thread.CurrentThread.CurrentCulture.Name == "fr-FR")
@@ -18,11 +18,11 @@ public static void Main()
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
-
+
// Generate and display three random numbers on the current thread.
DisplayRandomNumbers();
Thread.Sleep(1000);
-
+
Thread workerThread = new Thread(new ThreadStart(Example.DisplayRandomNumbers));
workerThread.Start();
}
@@ -30,9 +30,9 @@ public static void Main()
private static void DisplayRandomNumbers()
{
Console.WriteLine();
- Console.WriteLine("Current Culture: {0}",
+ Console.WriteLine("Current Culture: {0}",
Thread.CurrentThread.CurrentCulture);
- Console.WriteLine("Current UI Culture: {0}",
+ Console.WriteLine("Current UI Culture: {0}",
Thread.CurrentThread.CurrentUICulture);
Console.Write("Random Values: ");
@@ -46,9 +46,9 @@ private static void DisplayRandomNumbers()
// The example displays output similar to the following:
// Current Culture: fr-FR
// Current UI Culture: fr-FR
-// Random Values: 0,77 € 0,35 € 0,52 €
-//
+// Random Values: 0,77 € 0,35 € 0,52 €
+//
// Current Culture: en-US
// Current UI Culture: en-US
-// Random Values: $0.30 $0.79 $0.65
+// Random Values: $0.30 $0.79 $0.65
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentculture/cs/defaultculture2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentculture/cs/defaultculture2.cs
index 724984d8f9e..38fca37677d 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentculture/cs/defaultculture2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentculture/cs/defaultculture2.cs
@@ -8,24 +8,24 @@ public class Example
{
public static void Main()
{
- Console.OutputEncoding = Encoding.UTF8;
+ Console.OutputEncoding = Encoding.UTF8;
// Change current culture
CultureInfo culture;
if (Thread.CurrentThread.CurrentCulture.Name == "fr-FR")
culture = CultureInfo.CreateSpecificCulture("en-US");
else
culture = CultureInfo.CreateSpecificCulture("fr-FR");
-
+
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
-
+
// Generate and display three random numbers on the current thread.
DisplayRandomNumbers();
Thread.Sleep(1000);
-
+
Thread workerThread = new Thread(new ThreadStart(Example.DisplayRandomNumbers));
workerThread.Start();
}
@@ -33,9 +33,9 @@ public static void Main()
private static void DisplayRandomNumbers()
{
Console.WriteLine();
- Console.WriteLine("Current Culture: {0}",
+ Console.WriteLine("Current Culture: {0}",
Thread.CurrentThread.CurrentCulture);
- Console.WriteLine("Current UI Culture: {0}",
+ Console.WriteLine("Current UI Culture: {0}",
Thread.CurrentThread.CurrentUICulture);
Console.Write("Random Values: ");
@@ -50,7 +50,7 @@ private static void DisplayRandomNumbers()
// Current Culture: fr-FR
// Current UI Culture: fr-FR
// Random Values: 0,78 € 0,80 € 0,37 €
-//
+//
// Current Culture: fr-FR
// Current UI Culture: fr-FR
// Random Values: 0,52 € 0,32 € 0,15 €
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentuiculture/cs/example1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentuiculture/cs/example1.cs
index ee9f2b74de2..6d1c850a3b0 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentuiculture/cs/example1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentuiculture/cs/example1.cs
@@ -15,9 +15,9 @@ public class Example
public static void Main()
{
AppDomain domain = AppDomain.CurrentDomain;
- rm = new ResourceManager("GreetingStrings",
+ rm = new ResourceManager("GreetingStrings",
typeof(Example).Assembly);
-
+
CultureInfo culture = null;
if (Thread.CurrentThread.CurrentUICulture.Name == "ru-RU")
culture = CultureInfo.CreateSpecificCulture("en-US");
@@ -39,7 +39,7 @@ private static void ShowGreeting()
string greeting = nGreetings == 0 ? rm.GetString("newGreeting") :
rm.GetString("greeting");
nGreetings++;
- Console.WriteLine("{0}", greeting);
+ Console.WriteLine("{0}", greeting);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentuiculture/cs/example2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentuiculture/cs/example2.cs
index eec7fa4d281..5c456cd5267 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentuiculture/cs/example2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.defaultthreadcurrentuiculture/cs/example2.cs
@@ -15,9 +15,9 @@ public class Example
public static void Main()
{
AppDomain domain = AppDomain.CurrentDomain;
- rm = new ResourceManager("GreetingStrings",
+ rm = new ResourceManager("GreetingStrings",
typeof(Example).Assembly);
-
+
CultureInfo culture = null;
if (Thread.CurrentThread.CurrentUICulture.Name == "ru-RU")
culture = CultureInfo.CreateSpecificCulture("en-US");
@@ -42,7 +42,7 @@ private static void ShowGreeting()
string greeting = nGreetings == 0 ? rm.GetString("newGreeting") :
rm.GetString("greeting");
nGreetings++;
- Console.WriteLine("{0}", greeting);
+ Console.WriteLine("{0}", greeting);
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.invariantculture/cs/persist1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.invariantculture/cs/persist1.cs
index 3ad55344fa8..25f06cf6ed7 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.invariantculture/cs/persist1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.invariantculture/cs/persist1.cs
@@ -3,18 +3,18 @@
using System.IO;
using System.Globalization;
-public class Example
+public class Example
{
- public static void Main()
+ public static void Main()
{
// Persist the date and time data.
StreamWriter sw = new StreamWriter(@".\DateData.dat");
-
- // Create a DateTime value.
+
+ // Create a DateTime value.
DateTime dtIn = DateTime.Now;
// Retrieve a CultureInfo object.
CultureInfo invC = CultureInfo.InvariantCulture;
-
+
// Convert the date to a string and write it to a file.
sw.WriteLine(dtIn.ToString("r", invC));
sw.Close();
@@ -22,9 +22,9 @@ public static void Main()
// Restore the date and time data.
StreamReader sr = new StreamReader(@".\DateData.dat");
String input;
- while ((input = sr.ReadLine()) != null)
+ while ((input = sr.ReadLine()) != null)
{
- Console.WriteLine("Stored data: {0}\n" , input);
+ Console.WriteLine("Stored data: {0}\n" , input);
// Parse the stored string.
DateTime dtOut = DateTime.Parse(input, invC, DateTimeStyles.RoundtripKind);
@@ -32,13 +32,13 @@ public static void Main()
// Create a French (France) CultureInfo object.
CultureInfo frFr = new CultureInfo("fr-FR");
// Displays the date formatted for the "fr-FR" culture.
- Console.WriteLine("Date formatted for the {0} culture: {1}" ,
+ Console.WriteLine("Date formatted for the {0} culture: {1}" ,
frFr.Name, dtOut.ToString("f", frFr));
// Creates a German (Germany) CultureInfo object.
CultureInfo deDe= new CultureInfo("de-De");
// Displays the date formatted for the "de-DE" culture.
- Console.WriteLine("Date formatted for {0} culture: {1}" ,
+ Console.WriteLine("Date formatted for {0} culture: {1}" ,
deDe.Name, dtOut.ToString("f", deDe));
}
sr.Close();
@@ -46,7 +46,7 @@ public static void Main()
}
// The example displays the following output:
// Stored data: Tue, 15 May 2012 16:34:16 GMT
-//
+//
// Date formatted for the fr-FR culture: mardi 15 mai 2012 16:34
// Date formatted for de-DE culture: Dienstag, 15. Mai 2012 16:34
-//
+//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.twoletterisolanguagename/cs/twoletterisolanguagename1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.twoletterisolanguagename/cs/twoletterisolanguagename1.cs
index 78e834a13b2..5d65b98bb3e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.twoletterisolanguagename/cs/twoletterisolanguagename1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.cultureinfo.twoletterisolanguagename/cs/twoletterisolanguagename1.cs
@@ -9,26 +9,26 @@ public static void Main()
// Get all available cultures on the current system.
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
- Console.WriteLine("{0,-32} {1,-13} {2,-6}\n", "Display Name",
+ Console.WriteLine("{0,-32} {1,-13} {2,-6}\n", "Display Name",
"Name", "TwoLetterISOLanguageName");
foreach (var culture in cultures) {
// Exclude custom cultures.
- if ((culture.CultureTypes & CultureTypes.UserCustomCulture) == CultureTypes.UserCustomCulture)
+ if ((culture.CultureTypes & CultureTypes.UserCustomCulture) == CultureTypes.UserCustomCulture)
continue;
-
+
// Exclude all two-letter codes.
if (culture.TwoLetterISOLanguageName.Length == 2)
continue;
-
+
Console.WriteLine("{0,-32} {1,-13} {2,-6}", culture.DisplayName,
culture.Name, culture.TwoLetterISOLanguageName);
- }
+ }
}
}
// The example output like the following:
// Display Name Name TwoLetterISOLanguageName
-//
+//
// Upper Sorbian hsb hsb
// Konkani kok kok
// Syriac syr syr
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.abbreviateddaynames/cs/abbreviateddaynames1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.abbreviateddaynames/cs/abbreviateddaynames1.cs
index ba2312d0af7..28a8a5a7598 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.abbreviateddaynames/cs/abbreviateddaynames1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.abbreviateddaynames/cs/abbreviateddaynames1.cs
@@ -8,14 +8,14 @@ public static void Main()
{
CultureInfo ci = CultureInfo.CreateSpecificCulture("en-US");
DateTimeFormatInfo dtfi = ci.DateTimeFormat;
- dtfi.AbbreviatedDayNames = new String[] { "Su", "M", "Tu", "W",
- "Th", "F", "Sa" };
+ dtfi.AbbreviatedDayNames = new String[] { "Su", "M", "Tu", "W",
+ "Th", "F", "Sa" };
DateTime dat = new DateTime(2014, 5, 28);
for (int ctr = 0; ctr <= 6; ctr++) {
String output = String.Format(ci, "{0:ddd MMM dd, yyyy}", dat.AddDays(ctr));
Console.WriteLine(output);
- }
+ }
}
}
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.abbreviatedmonthgenitivenames/cs/abbreviatedmonthnames1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.abbreviatedmonthgenitivenames/cs/abbreviatedmonthnames1.cs
index d383fbf22ab..82fc321fe61 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.abbreviatedmonthgenitivenames/cs/abbreviatedmonthnames1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.abbreviatedmonthgenitivenames/cs/abbreviatedmonthnames1.cs
@@ -8,13 +8,13 @@ public static void Main()
{
CultureInfo ci = CultureInfo.CreateSpecificCulture("en-US");
DateTimeFormatInfo dtfi = ci.DateTimeFormat;
- dtfi.AbbreviatedMonthNames = new string[] { "of Jan", "of Feb", "of Mar",
- "of Apr", "of May", "of Jun",
- "of Jul", "of Aug", "of Sep",
- "of Oct", "of Nov", "of Dec", "" };
+ dtfi.AbbreviatedMonthNames = new string[] { "of Jan", "of Feb", "of Mar",
+ "of Apr", "of May", "of Jun",
+ "of Jul", "of Aug", "of Sep",
+ "of Oct", "of Nov", "of Dec", "" };
dtfi.AbbreviatedMonthGenitiveNames = dtfi.AbbreviatedMonthNames;
DateTime dat = new DateTime(2012, 5, 28);
-
+
for (int ctr = 0; ctr < dtfi.Calendar.GetMonthsInYear(dat.Year); ctr++)
Console.WriteLine(dat.AddMonths(ctr).ToString("dd MMM yyyy", dtfi));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/create1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/create1.cs
index 6dbfb7b189b..b3c9271213e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/create1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/create1.cs
@@ -14,35 +14,35 @@ public static void Main()
private static void CreateInvariant1()
{
//
- System.Globalization.DateTimeFormatInfo dtfi;
-
+ System.Globalization.DateTimeFormatInfo dtfi;
+
dtfi = System.Globalization.DateTimeFormatInfo.InvariantInfo;
- Console.WriteLine(dtfi.IsReadOnly);
+ Console.WriteLine(dtfi.IsReadOnly);
dtfi = new System.Globalization.DateTimeFormatInfo();
- Console.WriteLine(dtfi.IsReadOnly);
-
+ Console.WriteLine(dtfi.IsReadOnly);
+
dtfi = System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat;
- Console.WriteLine(dtfi.IsReadOnly);
+ Console.WriteLine(dtfi.IsReadOnly);
// The example displays the following output:
// True
// False
- // True
+ // True
//
- }
+ }
private static void CreateNeutral2()
{
//
System.Globalization.CultureInfo specific, neutral;
System.Globalization.DateTimeFormatInfo dtfi;
-
+
// Instantiate a culture by creating a specific culture and using its Parent property.
specific = System.Globalization.CultureInfo.GetCultureInfo("fr-FR");
neutral = specific.Parent;
dtfi = neutral.DateTimeFormat;
Console.WriteLine("{0} from Parent property: {1}", neutral.Name, dtfi.IsReadOnly);
-
+
dtfi = System.Globalization.CultureInfo.GetCultureInfo("fr-FR").Parent.DateTimeFormat;
Console.WriteLine("{0} from Parent property: {1}", neutral.Name, dtfi.IsReadOnly);
@@ -50,18 +50,18 @@ private static void CreateNeutral2()
neutral = new System.Globalization.CultureInfo("fr");
dtfi = neutral.DateTimeFormat;
Console.WriteLine("{0} from CultureInfo constructor: {1}", neutral.Name, dtfi.IsReadOnly);
-
- // Instantiate a culture using CreateSpecificCulture.
+
+ // Instantiate a culture using CreateSpecificCulture.
neutral = System.Globalization.CultureInfo.CreateSpecificCulture("fr");
dtfi = neutral.DateTimeFormat;
Console.WriteLine("{0} from CreateSpecificCulture: {1}", neutral.Name, dtfi.IsReadOnly);
-
+
// Retrieve a culture by calling the GetCultureInfo method.
neutral = System.Globalization.CultureInfo.GetCultureInfo("fr");
dtfi = neutral.DateTimeFormat;
Console.WriteLine("{0} from GetCultureInfo: {1}", neutral.Name, dtfi.IsReadOnly);
- // Instantiate a DateTimeFormatInfo object by calling GetInstance.
+ // Instantiate a DateTimeFormatInfo object by calling GetInstance.
neutral = System.Globalization.CultureInfo.CreateSpecificCulture("fr");
dtfi = System.Globalization.DateTimeFormatInfo.GetInstance(neutral);
Console.WriteLine("{0} from GetInstance: {1}", neutral.Name, dtfi.IsReadOnly);
@@ -72,36 +72,36 @@ private static void CreateNeutral2()
// fr from CultureInfo constructor: False
// fr-FR from CreateSpecificCulture: False
// fr from GetCultureInfo: True
- // fr-FR from GetInstance: False
+ // fr-FR from GetInstance: False
//
}
-
+
private static void CreateSpecific3()
{
//
System.Globalization.CultureInfo ci = null;
System.Globalization.DateTimeFormatInfo dtfi = null;
-
+
// Instantiate a culture using CreateSpecificCulture.
ci = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
dtfi = ci.DateTimeFormat;
Console.WriteLine("{0} from CreateSpecificCulture: {1}", ci.Name, dtfi.IsReadOnly);
-
+
// Instantiate a culture using the CultureInfo constructor.
- ci = new System.Globalization.CultureInfo("en-CA");
+ ci = new System.Globalization.CultureInfo("en-CA");
dtfi = ci.DateTimeFormat;
Console.WriteLine("{0} from CultureInfo constructor: {1}", ci.Name, dtfi.IsReadOnly);
-
+
// Retrieve a culture by calling the GetCultureInfo method.
ci = System.Globalization.CultureInfo.GetCultureInfo("en-AU");
dtfi = ci.DateTimeFormat;
Console.WriteLine("{0} from GetCultureInfo: {1}", ci.Name, dtfi.IsReadOnly);
-
- // Instantiate a DateTimeFormatInfo object by calling DateTimeFormatInfo.GetInstance.
+
+ // Instantiate a DateTimeFormatInfo object by calling DateTimeFormatInfo.GetInstance.
ci = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB");
dtfi = System.Globalization.DateTimeFormatInfo.GetInstance(ci);
Console.WriteLine("{0} from GetInstance: {1}", ci.Name, dtfi.IsReadOnly);
-
+
// The example displays the following output:
// en-US from CreateSpecificCulture: False
// en-CA from CultureInfo constructor: False
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/create2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/create2.cs
index 002aeaa04a9..0917707eb4b 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/create2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/create2.cs
@@ -7,13 +7,13 @@ public static void Main()
{
//
DateTimeFormatInfo dtfi;
-
+
dtfi = DateTimeFormatInfo.CurrentInfo;
Console.WriteLine(dtfi.IsReadOnly);
-
+
dtfi = CultureInfo.CurrentCulture.DateTimeFormat;
Console.WriteLine(dtfi.IsReadOnly);
-
+
dtfi = DateTimeFormatInfo.GetInstance(CultureInfo.CurrentCulture);
Console.WriteLine(dtfi.IsReadOnly);
// The example displays the following output:
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example1.cs
index a0f8892920e..d44c3b08d56 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example1.cs
@@ -6,25 +6,25 @@ public class Example
{
public static void Main()
{
- DateTime dateValue = new DateTime(2013, 8, 18);
+ DateTime dateValue = new DateTime(2013, 8, 18);
CultureInfo enUS = CultureInfo.CreateSpecificCulture("en-US");
DateTimeFormatInfo dtfi = enUS.DateTimeFormat;
-
+
Console.WriteLine("Before modifying DateTimeFormatInfo object: ");
- Console.WriteLine("{0}: {1}\n", dtfi.ShortDatePattern,
+ Console.WriteLine("{0}: {1}\n", dtfi.ShortDatePattern,
dateValue.ToString("d", enUS));
// Modify the short date pattern.
dtfi.ShortDatePattern = "yyyy-MM-dd";
Console.WriteLine("After modifying DateTimeFormatInfo object: ");
- Console.WriteLine("{0}: {1}", dtfi.ShortDatePattern,
+ Console.WriteLine("{0}: {1}", dtfi.ShortDatePattern,
dateValue.ToString("d", enUS));
}
}
// The example displays the following output:
// Before modifying DateTimeFormatInfo object:
// M/d/yyyy: 8/18/2013
-//
+//
// After modifying DateTimeFormatInfo object:
// yyyy-MM-dd: 2013-08-18
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example2.cs
index df1950fcdf5..e6dee167191 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example2.cs
@@ -16,10 +16,10 @@ public static void Main()
Console.WriteLine("{0}: {1}", fmt, value.ToString(fmt, dtfi));
Console.WriteLine();
-
+
// We don't want to change the FullDateTimePattern, so we need to save it.
String originalFullDateTimePattern = dtfi.FullDateTimePattern;
-
+
// Modify day name abbreviations and long date pattern.
dtfi.AbbreviatedDayNames = new String[] { "Su", "M", "Tu", "W", "Th", "F", "Sa" };
dtfi.LongDatePattern = "ddd dd-MMM-yyyy";
@@ -32,7 +32,7 @@ public static void Main()
// D: Tuesday, July 09, 2013
// F: Tuesday, July 09, 2013 12:00:00 AM
// f: Tuesday, July 09, 2013 12:00 AM
-//
+//
// D: Tu 09-Jul-2013
// F: Tuesday, July 09, 2013 12:00:00 AM
// f: Tu 09-Jul-2013 12:00 AM
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example3.cs
index 7f09b611050..904a853cdaa 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example3.cs
@@ -6,13 +6,13 @@ public class Example
{
public static void Main()
{
- DateTime dateValue = new DateTime(2013, 08, 28);
+ DateTime dateValue = new DateTime(2013, 08, 28);
CultureInfo frFR = CultureInfo.CreateSpecificCulture("fr-FR");
DateTimeFormatInfo dtfi = frFR.DateTimeFormat;
-
+
Console.WriteLine("Before modifying DateSeparator property: {0}",
dateValue.ToString("g", frFR));
-
+
// Modify the date separator.
dtfi.DateSeparator = "-";
Console.WriteLine("After modifying the DateSeparator property: {0}",
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example4.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example4.cs
index f9c0445932e..a9f3bde6360 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example4.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example4.cs
@@ -7,8 +7,8 @@ public class Example
public static void Main()
{
DateTime dateValue = new DateTime(2013, 5, 18, 13, 30, 0);
- String[] formats = { "D", "f", "F" };
-
+ String[] formats = { "D", "f", "F" };
+
CultureInfo enUS = CultureInfo.CreateSpecificCulture("en-US");
DateTimeFormatInfo dtfi = enUS.DateTimeFormat;
String originalLongDatePattern = dtfi.LongDatePattern;
@@ -18,14 +18,14 @@ public static void Main()
Console.WriteLine(dateValue.ToString(fmt, dtfi));
Console.WriteLine();
-
+
// Modify the long date pattern.
dtfi.LongDatePattern = originalLongDatePattern + " g";
foreach (var fmt in formats)
Console.WriteLine(dateValue.ToString(fmt, dtfi));
Console.WriteLine();
-
+
// Change A.D. to C.E. (for Common Era)
dtfi.LongDatePattern = originalLongDatePattern + @" 'C.E.'";
foreach (var fmt in formats)
@@ -36,11 +36,11 @@ public static void Main()
// Saturday, May 18, 2013
// Saturday, May 18, 2013 1:30 PM
// Saturday, May 18, 2013 1:30:00 PM
-//
+//
// Saturday, May 18, 2013 A.D.
// Saturday, May 18, 2013 A.D. 1:30 PM
// Saturday, May 18, 2013 A.D. 1:30:00 PM
-//
+//
// Saturday, May 18, 2013 C.E.
// Saturday, May 18, 2013 C.E. 1:30 PM
// Saturday, May 18, 2013 C.E. 1:30:00 PM
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example5.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example5.cs
index 6675c5d4751..87d542306a3 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example5.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/example5.cs
@@ -15,23 +15,23 @@ public static void Main()
Console.WriteLine("LongTimePattern: " + dtfi.LongTimePattern);
Console.WriteLine("FullDateTimePattern: " + dtfi.FullDateTimePattern);
Console.WriteLine();
-
+
dtfi.LongTimePattern = ReplaceWith24HourClock(dtfi.LongTimePattern);
dtfi.ShortTimePattern = ReplaceWith24HourClock(dtfi.ShortTimePattern);
-
+
Console.WriteLine("Modififed Property Values:");
Console.WriteLine("ShortTimePattern: " + dtfi.ShortTimePattern);
Console.WriteLine("LongTimePattern: " + dtfi.LongTimePattern);
Console.WriteLine("FullDateTimePattern: " + dtfi.FullDateTimePattern);
- }
-
+ }
+
private static string ReplaceWith24HourClock(string fmt)
{
string pattern = @"^(?\s*t+\s*)? " +
@"(?(openAMPM) h+(?[^ht]+)$ " +
@"| \s*h+(?[^ht]+)\s*t+)";
- return Regex.Replace(fmt, pattern, "HH${nonHours}",
- RegexOptions.IgnorePatternWhitespace);
+ return Regex.Replace(fmt, pattern, "HH${nonHours}",
+ RegexOptions.IgnorePatternWhitespace);
}
}
// The example displays the following output:
@@ -39,7 +39,7 @@ private static string ReplaceWith24HourClock(string fmt)
// ShortTimePattern: h:mm tt
// LongTimePattern: h:mm:ss tt
// FullDateTimePattern: dddd, MMMM dd, yyyy h:mm:ss tt
-//
+//
// Modififed Property Values:
// ShortTimePattern: HH:mm
// LongTimePattern: HH:mm:ss
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/format1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/format1.cs
index fab0b9f1b86..5452c3d7f9a 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/format1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/format1.cs
@@ -11,15 +11,15 @@ public static void Main()
DateTimeFormatInfo dtfi = CultureInfo.GetCultureInfo("en-US").DateTimeFormat;
Type typ = dtfi.GetType();
PropertyInfo[] props = typ.GetProperties();
- DateTime value = new DateTime(2012, 5, 28, 11, 35, 0);
-
+ DateTime value = new DateTime(2012, 5, 28, 11, 35, 0);
+
foreach (var prop in props) {
// Is this a format pattern-related property?
if (prop.Name.Contains("Pattern")) {
string fmt = prop.GetValue(dtfi, null).ToString();
- Console.WriteLine("{0,-33} {1} \n{2,-37}Example: {3}\n",
+ Console.WriteLine("{0,-33} {1} \n{2,-37}Example: {3}\n",
prop.Name + ":", fmt, "",
- value.ToString(fmt));
+ value.ToString(fmt));
}
}
}
@@ -27,31 +27,31 @@ public static void Main()
// The example displays the following output:
// FullDateTimePattern: dddd, MMMM dd, yyyy h:mm:ss tt
// Example: Monday, May 28, 2012 11:35:00 AM
-//
+//
// LongDatePattern: dddd, MMMM dd, yyyy
// Example: Monday, May 28, 2012
-//
+//
// LongTimePattern: h:mm:ss tt
// Example: 11:35:00 AM
-//
+//
// MonthDayPattern: MMMM dd
// Example: May 28
-//
+//
// RFC1123Pattern: ddd, dd MMM yyyy HH':'mm':'ss 'GMT'
// Example: Mon, 28 May 2012 11:35:00 GMT
-//
+//
// ShortDatePattern: M/d/yyyy
// Example: 5/28/2012
-//
+//
// ShortTimePattern: h:mm tt
// Example: 11:35 AM
-//
+//
// SortableDateTimePattern: yyyy'-'MM'-'dd'T'HH':'mm':'ss
// Example: 2012-05-28T11:35:00
-//
+//
// UniversalSortableDateTimePattern: yyyy'-'MM'-'dd HH':'mm':'ss'Z'
// Example: 2012-05-28 11:35:00Z
-//
+//
// YearMonthPattern: MMMM, yyyy
// Example: May, 2012
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/formatprovider1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/formatprovider1.cs
index 76703bfb902..2eaaa79580e 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/formatprovider1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/formatprovider1.cs
@@ -4,9 +4,9 @@
public class CurrentCultureFormatProvider : IFormatProvider
{
- public Object GetFormat(Type formatType)
+ public Object GetFormat(Type formatType)
{
- Console.WriteLine("Requesting an object of type {0}",
+ Console.WriteLine("Requesting an object of type {0}",
formatType.Name);
if (formatType == typeof(NumberFormatInfo))
return NumberFormatInfo.CurrentInfo;
@@ -25,7 +25,7 @@ public static void Main()
string value = dateValue.ToString("F", new CurrentCultureFormatProvider());
Console.WriteLine(value);
Console.WriteLine();
- string composite = String.Format(new CurrentCultureFormatProvider(),
+ string composite = String.Format(new CurrentCultureFormatProvider(),
"Date: {0:d} Amount: {1:C} Description: {2}",
dateValue, 1264.03m, "Service Charge");
Console.WriteLine(composite);
@@ -35,7 +35,7 @@ public static void Main()
// The example displays output like the following:
// Requesting an object of type DateTimeFormatInfo
// Tuesday, May 28, 2013 1:30:00 PM
-//
+//
// Requesting an object of type ICustomFormatter
// Requesting an object of type DateTimeFormatInfo
// Requesting an object of type NumberFormatInfo
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/instantiate3.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/instantiate3.cs
index 5e8093767eb..e334d73d048 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/instantiate3.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/instantiate3.cs
@@ -8,13 +8,13 @@ public static void Main()
{
CultureInfo culture;
DateTimeFormatInfo dtfi;
-
+
culture = CultureInfo.CurrentCulture;
dtfi = culture.DateTimeFormat;
Console.WriteLine("Culture Name: {0}", culture.Name);
Console.WriteLine("User Overrides: {0}", culture.UseUserOverride);
Console.WriteLine("Long Time Pattern: {0}\n", culture.DateTimeFormat.LongTimePattern);
-
+
culture = new CultureInfo(CultureInfo.CurrentCulture.Name, false);
Console.WriteLine("Culture Name: {0}", culture.Name);
Console.WriteLine("User Overrides: {0}", culture.UseUserOverride);
@@ -25,7 +25,7 @@ public static void Main()
// Culture Name: en-US
// User Overrides: True
// Long Time Pattern: HH:mm:ss
-//
+//
// Culture Name: en-US
// User Overrides: False
// Long Time Pattern: h:mm:ss tt
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/instantiate6c.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/instantiate6c.cs
index b0d787b67d8..989d79e7872 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/instantiate6c.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/instantiate6c.cs
@@ -17,8 +17,8 @@ public static void Main()
foreach (var name in names) {
// Ignore the invariant culture.
if (name == "") continue;
-
- ListSimilarChildCultures(name);
+
+ ListSimilarChildCultures(name);
}
}
@@ -27,55 +27,55 @@ private static void ListSimilarChildCultures(String name)
// Create the neutral DateTimeFormatInfo object.
DateTimeFormatInfo dtfi = CultureInfo.GetCultureInfo(name).DateTimeFormat;
// Retrieve all specific cultures of the neutral culture.
- CultureInfo[] cultures = Array.FindAll(CultureInfo.GetCultures(CultureTypes.SpecificCultures),
+ CultureInfo[] cultures = Array.FindAll(CultureInfo.GetCultures(CultureTypes.SpecificCultures),
culture => culture.Name.StartsWith(name + "-", StringComparison.OrdinalIgnoreCase));
// Create an array of DateTimeFormatInfo properties
PropertyInfo[] properties = typeof(DateTimeFormatInfo).GetProperties(BindingFlags.Instance | BindingFlags.Public);
bool hasOneMatch = false;
foreach (var ci in cultures) {
- bool match = true;
+ bool match = true;
// Get the DateTimeFormatInfo for a specific culture.
DateTimeFormatInfo specificDtfi = ci.DateTimeFormat;
// Compare the property values of the two.
foreach (var prop in properties) {
- // We're not interested in the value of IsReadOnly.
+ // We're not interested in the value of IsReadOnly.
if (prop.Name == "IsReadOnly") continue;
-
+
// For arrays, iterate the individual elements to see if they are the same.
- if (prop.PropertyType.IsArray) {
+ if (prop.PropertyType.IsArray) {
IList nList = (IList) prop.GetValue(dtfi, null);
IList sList = (IList) prop.GetValue(specificDtfi, null);
if (nList.Count != sList.Count) {
match = false;
Console.WriteLine(" Different n in {2} array for {0} and {1}", name, ci.Name, prop.Name);
break;
- }
+ }
for (int ctr = 0; ctr < nList.Count; ctr++) {
- if (! nList[ctr].Equals(sList[ctr])) {
+ if (! nList[ctr].Equals(sList[ctr])) {
match = false;
-Console.WriteLine(" {0} value different for {1} and {2}", prop.Name, name, ci.Name);
+Console.WriteLine(" {0} value different for {1} and {2}", prop.Name, name, ci.Name);
break;
- }
+ }
}
-
+
if (! match) break;
}
// Get non-array values.
else {
Object specificValue = prop.GetValue(specificDtfi);
Object neutralValue = prop.GetValue(dtfi);
-
+
// Handle comparison of Calendar objects.
- if (prop.Name == "Calendar") {
+ if (prop.Name == "Calendar") {
// The cultures have a different calendar type.
if (specificValue.ToString() != neutralValue.ToString()) {
Console.WriteLine(" Different calendar types for {0} and {1}", name, ci.Name);
match = false;
break;
}
-
+
if (specificValue is GregorianCalendar) {
if (((GregorianCalendar) specificValue).CalendarType != ((GregorianCalendar) neutralValue).CalendarType) {
Console.WriteLine(" Different Gregorian calendar types for {0} and {1}", name, ci.Name);
@@ -86,19 +86,19 @@ private static void ListSimilarChildCultures(String name)
}
else if (! specificValue.Equals(neutralValue)) {
match = false;
-Console.WriteLine(" Different {0} values for {1} and {2}", prop.Name, name, ci.Name);
- break;
+Console.WriteLine(" Different {0} values for {1} and {2}", prop.Name, name, ci.Name);
+ break;
}
- }
+ }
}
if (match) {
- Console.WriteLine("DateTimeFormatInfo object for '{0}' matches '{1}'",
+ Console.WriteLine("DateTimeFormatInfo object for '{0}' matches '{1}'",
name, ci.Name);
hasOneMatch = true;
- }
+ }
}
if (! hasOneMatch)
- Console.WriteLine("DateTimeFormatInfo object for '{0}' --> No Match", name);
+ Console.WriteLine("DateTimeFormatInfo object for '{0}' --> No Match", name);
Console.WriteLine();
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/parse2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/parse2.cs
index 028a1588cd5..fdd6c55deb9 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/parse2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/parse2.cs
@@ -7,29 +7,29 @@ public class Example
public static void Main()
{
string inputDate = "14/05/10";
-
- CultureInfo[] cultures = { CultureInfo.GetCultureInfo("en-US"),
+
+ CultureInfo[] cultures = { CultureInfo.GetCultureInfo("en-US"),
CultureInfo.CreateSpecificCulture("en-US") };
-
+
foreach (var culture in cultures) {
try {
- Console.WriteLine("{0} culture reflects user overrides: {1}",
+ Console.WriteLine("{0} culture reflects user overrides: {1}",
culture.Name, culture.UseUserOverride);
DateTime occasion = DateTime.Parse(inputDate, culture);
- Console.WriteLine("'{0}' --> {1}", inputDate,
+ Console.WriteLine("'{0}' --> {1}", inputDate,
occasion.ToString("D", CultureInfo.InvariantCulture));
}
catch (FormatException) {
- Console.WriteLine("Unable to parse '{0}'", inputDate);
- }
- Console.WriteLine();
+ Console.WriteLine("Unable to parse '{0}'", inputDate);
+ }
+ Console.WriteLine();
}
}
}
// The example displays the following output:
// en-US culture reflects user overrides: False
// Unable to parse '14/05/10'
-//
+//
// en-US culture reflects user overrides: True
// '14/05/10' --> Saturday, 10 May 2014
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/parsing1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/parsing1.cs
index 6d8768e90f5..05651810afd 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/parsing1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/parsing1.cs
@@ -8,15 +8,15 @@ public static void Main()
{
string[] dateStrings = { "08/18/2014", "01/02/2015" };
string[] cultureNames = { "en-US", "en-GB", "fr-FR", "fi-FI" };
-
+
foreach (var cultureName in cultureNames) {
CultureInfo culture = CultureInfo.CreateSpecificCulture(cultureName);
- Console.WriteLine("Parsing strings using the {0} culture.",
+ Console.WriteLine("Parsing strings using the {0} culture.",
culture.Name);
foreach (var dateStr in dateStrings) {
try {
- Console.WriteLine(String.Format(culture,
- " '{0}' --> {1:D}", dateStr,
+ Console.WriteLine(String.Format(culture,
+ " '{0}' --> {1:D}", dateStr,
DateTime.Parse(dateStr, culture)));
}
catch (FormatException) {
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/serialize1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/serialize1.cs
index 2cf8b603987..58b201dbe96 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/serialize1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/serialize1.cs
@@ -12,9 +12,9 @@ public static void Main()
DateTime originalDate = new DateTime(2014, 08, 18, 08, 16, 35);
// Display information on the date and time.
Console.WriteLine("Date to serialize: {0:F}", originalDate);
- Console.WriteLine("Current Culture: {0}",
+ Console.WriteLine("Current Culture: {0}",
CultureInfo.CurrentCulture.Name);
- Console.WriteLine("Time Zone: {0}",
+ Console.WriteLine("Time Zone: {0}",
TimeZoneInfo.Local.DisplayName);
// Convert the date value to UTC.
DateTime utcDate = originalDate.ToUniversalTime();
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/serialize2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/serialize2.cs
index 746ba0259f7..c0fce92d59f 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/serialize2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.class/cs/serialize2.cs
@@ -8,19 +8,19 @@ public class Example
public static void Main()
{
// Open the file and retrieve the date string.
- StreamReader sr = new StreamReader(@".\DateData.dat");
+ StreamReader sr = new StreamReader(@".\DateData.dat");
String dateValue = sr.ReadToEnd();
-
+
// Parse the date.
- DateTime parsedDate = DateTime.ParseExact(dateValue, "o",
+ DateTime parsedDate = DateTime.ParseExact(dateValue, "o",
DateTimeFormatInfo.InvariantInfo);
- // Convert it to local time.
+ // Convert it to local time.
DateTime restoredDate = parsedDate.ToLocalTime();
// Display information on the date and time.
Console.WriteLine("Deserialized date: {0:F}", restoredDate);
- Console.WriteLine("Current Culture: {0}",
+ Console.WriteLine("Current Culture: {0}",
CultureInfo.CurrentCulture.Name);
- Console.WriteLine("Time Zone: {0}",
+ Console.WriteLine("Time Zone: {0}",
TimeZoneInfo.Local.DisplayName);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.dateseparator/cs/dateseparatorex.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.dateseparator/cs/dateseparatorex.cs
index c291ac3c9f9..fa5f67cad11 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.dateseparator/cs/dateseparatorex.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.dateseparator/cs/dateseparatorex.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
DateTime value = new DateTime(2013, 9, 8);
-
+
string[] formats = { "d", "G", "g" };
CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
DateTimeFormatInfo dtfi = culture.DateTimeFormat;
dtfi.DateSeparator = "-";
-
+
foreach (var fmt in formats)
Console.WriteLine("{0}: {1}", fmt, value.ToString(fmt, dtfi));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.getalldatetimepatterns/cs/getalldatetimepatternsex1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.getalldatetimepatterns/cs/getalldatetimepatternsex1.cs
index d9ce34ae6b1..53aeddde188 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.getalldatetimepatterns/cs/getalldatetimepatternsex1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.getalldatetimepatterns/cs/getalldatetimepatternsex1.cs
@@ -11,14 +11,14 @@ public static void Main()
DateTime date2;
int total = 0;
int noRoundTrip = 0;
-
+
foreach (var fmt in culture.DateTimeFormat.GetAllDateTimePatterns()) {
total += 1;
if (! DateTime.TryParse(date1.ToString(fmt), out date2)) {
noRoundTrip++;
- Console.WriteLine("Unable to parse {0:" + fmt + "} (format '{1}')",
+ Console.WriteLine("Unable to parse {0:" + fmt + "} (format '{1}')",
date1, fmt);
- }
+ }
}
Console.WriteLine("\nUnable to round-trip {0} of {1} format strings.",
noRoundTrip, total);
@@ -67,6 +67,6 @@ public static void Main()
// Unable to parse 1-Feb-11 07.30.45 (format 'd-MMM-yy HH.mm.ss')
// Unable to parse 1 February 2011 7.30.45 (format 'd MMMM yyyy H.mm.ss')
// Unable to parse 1 February 2011 07.30.45 (format 'd MMMM yyyy HH.mm.ss')
-//
+//
// Unable to round-trip 42 of 98 format strings.
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.getalldatetimepatterns/cs/getalldatetimepatternsex2.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.getalldatetimepatterns/cs/getalldatetimepatternsex2.cs
index d0cbf232d8b..293fe6a3a20 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.getalldatetimepatterns/cs/getalldatetimepatternsex2.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.getalldatetimepatterns/cs/getalldatetimepatternsex2.cs
@@ -7,7 +7,7 @@ public class Example
public static void Main()
{
CultureInfo culture = CultureInfo.CreateSpecificCulture("ru-RU");
- char[] formats = { 'd', 'D', 'f', 'F', 'g', 'G', 'm', 'o',
+ char[] formats = { 'd', 'D', 'f', 'F', 'g', 'G', 'm', 'o',
'r', 's', 't', 'T', 'u', 'U', 'y' };
DateTime date1 = new DateTime(2011, 02, 01, 7, 30, 45, 0);
DateTime date2;
@@ -15,15 +15,15 @@ public static void Main()
int noRoundTrip = 0;
foreach (var fmt in formats) {
- total = 0;
+ total = 0;
noRoundTrip = 0;
foreach (var pattern in culture.DateTimeFormat.GetAllDateTimePatterns(fmt)) {
total++;
if (! DateTime.TryParse(date1.ToString(pattern), out date2)) {
noRoundTrip++;
- Console.WriteLine("Unable to parse {0:" + pattern + "} (format '{1}')",
+ Console.WriteLine("Unable to parse {0:" + pattern + "} (format '{1}')",
date1, pattern);
- }
+ }
}
if (noRoundTrip > 0)
Console.WriteLine("{0}: Unable to round-trip {1} of {2} format strings.\n",
@@ -35,46 +35,46 @@ public static void Main()
}
// The example displays the following output:
// d: All custom format strings round trip.
-//
+//
// Unable to parse 1 February 2011 г. (format 'd MMMM yyyy 'г.'')
// Unable to parse 01 February 2011 г. (format 'dd MMMM yyyy 'г.'')
// D: Unable to round-trip 2 of 2 format strings.
-//
+//
// Unable to parse 1 February 2011 г. 7:30 (format 'd MMMM yyyy 'г.' H:mm')
// Unable to parse 1 February 2011 г. 07:30 (format 'd MMMM yyyy 'г.' HH:mm')
// Unable to parse 01 February 2011 г. 7:30 (format 'dd MMMM yyyy 'г.' H:mm')
// Unable to parse 01 February 2011 г. 07:30 (format 'dd MMMM yyyy 'г.' HH:mm')
// f: Unable to round-trip 4 of 4 format strings.
-//
+//
// Unable to parse 1 February 2011 г. 7:30:45 (format 'd MMMM yyyy 'г.' H:mm:ss')
// Unable to parse 1 February 2011 г. 07:30:45 (format 'd MMMM yyyy 'г.' HH:mm:ss')
// Unable to parse 01 February 2011 г. 7:30:45 (format 'dd MMMM yyyy 'г.' H:mm:ss')
// Unable to parse 01 February 2011 г. 07:30:45 (format 'dd MMMM yyyy 'г.' HH:mm:ss')
// F: Unable to round-trip 4 of 4 format strings.
-//
+//
// g: All custom format strings round trip.
-//
+//
// G: All custom format strings round trip.
-//
+//
// m: All custom format strings round trip.
-//
+//
// o: All custom format strings round trip.
-//
+//
// r: All custom format strings round trip.
-//
+//
// s: All custom format strings round trip.
-//
+//
// t: All custom format strings round trip.
-//
+//
// T: All custom format strings round trip.
-//
+//
// u: All custom format strings round trip.
-//
+//
// Unable to parse 1 February 2011 г. 7:30:45 (format 'd MMMM yyyy 'г.' H:mm:ss')
// Unable to parse 1 February 2011 г. 07:30:45 (format 'd MMMM yyyy 'г.' HH:mm:ss')
// Unable to parse 01 February 2011 г. 7:30:45 (format 'dd MMMM yyyy 'г.' H:mm:ss')
// Unable to parse 01 February 2011 г. 07:30:45 (format 'dd MMMM yyyy 'г.' HH:mm:ss')
// U: Unable to round-trip 4 of 4 format strings.
-//
+//
// y: All custom format strings round trip.
//
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.setalldatetimepatterns/cs/setalldatetimepatterns.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.setalldatetimepatterns/cs/setalldatetimepatterns.cs
index 62c8fac03e6..9a26a872b49 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.setalldatetimepatterns/cs/setalldatetimepatterns.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.setalldatetimepatterns/cs/setalldatetimepatterns.cs
@@ -8,16 +8,16 @@ public static void Main()
{
// Use standard en-US culture.
CultureInfo enUS = new CultureInfo("en-US");
-
- string[] values = { "December 2010", "December, 2010",
- "Dec-2010", "December-2010" };
-
+
+ string[] values = { "December 2010", "December, 2010",
+ "Dec-2010", "December-2010" };
+
Console.WriteLine("Supported Y/y patterns for {0} culture:", enUS.Name);
foreach (var pattern in enUS.DateTimeFormat.GetAllDateTimePatterns('Y'))
Console.WriteLine(" " + pattern);
Console.WriteLine();
-
+
// Try to parse each date string using "Y" format specifier.
foreach (var value in values) {
try {
@@ -26,13 +26,13 @@ public static void Main()
}
catch (FormatException) {
Console.WriteLine(" Cannot parse {0}", value);
- }
- }
+ }
+ }
Console.WriteLine();
-
+
//Modify supported "Y" format.
enUS.DateTimeFormat.SetAllDateTimePatterns( new string[] { "MMM-yyyy" } , 'Y');
-
+
Console.WriteLine("New supported Y/y patterns for {0} culture:", enUS.Name);
foreach (var pattern in enUS.DateTimeFormat.GetAllDateTimePatterns('Y'))
Console.WriteLine(" " + pattern);
@@ -47,22 +47,22 @@ public static void Main()
}
catch (FormatException) {
Console.WriteLine(" Cannot parse {0}", value);
- }
- }
+ }
+ }
}
}
// The example displays the following output:
// Supported Y/y patterns for en-US culture:
// MMMM, yyyy
-//
+//
// Cannot parse December 2010
// Parsed December, 2010 as December, 2010
// Cannot parse Dec-2010
// Cannot parse December-2010
-//
+//
// New supported Y/y patterns for en-US culture:
// MMM-yyyy
-//
+//
// Cannot parse December 2010
// Cannot parse December, 2010
// Parsed Dec-2010 as Dec-2010
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.timeseparator/cs/timeseparatorex.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.timeseparator/cs/timeseparatorex.cs
index 9c4c3eeb0f8..ace6216eae8 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.timeseparator/cs/timeseparatorex.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.datetimeformatinfo.timeseparator/cs/timeseparatorex.cs
@@ -7,12 +7,12 @@ public class Example
public static void Main()
{
DateTime value = new DateTime(2013, 9, 8, 14, 30, 0);
-
+
string[] formats = { "t", "T", "f", "F", "G", "g" };
CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
DateTimeFormatInfo dtfi = culture.DateTimeFormat;
dtfi.TimeSeparator = ".";
-
+
foreach (var fmt in formats)
Console.WriteLine("{0}: {1}", fmt, value.ToString(fmt, dtfi));
}
diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.gregoriancalendar.class/cs/minimum1.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.gregoriancalendar.class/cs/minimum1.cs
index e9efd6e42f9..cbb8ecce490 100644
--- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.gregoriancalendar.class/cs/minimum1.cs
+++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.globalization.gregoriancalendar.class/cs/minimum1.cs
@@ -8,13 +8,13 @@ public class Example
public static void Main()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("da-DK");
-
+
JulianCalendar jc = new JulianCalendar();
DateTime lastDate = new DateTime(1700, 2, 18, jc);
Console.WriteLine("Last date (Gregorian): {0:d}", lastDate);
Console.WriteLine("Last date (Julian): {0}-{1}-{2}\n", jc.GetDayOfMonth(lastDate),
jc.GetMonth(lastDate), jc.GetYear(lastDate));
-
+
DateTime firstDate = lastDate.AddDays(1);
Console.WriteLine("First date (Gregorian): {0:d}", firstDate);
Console.WriteLine("First date (Julian): {0}-{1}-{2}", jc.GetDayOfMonth(firstDate),
@@ -24,7 +24,7 @@ public static void Main()
// The example displays the following output:
// Last date (Gregorian): 28-02-1700
// Last date (Julian): 18-2-1700
-//
+//
// First date (Gregorian): 01-03-1700
// First date (Julian): 19-2-1700
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/CS/source.cs
index 18e433533bf..5267f0898a4 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/CS/source.cs
@@ -1,28 +1,28 @@
//
using System;
using System.Xml;
-
+
public class Sample {
-
+
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Eva"+
- "Corets" +
- "");
-
+ "Corets" +
+ "");
+
Console.WriteLine("InnerText before...");
Console.WriteLine(doc.DocumentElement.InnerText);
-
- // Add white space.
+
+ // Add white space.
XmlNode currNode = doc.DocumentElement;
XmlSignificantWhitespace sigws = doc.CreateSignificantWhitespace("\t");
currNode.InsertAfter(sigws, currNode.FirstChild);
-
+
Console.WriteLine();
Console.WriteLine("InnerText after...");
Console.WriteLine(doc.DocumentElement.InnerText);
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/CS/source.cs
index dc00337114c..737749876bf 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/CS/source.cs
@@ -1,28 +1,28 @@
//
using System;
using System.Xml;
-
+
public class Sample {
public static void Main() {
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Eva"+
- "Corets" +
- "");
-
+ "Corets" +
+ "");
+
Console.WriteLine("InnerText before...");
Console.WriteLine(doc.DocumentElement.InnerText);
-
- // Add white space.
+
+ // Add white space.
XmlNode currNode=doc.DocumentElement;
XmlWhitespace ws = doc.CreateWhitespace("\r\n");
currNode.InsertAfter(ws, currNode.FirstChild);
-
+
Console.WriteLine();
Console.WriteLine("InnerText after...");
Console.WriteLine(doc.DocumentElement.InnerText);
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/CS/source.cs
index 750edf9f2c5..4c88c9f21b0 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/CS/source.cs
@@ -12,15 +12,15 @@ public static void Main()
"Pride And Prejudice" +
"");
- //Create an XML declaration.
+ //Create an XML declaration.
XmlDeclaration xmldecl;
xmldecl = doc.CreateXmlDeclaration("1.0",null,null);
//Add the new node to the document.
XmlElement root = doc.DocumentElement;
doc.InsertBefore(xmldecl, 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.GetElementById Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementById Example/CS/source.cs
index 1c192ae0bac..e9db745c200 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementById Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementById Example/CS/source.cs
@@ -18,7 +18,7 @@ public static void Main()
//Get the first element with an attribute of type ID and value of A222.
//This displays the node .
elem = doc.GetElementById("A222");
- Console.WriteLine( elem.OuterXml );
+ Console.WriteLine( elem.OuterXml );
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/CS/source.cs
index 07faa2803a9..7fca34f52e5 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/CS/source.cs
@@ -14,9 +14,9 @@ public static void Main()
//Display all the book titles.
XmlNodeList elemList = doc.GetElementsByTagName("title");
for (int i=0; i < elemList.Count; i++)
- {
+ {
Console.WriteLine(elemList[i].InnerXml);
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/CS/source.cs
index 83cf425dc35..7d79b118e82 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/CS/source.cs
@@ -21,8 +21,8 @@ public static void Main()
//Import the last book node from doc2 into the original document.
XmlNode newBook = doc.ImportNode(doc2.DocumentElement.LastChild, true);
- doc.DocumentElement.AppendChild(newBook);
-
+ doc.DocumentElement.AppendChild(newBook);
+
Console.WriteLine("Display the modified XML...");
doc.Save(Console.Out);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/CS/source.cs
index 81a7be75b84..d3ad42969d7 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Sample {
public static void Main() {
-
+
// Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.LoadXml("wrench");
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/CS/source.cs
index c7cacbc8d3a..ed4cbeccf17 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/CS/source.cs
@@ -23,8 +23,8 @@ public static void Main()
XmlNode cd = doc.ReadNode(reader);
//Insert the new node into the document.
- doc.DocumentElement.AppendChild(cd);
-
+ doc.DocumentElement.AppendChild(cd);
+
Console.WriteLine("Display the modified XML...");
doc.Save(Console.Out);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/CS/source.cs
index f4ef964bbcc..da1bc4c9f07 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Sample {
public static void Main() {
-
+
// Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.LoadXml("wrench");
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.CloneNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.CloneNode Example/CS/source.cs
index ac34faf69a9..5def2bb8f2d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.CloneNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.CloneNode Example/CS/source.cs
@@ -2,22 +2,22 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample
{
public static void Main()
{
-
+
// Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.LoadXml("");
// Create a document fragment.
XmlDocumentFragment docFrag = doc.CreateDocumentFragment();
-
+
// Set the contents of the document fragment.
docFrag.InnerXml ="widget";
-
+
// Create a deep clone. The cloned node
// includes child nodes.
XmlNode deep = docFrag.CloneNode(true);
@@ -28,7 +28,7 @@ public static void Main()
// not include any child nodes.
XmlNode shallow = docFrag.CloneNode(false);
Console.WriteLine("Name: " + shallow.Name);
- Console.WriteLine("OuterXml: " + shallow.OuterXml);
+ Console.WriteLine("OuterXml: " + shallow.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.InnerXml Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.InnerXml Example/CS/source.cs
index 0cd30cb0048..b562477639b 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.InnerXml Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.InnerXml Example/CS/source.cs
@@ -12,7 +12,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 XmlDocumentFragment.OwnerDocument Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.OwnerDocument Example/CS/source.cs
index 41bdbd47a44..d6f7a1bc5f3 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.OwnerDocument Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlDocumentFragment.OwnerDocument Example/CS/source.cs
@@ -18,7 +18,7 @@ public static void Main()
Console.WriteLine(docFrag.OwnerDocument.OuterXml);
// Add nodes to the document fragment. Notice that the
- // new element is created using the owner document of
+ // new element is created using the owner document of
// the document fragment.
XmlElement elem = doc.CreateElement("item");
elem.InnerText = "widget";
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.GetElementsByTagName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.GetElementsByTagName Example/CS/source.cs
index 393b67e2dee..adc1f80b63c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.GetElementsByTagName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.GetElementsByTagName Example/CS/source.cs
@@ -9,14 +9,14 @@ public static void Main()
{
XmlDocument doc = new XmlDocument();
doc.Load("2books.xml");
-
+
// Get and display all the book titles.
XmlElement root = doc.DocumentElement;
XmlNodeList elemList = root.GetElementsByTagName("title");
for (int i=0; i < elemList.Count; i++)
- {
+ {
Console.WriteLine(elemList[i].InnerXml);
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.HasAttributes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.HasAttributes Example/CS/source.cs
index 398a0590b96..f13f32b93dd 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.HasAttributes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.HasAttributes Example/CS/source.cs
@@ -18,7 +18,7 @@ public static void Main()
// Remove all attributes from the root element.
if (root.HasAttributes)
root.RemoveAllAttributes();
-
+
Console.WriteLine("Display the modified XML...");
Console.WriteLine(doc.InnerXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.InnerXml Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.InnerXml Example/CS/source.cs
index a233fb68f71..342d41fc0dc 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.InnerXml Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.InnerXml Example/CS/source.cs
@@ -19,12 +19,12 @@ public static void Main() {
Console.WriteLine("Display the InnerXml of the element...");
Console.WriteLine(elem.InnerXml);
- // Set InnerText to a string that includes markup.
+ // Set InnerText to a string that includes markup.
// The markup is escaped.
elem.InnerText = "Text containing will have char(<) and char(>) escaped.";
Console.WriteLine( elem.OuterXml );
- // Set InnerXml to a string that includes markup.
+ // Set InnerXml to a string that includes markup.
// The markup is not escaped.
elem.InnerXml = "Text containing .";
Console.WriteLine( elem.OuterXml );
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.IsEmpty Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.IsEmpty Example/CS/source.cs
index ea4e5020319..46af7b41c45 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.IsEmpty Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.IsEmpty Example/CS/source.cs
@@ -1,21 +1,21 @@
//
using System;
using System.Xml;
-
+
public class Sample {
-
+
public static void Main() {
XmlDocument doc = new XmlDocument();
- doc.LoadXml(""+
+ doc.LoadXml(""+
" Pride And Prejudice" +
" " +
- "");
-
+ "");
+
XmlElement currNode = (XmlElement) doc.DocumentElement.LastChild;
if (currNode.IsEmpty)
- currNode.InnerXml="19.95";
-
+ currNode.InnerXml="19.95";
+
Console.WriteLine("Display the modified XML...");
Console.WriteLine(doc.OuterXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.OwnerDocument Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.OwnerDocument Example/CS/source.cs
index 5e1673d7f9d..e87ad619d92 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.OwnerDocument Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.OwnerDocument Example/CS/source.cs
@@ -23,7 +23,7 @@ public static void Main()
// that although the element has not been inserted
// into the document, it still has an owner document.
Console.WriteLine(elem.OwnerDocument.OuterXml);
-
+
// Add the new element into the document.
root.AppendChild(elem);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAllAttributes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAllAttributes Example/CS/source.cs
index 8c227e66ff7..a2f23cf638c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAllAttributes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAllAttributes Example/CS/source.cs
@@ -17,7 +17,7 @@ public static void Main()
// Remove all attributes from the root element.
root.RemoveAllAttributes();
-
+
Console.WriteLine("Display the modified XML...");
Console.WriteLine(doc.InnerXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttribute Example/CS/source.cs
index c73d4efb4d3..af123adb23e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttribute Example/CS/source.cs
@@ -17,7 +17,7 @@ public static void Main()
// Remove the genre attribute.
root.RemoveAttribute("genre");
-
+
Console.WriteLine("Display the modified XML...");
Console.WriteLine(doc.InnerXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttribute1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttribute1 Example/CS/source.cs
index 803cf430696..1e9f61e9ab6 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttribute1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttribute1 Example/CS/source.cs
@@ -17,7 +17,7 @@ public static void Main()
// Remove the ISBN attribute.
root.RemoveAttribute("ISBN", "urn:samples");
-
+
Console.WriteLine("Display the modified XML...");
Console.WriteLine(doc.InnerXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttributeAt Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttributeAt Example/CS/source.cs
index cbf0c1ca992..b79e46d9b13 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttributeAt Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttributeAt Example/CS/source.cs
@@ -17,7 +17,7 @@ public static void Main()
// Remove the genre attribute.
root.RemoveAttributeAt(0);
-
+
Console.WriteLine("Display the modified XML...");
Console.WriteLine(doc.InnerXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttributeNode1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttributeNode1 Example/CS/source.cs
index b8ff0c15358..46a91afa332 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttributeNode1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlElement.RemoveAttributeNode1 Example/CS/source.cs
@@ -17,7 +17,7 @@ public static void Main()
// Remove the ISBN attribute.
root.RemoveAttributeNode("ISBN", "urn:samples");
-
+
Console.WriteLine("Display the modified XML...");
Console.WriteLine(doc.InnerXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlEntityReference.BaseURI Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlEntityReference.BaseURI Example/CS/source.cs
index 541c278694d..b7955896ea5 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlEntityReference.BaseURI Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlEntityReference.BaseURI Example/CS/source.cs
@@ -10,7 +10,7 @@ public static void Main()
//Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.Load("http://localhost/uri.xml");
-
+
//Display information on the entity reference node.
XmlEntityReference entref = (XmlEntityReference) doc.DocumentElement.LastChild.FirstChild;
Console.WriteLine("Name of the entity reference: {0}", entref.Name);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlLinkedNode.NextSibling Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlLinkedNode.NextSibling Example/CS/source.cs
index 81bb6c21a25..0fa9b451648 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlLinkedNode.NextSibling Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlLinkedNode.NextSibling Example/CS/source.cs
@@ -2,7 +2,7 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample
{
public static void Main()
@@ -10,7 +10,7 @@ public static void Main()
XmlDocument doc = new XmlDocument();
doc.Load("books.xml");
-
+
// Display the first two book nodes.
XmlNode book = doc.DocumentElement.FirstChild;
Console.WriteLine(book.OuterXml);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlLinkedNode.PreviousSibling Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlLinkedNode.PreviousSibling Example/CS/source.cs
index 7a48564049a..7f054f6c069 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlLinkedNode.PreviousSibling Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlLinkedNode.PreviousSibling Example/CS/source.cs
@@ -1,21 +1,21 @@
//
using System;
using System.Xml;
-
+
public class Sample {
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.Load("books.xml");
-
+
XmlNode lastNode = doc.DocumentElement.LastChild;
Console.WriteLine("Last book...");
Console.WriteLine(lastNode.OuterXml);
XmlNode prevNode = lastNode.PreviousSibling;
Console.WriteLine("\r\nPrevious book...");
- Console.WriteLine(prevNode.OuterXml);
+ Console.WriteLine(prevNode.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.Count Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.Count Example/CS/source.cs
index 69623e8e03d..2d6697cf060 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.Count Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.Count Example/CS/source.cs
@@ -10,15 +10,15 @@ public static void Main()
XmlDocument doc = new XmlDocument();
doc.LoadXml(" " +
" Pride And Prejudice" +
- "");
-
+ "");
+
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
Console.WriteLine("Display all the attributes for this book...");
for (int i=0; i < attrColl.Count; i++)
{
Console.WriteLine("{0} = {1}", attrColl.Item(i).Name, attrColl.Item(i).Value);
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.GetEnumerator Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.GetEnumerator Example/CS/source.cs
index eebb053e09b..be877e21727 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.GetEnumerator Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.GetEnumerator Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
using System.Collections;
-
+
public class Sample
{
public static void Main()
@@ -13,8 +13,8 @@ public static void Main()
doc.LoadXml("" +
" Pride And Prejudice" +
- "");
-
+ "");
+
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
Console.WriteLine("Display all the attributes for this book...");
@@ -23,7 +23,7 @@ public static void Main()
{
XmlAttribute attr = (XmlAttribute)ienum.Current;
Console.WriteLine("{0} = {1}", attr.Name, attr.Value);
- }
- }
+ }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.GetNamedItem Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.GetNamedItem Example/CS/source.cs
index 65cca1304ab..3f0ef1f0781 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.GetNamedItem Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.GetNamedItem Example/CS/source.cs
@@ -10,8 +10,8 @@ public static void Main()
XmlDocument doc = new XmlDocument();
doc.LoadXml(" " +
" Pride And Prejudice" +
- "");
-
+ "");
+
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
// Change the value for the genre attribute.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.RemoveNamedItem1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.RemoveNamedItem1 Example/CS/source.cs
index f9800ad5a79..73396040ec2 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.RemoveNamedItem1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.RemoveNamedItem1 Example/CS/source.cs
@@ -10,8 +10,8 @@ public static void Main()
XmlDocument doc = new XmlDocument();
doc.LoadXml(" " +
" Pride And Prejudice" +
- "");
-
+ "");
+
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
// Remove the publicationdate attribute.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.SetNamedItem Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.SetNamedItem Example/CS/source.cs
index f78179f82ee..ecb92b95b8f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.SetNamedItem Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamedNodeMap.SetNamedItem Example/CS/source.cs
@@ -10,8 +10,8 @@ public static void Main()
XmlDocument doc = new XmlDocument();
doc.LoadXml(" " +
" Pride And Prejudice" +
- "");
-
+ "");
+
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
// Add a new attribute to the collection.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamespaceManager.PopScope Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamespaceManager.PopScope Example/CS/source.cs
index 7ed779e30a7..1b041f5a588 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamespaceManager.PopScope Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNamespaceManager.PopScope Example/CS/source.cs
@@ -32,7 +32,7 @@ private void ShowAllNamespaces(XmlNamespaceManager nsmgr)
foreach (String prefix in nsmgr)
{
Console.WriteLine("Prefix={0}, Namespace={1}", prefix,nsmgr.LookupNamespace(prefix));
- }
+ }
}
while (nsmgr.PopScope());
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.CloneNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.CloneNode Example/CS/source.cs
index fdd5f89997c..866e64089c0 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.CloneNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.CloneNode Example/CS/source.cs
@@ -15,12 +15,12 @@ public static void Main() {
XmlNode root = doc.FirstChild;
- //Create a deep clone. The cloned node
+ //Create a deep clone. The cloned node
//includes the child nodes.
XmlNode deep = root.CloneNode(true);
Console.WriteLine(deep.OuterXml);
- //Create a shallow clone. The cloned node does not
+ //Create a shallow clone. The cloned node does not
//include the child nodes, but does include its attribute.
XmlNode shallow = root.CloneNode(false);
Console.WriteLine(shallow.OuterXml);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.GetEnumerator Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.GetEnumerator Example/CS/source.cs
index 1b432fdd36f..2a46932dcdf 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.GetEnumerator Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.GetEnumerator Example/CS/source.cs
@@ -6,7 +6,7 @@
public class Sample {
public static void Main() {
-
+
XmlDocument doc = new XmlDocument();
doc.Load("books.xml");
@@ -14,8 +14,8 @@ public static void Main() {
XmlNode root = doc.DocumentElement;
IEnumerator ienum = root.GetEnumerator();
XmlNode book;
- while (ienum.MoveNext())
- {
+ while (ienum.MoveNext())
+ {
book = (XmlNode) ienum.Current;
Console.WriteLine(book.OuterXml);
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.InnerText Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.InnerText Example/CS/source.cs
index 1bb858531a1..750aeda878f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.InnerText Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.InnerText Example/CS/source.cs
@@ -19,12 +19,12 @@ public static void Main() {
Console.WriteLine("Display the InnerXml of the element...");
Console.WriteLine(elem.InnerXml);
- // Set InnerText to a string that includes markup.
+ // Set InnerText to a string that includes markup.
// The markup is escaped.
elem.InnerText = "Text containing will have char(<) and char(>) escaped.";
Console.WriteLine( elem.OuterXml );
- // Set InnerXml to a string that includes markup.
+ // Set InnerXml to a string that includes markup.
// The markup is not escaped.
elem.InnerXml = "Text containing .";
Console.WriteLine( elem.OuterXml );
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.NextSibling Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.NextSibling Example/CS/source.cs
index 31f25d15f4b..9081982d6ae 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.NextSibling Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.NextSibling Example/CS/source.cs
@@ -1,21 +1,21 @@
//
using System;
using System.Xml;
-
+
public class Sample {
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.Load("books.xml");
-
+
XmlNode currNode = doc.DocumentElement.FirstChild;
Console.WriteLine("First book...");
Console.WriteLine(currNode.OuterXml);
XmlNode nextNode = currNode.NextSibling;
Console.WriteLine("\r\nSecond book...");
- Console.WriteLine(nextNode.OuterXml);
+ Console.WriteLine(nextNode.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.OuterXml Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.OuterXml Example/CS/source.cs
index 1e68de54db9..13c9f0e019d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.OuterXml Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.OuterXml Example/CS/source.cs
@@ -17,7 +17,7 @@ public static void Main() {
// OuterXml includes the markup of current node.
Console.WriteLine("Display the OuterXml property...");
Console.WriteLine(root.OuterXml);
-
+
// InnerXml does not include the markup of the current node.
// As a result, the attributes are not displayed.
Console.WriteLine();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.PreviousSibling Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.PreviousSibling Example/CS/source.cs
index 7a48564049a..7f054f6c069 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.PreviousSibling Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.PreviousSibling Example/CS/source.cs
@@ -1,21 +1,21 @@
//
using System;
using System.Xml;
-
+
public class Sample {
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.Load("books.xml");
-
+
XmlNode lastNode = doc.DocumentElement.LastChild;
Console.WriteLine("Last book...");
Console.WriteLine(lastNode.OuterXml);
XmlNode prevNode = lastNode.PreviousSibling;
Console.WriteLine("\r\nPrevious book...");
- Console.WriteLine(prevNode.OuterXml);
+ Console.WriteLine(prevNode.OuterXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.SelectNodes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.SelectNodes Example/CS/source.cs
index c337713c573..719c56232fa 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.SelectNodes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.SelectNodes Example/CS/source.cs
@@ -14,7 +14,7 @@ public static void Main() {
XmlNode root = doc.DocumentElement;
nodeList=root.SelectNodes("descendant::book[author/last-name='Austen']");
-
+
//Change the price on the books.
foreach (XmlNode book in nodeList)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.SelectSingleNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.SelectSingleNode Example/CS/source.cs
index 76f851fc0c2..044a5234849 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.SelectSingleNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNode.SelectSingleNode Example/CS/source.cs
@@ -6,7 +6,7 @@
public class Sample {
public static void Main() {
-
+
XmlDocument doc = new XmlDocument();
doc.Load("booksort.xml");
@@ -14,12 +14,12 @@ public static void Main() {
XmlNode root = doc.DocumentElement;
book=root.SelectSingleNode("descendant::book[author/last-name='Austen']");
-
+
//Change the price on the book.
book.LastChild.InnerText="15.95";
Console.WriteLine("Display the modified XML document....");
- doc.Save(Console.Out);
+ doc.Save(Console.Out);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeList.GetEnumerator Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeList.GetEnumerator Example/CS/source.cs
index 7b99f4e13ad..06e0a50c751 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeList.GetEnumerator Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeList.GetEnumerator Example/CS/source.cs
@@ -7,18 +7,18 @@
public class Sample {
public static void Main() {
-
+
XmlDocument doc = new XmlDocument();
doc.Load("2books.xml");
-
+
//Get and display all the book titles.
XmlElement root = doc.DocumentElement;
XmlNodeList elemList = root.GetElementsByTagName("title");
- IEnumerator ienum = elemList.GetEnumerator();
- while (ienum.MoveNext()) {
+ IEnumerator ienum = elemList.GetEnumerator();
+ while (ienum.MoveNext()) {
XmlNode title = (XmlNode) ienum.Current;
Console.WriteLine(title.InnerText);
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeList.Item Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeList.Item Example/CS/source.cs
index cde0bc19ddb..93ef9cb9d19 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeList.Item Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeList.Item Example/CS/source.cs
@@ -6,17 +6,17 @@
public class Sample {
public static void Main() {
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
" First item" +
" Second item" +
"");
-
+
//Get and display the last item node.
XmlElement root = doc.DocumentElement;
XmlNodeList nodeList = root.GetElementsByTagName("item");
- Console.WriteLine(nodeList.Item(1).InnerXml);
+ Console.WriteLine(nodeList.Item(1).InnerXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.AttributeCount Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.AttributeCount Example/CS/source.cs
index f2185b2d583..5b9f465588c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.AttributeCount Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.AttributeCount Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -14,11 +14,11 @@ public static void Main()
//Create and load the XML document.
XmlDocument doc = new XmlDocument();
doc.LoadXml(" " +
- "");
+ "");
- //Load the XmlNodeReader
+ //Load the XmlNodeReader
reader = new XmlNodeReader(doc);
-
+
//Read the attributes on the root element.
reader.MoveToContent();
if (reader.HasAttributes){
@@ -29,9 +29,9 @@ public static void Main()
//Return the reader to the book element.
reader.MoveToElement();
}
- }
+ }
- finally
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.BaseURI Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.BaseURI Example/CS/source.cs
index 4443723cfc8..343a94d2a7c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.BaseURI Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.BaseURI Example/CS/source.cs
@@ -10,7 +10,7 @@ public static void Main()
XmlNodeReader reader = null;
try
- {
+ {
//Create and load an XmlDocument.
XmlDocument doc = new XmlDocument();
doc.Load("http://localhost/uri.xml");
@@ -21,7 +21,7 @@ public static void Main()
while (reader.Read())
{
Console.WriteLine("({0}) {1}", reader.NodeType, reader.BaseURI);
- }
+ }
}
finally
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.GetAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.GetAttribute Example/CS/source.cs
index c910741f405..3b8a80c0d6d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.GetAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.GetAttribute Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -14,18 +14,18 @@ public static void Main()
//Create and load the XML document.
XmlDocument doc = new XmlDocument();
doc.LoadXml(" " +
- "");
+ "");
- // Load the XmlNodeReader
+ // Load the XmlNodeReader
reader = new XmlNodeReader(doc);
-
+
//Read the ISBN attribute.
reader.MoveToContent();
string isbn = reader.GetAttribute("ISBN");
Console.WriteLine("The ISBN value: " + isbn);
- }
+ }
- finally
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.HasValue Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.HasValue Example/CS/source.cs
index 536669328df..6a3c039ec8f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.HasValue Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.HasValue Example/CS/source.cs
@@ -6,11 +6,11 @@
public class Sample {
public static void Main() {
-
+
XmlNodeReader reader = null;
try {
-
+
// Create and load an XmlDocument.
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
@@ -28,7 +28,7 @@ public static void Main() {
Console.WriteLine("({0}) {1}={2}", reader.NodeType, reader.Name, reader.Value);
else
Console.WriteLine("({0}) {1}", reader.NodeType, reader.Name);
- }
+ }
}
finally {
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.IsEmptyElement Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.IsEmptyElement Example/CS/source.cs
index e0fd53fc464..33c6093583a 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.IsEmptyElement Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.IsEmptyElement Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -17,11 +17,11 @@ public static void Main()
"Pride And Prejudice" +
"19.95" +
"" +
- "");
+ "");
- //Load the XmlNodeReader
+ //Load the XmlNodeReader
reader = new XmlNodeReader(doc);
-
+
//Parse the XML and display the text content of each of the elements.
while (reader.Read()){
if (reader.IsStartElement()){
@@ -38,10 +38,10 @@ public static void Main()
Console.WriteLine(reader.ReadString()); //Read the text content of the element.
}
}
- }
- }
+ }
+ }
- finally
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.MoveToFirstAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.MoveToFirstAttribute Example/CS/source.cs
index efb62955704..508a9fccf78 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.MoveToFirstAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.MoveToFirstAttribute Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -14,18 +14,18 @@ public static void Main()
//Create and load the XML document.
XmlDocument doc = new XmlDocument();
doc.LoadXml(" " +
- "");
+ "");
- //Load the XmlNodeReader
+ //Load the XmlNodeReader
reader = new XmlNodeReader(doc);
-
+
//Read the genre attribute.
reader.MoveToContent();
reader.MoveToFirstAttribute();
string genre=reader.Value;
Console.WriteLine("The genre value: " + genre);
- }
- finally
+ }
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.MoveToNextAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.MoveToNextAttribute Example/CS/source.cs
index 98f06227c54..cc9a437c346 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.MoveToNextAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.MoveToNextAttribute Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -16,11 +16,11 @@ public static void Main()
doc.LoadXml(" " +
"Pride And Prejudice" +
"19.95" +
- "");
+ "");
- //Load the XmlNodeReader
+ //Load the XmlNodeReader
reader = new XmlNodeReader(doc);
-
+
//Read the attributes on the book element.
reader.MoveToContent();
while (reader.MoveToNextAttribute())
@@ -34,9 +34,9 @@ public static void Main()
//Read the title and price elements.
Console.WriteLine(reader.ReadElementString());
Console.WriteLine(reader.ReadElementString());
- }
+ }
- finally
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.Name Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.Name Example/CS/source.cs
index a262fc4cf6c..3799909d9cf 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.Name Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.Name Example/CS/source.cs
@@ -12,7 +12,7 @@ public static void Main()
XmlNodeReader reader = null;
try
- {
+ {
//Create an XmlNodeReader to read the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.Load(filename);
@@ -46,8 +46,8 @@ public static void Main()
case XmlNodeType.EndElement:
Console.Write("{0}>", reader.Name);
break;
- }
- }
+ }
+ }
}
finally
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.NamespaceURI Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.NamespaceURI Example/CS/source.cs
index f530863358c..d9e842a1e57 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.NamespaceURI Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.NamespaceURI Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -16,12 +16,12 @@ public static void Main()
doc.LoadXml(" " +
"Pride And Prejudice" +
"novel" +
- "");
+ "");
- //Load the XmlNodeReader
+ //Load the XmlNodeReader
reader = new XmlNodeReader(doc);
-
- //Parse the XML. If they exist, display the prefix and
+
+ //Parse the XML. If they exist, display the prefix and
//namespace URI of each node.
while (reader.Read()){
if (reader.IsStartElement()){
@@ -36,8 +36,8 @@ public static void Main()
}
}
}
- }
- finally
+ }
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.ReadAttributeValue Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.ReadAttributeValue Example/CS/source.cs
index b897ce6aad6..0306810c5c8 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.ReadAttributeValue Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.ReadAttributeValue Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -16,11 +16,11 @@ public static void Main()
doc.LoadXml("]>" +
"" +
"");
-
- //Create the reader.
+
+ //Create the reader.
reader = new XmlNodeReader(doc);
- //Read the misc attribute. The attribute is parsed into multiple
+ //Read the misc attribute. The attribute is parsed into multiple
//text and entity reference nodes.
reader.MoveToContent();
reader.MoveToAttribute("misc");
@@ -30,9 +30,9 @@ public static void Main()
Console.WriteLine("{0} {1}", reader.NodeType, reader.Name);
else
Console.WriteLine("{0} {1}", reader.NodeType, reader.Value);
- }
- }
- finally
+ }
+ }
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.ResolveEntity Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.ResolveEntity Example/CS/source.cs
index 85246375cb5..12771aab136 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.ResolveEntity Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.ResolveEntity Example/CS/source.cs
@@ -11,13 +11,13 @@ public static void Main()
try
{
- //Create and load an XML document.
+ //Create and load an XML document.
XmlDocument doc = new XmlDocument();
doc.LoadXml("]>" +
"" +
"Pride And Prejudice" +
"&h;" +
- "");
+ "");
//Create the reader.
reader = new XmlNodeReader(doc);
@@ -25,23 +25,23 @@ public static void Main()
reader.MoveToContent(); //Move to the root element.
reader.Read(); //Move to title start tag.
reader.Skip(); //Skip the title element.
-
+
//Read the misc start tag. The reader is now positioned on
//the entity reference node.
- reader.ReadStartElement();
+ reader.ReadStartElement();
//You must call ResolveEntity to expand the entity reference.
//The entity replacement text is then parsed and returned as a child node.
Console.WriteLine("Expand the entity...");
- reader.ResolveEntity();
+ reader.ResolveEntity();
Console.WriteLine("The entity replacement text is returned as a text node.");
- reader.Read();
+ reader.Read();
Console.WriteLine("NodeType: {0} Value: {1}", reader.NodeType ,reader.Value);
Console.WriteLine("An EndEntity node closes the entity reference scope.");
reader.Read();
- Console.WriteLine("NodeType: {0} Name: {1}", reader.NodeType,reader.Name);
+ Console.WriteLine("NodeType: {0} Name: {1}", reader.NodeType,reader.Name);
}
finally
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.Skip Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.Skip Example/CS/source.cs
index ea77791f01f..107b4c529eb 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.Skip Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlNodeReader.Skip Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -19,7 +19,7 @@ public static void Main()
"19.95" +
"");
- //Load the XmlNodeReader
+ //Load the XmlNodeReader
reader = new XmlNodeReader(doc);
reader.MoveToContent(); //Move to the book node.
@@ -27,9 +27,9 @@ public static void Main()
reader.Skip(); //Skip the title element.
Console.WriteLine(reader.ReadOuterXml()); //Read the price element.
- }
+ }
- finally
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/CS/source.cs
index 5cbe7bf9455..696dee56fcd 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/CS/source.cs
@@ -26,10 +26,10 @@ public static void Main()
//Create the XmlParserContext.
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
- //Implement the reader.
+ //Implement the reader.
reader = new XmlTextReader(xmlFrag, XmlNodeType.Element, context);
- //Parse the XML fragment. If they exist, display the
+ //Parse the XML fragment. If they exist, display the
//prefix and namespace URI of each element.
while (reader.Read())
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext1 Example/CS/source.cs
index 560d08c664d..a5327bc98cd 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext1 Example/CS/source.cs
@@ -14,13 +14,13 @@ public static void Main()
//Create the XML fragment to be parsed.
string xmlFrag = "";
- //Create the XmlParserContext. The XmlParserContext provides the
+ //Create the XmlParserContext. The XmlParserContext provides the
//necessary DTD information so that the entity reference can be expanded.
XmlParserContext context;
string subset = "";
context = new XmlParserContext(null, null, "book", null, null, subset, "", "", XmlSpace.None);
- //Create the reader.
+ //Create the reader.
reader = new XmlTextReader(xmlFrag, XmlNodeType.Element, context);
//Read the all the attributes on the book element.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlReader.IsStartElement Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlReader.IsStartElement Example/CS/source.cs
index a70e1c4e9f0..f284b4041fa 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlReader.IsStartElement Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlReader.IsStartElement Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -13,7 +13,7 @@ public static void Main()
{
//Load the reader with the XML file.
reader = new XmlTextReader("elems.xml");
-
+
//Parse the XML and display the text content of each of the elements.
while (reader.Read()){
if (reader.IsStartElement()){
@@ -30,10 +30,10 @@ public static void Main()
Console.WriteLine(reader.ReadString()); //Read the text content of the element.
}
}
- }
- }
+ }
+ }
- finally
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlReader.MoveToContent Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlReader.MoveToContent Example/CS/source.cs
index 36afd980f3b..57ad5c3d177 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlReader.MoveToContent Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlReader.MoveToContent Example/CS/source.cs
@@ -12,7 +12,7 @@ public void Method(XmlReader reader)
{
//
-if (reader.MoveToContent() == XmlNodeType.Element && reader.Name == "price")
+if (reader.MoveToContent() == XmlNodeType.Element && reader.Name == "price")
{
_price = reader.ReadString();
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSchemaCollection.GetEnumerator Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSchemaCollection.GetEnumerator Example/CS/source.cs
index 26a38a978f5..d8b0faab92e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSchemaCollection.GetEnumerator Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSchemaCollection.GetEnumerator Example/CS/source.cs
@@ -20,7 +20,7 @@ public void DisplaySchemas(XmlSchemaCollection xsc)
writer.Formatting = Formatting.Indented;
writer.Indentation = 2;
schema.Write(writer);
- Console.WriteLine(sw.ToString());
+ Console.WriteLine(sw.ToString());
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSchemaException Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSchemaException Example/CS/source.cs
index 1accfe5bb4a..a82048e662f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSchemaException Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSchemaException Example/CS/source.cs
@@ -32,7 +32,7 @@ public static int Main()
if (schema.IsCompiled)
{
- // Schema is successfully compiled.
+ // Schema is successfully compiled.
// Do something with it here.
}
return 0;
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSignificantWhitespace.NodeType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSignificantWhitespace.NodeType Example/CS/source.cs
index 29b1d5264e7..49cda114d7e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSignificantWhitespace.NodeType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlSignificantWhitespace.NodeType Example/CS/source.cs
@@ -2,53 +2,53 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample {
-
+
private XmlNode currNode;
private const String filename="space.xml";
XmlTextReader reader=null;
-
+
public static void Main() {
-
+
Sample test = new Sample();
}
public Sample() {
-
+
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"" +
"Eva"+
- "Corets" +
- "");
+ "Corets" +
+ "");
Console.WriteLine("InnerText before...");
Console.WriteLine(doc.DocumentElement.InnerText);
-
- // Add white space.
+
+ // Add white space.
currNode=doc.DocumentElement;
XmlSignificantWhitespace sigws=doc.CreateSignificantWhitespace("\t");
currNode.InsertAfter(sigws, currNode.FirstChild);
-
+
Console.WriteLine();
Console.WriteLine("InnerText after...");
Console.WriteLine(doc.DocumentElement.InnerText);
-
+
// Save and then display the file.
doc.Save(filename);
Console.WriteLine();
Console.WriteLine("Reading file...");
ReadFile(filename);
}
-
+
// Parse the file and print out each node.
public void ReadFile(String filename) {
try {
-
+
reader = new XmlTextReader(filename);
String sNodeType = null;
- while (reader.Read()) {
- sNodeType = NodeTypeToString(reader.NodeType);
+ while (reader.Read()) {
+ sNodeType = NodeTypeToString(reader.NodeType);
// Print the node type, name, and value.
Console.WriteLine("{0}<{1}> {2}", sNodeType, reader.Name, reader.Value);
}
@@ -58,7 +58,7 @@ public void ReadFile(String filename) {
reader.Close();
}
}
-
+
public static String NodeTypeToString(XmlNodeType nodetype) {
String sNodeType = null;
switch (nodetype) {
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.BaseURI Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.BaseURI Example/CS/source.cs
index c7685db1762..d1ec77811b9 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.BaseURI Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.BaseURI Example/CS/source.cs
@@ -10,7 +10,7 @@ public static void Main()
XmlTextReader reader = null;
try
- {
+ {
//Load the reader with the XML file.
reader = new XmlTextReader("http://localhost/baseuri.xml");
@@ -18,7 +18,7 @@ public static void Main()
while (reader.Read())
{
Console.WriteLine("({0}) {1}", reader.NodeType, reader.BaseURI);
- }
+ }
}
finally
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.GetAttribute1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.GetAttribute1 Example/CS/source.cs
index a18426eab21..5f9a7083030 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.GetAttribute1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.GetAttribute1 Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -13,13 +13,13 @@ public static void Main()
{
//Load the reader with the XML file.
reader = new XmlTextReader("attrs.xml");
-
+
//Read the ISBN attribute.
reader.MoveToContent();
string isbn = reader.GetAttribute("ISBN");
Console.WriteLine("The ISBN value: " + isbn);
- }
- finally
+ }
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.GetRemainder Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.GetRemainder Example/CS/source.cs
index e775385311c..25f738ae6f9 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.GetRemainder Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.GetRemainder Example/CS/source.cs
@@ -1,20 +1,20 @@
//
using System;
-using System.Xml;
+using System.Xml;
public class Sample {
private static string filename = "tworeads.xml";
-
+
public static void Main() {
-
+
XmlTextReader reader = new XmlTextReader(filename);
reader.WhitespaceHandling=WhitespaceHandling.None;
// Read the first part of the XML document
while(reader.Read()) {
// Display the elements and stop reading on the book endelement tag
- // then go to ReadPart2 to start another reader to read the rest of the file.
+ // then go to ReadPart2 to start another reader to read the rest of the file.
switch(reader.NodeType) {
case XmlNodeType.Element:
Console.WriteLine("Name: {0}", reader.Name);
@@ -26,12 +26,12 @@ public static void Main() {
// Stop reading when the reader gets to the end element of the book node.
if ("book"==reader.LocalName) {
Console.WriteLine("End reading first book...");
- Console.WriteLine();
+ Console.WriteLine();
goto ReadPart2;
}
break;
- }
- }
+ }
+ }
// Read the rest of the XML document
ReadPart2:
@@ -60,7 +60,7 @@ public static void Main() {
Done:
Console.WriteLine("Done.");
- reader.Close();
+ reader.Close();
reader2.Close();
}
}//End class
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.HasValue Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.HasValue Example/CS/source.cs
index 48ab59a2066..606290ebcbe 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.HasValue Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.HasValue Example/CS/source.cs
@@ -11,7 +11,7 @@ public static void Main()
XmlTextReader reader = null;
try
- {
+ {
//Load the reader with the XML file.
reader = new XmlTextReader("book1.xml");
reader.WhitespaceHandling = WhitespaceHandling.None;
@@ -23,7 +23,7 @@ public static void Main()
Console.WriteLine("({0}) {1}={2}", reader.NodeType, reader.Name, reader.Value);
else
Console.WriteLine("({0}) {1}", reader.NodeType, reader.Name);
- }
+ }
}
finally
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.LocalName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.LocalName Example/CS/source.cs
index 9736b7973eb..6c48196a655 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.LocalName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.LocalName Example/CS/source.cs
@@ -6,15 +6,15 @@
public class Sample {
public static void Main() {
-
+
XmlTextReader reader = null;
try {
// Load the reader with the XML file.
reader = new XmlTextReader("book2.xml");
-
- // Parse the file. If they exist, display the prefix and
+
+ // Parse the file. If they exist, display the prefix and
// namespace URI of each node.
while (reader.Read()) {
if (reader.IsStartElement()) {
@@ -27,12 +27,12 @@ public static void Main() {
Console.WriteLine(" The namespace URI is " + reader.NamespaceURI);
}
}
- }
- }
+ }
+ }
finally {
if (reader != null)
reader.Close();
}
- }
+ }
} // End class
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.MoveToFirstAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.MoveToFirstAttribute Example/CS/source.cs
index e8828c72c28..c55b76cca01 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.MoveToFirstAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.MoveToFirstAttribute Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -13,14 +13,14 @@ public static void Main()
{
//Load the reader with the XML file.
reader = new XmlTextReader("attrs.xml");
-
+
//Read the genre attribute.
reader.MoveToContent();
reader.MoveToFirstAttribute();
string genre=reader.Value;
Console.WriteLine("The genre value: " + genre);
- }
- finally
+ }
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.Name Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.Name Example/CS/source.cs
index d69fc1ea75b..8b525b6085c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.Name Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.Name Example/CS/source.cs
@@ -8,12 +8,12 @@ public class Sample {
private const String filename = "items.xml";
public static void Main() {
-
+
XmlTextReader reader = null;
try {
-
- // Load the reader with the data file and ignore all white space nodes.
+
+ // Load the reader with the data file and ignore all white space nodes.
reader = new XmlTextReader(filename);
reader.WhitespaceHandling = WhitespaceHandling.None;
@@ -49,8 +49,8 @@ public static void Main() {
case XmlNodeType.EndElement:
Console.Write("{0}>", reader.Name);
break;
- }
- }
+ }
+ }
}
finally {
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.ReadBase64 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.ReadBase64 Example/CS/source.cs
index 31a0135e210..2960b64a958 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.ReadBase64 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.ReadBase64 Example/CS/source.cs
@@ -12,7 +12,7 @@ public static void Main() {
XmlTextReader reader = null;
try {
-
+
reader = new XmlTextReader(filename);
reader.WhitespaceHandling = WhitespaceHandling.None;
@@ -21,23 +21,23 @@ public static void Main() {
if ("Base64" == reader.Name) break;
}
- // Read the Base64 data. Write the decoded
+ // Read the Base64 data. Write the decoded
// bytes to the console.
Console.WriteLine("Reading Base64... ");
int base64len = 0;
byte[] base64 = new byte[1000];
do {
- base64len = reader.ReadBase64(base64, 0, 50);
+ base64len = reader.ReadBase64(base64, 0, 50);
for (int i=0; i < base64len; i++) Console.Write(base64[i]);
} while (reader.Name == "Base64");
- // Read the BinHex data. Write the decoded
+ // Read the BinHex data. Write the decoded
// bytes to the console.
Console.WriteLine("\r\nReading BinHex...");
int binhexlen = 0;
byte[] binhex = new byte[1000];
do {
- binhexlen = reader.ReadBinHex(binhex, 0, 50);
+ binhexlen = reader.ReadBinHex(binhex, 0, 50);
for (int i=0; i < binhexlen; i++) Console.Write(binhex[i]);
} while (reader.Name == "BinHex");
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.ReadChars Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.ReadChars Example/CS/source.cs
index 82fd7d47c03..fb4c8914844 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.ReadChars Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.ReadChars Example/CS/source.cs
@@ -9,16 +9,16 @@ public class Sample {
private const String filename = "items.xml";
public static void Main() {
-
+
XmlTextReader reader = null;
try {
-
+
// Declare variables used by ReadChars
Char []buffer;
int iCnt = 0;
int charbuffersize;
-
+
// Load the reader with the data file. Ignore white space.
reader = new XmlTextReader(filename);
reader.WhitespaceHandling = WhitespaceHandling.None;
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.WhitespaceHandling Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.WhitespaceHandling Example/CS/source.cs
index 511ed68b462..197f6782068 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.WhitespaceHandling Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextReader.WhitespaceHandling Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main(){
@@ -11,7 +11,7 @@ public static void Main(){
string xmlFrag =" " +
" Pride And Prejudice" +
" novel" +
- "";
+ "";
//Create the XmlNamespaceManager.
NameTable nt = new NameTable();
@@ -26,7 +26,7 @@ public static void Main(){
Console.WriteLine("\r\nRead the XML including white space nodes...");
ReadXML(context, xmlFrag, WhitespaceHandling.All);
}
-
+
public static void ReadXML(XmlParserContext context, string xmlFrag, WhitespaceHandling ws){
//Create the reader and specify the WhitespaceHandling setting.
@@ -53,11 +53,11 @@ public static void ReadXML(XmlParserContext context, string xmlFrag, WhitespaceH
case XmlNodeType.SignificantWhitespace:
Console.WriteLine("{0}:", reader.NodeType);
break;
- }
- }
-
+ }
+ }
+
//Close the reader.
- reader.Close();
+ reader.Close();
}
} // End class
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.Formatting Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.Formatting Example/CS/source.cs
index bb58b4b2d1a..11f2fe4d916 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.Formatting Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.Formatting Example/CS/source.cs
@@ -5,7 +5,7 @@
public class Sample
{
-
+
public static void Main()
{
//Create a writer to write XML to the console.
@@ -15,7 +15,7 @@ public static void Main()
//Use indentation for readability.
writer.Formatting = Formatting.Indented;
writer.Indentation = 4;
-
+
//Write an element (this one is the root).
writer.WriteStartElement("book");
@@ -26,9 +26,9 @@ public static void Main()
//Write the close tag for the root element.
writer.WriteEndElement();
-
+
//Write the XML to file and close the writer.
- writer.Close();
+ writer.Close();
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteEndElement Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteEndElement Example/CS/source.cs
index 06d95eb384d..27cd4c957fb 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteEndElement Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteEndElement Example/CS/source.cs
@@ -15,7 +15,7 @@ public static void Main()
//Use indenting for readability.
writer.Formatting = Formatting.Indented;
- //Write the XML delcaration
+ //Write the XML delcaration
writer.WriteStartDocument();
//Write the ProcessingInstruction node.
@@ -24,26 +24,26 @@ public static void Main()
//Write the DocumentType node.
writer.WriteDocType("book", null , null, "");
-
+
//Write a Comment node.
writer.WriteComment("sample XML");
-
+
//Write the root element.
writer.WriteStartElement("book");
//Write the genre attribute.
writer.WriteAttributeString("genre", "novel");
-
+
//Write the ISBN attribute.
writer.WriteAttributeString("ISBN", "1-8630-014");
//Write the title.
writer.WriteElementString("title", "The Handmaid's Tale");
-
+
//Write the style element.
writer.WriteStartElement("style");
writer.WriteEntityRef("h");
- writer.WriteEndElement();
+ writer.WriteEndElement();
//Write the price.
writer.WriteElementString("price", "19.95");
@@ -53,22 +53,22 @@ public static void Main()
//Write the close tag for the root element.
writer.WriteEndElement();
-
+
writer.WriteEndDocument();
//Write the XML to file and close the writer.
writer.Flush();
- writer.Close();
+ writer.Close();
//Load the file into an XmlDocument to ensure well formed XML.
XmlDocument doc = new XmlDocument();
//Preserve white space for readability.
doc.PreserveWhitespace = true;
//Load the file.
- doc.Load(filename);
-
+ doc.Load(filename);
+
//Display the XML content to the console.
- Console.Write(doc.InnerXml);
+ Console.Write(doc.InnerXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteFullEndElement Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteFullEndElement Example/CS/source.cs
index be0f64b19c2..5ed55401e22 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteFullEndElement Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteFullEndElement Example/CS/source.cs
@@ -4,7 +4,7 @@
using System.Xml;
public class Sample
-{
+{
public static void Main()
{
//Create a writer to write XML to the console.
@@ -13,7 +13,7 @@ public static void Main()
//Use indentation for readability.
writer.Formatting = Formatting.Indented;
-
+
//Write an element (this one is the root).
writer.WriteStartElement("order");
@@ -25,9 +25,9 @@ public static void Main()
//content, calling WriteEndElement would have written a
//short end tag '/>'.
writer.WriteFullEndElement();
-
+
//Write the XML to file and close the writer
- writer.Close();
+ writer.Close();
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteQualifiedName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteQualifiedName Example/CS/source.cs
index c557b2e1c63..77d41fb6a07 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteQualifiedName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteQualifiedName Example/CS/source.cs
@@ -14,7 +14,7 @@ public static void Main()
writer = new XmlTextWriter (filename, null);
// Use indenting for readability.
writer.Formatting = Formatting.Indented;
-
+
// Write the root element.
writer.WriteStartElement("schema");
@@ -35,10 +35,10 @@ public static void Main()
// Write the close tag for the root element.
writer.WriteEndElement();
-
+
// Write the XML to file and close the writer.
writer.Flush();
- writer.Close();
+ writer.Close();
// Read the file back in and parse to ensure well formed XML.
XmlDocument doc = new XmlDocument();
@@ -46,7 +46,7 @@ public static void Main()
doc.PreserveWhitespace = true;
// Load the file.
doc.Load(filename);
-
+
// Write the XML content to the console.
Console.Write(doc.InnerXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteRaw1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteRaw1 Example/CS/source.cs
index 818e67fd3d0..8ba0e2d5840 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteRaw1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteRaw1 Example/CS/source.cs
@@ -10,7 +10,7 @@ public static void Main()
// Create a writer that outputs to the console.
XmlTextWriter writer = new XmlTextWriter (Console.Out);
writer.Formatting = Formatting.Indented;
-
+
// Write the root element.
writer.WriteStartElement("Items");
@@ -21,7 +21,7 @@ public static void Main()
writer.WriteRaw("this & that");
writer.WriteEndElement();
- // Write the same string using WriteString. Note that the
+ // Write the same string using WriteString. Note that the
// special characters are escaped.
writer.WriteStartElement("Item");
writer.WriteString("Write the same string using WriteString: ");
@@ -30,9 +30,9 @@ public static void Main()
// Write the close tag for the root element.
writer.WriteEndElement();
-
+
// Write the XML to file and close the writer.
- writer.Close();
+ writer.Close();
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteStartDocument Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteStartDocument Example/CS/source.cs
index 7830dfbb8dc..d1568f2add1 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteStartDocument Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteStartDocument Example/CS/source.cs
@@ -15,7 +15,7 @@ public static void Main()
//Use indenting for readability.
writer.Formatting = Formatting.Indented;
- //Write the XML delcaration.
+ //Write the XML delcaration.
writer.WriteStartDocument();
//Write the ProcessingInstruction node.
@@ -24,26 +24,26 @@ public static void Main()
//Write the DocumentType node.
writer.WriteDocType("book", null , null, "");
-
+
//Write a Comment node.
writer.WriteComment("sample XML");
-
+
//Write a root element.
writer.WriteStartElement("book");
//Write the genre attribute.
writer.WriteAttributeString("genre", "novel");
-
+
//Write the ISBN attribute.
writer.WriteAttributeString("ISBN", "1-8630-014");
//Write the title.
writer.WriteElementString("title", "The Handmaid's Tale");
-
+
//Write the style element.
writer.WriteStartElement("style");
writer.WriteEntityRef("h");
- writer.WriteEndElement();
+ writer.WriteEndElement();
//Write the price.
writer.WriteElementString("price", "19.95");
@@ -53,22 +53,22 @@ public static void Main()
//Write the close tag for the root element.
writer.WriteEndElement();
-
+
writer.WriteEndDocument();
//Write the XML to file and close the writer.
writer.Flush();
- writer.Close();
+ writer.Close();
//Load the file into an XmlDocument to ensure well formed XML.
XmlDocument doc = new XmlDocument();
//Preserve white space for readability.
doc.PreserveWhitespace = true;
//Load the file.
- doc.Load(filename);
-
+ doc.Load(filename);
+
//Display the XML content to the console.
- Console.Write(doc.InnerXml);
+ Console.Write(doc.InnerXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteStartElement Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteStartElement Example/CS/source.cs
index 591135b604d..d7525b19b9f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteStartElement Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteStartElement Example/CS/source.cs
@@ -13,9 +13,9 @@ public static void Main()
XmlTextWriter writer = new XmlTextWriter (filename, null);
//Use indenting for readability.
writer.Formatting = Formatting.Indented;
-
+
writer.WriteComment("sample XML fragment");
-
+
//Write an element (this one is the root).
writer.WriteStartElement("bookstore");
@@ -28,16 +28,16 @@ public static void Main()
string prefix = writer.LookupPrefix("urn:samples");
writer.WriteStartAttribute(prefix, "ISBN", "urn:samples");
writer.WriteString("1-861003-78");
- writer.WriteEndAttribute();
+ writer.WriteEndAttribute();
//Write the title.
writer.WriteStartElement("title");
writer.WriteString("The Handmaid's Tale");
writer.WriteEndElement();
-
+
//Write the price.
writer.WriteElementString("price", "19.95");
-
+
//Write the style element.
writer.WriteStartElement(prefix, "style", "urn:samples");
writer.WriteString("hardcover");
@@ -48,7 +48,7 @@ public static void Main()
//Write the close tag for the root element.
writer.WriteEndElement();
-
+
//Write the XML to file and close the writer.
writer.Flush();
writer.Close();
@@ -59,9 +59,9 @@ public static void Main()
doc.PreserveWhitespace = true;
//Load the file
doc.Load(filename);
-
+
//Write the XML content to the console.
- Console.Write(doc.InnerXml);
+ Console.Write(doc.InnerXml);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteTimeSpan Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteTimeSpan Example/CS/source.cs
index f86f5058f8d..83c702bbc46 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteTimeSpan Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteTimeSpan Example/CS/source.cs
@@ -3,18 +3,18 @@
using System.Xml;
public class Sample {
-
+
public static void Main() {
-
+
XmlTextWriter writer = null;
-
+
try {
-
+
writer = new XmlTextWriter (Console.Out);
-
+
// Write an element.
writer.WriteStartElement("address");
-
+
// Write an email address using entities
// for the @ and . characters.
writer.WriteString("someone");
@@ -23,13 +23,13 @@ public static void Main() {
writer.WriteCharEntity('.');
writer.WriteString("com");
writer.WriteEndElement();
- }
-
+ }
+
finally {
// Close the writer.
if (writer != null)
writer.Close();
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.XmlSpace Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.XmlSpace Example/CS/source.cs
index c4ad5ab3abd..33ed56c33e2 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.XmlSpace Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlTextWriter.XmlSpace Example/CS/source.cs
@@ -4,7 +4,7 @@
using System.Xml;
public class Sample
-{
+{
public static void Main()
{
// Create the writer.
@@ -30,9 +30,9 @@ public static void Main()
// Write the root end element.
writer.WriteEndElement();
-
+
// Write the XML to file and close the writer.
- writer.Close();
+ writer.Close();
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlUrlResolver.ResolveUri Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlUrlResolver.ResolveUri Example/CS/source.cs
index 0ee12f0564a..eca38ca464d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlUrlResolver.ResolveUri Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlUrlResolver.ResolveUri Example/CS/source.cs
@@ -2,27 +2,27 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample
{
-
+
public static void Main()
{
XmlUrlResolver resolver = new XmlUrlResolver();
-
+
Uri baseUri = new Uri ("http://servername/tmp/test.xsl");
-
+
Uri fulluri=resolver.ResolveUri(baseUri, "includefile.xsl");
-
+
// Get a stream object containing the XSL file
Stream s=(Stream)resolver.GetEntity(fulluri, null, typeof(Stream));
-
+
// Read the stream object displaying the contents of the XSL file
XmlTextReader reader = new XmlTextReader(s);
- while (reader.Read())
+ while (reader.Read())
{
Console.WriteLine(reader.ReadOuterXml());
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CS/source.cs
index 454423d2255..eb34c9de63b 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -23,7 +23,7 @@ public static void Main()
//Create the XmlValidatingReader .
reader = new XmlValidatingReader(xmlFrag, XmlNodeType.Element, context);
-
+
//Read the attributes on the root element.
reader.MoveToContent();
if (reader.HasAttributes){
@@ -34,9 +34,9 @@ public static void Main()
//Move the reader back to the node that owns the attribute.
reader.MoveToElement();
}
- }
+ }
- finally
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/CS/source.cs
index 87d262a6227..91987caed2e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/CS/source.cs
@@ -11,7 +11,7 @@ public static void Main()
XmlTextReader txtreader = null;
try
- {
+ {
//Create the validating reader.
txtreader = new XmlTextReader("http://localhost/uri.xml");
reader = new XmlValidatingReader(txtreader);
@@ -21,7 +21,7 @@ public static void Main()
while (reader.Read())
{
Console.WriteLine("({0}) {1}", reader.NodeType, reader.BaseURI);
- }
+ }
}
finally
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/CS/source.cs
index 630ecc6a7bd..c0dbc6e5835 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -19,6 +19,6 @@ public static void Main()
//Close the reader.
reader.Close();
- }
+ }
} // End class
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CS/source.cs
index f95bfd29c0c..87f55c09485 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -15,7 +15,7 @@ public static void Main()
//Implement the readers.
txtreader = new XmlTextReader("elems.xml");
reader = new XmlValidatingReader(txtreader);
-
+
//Parse the XML and display the text content of each of the elements.
while (reader.Read()){
if (reader.IsStartElement()){
@@ -32,10 +32,10 @@ public static void Main()
Console.WriteLine(reader.ReadString()); //Read the text content of the element.
}
}
- }
- }
+ }
+ }
- finally
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CS/source.cs
index 1f686b46252..378a2a915d4 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -18,12 +18,12 @@ public static void Main()
XmlParserContext context;
string subset = "";
context = new XmlParserContext(null, null, "book", null, null, subset, "", "", XmlSpace.None);
-
- //Create the reader and set it to not expand general entities.
+
+ //Create the reader and set it to not expand general entities.
reader = new XmlValidatingReader(xmlFrag, XmlNodeType.Element, context);
reader.ValidationType = ValidationType.None;
reader.EntityHandling = EntityHandling.ExpandCharEntities;
-
+
//Read the misc attribute. Because EntityHandling is set to
//ExpandCharEntities, the attribute is parsed into multiple text
//and entity reference nodes.
@@ -35,9 +35,9 @@ public static void Main()
Console.WriteLine("{0} {1}", reader.NodeType, reader.Name);
else
Console.WriteLine("{0} {1}", reader.NodeType, reader.Value);
- }
- }
- finally
+ }
+ }
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CS/source.cs
index a9b66f36609..9a662bad19d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -20,6 +20,6 @@ public static void Main()
//Close the reader.
reader.Close();
- }
+ }
} // End class
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CS/source.cs
index dfe948d9835..959d4132b4a 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CS/source.cs
@@ -13,12 +13,12 @@ public static void Main()
XmlValidatingReader reader = null;
try
- {
- //Load the reader with the data file and ignore all white space nodes.
+ {
+ //Load the reader with the data file and ignore all white space nodes.
txtreader = new XmlTextReader(filename);
txtreader.WhitespaceHandling = WhitespaceHandling.None;
- //Implement the validating reader over the text reader.
+ //Implement the validating reader over the text reader.
reader = new XmlValidatingReader(txtreader);
reader.ValidationType = ValidationType.None;
@@ -56,8 +56,8 @@ public static void Main()
case XmlNodeType.EndElement:
Console.Write("{0}>", reader.Name);
break;
- }
- }
+ }
+ }
}
finally
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CS/source.cs
index 3272809bd5b..c83aae9cf86 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CS/source.cs
@@ -12,7 +12,7 @@ public static void Main()
try
{
- //Create and load the XmlTextReader with the XML file.
+ //Create and load the XmlTextReader with the XML file.
txtreader = new XmlTextReader("book1.xml");
txtreader.WhitespaceHandling = WhitespaceHandling.None;
@@ -25,19 +25,19 @@ public static void Main()
reader.MoveToContent(); //Move to the root element.
reader.Read(); //Move to title start tag.
reader.Skip(); //Skip the title element.
-
+
//Read the misc start tag. The reader is now positioned on
//the entity reference node.
- reader.ReadStartElement();
+ reader.ReadStartElement();
- //Because EntityHandling is set to ExpandCharEntities, you must call
- //ResolveEntity to expand the entity. The entity replacement text is
- //then parsed and returned as a child node.
+ //Because EntityHandling is set to ExpandCharEntities, you must call
+ //ResolveEntity to expand the entity. The entity replacement text is
+ //then parsed and returned as a child node.
Console.WriteLine("Expand the entity...");
- reader.ResolveEntity();
+ reader.ResolveEntity();
Console.WriteLine("The entity replacement text is returned as a text node.");
- reader.Read();
+ reader.Read();
Console.WriteLine("NodeType: {0} Value: {1}", reader.NodeType ,reader.Value);
Console.WriteLine("An EndEntity node closes the entity reference scope.");
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/CS/source.cs
index b63a50fcba5..f715426e77e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
using System.Xml.Schema;
-
+
public class SchemaCollectionSample
{
private const String doc1 = "booksSchema.xml";
@@ -11,43 +11,43 @@ public class SchemaCollectionSample
private const String doc3 = "newbooks.xml";
private const String schema = "books.xsd";
private const String schema1 = "schema1.xdr";
-
+
private XmlTextReader reader=null;
private XmlValidatingReader vreader = null;
private Boolean m_success = true;
-
+
public SchemaCollectionSample ()
{
//Load the schema collection.
XmlSchemaCollection xsc = new XmlSchemaCollection();
xsc.Add("urn:bookstore-schema", schema); //XSD schema
xsc.Add("urn:newbooks-schema", schema1); //XDR schema
-
+
//Validate the files using schemas stored in the collection.
Validate(doc1, xsc); //Should pass.
- Validate(doc2, xsc); //Should fail.
- Validate(doc3, xsc); //Should fail.
- }
-
+ Validate(doc2, xsc); //Should fail.
+ Validate(doc3, xsc); //Should fail.
+ }
+
public static void Main ()
{
SchemaCollectionSample validation = new SchemaCollectionSample();
}
-
+
private void Validate(String filename, XmlSchemaCollection xsc)
{
-
+
m_success = true;
Console.WriteLine();
Console.WriteLine("Validating XML file {0}...", filename.ToString());
reader = new XmlTextReader (filename);
-
+
//Create a validating reader.
vreader = new XmlValidatingReader (reader);
//Validate using the schemas stored in the schema collection.
vreader.Schemas.Add(xsc);
-
+
//Set the validation event handler
vreader.ValidationEventHandler += new ValidationEventHandler (ValidationCallBack);
//Read and validate the XML data.
@@ -57,13 +57,13 @@ private void Validate(String filename, XmlSchemaCollection xsc)
//Close the reader.
vreader.Close();
- }
+ }
private void ValidationCallBack (object sender, ValidationEventArgs args)
{
m_success = false;
-
+
Console.Write("\r\n\tValidation error: " + args.Message);
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/CS/source.cs
index 475b8ab4872..4e4b81e91b1 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/CS/source.cs
@@ -13,10 +13,10 @@ public class Sample
public Sample ()
{
- //Validate file against the XSD schema.
+ //Validate file against the XSD schema.
//The validation should fail.
- Validate("notValidXSD.xml");
- }
+ Validate("notValidXSD.xml");
+ }
public static void Main ()
{
@@ -24,7 +24,7 @@ public static void Main ()
}
private void Validate(String filename)
- {
+ {
try
{
Console.WriteLine("Validating XML file " + filename.ToString());
@@ -44,7 +44,7 @@ private void Validate(String filename)
//Close the reader.
if (reader != null)
reader.Close();
- }
+ }
}
//Display the validation error.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/CS/source.cs
index 8b8cdea49c1..271a5fc3fa7 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/CS/source.cs
@@ -20,7 +20,7 @@ public Sample ()
Validate(doc1, ValidationType.XDR); //Validation should fail.
Validate(doc2, ValidationType.DTD); //Validation should fail.
Validate(doc3, ValidationType.None); //No validation performed.
- }
+ }
public static void Main ()
{
@@ -30,7 +30,7 @@ public static void Main ()
private void Validate(String filename, ValidationType vt)
{
try
- {
+ {
//Implement the readers. Set the ValidationType.
txtreader = new XmlTextReader(filename);
reader = new XmlValidatingReader(txtreader);
@@ -63,9 +63,9 @@ private void Validate(String filename, ValidationType vt)
//Close the reader.
if (reader != null)
reader.Close();
- }
+ }
}
-
+
//Display the validation errors.
private void ValidationCallBack (object sender, ValidationEventArgs args)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlWhitespace.NodeType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlWhitespace.NodeType Example/CS/source.cs
index f97e686d9b3..04cced04d57 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlWhitespace.NodeType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XmlWhitespace.NodeType Example/CS/source.cs
@@ -2,14 +2,14 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample {
private XmlNode currNode;
private const String filename="space.xml";
XmlTextReader reader=null;
-
+
public static void Main() {
-
+
Sample test = new Sample();
}
public Sample() {
@@ -17,47 +17,47 @@ public Sample() {
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Eva"+
- "Corets" +
- "");
+ "Corets" +
+ "");
Console.WriteLine("InnerText before...");
Console.WriteLine(doc.DocumentElement.InnerText);
-
- // Add white space.
+
+ // Add white space.
currNode=doc.DocumentElement;
XmlWhitespace ws = doc.CreateWhitespace("\r\n");
currNode.InsertAfter(ws, currNode.FirstChild);
-
+
Console.WriteLine();
Console.WriteLine("InnerText after...");
Console.WriteLine(doc.DocumentElement.InnerText);
-
+
// Save and then display the file.
doc.Save(filename);
Console.WriteLine();
Console.WriteLine("Reading file...");
ReadFile(filename);
}
-
+
// Parse the file and display each node.
public void ReadFile(String filename) {
try {
reader = new XmlTextReader(filename);
String sNodeType = null;
- while (reader.Read()) {
- sNodeType = NodeTypeToString(reader.NodeType);
+ while (reader.Read()) {
+ sNodeType = NodeTypeToString(reader.NodeType);
// Print the node type, name, and value.
Console.WriteLine("{0}<{1}> {2}", sNodeType, reader.Name, reader.Value);
}
}
- finally
+ finally
{
if (reader != null)
reader.Close();
}
}
-
+
public static String NodeTypeToString(XmlNodeType nodetype) {
String sNodeType = null;
switch (nodetype) {
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XslTransform.Transform7 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XslTransform.Transform7 Example/CS/source.cs
index 4a38ed713cb..d6eefd6a924 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XslTransform.Transform7 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic WebData XslTransform.Transform7 Example/CS/source.cs
@@ -18,7 +18,7 @@ public static void Main()
//Load the file to transform.
XPathDocument doc = new XPathDocument(filename);
-
+
//Create an XmlTextWriter which outputs to the console.
XmlTextWriter writer = new XmlTextWriter(Console.Out);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic Webdata XmlSchemaInclude Example/CS/import_include_sample.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic Webdata XmlSchemaInclude Example/CS/import_include_sample.cs
index b63a9ba5c25..94253499958 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic Webdata XmlSchemaInclude Example/CS/import_include_sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic Webdata XmlSchemaInclude Example/CS/import_include_sample.cs
@@ -27,12 +27,12 @@ public static void Main()
schema.ElementFormDefault = XmlSchemaForm.Qualified;
schema.TargetNamespace = "http://www.w3.org/2001/05/XMLInfoset";
- //
+ //
XmlSchemaImport import = new XmlSchemaImport();
import.Namespace = "http://www.example.com/IPO";
schema.Includes.Add(import);
- //
+ //
XmlSchemaInclude include = new XmlSchemaInclude();
include.SchemaLocation = "example.xsd";
schema.Includes.Add(include);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/Classic Webdata XmlSchemaKeyRef Example/CS/key_sample.cs b/samples/snippets/csharp/VS_Snippets_Data/Classic Webdata XmlSchemaKeyRef Example/CS/key_sample.cs
index c755a20ac09..ac47b2f8249 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/Classic Webdata XmlSchemaKeyRef Example/CS/key_sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/Classic Webdata XmlSchemaKeyRef Example/CS/key_sample.cs
@@ -9,12 +9,12 @@
public class XmlSchemaObjectGenerator {
private static void ValidationCallback(object sender, ValidationEventArgs args ){
-
+
if(args.Severity == XmlSeverityType.Warning)
Console.Write("WARNING: ");
else if(args.Severity == XmlSeverityType.Error)
Console.Write("ERROR: ");
-
+
Console.WriteLine(args.Message);
}
@@ -22,42 +22,42 @@ public static void Main() {
XmlTextReader tr = new XmlTextReader("empty.xsd");
XmlSchema schema = XmlSchema.Read(tr, new ValidationEventHandler(ValidationCallback));
-
+
schema.ElementFormDefault = XmlSchemaForm.Qualified;
-
+
schema.TargetNamespace = "http://www.example.com/Report";
-
+
{
-
+
XmlSchemaElement element = new XmlSchemaElement();
element.Name = "purchaseReport";
-
+
XmlSchemaComplexType element_complexType = new XmlSchemaComplexType();
-
+
XmlSchemaSequence element_complexType_sequence = new XmlSchemaSequence();
-
+
{
-
+
XmlSchemaElement element_complexType_sequence_element = new XmlSchemaElement();
element_complexType_sequence_element.Name = "region";
- element_complexType_sequence_element.SchemaTypeName =
+ element_complexType_sequence_element.SchemaTypeName =
new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema")
;
-
+
{
-
+
XmlSchemaKeyref element_complexType_sequence_element_keyref = new XmlSchemaKeyref();
element_complexType_sequence_element_keyref.Name = "dummy2";
element_complexType_sequence_element_keyref.Selector = new XmlSchemaXPath();
element_complexType_sequence_element_keyref.Selector.XPath = "r:zip/r:part";
-
+
{
XmlSchemaXPath field = new XmlSchemaXPath();
field.XPath = "@number";
element_complexType_sequence_element_keyref.Fields.Add(field);
}
- element_complexType_sequence_element_keyref.Refer =
+ element_complexType_sequence_element_keyref.Refer =
new XmlQualifiedName("pNumKey", "http://www.example.com/Report")
;
element_complexType_sequence_element.Constraints.Add(element_complexType_sequence_element_keyref);
@@ -65,25 +65,25 @@ public static void Main() {
element_complexType_sequence.Items.Add(element_complexType_sequence_element);
}
element_complexType.Particle = element_complexType_sequence;
-
+
{
-
+
XmlSchemaAttribute element_complexType_attribute = new XmlSchemaAttribute();
element_complexType_attribute.Name = "periodEnding";
- element_complexType_attribute.SchemaTypeName =
+ element_complexType_attribute.SchemaTypeName =
new XmlQualifiedName("date", "http://www.w3.org/2001/XMLSchema")
;
element_complexType.Attributes.Add(element_complexType_attribute);
}
element.SchemaType = element_complexType;
-
+
{
-
+
XmlSchemaKey element_key = new XmlSchemaKey();
element_key.Name = "pNumKey";
element_key.Selector = new XmlSchemaXPath();
element_key.Selector.XPath = "r:parts/r:part";
-
+
{
XmlSchemaXPath field = new XmlSchemaXPath();
@@ -92,12 +92,12 @@ public static void Main() {
}
element.Constraints.Add(element_key);
}
-
+
schema.Items.Add(element);
}
-
+
schema.Write(Console.Out);
- }/* Main() */
-}
+ }/* Main() */
+}
//XmlSchemaObjectGenerator
-//
+//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs
index bcdf5a49a8e..ef4678a2b5c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs
@@ -17,7 +17,7 @@ static void Main(string[] args)
// Northwnd db = new Northwnd(@"c:\northwnd.mdf");
//
-// DataContext takes a connection string.
+// DataContext takes a connection string.
DataContext db = new DataContext(@"c:\Northwind.mdf");
// Get a typed table to run queries.
@@ -90,7 +90,7 @@ public Northwind(string connection) : base(connection) { }
//
void method()
- {
+ {
//
Northwnd db = new Northwnd(@"c:\Northwnd.mdf");
var query =
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/northwind.cs
index 2d958898230..663d4c4d3c1 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2474,7 +2474,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2508,7 +2508,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2542,7 +2542,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2898,7 +2898,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2932,7 +2932,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3725,7 +3725,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs
index 1c127ecc71d..72153bd996a 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs
@@ -37,7 +37,7 @@ void method2()
from cust in db.Customers
where cust.City == "London"
select cust;
-
+
foreach (Customer custObj in custQuery)
{
Console.WriteLine("CustomerID: {0}", custObj.CustomerID);
@@ -45,7 +45,7 @@ from cust in db.Customers
custObj.City = "Paris";
Console.WriteLine("\tUpdated value: {0}", custObj.City);
}
-
+
ChangeSet cs = db.GetChangeSet();
Console.Write("Total changes: {0}", cs);
// Freeze the console window.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/northwind.cs
index 87e0e7642c5..3ea08e89d23 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3721,7 +3721,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqNTier/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqNTier/cs/Program.cs
index a21489a9fa4..a71cfde1c19 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DLinqNTier/cs/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqNTier/cs/Program.cs
@@ -77,7 +77,7 @@ void method4()
{
Customer Cust_File = new Customer();
string xmlFile = "";
-
+
// Get the original object from the deserializer.
Customer c = SerializeHelper.Deserialize
(xmlFile, Cust_File);
@@ -86,14 +86,14 @@ void method4()
Customer c_updated = new Customer() { CustomerID = c.CustomerID,
Phone = "425-123-4567", CompanyName = "Microsoft" };
db2.Customers.Attach(c_updated, c);
-
- // Perform last minute updates, which will still take effect.
+
+ // Perform last minute updates, which will still take effect.
c_updated.Phone = "425-765-4321";
// SubmitChanges()sets the phoneNumber and CompanyName of
// customer with customerID=Cust. to "425-765-4321" and
// "Microsoft" respectively.
- db2.SubmitChanges();
+ db2.SubmitChanges();
}
//
}
@@ -103,9 +103,9 @@ void method4()
//void method6()
//{
// // s6: skip until it compiles
-
+
// // This tier uses DataLoadOptions to disable deferred loading. Only the
- // // customer and orders are moved in a single serialization.
+ // // customer and orders are moved in a single serialization.
// DataLoadOptions shape = new DataLoadOptions();
// shape.LoadWith(c => c.Orders);
@@ -232,26 +232,26 @@ thrown. The Delete operation cannot complete at this time. */
}
//
}
-
+
public Northwind_Simplified(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwind_Simplified(System.Data.IDbConnection connection) :
+ public Northwind_Simplified(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwind_Simplified(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwind_Simplified(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwind_Simplified(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwind_Simplified(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqNTier/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqNTier/cs/northwind.cs
index 06171164a0e..b2bd86ff44f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DLinqNTier/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqNTier/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3721,7 +3721,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqSprox/cs/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqSprox/cs/Program.cs
index bc17654ab7c..1b8a72414f2 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DLinqSprox/cs/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqSprox/cs/Program.cs
@@ -39,7 +39,7 @@ void CallMultiple()
// Pause to view company names; press Enter to continue.
Console.ReadLine();
-
+
// Assign the results of the procedure with an argument
// of (2) to local variable 'result'.
IMultipleResults result2 = db.VariableResultShapes(2);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DLinqSprox/cs/northwind-sprox.cs b/samples/snippets/csharp/VS_Snippets_Data/DLinqSprox/cs/northwind-sprox.cs
index 887ad225342..95e4fc37267 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DLinqSprox/cs/northwind-sprox.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DLinqSprox/cs/northwind-sprox.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -561,7 +561,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -595,7 +595,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1593,7 +1593,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1808,7 +1808,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1842,7 +1842,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2048,7 +2048,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2082,7 +2082,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2527,7 +2527,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2561,7 +2561,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2595,7 +2595,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2951,7 +2951,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2985,7 +2985,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3778,7 +3778,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP EntityObject Concepts/CS/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DP EntityObject Concepts/CS/Program.cs
index 20c4018eb81..73e2d0fbe9a 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DP EntityObject Concepts/CS/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DP EntityObject Concepts/CS/Program.cs
@@ -28,10 +28,10 @@ private static void QueryWithSpan()
{
// Set the object span to return line items with an order.
ObjectQuery query = context.Order.Include("LineItem");
-
+
try
{
- // Execute the query and display information for each item
+ // Execute the query and display information for each item
// in the orders that belong to the first contact.
foreach (Order order in query.Top("5").Execute(MergeOption.AppendOnly))
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP EntityObject Concepts/CS/SalesObjects.cs b/samples/snippets/csharp/VS_Snippets_Data/DP EntityObject Concepts/CS/SalesObjects.cs
index 92aac90e392..3d30f79f5cf 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DP EntityObject Concepts/CS/SalesObjects.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DP EntityObject Concepts/CS/SalesObjects.cs
@@ -13,15 +13,15 @@
//
[assembly: EdmSchemaAttribute()]
[assembly: EdmRelationshipAttribute("Microsoft.Samples.Edm",
- "FK_LineItem_Order_OrderId", "Order",
+ "FK_LineItem_Order_OrderId", "Order",
RelationshipMultiplicity.One, typeof(Order),"LineItem",
RelationshipMultiplicity.Many, typeof(LineItem))]
//
namespace Microsoft.Samples.Edm
-{
+{
//
[EdmEntityTypeAttribute(NamespaceName="Microsoft.Samples.Edm",Name="Order")]
- public class Order : EntityObject
+ public class Order : EntityObject
//
{
// Define private property variables.
@@ -36,12 +36,12 @@ public class Order : EntityObject
private decimal _freight;
private decimal _totalDue;
private OrderInfo _ExtendedInfo;
-
+
// Public properties of the Order object.
[EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
public int OrderId
{
- get
+ get
{
return _orderId;
}
@@ -66,9 +66,9 @@ public System.Data.Objects.DataClasses.EntityCollection LineItem
}
}
[EdmScalarPropertyAttribute(IsNullable = false)]
- public DateTime OrderDate
+ public DateTime OrderDate
{
- get
+ get
{
return _orderDate;
}
@@ -80,9 +80,9 @@ public DateTime OrderDate
}
}
[EdmScalarPropertyAttribute(IsNullable = false)]
- public DateTime DueDate
+ public DateTime DueDate
{
- get
+ get
{
return _dueDate;
}
@@ -111,7 +111,7 @@ public DateTime ShipDate
[EdmScalarPropertyAttribute(IsNullable = false)]
public byte Status
{
- get
+ get
{
return _status;
}
@@ -147,7 +147,7 @@ public decimal SubTotal
{
return _subTotal;
}
- set
+ set
{
if (_subTotal != value)
{
@@ -240,7 +240,7 @@ public OrderInfo ExtendedInfo
{
this.ReportPropertyChanging("ExtendedInfo");
_ExtendedInfo = value;
- this.ReportPropertyChanged("ExtendedInfo");
+ this.ReportPropertyChanged("ExtendedInfo");
}
}
private void CalculateOrderTotal()
@@ -250,7 +250,7 @@ private void CalculateOrderTotal()
}
}
//
- [EdmComplexTypeAttribute(NamespaceName =
+ [EdmComplexTypeAttribute(NamespaceName =
"Microsoft.Samples.Edm", Name = "OrderInfo")]
public partial class OrderInfo : ComplexObject
//
@@ -356,10 +356,10 @@ public string Comment
}
[EdmEntityTypeAttribute(NamespaceName = "Microsoft.Samples.Edm", Name = "LineItem")]
- public class LineItem : EntityObject
+ public class LineItem : EntityObject
{
// Define private property variables.
- int _lineItemId;
+ int _lineItemId;
string _trackingNumber;
short _quantity;
int _product;
@@ -370,7 +370,7 @@ public class LineItem : EntityObject
// Default constructor.
public LineItem()
{
- }
+ }
// Defines a navigation property to the Order class.
[EdmRelationshipNavigationPropertyAttribute("Microsoft.Samples.Edm", "FK_LineItem_Order_OrderId", "Order")]
@@ -446,7 +446,7 @@ public short Quantity
ReportPropertyChanging("Quantity");
_quantity = value;
ReportPropertyChanged("Quantity");
-
+
// Update the line total.
CalculateLineTotal();
}
@@ -465,7 +465,7 @@ public int Product
if (value < 1)
{
throw new ApplicationException(string.Format(
- Properties.Resources.propertyNotValidNegative,
+ Properties.Resources.propertyNotValidNegative,
new string[2] { value.ToString(), "Product" }));
}
ReportPropertyChanging("Product");
@@ -473,7 +473,7 @@ public int Product
ReportPropertyChanged("Product");
}
}
- [EdmScalarPropertyAttribute(IsNullable = false)]
+ [EdmScalarPropertyAttribute(IsNullable = false)]
public decimal Price
{
get
@@ -522,7 +522,7 @@ public decimal Discount
ReportPropertyChanged("Discount");
}
}
-
+
public decimal Total
{
get
@@ -533,7 +533,7 @@ public decimal Total
private void CalculateLineTotal()
{
- _total = (_quantity * (_price - _discount));
+ _total = (_quantity * (_price - _discount));
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs
index 228c9d1425a..779e4834190 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs
@@ -45,7 +45,7 @@ static void Main(string[] args)
// AnonymousTypeInitialization_MQ();
// TypeInitialization();
// TypeInitialization_MQ();
-
+
//WhereExpression();
//LiteralParameter1();
//int orderID = 51987;
@@ -56,7 +56,7 @@ static void Main(string[] args)
//CanonicalFuncVsCLRBaseType();
//ConvertExpression();
//NonSymmetricGetterSetter();
-
+
//*** Nav property examples ***//
//NavPropLoadError();
// NavProperty_MQ();
@@ -109,7 +109,7 @@ from s in context.SalesOrderHeaders
Console.WriteLine(orderNum);
}
}
- //
+ //
}
static void RestrictionExpression()
@@ -205,7 +205,7 @@ class AClass { public int ID;}
//
static void PropertyAsConstant()
{
- //
+ //
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
AClass aClass = new AClass();
@@ -236,7 +236,7 @@ class MyClass2
static void MethodAsConstantFails()
{
- //
+ //
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
MyClass2 myClass = new MyClass2();
@@ -267,14 +267,14 @@ from s in context.SalesOrderHeaders
static void NullComparison()
{
- //
+ //
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
ObjectQuery sales = context.SalesOrderHeaders;
//Throws a NotSupportedException
/* var orders = from c in edm.Cusomters
- join c2 in edm.Orders
+ join c2 in edm.Orders
on c.Region == c2.ShipRegion
where c.Region == null
select c.CustomerID;
@@ -308,7 +308,7 @@ static void CastResultsIsNull()
static void JoinOnNull()
{
-
+
//
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
@@ -316,10 +316,10 @@ static void JoinOnNull()
ObjectSet details = context.SalesOrderDetails;
var query =
- from order in orders
- join detail in details
- on order.SalesOrderID
- equals detail.SalesOrderID
+ from order in orders
+ join detail in details
+ on order.SalesOrderID
+ equals detail.SalesOrderID
where order.ShipDate == null
select order.SalesOrderID;
@@ -478,9 +478,9 @@ public static void NavPropLoadError()
foreach (Contact contact in contacts)
{
Console.WriteLine("Name: {0}, {1}", contact.LastName, contact.FirstName);
-
- // Throws a EntityCommandExecutionException if
- // MultipleActiveResultSets is set to False in the
+
+ // Throws a EntityCommandExecutionException if
+ // MultipleActiveResultSets is set to False in the
// connection string.
contact.SalesOrderHeaders.Load();
@@ -512,7 +512,7 @@ from s in context.SalesOrderHeaders
Console.WriteLine("Sales order info:");
foreach (int orderNumber in salesInfo)
{
- Console.WriteLine("Order number: " + orderNumber);
+ Console.WriteLine("Order number: " + orderNumber);
}
}
//
@@ -520,7 +520,7 @@ from s in context.SalesOrderHeaders
public static void LiteralParameter1()
{
-
+
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
//
@@ -544,11 +544,11 @@ public static void MethodParameterExample(int orderID)
{
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
-
+
IQueryable salesInfo =
from s in context.SalesOrderHeaders
where s.SalesOrderID == orderID
- select s;
+ select s;
foreach (SalesOrderHeader sale in salesInfo)
{
@@ -559,7 +559,7 @@ from s in context.SalesOrderHeaders
//
public static void NullCastToString()
- {
+ {
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
//
@@ -573,7 +573,7 @@ from c in context.Contacts
{
Console.WriteLine("Name: {0}", contact.LastName);
}
- }
+ }
}
public static void CastToNullable()
@@ -592,7 +592,7 @@ from product in context.Products
{
Console.WriteLine("Name: {0}", p.Name);
}
- }
+ }
}
public static void ConstructorForLiteral()
@@ -611,7 +611,7 @@ from product in context.Products
{
Console.WriteLine("Name: {0}", p.Name);
}
- }
+ }
}
public static void CanonicalFuncVsCLRBaseType()
@@ -639,7 +639,7 @@ public static void ConvertExpression()
{
var sales = from sale in context.SalesOrderDetails
where sale.OrderQty > orderQty
- select new { Sale = sale, TotalValue = (decimal)sale.OrderQty * sale.UnitPrice };
+ select new { Sale = sale, TotalValue = (decimal)sale.OrderQty * sale.UnitPrice };
foreach (var s in sales)
{
@@ -872,7 +872,7 @@ static void SBUDT544351()
Console.WriteLine(productName);
}
- // In this query, the ordering is preserved because
+ // In this query, the ordering is preserved because
// OrderByDescending is called after Distinct.
IQueryable productsList2 = context.Products
.Select(p => p.Name)
@@ -913,7 +913,7 @@ static void SBUDT496552A()
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
// Return all contacts, ordered by last name. The OrderBy before
- // the Where produces a nested query when translated to
+ // the Where produces a nested query when translated to
// canonical command trees and the ordering by last name is lost.
IQueryable contacts = context.Contacts
.OrderBy(x => x.LastName)
@@ -1060,7 +1060,7 @@ public static void SBUDT555877()
}
//
}
-
+
# endregion
# region "How to examples"
public static void QueryReturnsPrimitiveValue()
@@ -1176,32 +1176,32 @@ static void FunctionMappingWorkAround()
# region Compiled Query Examples
//
- static readonly Func> s_compiledQuery1 =
+ static readonly Func> s_compiledQuery1 =
CompiledQuery.Compile>(
ctx => ctx.SalesOrderHeaders);
static void CompiledQuery1_MQ()
{
-
+
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
IQueryable orders = s_compiledQuery1.Invoke(context);
foreach (SalesOrderHeader order in orders)
Console.WriteLine(order.SalesOrderID);
- }
+ }
}
//
//
- static readonly Func> s_compiledQuery2 =
+ static readonly Func> s_compiledQuery2 =
CompiledQuery.Compile>(
(ctx, total) => from order in ctx.SalesOrderHeaders
where order.TotalDue >= total
select order);
static void CompiledQuery2()
- {
+ {
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
Decimal totalDue = 200.00M;
@@ -1215,11 +1215,11 @@ static void CompiledQuery2()
order.OrderDate,
order.TotalDue);
}
- }
+ }
}
//
- static readonly Func> s_compiledQuery2MQ =
+ static readonly Func> s_compiledQuery2MQ =
CompiledQuery.Compile>(
(ctx, total) => ctx.SalesOrderHeaders
.Where(s => s.TotalDue >= total)
@@ -1241,7 +1241,7 @@ static void CompiledQuery2_MQ()
order.OrderDate,
order.TotalDue);
}
- }
+ }
}
//
@@ -1251,23 +1251,23 @@ static void CompiledQuery2_MQ()
static void CompiledQuery3_MQ()
{
-
+
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
Decimal averageProductPrice = s_compiledQuery3MQ.Invoke(context);
Console.WriteLine("The average of the product list prices is $: {0}", averageProductPrice);
- }
+ }
}
//
//
- static readonly Func s_compiledQuery4MQ =
+ static readonly Func s_compiledQuery4MQ =
CompiledQuery.Compile(
(ctx, name) => ctx.Contacts.First(contact => contact.EmailAddress.StartsWith(name)));
static void CompiledQuery4_MQ()
- {
+ {
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
string contactName = "caroline";
@@ -1275,23 +1275,23 @@ static void CompiledQuery4_MQ()
Console.WriteLine("An email address starting with 'caroline': {0}",
foundContact.EmailAddress);
- }
+ }
}
//
//
- static readonly Func> s_compiledQuery5 =
+ static readonly Func> s_compiledQuery5 =
CompiledQuery.Compile>(
(ctx, orderDate, totalDue) => from product in ctx.SalesOrderHeaders
- where product.OrderDate > orderDate
+ where product.OrderDate > orderDate
&& product.TotalDue < totalDue
orderby product.OrderDate
select product);
static void CompiledQuery5()
- {
+ {
using (AdventureWorksEntities context = new AdventureWorksEntities())
- {
+ {
DateTime date = new DateTime(2003, 3, 8);
Decimal amountDue = 300.00M;
@@ -1301,7 +1301,7 @@ static void CompiledQuery5()
{
Console.WriteLine("ID: {0} Order date: {1} Total due: {2}", order.SalesOrderID, order.OrderDate, order.TotalDue);
}
- }
+ }
}
//
@@ -1336,15 +1336,15 @@ struct MyParams
//
//
- static Func> s_compiledQuery =
+ static Func> s_compiledQuery =
CompiledQuery.Compile>(
(ctx, myparams) => from sale in ctx.SalesOrderHeaders
- where sale.ShipDate > myparams.startDate && sale.ShipDate < myparams.endDate
- && sale.TotalDue > myparams.totalDue
+ where sale.ShipDate > myparams.startDate && sale.ShipDate < myparams.endDate
+ && sale.TotalDue > myparams.totalDue
select sale);
static void CompiledQuery7()
{
-
+
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
MyParams myParams = new MyParams();
@@ -1360,7 +1360,7 @@ static void CompiledQuery7()
Console.WriteLine("Ship date: {0}", sale.ShipDate);
Console.WriteLine("Total due: {0}", sale.TotalDue);
}
- }
+ }
}
//
# endregion
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/adventureworksmodel.designer.cs b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/adventureworksmodel.designer.cs
index 7c64c5629d1..03506be4e36 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/adventureworksmodel.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/adventureworksmodel.designer.cs
@@ -40,7 +40,7 @@ public AdventureWorksEntities() : base("name=AdventureWorksEntities", "Adventure
{
OnContextCreated();
}
-
+
///
/// Initialize a new AdventureWorksEntities object.
///
@@ -48,7 +48,7 @@ public AdventureWorksEntities(string connectionString) : base(connectionString,
{
OnContextCreated();
}
-
+
///
/// Initialize a new AdventureWorksEntities object.
///
@@ -57,11 +57,11 @@ public AdventureWorksEntities(EntityConnection connection) : base(connection, "A
OnContextCreated();
}
#endregion
-
+
#region Partial Methods
partial void OnContextCreated();
#endregion
-
+
#region ObjectSet Properties
///
/// No Metadata Documentation available.
@@ -78,7 +78,7 @@ public ObjectSet Addresses
}
}
private ObjectSet _Addresses;
-
+
///
/// No Metadata Documentation available.
///
@@ -94,7 +94,7 @@ public ObjectSet Contacts
}
}
private ObjectSet _Contacts;
-
+
///
/// No Metadata Documentation available.
///
@@ -110,7 +110,7 @@ public ObjectSet Products
}
}
private ObjectSet _Products;
-
+
///
/// No Metadata Documentation available.
///
@@ -126,7 +126,7 @@ public ObjectSet SalesOrderDetails
}
}
private ObjectSet _SalesOrderDetails;
-
+
///
/// No Metadata Documentation available.
///
@@ -142,10 +142,10 @@ public ObjectSet SalesOrderHeaders
}
}
private ObjectSet _SalesOrderHeaders;
-
+
#endregion
#region AddTo Methods
-
+
///
/// Deprecated Method for adding a new object to the Addresses EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -153,7 +153,7 @@ public void AddToAddresses(Address address)
{
base.AddObject("Addresses", address);
}
-
+
///
/// Deprecated Method for adding a new object to the Contacts EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -161,7 +161,7 @@ public void AddToContacts(Contact contact)
{
base.AddObject("Contacts", contact);
}
-
+
///
/// Deprecated Method for adding a new object to the Products EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -169,7 +169,7 @@ public void AddToProducts(Product product)
{
base.AddObject("Products", product);
}
-
+
///
/// Deprecated Method for adding a new object to the SalesOrderDetails EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -177,7 +177,7 @@ public void AddToSalesOrderDetails(SalesOrderDetail salesOrderDetail)
{
base.AddObject("SalesOrderDetails", salesOrderDetail);
}
-
+
///
/// Deprecated Method for adding a new object to the SalesOrderHeaders EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -187,10 +187,10 @@ public void AddToSalesOrderHeaders(SalesOrderHeader salesOrderHeader)
}
#endregion
}
-
+
#endregion
-
-
+
+
#region Entities
///
/// No Metadata Documentation available.
@@ -215,19 +215,19 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
{
Address address = new Address();
address.AddressID = addressID;
-
+
address.AddressLine1 = addressLine1;
-
+
address.City = city;
-
+
address.StateProvinceID = stateProvinceID;
-
+
address.PostalCode = postalCode;
-
+
address.rowguid = rowguid;
-
+
address.ModifiedDate = modifiedDate;
-
+
return address;
}
#endregion
@@ -255,12 +255,12 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
OnAddressIDChanged();
}
}
-
+
}
private global::System.Int32 _AddressID;
partial void OnAddressIDChanging(global::System.Int32 value);
partial void OnAddressIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -280,12 +280,12 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
ReportPropertyChanged("AddressLine1");
OnAddressLine1Changed();
}
-
+
}
private global::System.String _AddressLine1;
partial void OnAddressLine1Changing(global::System.String value);
partial void OnAddressLine1Changed();
-
+
///
/// No Metadata Documentation available.
///
@@ -305,12 +305,12 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
ReportPropertyChanged("AddressLine2");
OnAddressLine2Changed();
}
-
+
}
private global::System.String _AddressLine2;
partial void OnAddressLine2Changing(global::System.String value);
partial void OnAddressLine2Changed();
-
+
///
/// No Metadata Documentation available.
///
@@ -330,12 +330,12 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
ReportPropertyChanged("City");
OnCityChanged();
}
-
+
}
private global::System.String _City;
partial void OnCityChanging(global::System.String value);
partial void OnCityChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -355,12 +355,12 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
ReportPropertyChanged("StateProvinceID");
OnStateProvinceIDChanged();
}
-
+
}
private global::System.Int32 _StateProvinceID;
partial void OnStateProvinceIDChanging(global::System.Int32 value);
partial void OnStateProvinceIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -380,12 +380,12 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
ReportPropertyChanged("PostalCode");
OnPostalCodeChanged();
}
-
+
}
private global::System.String _PostalCode;
partial void OnPostalCodeChanging(global::System.String value);
partial void OnPostalCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -405,12 +405,12 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
ReportPropertyChanged("rowguid");
OnrowguidChanged();
}
-
+
}
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -430,14 +430,14 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
ReportPropertyChanged("ModifiedDate");
OnModifiedDateChanged();
}
-
+
}
private global::System.DateTime _ModifiedDate;
partial void OnModifiedDateChanging(global::System.DateTime value);
partial void OnModifiedDateChanged();
-
+
#endregion
-
+
#region Navigation Properties
///
/// No Metadata Documentation available.
@@ -445,7 +445,7 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader")]
+ [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader")]
public EntityCollection SalesOrderHeaders
{
get
@@ -466,7 +466,7 @@ public EntityCollection SalesOrderHeaders
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader")]
+ [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader")]
public EntityCollection SalesOrderHeaders1
{
get
@@ -483,7 +483,7 @@ public EntityCollection SalesOrderHeaders1
}
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -509,23 +509,23 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
{
Contact contact = new Contact();
contact.ContactID = contactID;
-
+
contact.NameStyle = nameStyle;
-
+
contact.FirstName = firstName;
-
+
contact.LastName = lastName;
-
+
contact.EmailPromotion = emailPromotion;
-
+
contact.PasswordHash = passwordHash;
-
+
contact.PasswordSalt = passwordSalt;
-
+
contact.rowguid = rowguid;
-
+
contact.ModifiedDate = modifiedDate;
-
+
return contact;
}
#endregion
@@ -553,12 +553,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
OnContactIDChanged();
}
}
-
+
}
private global::System.Int32 _ContactID;
partial void OnContactIDChanging(global::System.Int32 value);
partial void OnContactIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -578,12 +578,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("NameStyle");
OnNameStyleChanged();
}
-
+
}
private global::System.Boolean _NameStyle;
partial void OnNameStyleChanging(global::System.Boolean value);
partial void OnNameStyleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -603,12 +603,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("Title");
OnTitleChanged();
}
-
+
}
private global::System.String _Title;
partial void OnTitleChanging(global::System.String value);
partial void OnTitleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -628,12 +628,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("FirstName");
OnFirstNameChanged();
}
-
+
}
private global::System.String _FirstName;
partial void OnFirstNameChanging(global::System.String value);
partial void OnFirstNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -653,12 +653,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("MiddleName");
OnMiddleNameChanged();
}
-
+
}
private global::System.String _MiddleName;
partial void OnMiddleNameChanging(global::System.String value);
partial void OnMiddleNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -678,12 +678,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("LastName");
OnLastNameChanged();
}
-
+
}
private global::System.String _LastName;
partial void OnLastNameChanging(global::System.String value);
partial void OnLastNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -703,12 +703,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("Suffix");
OnSuffixChanged();
}
-
+
}
private global::System.String _Suffix;
partial void OnSuffixChanging(global::System.String value);
partial void OnSuffixChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -728,12 +728,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("EmailAddress");
OnEmailAddressChanged();
}
-
+
}
private global::System.String _EmailAddress;
partial void OnEmailAddressChanging(global::System.String value);
partial void OnEmailAddressChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -753,12 +753,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("EmailPromotion");
OnEmailPromotionChanged();
}
-
+
}
private global::System.Int32 _EmailPromotion;
partial void OnEmailPromotionChanging(global::System.Int32 value);
partial void OnEmailPromotionChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -778,12 +778,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("Phone");
OnPhoneChanged();
}
-
+
}
private global::System.String _Phone;
partial void OnPhoneChanging(global::System.String value);
partial void OnPhoneChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -803,12 +803,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("PasswordHash");
OnPasswordHashChanged();
}
-
+
}
private global::System.String _PasswordHash;
partial void OnPasswordHashChanging(global::System.String value);
partial void OnPasswordHashChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -828,12 +828,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("PasswordSalt");
OnPasswordSaltChanged();
}
-
+
}
private global::System.String _PasswordSalt;
partial void OnPasswordSaltChanging(global::System.String value);
partial void OnPasswordSaltChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -853,12 +853,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("AdditionalContactInfo");
OnAdditionalContactInfoChanged();
}
-
+
}
private global::System.String _AdditionalContactInfo;
partial void OnAdditionalContactInfoChanging(global::System.String value);
partial void OnAdditionalContactInfoChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -878,12 +878,12 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("rowguid");
OnrowguidChanged();
}
-
+
}
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -903,14 +903,14 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
ReportPropertyChanged("ModifiedDate");
OnModifiedDateChanged();
}
-
+
}
private global::System.DateTime _ModifiedDate;
partial void OnModifiedDateChanging(global::System.DateTime value);
partial void OnModifiedDateChanged();
-
+
#endregion
-
+
#region Navigation Properties
///
/// No Metadata Documentation available.
@@ -918,7 +918,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader")]
+ [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader")]
public EntityCollection SalesOrderHeaders
{
get
@@ -935,7 +935,7 @@ public EntityCollection SalesOrderHeaders
}
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -965,31 +965,31 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
{
Product product = new Product();
product.ProductID = productID;
-
+
product.Name = name;
-
+
product.ProductNumber = productNumber;
-
+
product.MakeFlag = makeFlag;
-
+
product.FinishedGoodsFlag = finishedGoodsFlag;
-
+
product.SafetyStockLevel = safetyStockLevel;
-
+
product.ReorderPoint = reorderPoint;
-
+
product.StandardCost = standardCost;
-
+
product.ListPrice = listPrice;
-
+
product.DaysToManufacture = daysToManufacture;
-
+
product.SellStartDate = sellStartDate;
-
+
product.rowguid = rowguid;
-
+
product.ModifiedDate = modifiedDate;
-
+
return product;
}
#endregion
@@ -1017,12 +1017,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
OnProductIDChanged();
}
}
-
+
}
private global::System.Int32 _ProductID;
partial void OnProductIDChanging(global::System.Int32 value);
partial void OnProductIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1042,12 +1042,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("Name");
OnNameChanged();
}
-
+
}
private global::System.String _Name;
partial void OnNameChanging(global::System.String value);
partial void OnNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1067,12 +1067,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("ProductNumber");
OnProductNumberChanged();
}
-
+
}
private global::System.String _ProductNumber;
partial void OnProductNumberChanging(global::System.String value);
partial void OnProductNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1092,12 +1092,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("MakeFlag");
OnMakeFlagChanged();
}
-
+
}
private global::System.Boolean _MakeFlag;
partial void OnMakeFlagChanging(global::System.Boolean value);
partial void OnMakeFlagChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1117,12 +1117,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("FinishedGoodsFlag");
OnFinishedGoodsFlagChanged();
}
-
+
}
private global::System.Boolean _FinishedGoodsFlag;
partial void OnFinishedGoodsFlagChanging(global::System.Boolean value);
partial void OnFinishedGoodsFlagChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1142,12 +1142,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("Color");
OnColorChanged();
}
-
+
}
private global::System.String _Color;
partial void OnColorChanging(global::System.String value);
partial void OnColorChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1167,12 +1167,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("SafetyStockLevel");
OnSafetyStockLevelChanged();
}
-
+
}
private global::System.Int16 _SafetyStockLevel;
partial void OnSafetyStockLevelChanging(global::System.Int16 value);
partial void OnSafetyStockLevelChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1192,12 +1192,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("ReorderPoint");
OnReorderPointChanged();
}
-
+
}
private global::System.Int16 _ReorderPoint;
partial void OnReorderPointChanging(global::System.Int16 value);
partial void OnReorderPointChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1217,12 +1217,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("StandardCost");
OnStandardCostChanged();
}
-
+
}
private global::System.Decimal _StandardCost;
partial void OnStandardCostChanging(global::System.Decimal value);
partial void OnStandardCostChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1242,12 +1242,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("ListPrice");
OnListPriceChanged();
}
-
+
}
private global::System.Decimal _ListPrice;
partial void OnListPriceChanging(global::System.Decimal value);
partial void OnListPriceChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1267,12 +1267,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("Size");
OnSizeChanged();
}
-
+
}
private global::System.String _Size;
partial void OnSizeChanging(global::System.String value);
partial void OnSizeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1292,12 +1292,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("SizeUnitMeasureCode");
OnSizeUnitMeasureCodeChanged();
}
-
+
}
private global::System.String _SizeUnitMeasureCode;
partial void OnSizeUnitMeasureCodeChanging(global::System.String value);
partial void OnSizeUnitMeasureCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1317,12 +1317,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("WeightUnitMeasureCode");
OnWeightUnitMeasureCodeChanged();
}
-
+
}
private global::System.String _WeightUnitMeasureCode;
partial void OnWeightUnitMeasureCodeChanging(global::System.String value);
partial void OnWeightUnitMeasureCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1342,12 +1342,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("Weight");
OnWeightChanged();
}
-
+
}
private Nullable _Weight;
partial void OnWeightChanging(Nullable value);
partial void OnWeightChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1367,12 +1367,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("DaysToManufacture");
OnDaysToManufactureChanged();
}
-
+
}
private global::System.Int32 _DaysToManufacture;
partial void OnDaysToManufactureChanging(global::System.Int32 value);
partial void OnDaysToManufactureChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1392,12 +1392,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("ProductLine");
OnProductLineChanged();
}
-
+
}
private global::System.String _ProductLine;
partial void OnProductLineChanging(global::System.String value);
partial void OnProductLineChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1417,12 +1417,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("Class");
OnClassChanged();
}
-
+
}
private global::System.String _Class;
partial void OnClassChanging(global::System.String value);
partial void OnClassChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1442,12 +1442,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("Style");
OnStyleChanged();
}
-
+
}
private global::System.String _Style;
partial void OnStyleChanging(global::System.String value);
partial void OnStyleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1467,12 +1467,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("ProductSubcategoryID");
OnProductSubcategoryIDChanged();
}
-
+
}
private Nullable _ProductSubcategoryID;
partial void OnProductSubcategoryIDChanging(Nullable value);
partial void OnProductSubcategoryIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1492,12 +1492,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("ProductModelID");
OnProductModelIDChanged();
}
-
+
}
private Nullable _ProductModelID;
partial void OnProductModelIDChanging(Nullable value);
partial void OnProductModelIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1517,12 +1517,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("SellStartDate");
OnSellStartDateChanged();
}
-
+
}
private global::System.DateTime _SellStartDate;
partial void OnSellStartDateChanging(global::System.DateTime value);
partial void OnSellStartDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1542,12 +1542,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("SellEndDate");
OnSellEndDateChanged();
}
-
+
}
private Nullable _SellEndDate;
partial void OnSellEndDateChanging(Nullable value);
partial void OnSellEndDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1567,12 +1567,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("DiscontinuedDate");
OnDiscontinuedDateChanged();
}
-
+
}
private Nullable _DiscontinuedDate;
partial void OnDiscontinuedDateChanging(Nullable value);
partial void OnDiscontinuedDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1592,12 +1592,12 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("rowguid");
OnrowguidChanged();
}
-
+
}
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1617,16 +1617,16 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
ReportPropertyChanged("ModifiedDate");
OnModifiedDateChanged();
}
-
+
}
private global::System.DateTime _ModifiedDate;
partial void OnModifiedDateChanging(global::System.DateTime value);
partial void OnModifiedDateChanged();
-
+
#endregion
-
+
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1653,25 +1653,25 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
{
SalesOrderDetail salesOrderDetail = new SalesOrderDetail();
salesOrderDetail.SalesOrderID = salesOrderID;
-
+
salesOrderDetail.SalesOrderDetailID = salesOrderDetailID;
-
+
salesOrderDetail.OrderQty = orderQty;
-
+
salesOrderDetail.ProductID = productID;
-
+
salesOrderDetail.SpecialOfferID = specialOfferID;
-
+
salesOrderDetail.UnitPrice = unitPrice;
-
+
salesOrderDetail.UnitPriceDiscount = unitPriceDiscount;
-
+
salesOrderDetail.LineTotal = lineTotal;
-
+
salesOrderDetail.rowguid = rowguid;
-
+
salesOrderDetail.ModifiedDate = modifiedDate;
-
+
return salesOrderDetail;
}
#endregion
@@ -1699,12 +1699,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
OnSalesOrderIDChanged();
}
}
-
+
}
private global::System.Int32 _SalesOrderID;
partial void OnSalesOrderIDChanging(global::System.Int32 value);
partial void OnSalesOrderIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1727,12 +1727,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
OnSalesOrderDetailIDChanged();
}
}
-
+
}
private global::System.Int32 _SalesOrderDetailID;
partial void OnSalesOrderDetailIDChanging(global::System.Int32 value);
partial void OnSalesOrderDetailIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1752,12 +1752,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
ReportPropertyChanged("CarrierTrackingNumber");
OnCarrierTrackingNumberChanged();
}
-
+
}
private global::System.String _CarrierTrackingNumber;
partial void OnCarrierTrackingNumberChanging(global::System.String value);
partial void OnCarrierTrackingNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1777,12 +1777,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
ReportPropertyChanged("OrderQty");
OnOrderQtyChanged();
}
-
+
}
private global::System.Int16 _OrderQty;
partial void OnOrderQtyChanging(global::System.Int16 value);
partial void OnOrderQtyChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1802,12 +1802,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
ReportPropertyChanged("ProductID");
OnProductIDChanged();
}
-
+
}
private global::System.Int32 _ProductID;
partial void OnProductIDChanging(global::System.Int32 value);
partial void OnProductIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1827,12 +1827,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
ReportPropertyChanged("SpecialOfferID");
OnSpecialOfferIDChanged();
}
-
+
}
private global::System.Int32 _SpecialOfferID;
partial void OnSpecialOfferIDChanging(global::System.Int32 value);
partial void OnSpecialOfferIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1852,12 +1852,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
ReportPropertyChanged("UnitPrice");
OnUnitPriceChanged();
}
-
+
}
private global::System.Decimal _UnitPrice;
partial void OnUnitPriceChanging(global::System.Decimal value);
partial void OnUnitPriceChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1877,12 +1877,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
ReportPropertyChanged("UnitPriceDiscount");
OnUnitPriceDiscountChanged();
}
-
+
}
private global::System.Decimal _UnitPriceDiscount;
partial void OnUnitPriceDiscountChanging(global::System.Decimal value);
partial void OnUnitPriceDiscountChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1902,12 +1902,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
ReportPropertyChanged("LineTotal");
OnLineTotalChanged();
}
-
+
}
private global::System.Decimal _LineTotal;
partial void OnLineTotalChanging(global::System.Decimal value);
partial void OnLineTotalChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1927,12 +1927,12 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
ReportPropertyChanged("rowguid");
OnrowguidChanged();
}
-
+
}
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1952,14 +1952,14 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
ReportPropertyChanged("ModifiedDate");
OnModifiedDateChanged();
}
-
+
}
private global::System.DateTime _ModifiedDate;
partial void OnModifiedDateChanging(global::System.DateTime value);
partial void OnModifiedDateChanged();
-
+
#endregion
-
+
#region Navigation Properties
///
/// No Metadata Documentation available.
@@ -1967,7 +1967,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader")]
+ [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader")]
public SalesOrderHeader SalesOrderHeader
{
get
@@ -2000,7 +2000,7 @@ public EntityReference SalesOrderHeaderReference
}
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -2035,41 +2035,41 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
{
SalesOrderHeader salesOrderHeader = new SalesOrderHeader();
salesOrderHeader.SalesOrderID = salesOrderID;
-
+
salesOrderHeader.RevisionNumber = revisionNumber;
-
+
salesOrderHeader.OrderDate = orderDate;
-
+
salesOrderHeader.DueDate = dueDate;
-
+
salesOrderHeader.Status = status;
-
+
salesOrderHeader.OnlineOrderFlag = onlineOrderFlag;
-
+
salesOrderHeader.SalesOrderNumber = salesOrderNumber;
-
+
salesOrderHeader.CustomerID = customerID;
-
+
salesOrderHeader.ContactID = contactID;
-
+
salesOrderHeader.BillToAddressID = billToAddressID;
-
+
salesOrderHeader.ShipToAddressID = shipToAddressID;
-
+
salesOrderHeader.ShipMethodID = shipMethodID;
-
+
salesOrderHeader.SubTotal = subTotal;
-
+
salesOrderHeader.TaxAmt = taxAmt;
-
+
salesOrderHeader.Freight = freight;
-
+
salesOrderHeader.TotalDue = totalDue;
-
+
salesOrderHeader.rowguid = rowguid;
-
+
salesOrderHeader.ModifiedDate = modifiedDate;
-
+
return salesOrderHeader;
}
#endregion
@@ -2097,12 +2097,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
OnSalesOrderIDChanged();
}
}
-
+
}
private global::System.Int32 _SalesOrderID;
partial void OnSalesOrderIDChanging(global::System.Int32 value);
partial void OnSalesOrderIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2122,12 +2122,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("RevisionNumber");
OnRevisionNumberChanged();
}
-
+
}
private global::System.Byte _RevisionNumber;
partial void OnRevisionNumberChanging(global::System.Byte value);
partial void OnRevisionNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2147,12 +2147,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("OrderDate");
OnOrderDateChanged();
}
-
+
}
private global::System.DateTime _OrderDate;
partial void OnOrderDateChanging(global::System.DateTime value);
partial void OnOrderDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2172,12 +2172,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("DueDate");
OnDueDateChanged();
}
-
+
}
private global::System.DateTime _DueDate;
partial void OnDueDateChanging(global::System.DateTime value);
partial void OnDueDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2197,12 +2197,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("ShipDate");
OnShipDateChanged();
}
-
+
}
private Nullable _ShipDate;
partial void OnShipDateChanging(Nullable value);
partial void OnShipDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2222,12 +2222,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("Status");
OnStatusChanged();
}
-
+
}
private global::System.Byte _Status;
partial void OnStatusChanging(global::System.Byte value);
partial void OnStatusChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2247,12 +2247,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("OnlineOrderFlag");
OnOnlineOrderFlagChanged();
}
-
+
}
private global::System.Boolean _OnlineOrderFlag;
partial void OnOnlineOrderFlagChanging(global::System.Boolean value);
partial void OnOnlineOrderFlagChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2272,12 +2272,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("SalesOrderNumber");
OnSalesOrderNumberChanged();
}
-
+
}
private global::System.String _SalesOrderNumber;
partial void OnSalesOrderNumberChanging(global::System.String value);
partial void OnSalesOrderNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2297,12 +2297,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("PurchaseOrderNumber");
OnPurchaseOrderNumberChanged();
}
-
+
}
private global::System.String _PurchaseOrderNumber;
partial void OnPurchaseOrderNumberChanging(global::System.String value);
partial void OnPurchaseOrderNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2322,12 +2322,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("AccountNumber");
OnAccountNumberChanged();
}
-
+
}
private global::System.String _AccountNumber;
partial void OnAccountNumberChanging(global::System.String value);
partial void OnAccountNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2347,12 +2347,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("CustomerID");
OnCustomerIDChanged();
}
-
+
}
private global::System.Int32 _CustomerID;
partial void OnCustomerIDChanging(global::System.Int32 value);
partial void OnCustomerIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2372,12 +2372,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("ContactID");
OnContactIDChanged();
}
-
+
}
private global::System.Int32 _ContactID;
partial void OnContactIDChanging(global::System.Int32 value);
partial void OnContactIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2397,12 +2397,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("SalesPersonID");
OnSalesPersonIDChanged();
}
-
+
}
private Nullable _SalesPersonID;
partial void OnSalesPersonIDChanging(Nullable value);
partial void OnSalesPersonIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2422,12 +2422,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("TerritoryID");
OnTerritoryIDChanged();
}
-
+
}
private Nullable _TerritoryID;
partial void OnTerritoryIDChanging(Nullable value);
partial void OnTerritoryIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2447,12 +2447,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("BillToAddressID");
OnBillToAddressIDChanged();
}
-
+
}
private global::System.Int32 _BillToAddressID;
partial void OnBillToAddressIDChanging(global::System.Int32 value);
partial void OnBillToAddressIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2472,12 +2472,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("ShipToAddressID");
OnShipToAddressIDChanged();
}
-
+
}
private global::System.Int32 _ShipToAddressID;
partial void OnShipToAddressIDChanging(global::System.Int32 value);
partial void OnShipToAddressIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2497,12 +2497,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("ShipMethodID");
OnShipMethodIDChanged();
}
-
+
}
private global::System.Int32 _ShipMethodID;
partial void OnShipMethodIDChanging(global::System.Int32 value);
partial void OnShipMethodIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2522,12 +2522,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("CreditCardID");
OnCreditCardIDChanged();
}
-
+
}
private Nullable _CreditCardID;
partial void OnCreditCardIDChanging(Nullable value);
partial void OnCreditCardIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2547,12 +2547,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("CreditCardApprovalCode");
OnCreditCardApprovalCodeChanged();
}
-
+
}
private global::System.String _CreditCardApprovalCode;
partial void OnCreditCardApprovalCodeChanging(global::System.String value);
partial void OnCreditCardApprovalCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2572,12 +2572,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("CurrencyRateID");
OnCurrencyRateIDChanged();
}
-
+
}
private Nullable _CurrencyRateID;
partial void OnCurrencyRateIDChanging(Nullable value);
partial void OnCurrencyRateIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2597,12 +2597,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("SubTotal");
OnSubTotalChanged();
}
-
+
}
private global::System.Decimal _SubTotal;
partial void OnSubTotalChanging(global::System.Decimal value);
partial void OnSubTotalChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2622,12 +2622,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("TaxAmt");
OnTaxAmtChanged();
}
-
+
}
private global::System.Decimal _TaxAmt;
partial void OnTaxAmtChanging(global::System.Decimal value);
partial void OnTaxAmtChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2647,12 +2647,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("Freight");
OnFreightChanged();
}
-
+
}
private global::System.Decimal _Freight;
partial void OnFreightChanging(global::System.Decimal value);
partial void OnFreightChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2672,12 +2672,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("TotalDue");
OnTotalDueChanged();
}
-
+
}
private global::System.Decimal _TotalDue;
partial void OnTotalDueChanging(global::System.Decimal value);
partial void OnTotalDueChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2697,12 +2697,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("Comment");
OnCommentChanged();
}
-
+
}
private global::System.String _Comment;
partial void OnCommentChanging(global::System.String value);
partial void OnCommentChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2722,12 +2722,12 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("rowguid");
OnrowguidChanged();
}
-
+
}
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2747,14 +2747,14 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
ReportPropertyChanged("ModifiedDate");
OnModifiedDateChanged();
}
-
+
}
private global::System.DateTime _ModifiedDate;
partial void OnModifiedDateChanging(global::System.DateTime value);
partial void OnModifiedDateChanged();
-
+
#endregion
-
+
#region Navigation Properties
///
/// No Metadata Documentation available.
@@ -2762,7 +2762,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "Address")]
+ [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_BillToAddressID", "Address")]
public Address Address
{
get
@@ -2799,7 +2799,7 @@ public EntityReference AddressReference
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "Address")]
+ [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Address_ShipToAddressID", "Address")]
public Address Address1
{
get
@@ -2836,7 +2836,7 @@ public EntityReference Address1Reference
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "Contact")]
+ [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderHeader_Contact_ContactID", "Contact")]
public Contact Contact
{
get
@@ -2873,7 +2873,7 @@ public EntityReference ContactReference
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
- [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail")]
+ [EdmRelationshipNavigationPropertyAttribute("AdventureWorksModel", "FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail")]
public EntityCollection SalesOrderDetails
{
get
@@ -2890,7 +2890,7 @@ public EntityCollection SalesOrderDetails
}
#endregion
}
-
+
#endregion
-
+
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Source.cs b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Source.cs
index 5104d193f85..8a8e29e67d9 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Source.cs
@@ -80,7 +80,7 @@ public static void ExecuteStoreCommands()
DepartmentID, "Engineering", 350000.00, "2009-09-01", 2);
Console.WriteLine("Number of affected rows: {0}", rowsAffected);
- // Get the DepartmentTest object.
+ // Get the DepartmentTest object.
DepartmentInfo department = context.ExecuteStoreQuery
("select * from Department where DepartmentID= {0}", DepartmentID).FirstOrDefault();
@@ -155,8 +155,8 @@ static public void ObjectStateChanges()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- // The ObjectStateManagerChanged event is raised whenever
- // an entity leaves or enters the context.
+ // The ObjectStateManagerChanged event is raised whenever
+ // an entity leaves or enters the context.
context.ObjectStateManager.ObjectStateManagerChanged += (sender, e) =>
{
Console.WriteLine(string.Format(
@@ -197,7 +197,7 @@ static public void ContextClass()
// Set the DefaultContainerName for the ObjectContext.
// When DefaultContainerName is set, the Entity Framework only
- // searches for the type in the specified container.
+ // searches for the type in the specified container.
// Note that if a type is defined only once in the metadata workspace
// you do not have to set the DefaultContainerName.
context.DefaultContainerName = "AdventureWorksEntities";
@@ -383,7 +383,7 @@ static public void ObjectQuery_ToTraceStringEsql()
{
// Define the Entity SQL query string.
string queryString =
- @"SELECT VALUE product FROM AdventureWorksEntities.Products AS product
+ @"SELECT VALUE product FROM AdventureWorksEntities.Products AS product
WHERE product.ProductID = @productID";
// Define the object query with the query string.
@@ -467,7 +467,7 @@ static public void ObjectQuery_Where()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE product FROM
+ @"SELECT VALUE product FROM
AdventureWorksEntities.Products AS product";
ObjectQuery productQuery1 =
@@ -517,7 +517,7 @@ static public void ObjectQuery_SelectValue()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE product FROM
+ @"SELECT VALUE product FROM
AdventureWorksEntities.Products AS product";
ObjectQuery productQuery1 =
@@ -543,7 +543,7 @@ static public void ObjectQuery_Select()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- string queryString = @"SELECT VALUE product FROM
+ string queryString = @"SELECT VALUE product FROM
AdventureWorksEntities.Products AS product
WHERE product.ProductID > @productID";
@@ -570,7 +570,7 @@ static public void ObjectQuery_OrderBy()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- string queryString = @"SELECT VALUE product
+ string queryString = @"SELECT VALUE product
FROM AdventureWorksEntities.Products AS product";
ObjectQuery productQuery1 =
@@ -597,16 +597,16 @@ static public void ObjectQuery_Intersect()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- string queryString = @"SELECT VALUE product
- FROM AdventureWorksEntities.Products
+ string queryString = @"SELECT VALUE product
+ FROM AdventureWorksEntities.Products
AS product WHERE product.ProductID > @productID1";
ObjectQuery productQuery =
new ObjectQuery(queryString,
context, MergeOption.NoTracking);
- string queryString2 = @"SELECT VALUE product
- FROM AdventureWorksEntities.Products
+ string queryString2 = @"SELECT VALUE product
+ FROM AdventureWorksEntities.Products
AS product WHERE product.ProductID > @productID2";
ObjectQuery productQuery2 =
@@ -642,8 +642,8 @@ static public void Projection_SkipLimit()
int skipValue = 3;
int limitValue = 5;
- // Define a query that returns a "page" or the full
- // Product data using the Skip and Top methods.
+ // Define a query that returns a "page" or the full
+ // Product data using the Skip and Top methods.
// When Top() follows Skip(), it acts like the LIMIT statement.
ObjectQuery query = context.Products
.Skip("it.ListPrice", "@skip",
@@ -769,7 +769,7 @@ static public void ObjectQuery_GroupBy()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- string queryString = @"SELECT VALUE product
+ string queryString = @"SELECT VALUE product
FROM AdventureWorksEntities.Products AS product";
ObjectQuery productQuery =
@@ -798,15 +798,15 @@ static public void ObjectQuery_Except()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- string queryString = @"SELECT VALUE product
+ string queryString = @"SELECT VALUE product
FROM AdventureWorksEntities.Products AS product";
ObjectQuery productQuery =
new ObjectQuery(queryString,
context, MergeOption.NoTracking);
- string queryString2 = @"SELECT VALUE product
- FROM AdventureWorksEntities.Products
+ string queryString2 = @"SELECT VALUE product
+ FROM AdventureWorksEntities.Products
AS product WHERE product.ProductID < @productID";
ObjectQuery productQuery2 =
@@ -838,7 +838,7 @@ static public void ObjectQuery_Distinct_UnionAll()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE product FROM AdventureWorksEntities.Products
+ @"SELECT VALUE product FROM AdventureWorksEntities.Products
AS product WHERE product.ProductID < @productID";
ObjectQuery productQuery =
@@ -857,7 +857,7 @@ static public void ObjectQuery_Distinct_UnionAll()
Console.WriteLine("Result of UnionAll");
Console.WriteLine("------------------");
- // Iterate through the collection of Product items,
+ // Iterate through the collection of Product items,
// after the UnionAll method was called on two queries.
foreach (Product result in productQuery3)
{
@@ -869,7 +869,7 @@ static public void ObjectQuery_Distinct_UnionAll()
Console.WriteLine("------------------");
// Iterate through the collection of Product items.
- // after the Distinct method was called on a query.
+ // after the Distinct method was called on a query.
foreach (Product result in productQuery4)
Console.WriteLine("Product Name: {0}", result.ProductID);
}
@@ -883,8 +883,8 @@ static public void ObjectQuery_Distinct_Union()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- string queryString = @"SELECT VALUE product
- FROM AdventureWorksEntities.Products AS product
+ string queryString = @"SELECT VALUE product
+ FROM AdventureWorksEntities.Products AS product
WHERE product.ProductID < @productID";
ObjectQuery productQuery =
@@ -903,7 +903,7 @@ FROM AdventureWorksEntities.Products AS product
Console.WriteLine("Result of Union");
Console.WriteLine("------------------");
- // Iterate through the collection of Product items,
+ // Iterate through the collection of Product items,
// after the Union method was called on two queries.
foreach (Product result in productQuery3)
{
@@ -944,7 +944,7 @@ static public void ObjectQuery_Parameters()
{
string queryString =
@"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
- AS contact WHERE contact.LastName = @ln
+ AS contact WHERE contact.LastName = @ln
AND contact.FirstName = @fn";
ObjectQuery contactQuery =
@@ -975,7 +975,7 @@ static public void ObjectQuery_Name()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE contact
+ @"SELECT VALUE contact
FROM AdventureWorksEntities.Contacts AS contact";
ObjectQuery contactQuery =
@@ -1000,7 +1000,7 @@ static public void ObjectQuery_ScalarTypeException()
try
{
//
- // Define a query projection that returns
+ // Define a query projection that returns
// a collection with a single scalar result.
ObjectQuery scalarQuery =
new ObjectQuery("100", context);
@@ -1025,7 +1025,7 @@ static public void ObjectQuery_Context()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE contact FROM
+ @"SELECT VALUE contact FROM
AdventureWorksEntities.Contacts AS contact";
ObjectQuery contactQuery =
@@ -1063,7 +1063,7 @@ static public void ObjectQueryConstructors()
foreach (Product result in productQuery2)
Console.WriteLine("Product Name: {0}", result.Name);
- // Call the constructor with the specified query, the ObjectContext,
+ // Call the constructor with the specified query, the ObjectContext,
// and the NoTracking merge option.
ObjectQuery productQuery3 =
new ObjectQuery(queryString,
@@ -1082,7 +1082,7 @@ static public void ObjectParameterCollectionClass_Remove()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
+ @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
AS contact WHERE contact.LastName = @ln AND contact.FirstName = @fn";
ObjectQuery contactQuery =
@@ -1114,8 +1114,8 @@ static public void ObjectParameterCollectionClass_CopyTo()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
- AS contact WHERE contact.LastName = @ln
+ @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
+ AS contact WHERE contact.LastName = @ln
AND contact.FirstName = @fn";
ObjectQuery contactQuery =
@@ -1151,7 +1151,7 @@ static public void ObjectParameterCollectionClass_Count_Add_Indexer()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
+ @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
AS contact WHERE contact.LastName = @ln AND contact.FirstName = @fn";
ObjectQuery contactQuery =
@@ -1184,7 +1184,7 @@ static public void ObjectParameterCollectionClass_ContainsWithParamArg()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
+ @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
AS contact WHERE contact.LastName = @ln AND contact.FirstName = @fn";
ObjectQuery contactQuery =
@@ -1214,7 +1214,7 @@ static public void ObjectParameterCollectionClass_ContainsWithStringArg()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
+ @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
AS contact WHERE contact.LastName = @ln AND contact.FirstName = @fn";
ObjectQuery contactQuery =
@@ -1257,7 +1257,7 @@ static public void ObjectParameterClass()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
+ @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
AS contact WHERE contact.FirstName = @fn";
ObjectParameter param = new ObjectParameter("fn", "Frances");
@@ -1284,7 +1284,7 @@ static public void EntityKeyClass_TryGetObjectByKey()
new KeyValuePair[] {
new KeyValuePair("SalesOrderID", 43680) };
- // Create the key for a specific SalesOrderHeader object.
+ // Create the key for a specific SalesOrderHeader object.
EntityKey key = new EntityKey("AdventureWorksEntities.SalesOrderHeaders", entityKeyValues);
// Get the object from the context or the persisted store by its key.
@@ -1312,10 +1312,10 @@ static public void EntityKeyClass_GetObjectByKey_CreateKey()
{
// Define the entity key values.
IEnumerable> entityKeyValues =
- new KeyValuePair[] {
+ new KeyValuePair[] {
new KeyValuePair("SalesOrderID", 43680) };
- // Create the key for a specific SalesOrderHeader object.
+ // Create the key for a specific SalesOrderHeader object.
EntityKey key = new EntityKey("AdventureWorksEntities.SalesOrderHeaders", entityKeyValues);
// Get the object from the context or the persisted store by its key.
@@ -1340,7 +1340,7 @@ static public void CreateQuery()
new AdventureWorksEntities())
{
string queryString =
- @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
+ @"SELECT VALUE contact FROM AdventureWorksEntities.Contacts
AS contact WHERE contact.FirstName = @fn";
ObjectQuery contactQuery =
@@ -1523,7 +1523,7 @@ public static void Projection_Navigation()
new AdventureWorksEntities())
{
//
- // Define a query that returns a nested
+ // Define a query that returns a nested
// DbDataRecord for the projection.
ObjectQuery query =
context.Contacts.Select("it.FirstName, "
@@ -1539,7 +1539,7 @@ public static void Projection_Navigation()
Console.WriteLine("First Name {0}: ", rec[0]);
List list = rec[2]
as List;
- // Display SalesOrderHeader information
+ // Display SalesOrderHeader information
// associated with the contact.
foreach (SalesOrderHeader soh in list)
{
@@ -1602,7 +1602,7 @@ public static void ReadFromBinaryStream()
Contact contact = (Contact)formatter.Deserialize(stream);
context.Attach(contact);
- // Display information for each item
+ // Display information for each item
// in the orders that belong to the first contact.
foreach (SalesOrderHeader order in contact.SalesOrderHeaders)
{
@@ -1643,7 +1643,7 @@ private static MemoryStream SerializeToBinaryStream(string lastName)
// Define a customer contact.
Contact customer;
- // Create a Contact query with a path that returns
+ // Create a Contact query with a path that returns
// orders and items for a contact.
ObjectQuery query =
context.Contacts.Include("SalesOrderHeaders.SalesOrderDetails");
@@ -1698,9 +1698,9 @@ public static Boolean CleanupOrders()
}
//
- // This method is called to detach SalesOrderHeader objects and
+ // This method is called to detach SalesOrderHeader objects and
// related SalesOrderDetail objects from the supplied object
- // context when no longer needed by the application.
+ // context when no longer needed by the application.
// Once detached, the resources can be garbage collected.
private static void DetachOrders(ObjectContext context,
SalesOrderHeader order)
@@ -1795,7 +1795,7 @@ public static void FilterQueryEsql()
// Specify the Entity SQL query that returns only online orders
// more than the specified amount.
- string queryString = @"SELECT VALUE o FROM AdventureWorksEntities.SalesOrderHeaders AS o
+ string queryString = @"SELECT VALUE o FROM AdventureWorksEntities.SalesOrderHeaders AS o
WHERE o.OnlineOrderFlag = TRUE AND o.TotalDue > @ordercost";
// Define an ObjectQuery and pass the maxOrderCost parameter.
@@ -1825,7 +1825,7 @@ public static void FilterQuery()
// Specify the order amount.
int orderCost = 2500;
- // Define an ObjectQuery that returns only online orders
+ // Define an ObjectQuery that returns only online orders
// more than the specified amount.
ObjectQuery onlineOrders =
context.SalesOrderHeaders
@@ -1851,7 +1851,7 @@ public static void SortQueryLinq()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- // Define a query that returns a list
+ // Define a query that returns a list
// of Contact objects sorted by last name.
var sortedNames =
from n in context.Contacts
@@ -1870,15 +1870,15 @@ public static void SortQueryEsql()
{
Console.WriteLine("Starting method 'SortQueryEsql'");
//
- // Define the Entity SQL query string that returns
+ // Define the Entity SQL query string that returns
// Contact objects sorted by last name.
- string queryString = @"SELECT VALUE contact FROM Contacts AS contact
+ string queryString = @"SELECT VALUE contact FROM Contacts AS contact
Order By contact.LastName";
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- // Define an ObjectQuery that returns a collection
+ // Define an ObjectQuery that returns a collection
// of Contact objects sorted by last name.
ObjectQuery query =
new ObjectQuery(queryString, context);
@@ -1898,7 +1898,7 @@ public static void SortQuery()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- // Define an ObjectQuery that returns a collection
+ // Define an ObjectQuery that returns a collection
// of Contact objects sorted by last name.
ObjectQuery query =
context.Contacts.OrderBy("it.LastName");
@@ -1928,8 +1928,8 @@ public static void QueryEntityCollection()
select customers).First();
// You do not have to call the Load method to load the orders for the customer,
- // because lazy loading is set to true
- // by the constructor of the AdventureWorksEntities object.
+ // because lazy loading is set to true
+ // by the constructor of the AdventureWorksEntities object.
// With lazy loading set to true the related objects are loaded when
// you access the navigation property. In this case SalesOrderHeaders.
@@ -1966,7 +1966,7 @@ public static void QueryCreateSourceQuery()
where customers.ContactID == customerId
select customers).First();
- // Use CreateSourceQuery to generate a query that returns
+ // Use CreateSourceQuery to generate a query that returns
// only the online orders that have shipped.
var shippedOrders =
from orders in customer.SalesOrderHeaders.CreateSourceQuery()
@@ -1979,8 +1979,8 @@ from orders in customer.SalesOrderHeaders.CreateSourceQuery()
shippedOrders.Count());
// You do not have to call the Load method to load the orders for the customer,
- // because lazy loading is set to true
- // by the constructor of the AdventureWorksEntities object.
+ // because lazy loading is set to true
+ // by the constructor of the AdventureWorksEntities object.
// With lazy loading set to true the related objects are loaded when
// you access the navigation property. In this case SalesOrderHeaders.
@@ -2039,14 +2039,14 @@ public static void QueryWithMultipleSpan()
new AdventureWorksEntities())
{
//
- // Create a SalesOrderHeader query with two query paths,
- // one that returns order items and a second that returns the
+ // Create a SalesOrderHeader query with two query paths,
+ // one that returns order items and a second that returns the
// billing and shipping addresses for each order.
ObjectQuery query =
context.SalesOrderHeaders.Include("SalesOrderDetails").Include("Address");
//
- // Execute the query and display information for each item
+ // Execute the query and display information for each item
// in the orders that belong to the first contact.
foreach (SalesOrderHeader order in query.Top("10"))
{
@@ -2082,7 +2082,7 @@ public static void OpenConnection()
new AdventureWorksEntities())
{
//
- // Explicitly open the connection.
+ // Explicitly open the connection.
context.Connection.Open();
//
@@ -2134,8 +2134,8 @@ static public void OpenConnection_Long()
order.Status = 1;
// You do not have to call the Load method to load the details for the order,
- // because lazy loading is set to true
- // by the constructor of the AdventureWorksEntities object.
+ // because lazy loading is set to true
+ // by the constructor of the AdventureWorksEntities object.
// With lazy loading set to true the related objects are loaded when
// you access the navigation property. In this case SalesOrderDetails.
@@ -2181,8 +2181,8 @@ static public void OpenConnection_Long()
}
finally
{
- // Explicitly dispose of the context,
- // which closes the connection.
+ // Explicitly dispose of the context,
+ // which closes the connection.
context.Dispose();
}
//
@@ -2223,8 +2223,8 @@ public static void OpenEntityConnection()
order.Status = 1;
// You do not have to call the Load method to load the details for the order,
- // because lazy loading is set to true
- // by the constructor of the AdventureWorksEntities object.
+ // because lazy loading is set to true
+ // by the constructor of the AdventureWorksEntities object.
// With lazy loading set to true the related objects are loaded when
// you access the navigation property. In this case SalesOrderDetails.
@@ -2270,7 +2270,7 @@ public static void OpenEntityConnection()
}
finally
{
- // Explicitly dispose of the context and the connection.
+ // Explicitly dispose of the context and the connection.
context.Dispose();
conn.Dispose();
}
@@ -2330,8 +2330,8 @@ private static void AttachObjectGraph(
SalesOrderHeader detachedOrder,
List detachedItems)
{
- // Define the relationships by adding each SalesOrderDetail
- // object in the detachedItems List collection to the
+ // Define the relationships by adding each SalesOrderDetail
+ // object in the detachedItems List collection to the
// EntityCollection on the SalesOrderDetail navigation property of detachedOrder.
foreach (SalesOrderDetail item in detachedItems)
{
@@ -2352,7 +2352,7 @@ private static void AttachRelatedObjects(
currentContext.Attach(detachedOrder);
// Attach each detachedItem to the context, and define each relationship
- // by attaching the attached SalesOrderDetail object to the EntityCollection on
+ // by attaching the attached SalesOrderDetail object to the EntityCollection on
// the SalesOrderDetail navigation property of the now attached detachedOrder.
foreach (SalesOrderDetail item in detachedItems)
{
@@ -2371,7 +2371,7 @@ public static void DetachAndUpdateItem()
SalesOrderDetail originalItem =
context.SalesOrderDetails.First();
- // Get the order for the item and set the status to 1,
+ // Get the order for the item and set the status to 1,
// or an exception will occur when the item Qty is changed.
if (!originalItem.SalesOrderHeaderReference.IsLoaded)
{
@@ -2422,7 +2422,7 @@ private static void ApplyItemUpdates(SalesOrderDetail originalItem,
new AdventureWorksEntities())
{
context.SalesOrderDetails.Attach(updatedItem);
- // Check if the ID is 0, if it is the item is new.
+ // Check if the ID is 0, if it is the item is new.
// In this case we need to chage the state to Added.
if (updatedItem.SalesOrderDetailID == 0)
{
@@ -2433,12 +2433,12 @@ private static void ApplyItemUpdates(SalesOrderDetail originalItem,
else
{
// If the SalesOrderDetailID is not 0, then the item is not new
- // and needs to be updated. Because we already added the
+ // and needs to be updated. Because we already added the
// updated object to the context we need to apply the original values.
- // If we attached originalItem to the context
+ // If we attached originalItem to the context
// we would need to apply the current values:
// context.ApplyCurrentValues("SalesOrderDetails", updatedItem);
- // Applying current or original values, changes the state
+ // Applying current or original values, changes the state
// of the attached object to Modified.
context.ApplyOriginalValues("SalesOrderDetails", originalItem);
}
@@ -2446,25 +2446,25 @@ private static void ApplyItemUpdates(SalesOrderDetail originalItem,
}
}
//
-
+
//
private static void ApplyItemUpdates(SalesOrderDetail updatedItem)
{
- // Define an ObjectStateEntry and EntityKey for the current object.
+ // Define an ObjectStateEntry and EntityKey for the current object.
EntityKey key = default(EntityKey);
object originalItem = null;
using (AdventureWorksEntities context = new AdventureWorksEntities())
{
- // Create the detached object's entity key.
+ // Create the detached object's entity key.
key = context.CreateEntityKey("SalesOrderDetails", updatedItem);
- // Get the original item based on the entity key from the context
- // or from the database.
+ // Get the original item based on the entity key from the context
+ // or from the database.
if (context.TryGetObjectByKey(key, out originalItem))
{
- // Call the ApplyCurrentValues method to apply changes
- // from the updated item to the original version.
+ // Call the ApplyCurrentValues method to apply changes
+ // from the updated item to the original version.
context.ApplyCurrentValues(key.EntitySetName, updatedItem);
}
@@ -2472,7 +2472,7 @@ private static void ApplyItemUpdates(SalesOrderDetail updatedItem)
}
}
//
-
+
public static void ChangeItemQuantity()
{
Console.WriteLine("Starting method 'ChangeItemQuantity'");
@@ -2518,8 +2518,8 @@ public static void ChangeObjectRelationship()
context.SalesOrderHeaders.Single(o => o.SalesOrderID == orderId);
// You do not have to call the Load method to load the addresses for the order,
- // because lazy loading is set to true
- // by the constructor of the AdventureWorksEntities object.
+ // because lazy loading is set to true
+ // by the constructor of the AdventureWorksEntities object.
// With lazy loading set to true the related objects are loaded when
// you access the navigation property. In this case Address.
@@ -2690,8 +2690,8 @@ static public void QueryWithAlias()
.Where("it.StandardCost > @cost", new ObjectParameter("cost", cost));
//
- // Set the Name property for the query and then
- // use that name as the alias in the subsequent
+ // Set the Name property for the query and then
+ // use that name as the alias in the subsequent
// OrderBy method.
productQuery.Name = "product";
ObjectQuery filteredProduct = productQuery
@@ -2739,14 +2739,14 @@ public static void QueryWithSpan()
new AdventureWorksEntities())
{
//
- // Define an object query with a path that returns
+ // Define an object query with a path that returns
// orders and items for a specific contact.
Contact contact =
context.Contacts.Include("SalesOrderHeaders.SalesOrderDetails")
.FirstOrDefault();
//
- // Execute the query and display information for each item
+ // Execute the query and display information for each item
// in the orders that belong to the first contact.
foreach (SalesOrderHeader order in contact
.SalesOrderHeaders)
@@ -2774,14 +2774,14 @@ public static void QueryWithSpanLinq()
new AdventureWorksEntities())
{
//
- // Define a LINQ query with a path that returns
+ // Define a LINQ query with a path that returns
// orders and items for a contact.
var contacts = (from contact in context.Contacts
.Include("SalesOrderHeaders.SalesOrderDetails")
select contact).FirstOrDefault();
//
- // Execute the query and display information for each item
+ // Execute the query and display information for each item
// in the orders that belong to the contact.
foreach (SalesOrderHeader order in contacts
.SalesOrderHeaders)
@@ -2809,8 +2809,8 @@ public static void QueryWithSpanEsql()
new AdventureWorksEntities())
{
//
- // Define an object query with a path that returns
- // orders and items for a specific contact.
+ // Define an object query with a path that returns
+ // orders and items for a specific contact.
string queryString =
@"SELECT VALUE TOP(1) contact FROM " +
"AdventureWorksEntities.Contacts AS contact";
@@ -2824,7 +2824,7 @@ public static void QueryWithSpanEsql()
.FirstOrDefault();
//
- // Execute the query and display information for each item
+ // Execute the query and display information for each item
// in the orders that belong to the first contact.
foreach (SalesOrderHeader order in contact
.SalesOrderHeaders)
@@ -2867,7 +2867,7 @@ public static void QueryEntityTypeCollection()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- ObjectQuery query= context.Contacts.Where("it.LastName==@ln",
+ ObjectQuery query= context.Contacts.Where("it.LastName==@ln",
new ObjectParameter("ln", "Zhou"));
// Iterate through the collection of Contact items.
@@ -3060,8 +3060,8 @@ public static void ModifyObjects()
order.ShipDate = DateTime.Today;
// You do not have to call the Load method to load the details for the order,
- // because lazy loading is set to true
- // by the constructor of the AdventureWorksEntities object.
+ // because lazy loading is set to true
+ // by the constructor of the AdventureWorksEntities object.
// With lazy loading set to true the related objects are loaded when
// you access the navigation property. In this case SalesOrderDetails.
@@ -3245,8 +3245,8 @@ public static void HandleConflicts()
}
catch (OptimisticConcurrencyException)
{
- // Resolve the concurrency conflict by refreshing the
- // object context before re-saving changes.
+ // Resolve the concurrency conflict by refreshing the
+ // object context before re-saving changes.
context.Refresh(RefreshMode.ClientWins, orders);
// Save changes.
@@ -3326,7 +3326,7 @@ public static void DirectlyExecuteCommandsAgainstStore()
using (SchoolEntities context =
new SchoolEntities())
{
- // The following three queries demonstrate
+ // The following three queries demonstrate
// three different ways of passing a parameter.
// The queries return a string result type.
@@ -3372,7 +3372,7 @@ public static void TranslateReader()
DbCommand cmd = con.CreateCommand();
cmd.CommandText = @"SELECT * FROM Department";
- // Create a reader that contains rows of entity data.
+ // Create a reader that contains rows of entity data.
using (DbDataReader rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
{
using (SchoolEntities context =
@@ -3408,7 +3408,7 @@ public static void ExecuteStoredProc()
}
//
}
-
+
public static void ExecuteStoredProcWithOutputParams()
{
Console.WriteLine("Starting method 'ExecuteStoredProcWithOutputParams'");
@@ -3423,7 +3423,7 @@ public static void ExecuteStoredProcWithOutputParams()
}
//
}
-
+
public static void ExecuteFunctionWithOutParam()
{
Console.WriteLine("Starting method 'ExecuteFunctionWithOutParam'");
@@ -3495,7 +3495,7 @@ static public void AddNewObjectsWithFK()
Person newStudent = new Person
{
// The database will generate PersonID.
- // The object context will get the ID
+ // The object context will get the ID
// After the SaveChanges is called.
PersonID = 0,
LastName = "Li",
@@ -3504,20 +3504,20 @@ static public void AddNewObjectsWithFK()
StudentGrade newStudentGrade = new StudentGrade
{
// The database will generate EnrollmentID.
- // The object context will get the ID
+ // The object context will get the ID
// After the SaveChanges is called.
EnrollmentID = 0,
Grade = 4.0M,
StudentID = 50
};
- // Add newStudent to object context.
+ // Add newStudent to object context.
// The newStudent's state will change from Detached to Added.
context.People.AddObject(newStudent);
// To associate the new objects you can do one of the following:
// Add the new dependent object to the principal object: newStudent.StudentGrades.Add(newStudentGrade).
- // Assign the reference (principal) object to the navigation property of the
+ // Assign the reference (principal) object to the navigation property of the
// dependent object: newStudentGrade.Person = newStudent.
// Both of these methods will synchronize the navigation properties on both ends of the relationship.
@@ -3540,7 +3540,7 @@ static public void CreateNewObjectSetFKAndRef()
// The following example creates a new StudentGrade object and associates
// the StudentGrade with the Course and Person by
- // setting the foreign key properties.
+ // setting the foreign key properties.
using (SchoolEntities context = new SchoolEntities())
{
@@ -3549,8 +3549,8 @@ static public void CreateNewObjectSetFKAndRef()
// The database will generate the EnrollmentID.
EnrollmentID = 0,
Grade = 4.0M,
- // To create the association between the Course and StudentGrade,
- // and the Student and the StudentGrade, set the foreign key property
+ // To create the association between the Course and StudentGrade,
+ // and the Student and the StudentGrade, set the foreign key property
// to the ID of the principal.
CourseID = 4022,
StudentID = 17,
@@ -3565,7 +3565,7 @@ static public void CreateNewObjectSetFKAndRef()
// the lazy loading option is set to true in the constructor of SchoolEntities.
Console.WriteLine("Student ID {0}:", newStudentGrade.Person.PersonID);
Console.WriteLine("Course ID {0}:", newStudentGrade.Course.CourseID);
-
+
context.SaveChanges();
}
//
@@ -3574,12 +3574,12 @@ static public void CreateNewObjectSetFKAndRef()
// The following example creates a new StudentGrade and associates
// the StudentGrade with the Course and Person by
// setting the navigation properties to the Course and Person objects that were returned
- // by the query.
+ // by the query.
// You do not need to call AddObject() in order to add the grade object
- // to the context, because when you assign the reference
+ // to the context, because when you assign the reference
// to the navigation property the objects on both ends get synchronized by the Entity Framework.
// Note, that the Entity Framework will not synchronize the ends untill the SaveChanges method
- // is called if your objects do not meet the change tracking requirements.
+ // is called if your objects do not meet the change tracking requirements.
using (var context = new SchoolEntities())
{
int courseID = 4022;
@@ -3671,7 +3671,7 @@ public static void DDLTest()
}
// View the database creation script.
Console.WriteLine(context.CreateDatabaseScript());
- // Create the new database instance based on the storage (SSDL) section
+ // Create the new database instance based on the storage (SSDL) section
// of the .edmx file.
context.CreateDatabase();
@@ -3685,11 +3685,11 @@ public static void DDLTest()
};
context.Departments.AddObject(dpt);
- // An entity has a temporary key
+ // An entity has a temporary key
// until it is saved to the database.
Console.WriteLine(dpt.EntityKey.IsTemporary);
context.SaveChanges();
- // The object was saved and the key
+ // The object was saved and the key
// is not temporary any more.
Console.WriteLine(dpt.EntityKey.IsTemporary);
}
@@ -3720,7 +3720,7 @@ public static void DDLTest2()
// View the database creation script.
Console.WriteLine(context.CreateDatabaseScript());
- // Create the new database instance based on the storage (SSDL) section
+ // Create the new database instance based on the storage (SSDL) section
// of the .edmx file.
context.CreateDatabase();
@@ -3781,7 +3781,7 @@ public void UpdateOrderTotal()
decimal taxRatePercent = GetCurrentTaxRate();
decimal freightPercent = GetCurrentFreight();
- // If the items for this order are loaded or if the order is
+ // If the items for this order are loaded or if the order is
// newly added, then recalculate the subtotal as it may have changed.
if (this.SalesOrderDetails.IsLoaded ||
EntityState == EntityState.Added)
@@ -3826,7 +3826,7 @@ public partial class SalesOrderDetail : EntityObject
{
partial void OnOrderQtyChanging(short value)
{
- // Only handle this change for existing SalesOrderHeader
+ // Only handle this change for existing SalesOrderHeader
// objects that are attached to an object context. If the item
// is detached then we cannot access or load the related order.
if (EntityState != EntityState.Detached)
@@ -3866,7 +3866,7 @@ partial void OnOrderQtyChanging(short value)
}
partial void OnOrderQtyChanged()
{
- // Only handle this change for existing SalesOrderHeader
+ // Only handle this change for existing SalesOrderHeader
// objects that are attached to an object context.
if (EntityState != EntityState.Detached)
{
@@ -3907,21 +3907,21 @@ public partial class SalesOrderHeader
// SalesOrderHeader default constructor.
public SalesOrderHeader()
{
- // Register the handler for changes to the
+ // Register the handler for changes to the
// shipping address (Address1) reference.
this.AddressReference.AssociationChanged
+= new CollectionChangeEventHandler(ShippingAddress_Changed);
}
- // AssociationChanged handler for the relationship
+ // AssociationChanged handler for the relationship
// between the order and the shipping address.
private void ShippingAddress_Changed(object sender,
CollectionChangeEventArgs e)
{
- // Check for a related reference being removed.
+ // Check for a related reference being removed.
if (e.Action == CollectionChangeAction.Remove)
{
- // Check the order status and raise an exception if
+ // Check the order status and raise an exception if
// the order can no longer be changed.
if (this.Status > 3)
{
@@ -3958,7 +3958,7 @@ public class AdventureWorksProxy
public AdventureWorksProxy()
{
- // When the object is initialized, register the
+ // When the object is initialized, register the
// handler for the SavingChanges event.
contextProxy.SavingChanges
+= new EventHandler(context_SavingChanges);
@@ -3987,12 +3987,12 @@ private void context_SavingChanges(object sender, EventArgs e)
context.ObjectStateManager.GetObjectStateEntries(
EntityState.Added | EntityState.Modified))
{
- // Find an object state entry for a SalesOrderHeader object.
+ // Find an object state entry for a SalesOrderHeader object.
if (!entry.IsRelationship && (entry.Entity.GetType() == typeof(SalesOrderHeader)))
{
SalesOrderHeader orderToCheck = entry.Entity as SalesOrderHeader;
- // Call a helper method that performs string checking
+ // Call a helper method that performs string checking
// on the Comment property.
string textNotAllowed = Validator.CheckStringForLanguage(
orderToCheck.Comment);
@@ -4040,12 +4040,12 @@ private static void context_SavingChanges(object sender, EventArgs e)
((ObjectContext)sender).ObjectStateManager.GetObjectStateEntries(
EntityState.Added | EntityState.Modified))
{
- // Find an object state entry for a SalesOrderHeader object.
+ // Find an object state entry for a SalesOrderHeader object.
if (!entry.IsRelationship && (entry.Entity.GetType() == typeof(SalesOrderHeader)))
{
SalesOrderHeader orderToCheck = entry.Entity as SalesOrderHeader;
- // Call a helper method that performs string checking
+ // Call a helper method that performs string checking
// on the Comment property.
string textNotAllowed = Validator.CheckStringForLanguage(
orderToCheck.Comment);
@@ -4108,7 +4108,7 @@ static public void ManipulateObjects()
// Change the relationships.
studentGrade.CourseID = 5;
studentGrade.StudentID = 10;
- // The client calls a method on a service to save the updates.
+ // The client calls a method on a service to save the updates.
SaveUpdates(studentGrade);
//
}
@@ -4122,10 +4122,10 @@ public void EnableLazyLoading()
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
- // You do not have to set context.ContextOptions.LazyLoadingEnabled to true
+ // You do not have to set context.ContextOptions.LazyLoadingEnabled to true
// if you used the Entity Framework to generate the object layer.
// The generated object context type sets lazy loading to true
- // in the constructor.
+ // in the constructor.
context.ContextOptions.LazyLoadingEnabled = true;
// Display ten contacts and select a contact
@@ -4136,7 +4136,7 @@ public void EnableLazyLoading()
Console.WriteLine("Select a customer:");
Int32 contactID = Convert.ToInt32(Console.ReadLine());
- // Get a specified customer by contact ID.
+ // Get a specified customer by contact ID.
var contact = context.Contacts.Where(c => c.ContactID == contactID).FirstOrDefault();
// If lazy loading was not enabled no SalesOrderHeaders would be loaded for the contact.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Transaction.cs b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Transaction.cs
index 03750cde215..cbd6ebe28a1 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Transaction.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Transaction.cs
@@ -59,7 +59,7 @@ AdventureWorksEntities context
// Add new item to the order.
order.SalesOrderDetails.Add(newItem);
- // Save changes pessimistically. This means that changes
+ // Save changes pessimistically. This means that changes
// must be accepted manually once the transaction succeeds.
context.SaveChanges(SaveOptions.DetectChangesBeforeSave);
@@ -91,7 +91,7 @@ AdventureWorksEntities context
catch (Exception ex)
{
// Handle errors and deadlocks here and retry if needed.
- // Allow an UpdateException to pass through and
+ // Allow an UpdateException to pass through and
// retry, otherwise stop the execution.
if (ex.GetType() != typeof(UpdateException))
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/adventureworksmodel.designer.cs b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/adventureworksmodel.designer.cs
index 9ae3c7b8163..bbb91e31347 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/adventureworksmodel.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/adventureworksmodel.designer.cs
@@ -28,14 +28,14 @@
namespace ObjectServicesConceptsCS
{
#region Contexts
-
+
///
/// No Metadata Documentation available.
///
public partial class AdventureWorksEntities : ObjectContext
{
#region Constructors
-
+
///
/// Initializes a new AdventureWorksEntities object using the connection string found in the 'AdventureWorksEntities' section of the application configuration file.
///
@@ -44,7 +44,7 @@ public AdventureWorksEntities() : base("name=AdventureWorksEntities", "Adventure
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
///
/// Initialize a new AdventureWorksEntities object.
///
@@ -53,7 +53,7 @@ public AdventureWorksEntities(string connectionString) : base(connectionString,
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
///
/// Initialize a new AdventureWorksEntities object.
///
@@ -62,17 +62,17 @@ public AdventureWorksEntities(EntityConnection connection) : base(connection, "A
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
#endregion
-
+
#region Partial Methods
-
+
partial void OnContextCreated();
-
+
#endregion
-
+
#region ObjectSet Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -88,7 +88,7 @@ public ObjectSet Addresses
}
}
private ObjectSet _Addresses;
-
+
///
/// No Metadata Documentation available.
///
@@ -104,7 +104,7 @@ public ObjectSet Contacts
}
}
private ObjectSet _Contacts;
-
+
///
/// No Metadata Documentation available.
///
@@ -120,7 +120,7 @@ public ObjectSet Products
}
}
private ObjectSet _Products;
-
+
///
/// No Metadata Documentation available.
///
@@ -136,7 +136,7 @@ public ObjectSet SalesOrderDetails
}
}
private ObjectSet _SalesOrderDetails;
-
+
///
/// No Metadata Documentation available.
///
@@ -155,7 +155,7 @@ public ObjectSet SalesOrderHeaders
#endregion
#region AddTo Methods
-
+
///
/// Deprecated Method for adding a new object to the Addresses EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -163,7 +163,7 @@ public void AddToAddresses(Address address)
{
base.AddObject("Addresses", address);
}
-
+
///
/// Deprecated Method for adding a new object to the Contacts EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -171,7 +171,7 @@ public void AddToContacts(Contact contact)
{
base.AddObject("Contacts", contact);
}
-
+
///
/// Deprecated Method for adding a new object to the Products EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -179,7 +179,7 @@ public void AddToProducts(Product product)
{
base.AddObject("Products", product);
}
-
+
///
/// Deprecated Method for adding a new object to the SalesOrderDetails EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -187,7 +187,7 @@ public void AddToSalesOrderDetails(SalesOrderDetail salesOrderDetail)
{
base.AddObject("SalesOrderDetails", salesOrderDetail);
}
-
+
///
/// Deprecated Method for adding a new object to the SalesOrderHeaders EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -198,12 +198,12 @@ public void AddToSalesOrderHeaders(SalesOrderHeader salesOrderHeader)
#endregion
}
-
+
#endregion
-
+
#region Entities
-
+
///
/// No Metadata Documentation available.
///
@@ -213,7 +213,7 @@ public void AddToSalesOrderHeaders(SalesOrderHeader salesOrderHeader)
public partial class Address : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Address object.
///
@@ -239,7 +239,7 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -266,7 +266,7 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
private global::System.Int32 _AddressID;
partial void OnAddressIDChanging(global::System.Int32 value);
partial void OnAddressIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -290,7 +290,7 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
private global::System.String _AddressLine1;
partial void OnAddressLine1Changing(global::System.String value);
partial void OnAddressLine1Changed();
-
+
///
/// No Metadata Documentation available.
///
@@ -314,7 +314,7 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
private global::System.String _AddressLine2;
partial void OnAddressLine2Changing(global::System.String value);
partial void OnAddressLine2Changed();
-
+
///
/// No Metadata Documentation available.
///
@@ -338,7 +338,7 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
private global::System.String _City;
partial void OnCityChanging(global::System.String value);
partial void OnCityChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -362,7 +362,7 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
private global::System.Int32 _StateProvinceID;
partial void OnStateProvinceIDChanging(global::System.Int32 value);
partial void OnStateProvinceIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -386,7 +386,7 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
private global::System.String _PostalCode;
partial void OnPostalCodeChanging(global::System.String value);
partial void OnPostalCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -410,7 +410,7 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -436,9 +436,9 @@ public static Address CreateAddress(global::System.Int32 addressID, global::Syst
partial void OnModifiedDateChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -460,7 +460,7 @@ public EntityCollection SalesOrderHeaders
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -485,7 +485,7 @@ public EntityCollection SalesOrderHeaders1
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -495,7 +495,7 @@ public EntityCollection SalesOrderHeaders1
public partial class Contact : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Contact object.
///
@@ -527,7 +527,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -554,7 +554,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.Int32 _ContactID;
partial void OnContactIDChanging(global::System.Int32 value);
partial void OnContactIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -578,7 +578,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.Boolean _NameStyle;
partial void OnNameStyleChanging(global::System.Boolean value);
partial void OnNameStyleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -602,7 +602,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.String _Title;
partial void OnTitleChanging(global::System.String value);
partial void OnTitleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -626,7 +626,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.String _FirstName;
partial void OnFirstNameChanging(global::System.String value);
partial void OnFirstNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -650,7 +650,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.String _MiddleName;
partial void OnMiddleNameChanging(global::System.String value);
partial void OnMiddleNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -674,7 +674,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.String _LastName;
partial void OnLastNameChanging(global::System.String value);
partial void OnLastNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -698,7 +698,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.String _Suffix;
partial void OnSuffixChanging(global::System.String value);
partial void OnSuffixChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -722,7 +722,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.Int32 _EmailPromotion;
partial void OnEmailPromotionChanging(global::System.Int32 value);
partial void OnEmailPromotionChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -746,7 +746,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.String _PasswordHash;
partial void OnPasswordHashChanging(global::System.String value);
partial void OnPasswordHashChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -770,7 +770,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.String _PasswordSalt;
partial void OnPasswordSaltChanging(global::System.String value);
partial void OnPasswordSaltChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -794,7 +794,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.String _AdditionalContactInfo;
partial void OnAdditionalContactInfoChanging(global::System.String value);
partial void OnAdditionalContactInfoChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -818,7 +818,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -845,7 +845,7 @@ public static Contact CreateContact(global::System.Int32 contactID, global::Syst
#endregion
#region Complex Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -878,9 +878,9 @@ public EmailPhone EmailPhoneComplexProperty
partial void OnEmailPhoneComplexPropertyChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -905,7 +905,7 @@ public EntityCollection SalesOrderHeaders
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -915,7 +915,7 @@ public EntityCollection SalesOrderHeaders
public partial class Product : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Product object.
///
@@ -953,7 +953,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -980,7 +980,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.
///
@@ -1004,7 +1004,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _Name;
partial void OnNameChanging(global::System.String value);
partial void OnNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1028,7 +1028,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _ProductNumber;
partial void OnProductNumberChanging(global::System.String value);
partial void OnProductNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1052,7 +1052,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Boolean _MakeFlag;
partial void OnMakeFlagChanging(global::System.Boolean value);
partial void OnMakeFlagChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1076,7 +1076,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Boolean _FinishedGoodsFlag;
partial void OnFinishedGoodsFlagChanging(global::System.Boolean value);
partial void OnFinishedGoodsFlagChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1100,7 +1100,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _Color;
partial void OnColorChanging(global::System.String value);
partial void OnColorChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1124,7 +1124,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Int16 _SafetyStockLevel;
partial void OnSafetyStockLevelChanging(global::System.Int16 value);
partial void OnSafetyStockLevelChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1148,7 +1148,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Int16 _ReorderPoint;
partial void OnReorderPointChanging(global::System.Int16 value);
partial void OnReorderPointChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1172,7 +1172,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Decimal _StandardCost;
partial void OnStandardCostChanging(global::System.Decimal value);
partial void OnStandardCostChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1196,7 +1196,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Decimal _ListPrice;
partial void OnListPriceChanging(global::System.Decimal value);
partial void OnListPriceChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1220,7 +1220,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _Size;
partial void OnSizeChanging(global::System.String value);
partial void OnSizeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1244,7 +1244,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _SizeUnitMeasureCode;
partial void OnSizeUnitMeasureCodeChanging(global::System.String value);
partial void OnSizeUnitMeasureCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1268,7 +1268,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _WeightUnitMeasureCode;
partial void OnWeightUnitMeasureCodeChanging(global::System.String value);
partial void OnWeightUnitMeasureCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1292,7 +1292,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _Weight;
partial void OnWeightChanging(Nullable value);
partial void OnWeightChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1316,7 +1316,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Int32 _DaysToManufacture;
partial void OnDaysToManufactureChanging(global::System.Int32 value);
partial void OnDaysToManufactureChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1340,7 +1340,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _ProductLine;
partial void OnProductLineChanging(global::System.String value);
partial void OnProductLineChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1364,7 +1364,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _Class;
partial void OnClassChanging(global::System.String value);
partial void OnClassChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1388,7 +1388,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.String _Style;
partial void OnStyleChanging(global::System.String value);
partial void OnStyleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1412,7 +1412,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _ProductSubcategoryID;
partial void OnProductSubcategoryIDChanging(Nullable value);
partial void OnProductSubcategoryIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1436,7 +1436,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _ProductModelID;
partial void OnProductModelIDChanging(Nullable value);
partial void OnProductModelIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1460,7 +1460,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.DateTime _SellStartDate;
partial void OnSellStartDateChanging(global::System.DateTime value);
partial void OnSellStartDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1484,7 +1484,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _SellEndDate;
partial void OnSellEndDateChanging(Nullable value);
partial void OnSellEndDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1508,7 +1508,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private Nullable _DiscontinuedDate;
partial void OnDiscontinuedDateChanging(Nullable value);
partial void OnDiscontinuedDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1532,7 +1532,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1558,9 +1558,9 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
partial void OnModifiedDateChanged();
#endregion
-
+
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1570,7 +1570,7 @@ public static Product CreateProduct(global::System.Int32 productID, global::Syst
public partial class SalesOrderDetail : EntityObject
{
#region Factory Method
-
+
///
/// Create a new SalesOrderDetail object.
///
@@ -1604,7 +1604,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1631,7 +1631,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.Int32 _SalesOrderID;
partial void OnSalesOrderIDChanging(global::System.Int32 value);
partial void OnSalesOrderIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1658,7 +1658,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.Int32 _SalesOrderDetailID;
partial void OnSalesOrderDetailIDChanging(global::System.Int32 value);
partial void OnSalesOrderDetailIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1682,7 +1682,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.String _CarrierTrackingNumber;
partial void OnCarrierTrackingNumberChanging(global::System.String value);
partial void OnCarrierTrackingNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1706,7 +1706,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.Int16 _OrderQty;
partial void OnOrderQtyChanging(global::System.Int16 value);
partial void OnOrderQtyChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1730,7 +1730,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.Int32 _ProductID;
partial void OnProductIDChanging(global::System.Int32 value);
partial void OnProductIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1754,7 +1754,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.Int32 _SpecialOfferID;
partial void OnSpecialOfferIDChanging(global::System.Int32 value);
partial void OnSpecialOfferIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1778,7 +1778,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.Decimal _UnitPrice;
partial void OnUnitPriceChanging(global::System.Decimal value);
partial void OnUnitPriceChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1802,7 +1802,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.Decimal _UnitPriceDiscount;
partial void OnUnitPriceDiscountChanging(global::System.Decimal value);
partial void OnUnitPriceDiscountChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1826,7 +1826,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.Decimal _LineTotal;
partial void OnLineTotalChanging(global::System.Decimal value);
partial void OnLineTotalChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1850,7 +1850,7 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1876,9 +1876,9 @@ public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 sales
partial void OnModifiedDateChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1919,7 +1919,7 @@ public EntityReference SalesOrderHeaderReference
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1929,7 +1929,7 @@ public EntityReference SalesOrderHeaderReference
public partial class SalesOrderHeader : EntityObject
{
#region Factory Method
-
+
///
/// Create a new SalesOrderHeader object.
///
@@ -1977,7 +1977,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -2004,7 +2004,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Int32 _SalesOrderID;
partial void OnSalesOrderIDChanging(global::System.Int32 value);
partial void OnSalesOrderIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2028,7 +2028,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Byte _RevisionNumber;
partial void OnRevisionNumberChanging(global::System.Byte value);
partial void OnRevisionNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2052,7 +2052,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.DateTime _OrderDate;
partial void OnOrderDateChanging(global::System.DateTime value);
partial void OnOrderDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2076,7 +2076,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.DateTime _DueDate;
partial void OnDueDateChanging(global::System.DateTime value);
partial void OnDueDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2100,7 +2100,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private Nullable _ShipDate;
partial void OnShipDateChanging(Nullable value);
partial void OnShipDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2124,7 +2124,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Byte _Status;
partial void OnStatusChanging(global::System.Byte value);
partial void OnStatusChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2148,7 +2148,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Boolean _OnlineOrderFlag;
partial void OnOnlineOrderFlagChanging(global::System.Boolean value);
partial void OnOnlineOrderFlagChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2172,7 +2172,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.String _SalesOrderNumber;
partial void OnSalesOrderNumberChanging(global::System.String value);
partial void OnSalesOrderNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2196,7 +2196,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.String _PurchaseOrderNumber;
partial void OnPurchaseOrderNumberChanging(global::System.String value);
partial void OnPurchaseOrderNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2220,7 +2220,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.String _AccountNumber;
partial void OnAccountNumberChanging(global::System.String value);
partial void OnAccountNumberChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2244,7 +2244,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Int32 _CustomerID;
partial void OnCustomerIDChanging(global::System.Int32 value);
partial void OnCustomerIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2268,7 +2268,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Int32 _ContactID;
partial void OnContactIDChanging(global::System.Int32 value);
partial void OnContactIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2292,7 +2292,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private Nullable _SalesPersonID;
partial void OnSalesPersonIDChanging(Nullable value);
partial void OnSalesPersonIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2316,7 +2316,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private Nullable _TerritoryID;
partial void OnTerritoryIDChanging(Nullable value);
partial void OnTerritoryIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2340,7 +2340,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Int32 _BillToAddressID;
partial void OnBillToAddressIDChanging(global::System.Int32 value);
partial void OnBillToAddressIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2364,7 +2364,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Int32 _ShipToAddressID;
partial void OnShipToAddressIDChanging(global::System.Int32 value);
partial void OnShipToAddressIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2388,7 +2388,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Int32 _ShipMethodID;
partial void OnShipMethodIDChanging(global::System.Int32 value);
partial void OnShipMethodIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2412,7 +2412,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private Nullable _CreditCardID;
partial void OnCreditCardIDChanging(Nullable value);
partial void OnCreditCardIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2436,7 +2436,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.String _CreditCardApprovalCode;
partial void OnCreditCardApprovalCodeChanging(global::System.String value);
partial void OnCreditCardApprovalCodeChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2460,7 +2460,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private Nullable _CurrencyRateID;
partial void OnCurrencyRateIDChanging(Nullable value);
partial void OnCurrencyRateIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2484,7 +2484,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Decimal _SubTotal;
partial void OnSubTotalChanging(global::System.Decimal value);
partial void OnSubTotalChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2508,7 +2508,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Decimal _TaxAmt;
partial void OnTaxAmtChanging(global::System.Decimal value);
partial void OnTaxAmtChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2532,7 +2532,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Decimal _Freight;
partial void OnFreightChanging(global::System.Decimal value);
partial void OnFreightChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2556,7 +2556,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Decimal _TotalDue;
partial void OnTotalDueChanging(global::System.Decimal value);
partial void OnTotalDueChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2580,7 +2580,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.String _Comment;
partial void OnCommentChanging(global::System.String value);
partial void OnCommentChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2604,7 +2604,7 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
private global::System.Guid _rowguid;
partial void OnrowguidChanging(global::System.Guid value);
partial void OnrowguidChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2630,9 +2630,9 @@ public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 sales
partial void OnModifiedDateChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -2670,7 +2670,7 @@ public EntityReference AddressReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -2708,7 +2708,7 @@ public EntityReference Address1Reference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -2746,7 +2746,7 @@ public EntityReference ContactReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -2774,7 +2774,7 @@ public EntityCollection SalesOrderDetails
#endregion
#region ComplexTypes
-
+
///
/// No Metadata Documentation available.
///
@@ -2784,7 +2784,7 @@ public EntityCollection SalesOrderDetails
public partial class EmailPhone : ComplexObject
{
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -2808,7 +2808,7 @@ public partial class EmailPhone : ComplexObject
private global::System.String _EmailAddress;
partial void OnEmailAddressChanging(global::System.String value);
partial void OnEmailAddressChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -2837,5 +2837,5 @@ public partial class EmailPhone : ComplexObject
}
#endregion
-
+
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/fkvsref.cs b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/fkvsref.cs
index 3240385ff2b..a81e2d9937c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/fkvsref.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/fkvsref.cs
@@ -94,7 +94,7 @@ public void Create_new_Product_and_new_Contact_relate_by_value()
ContactID = 2
};
context.SalesOrderHeaders.AddObject(order);
- // Not that the only difference from the customers perspective is
+ // Not that the only difference from the customers perspective is
// that the BOTH entities need to be added, this seems acceptable
context.Contacts.AddObject(c);
context.SaveChanges();
@@ -142,7 +142,7 @@ public void Create_new_Product_and_new_Contact_with_pk_identity_and_relate_by_va
context.SalesOrderHeaders.AddObject(order);
context.Contacts.AddObject(c);
- // Must not fail because of a dependency issue...
+ // Must not fail because of a dependency issue...
// i.e. Update must re-order so that the Contact is created before the SalesOrderHeader
context.SaveChanges();
}
@@ -269,7 +269,7 @@ public void Update_existing_Product_with_new_Contact_with_pk_identity_by_value()
{
using (var context = new AdventureWorksEntities())
{
- //Get the food category into the statemanager...
+ //Get the food category into the statemanager...
//so the subsequent query will bring span in product.Contact? Is this the expected behavior?
Contact contact = context.Contacts.Single(c => c.FirstName == "Alex");
@@ -321,7 +321,7 @@ public void Fixup_does_not_take_precedence()
//Debug.ReferenceEquals(food, product.Contact);
// ADVICE: should NULL out the category / or do some sort of query etc.
- // RULE: if this is EOCO we should notice that they made an EXPLICIT change
+ // RULE: if this is EOCO we should notice that they made an EXPLICIT change
// and that takes precedence over IMPLICIT fixup.
order.ContactID = contact.ContactID + 1;
context.SaveChanges();
@@ -401,7 +401,7 @@ public void Initialize_data_and_fixup_using_AcceptChanges()
/*
-// The following example creates a new order for existing Contact using the Foreign key property.
+// The following example creates a new order for existing Contact using the Foreign key property.
// Notice that you do not need to load a contact, just assign the Contact's ID to the foreign key property.
using (var context = new AdventureWorksEntities())
{
@@ -410,7 +410,7 @@ public void Initialize_data_and_fixup_using_AcceptChanges()
SalesOrderID = 1,
ModifiedDate = DateTime.Now,
// Set the foreign key property to the ID of the principal
- // to create the association between the Category and SalesOrderHeader.
+ // to create the association between the Category and SalesOrderHeader.
ContactID = 13
};
context.SalesOrderHeaders.AddObject(order);
@@ -418,9 +418,9 @@ public void Initialize_data_and_fixup_using_AcceptChanges()
}
-// The following example creates a new order for existing Contact using the reference assignment.
-// Notice that to set the reference, we need to load the contact.
-// You do not need to call AddObject() because when you assign the reference
+// The following example creates a new order for existing Contact using the reference assignment.
+// Notice that to set the reference, we need to load the contact.
+// You do not need to call AddObject() because when you assign the reference
// to the navigation property the objects on both ends get synronized in the state manager.
using (var context = new AdventureWorksEntities())
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/school.designer.cs b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/school.designer.cs
index 73810cecc63..c26b96c923e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/school.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/school.designer.cs
@@ -29,14 +29,14 @@
namespace ObjectServicesConceptsCS
{
#region Contexts
-
+
///
/// No Metadata Documentation available.
///
public partial class SchoolEntities : ObjectContext
{
#region Constructors
-
+
///
/// Initializes a new SchoolEntities object using the connection string found in the 'SchoolEntities' section of the application configuration file.
///
@@ -45,7 +45,7 @@ public SchoolEntities() : base("name=SchoolEntities", "SchoolEntities")
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
///
/// Initialize a new SchoolEntities object.
///
@@ -54,7 +54,7 @@ public SchoolEntities(string connectionString) : base(connectionString, "SchoolE
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
///
/// Initialize a new SchoolEntities object.
///
@@ -63,17 +63,17 @@ public SchoolEntities(EntityConnection connection) : base(connection, "SchoolEnt
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
-
+
#endregion
-
+
#region Partial Methods
-
+
partial void OnContextCreated();
-
+
#endregion
-
+
#region ObjectSet Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -89,7 +89,7 @@ public ObjectSet Courses
}
}
private ObjectSet _Courses;
-
+
///
/// No Metadata Documentation available.
///
@@ -105,7 +105,7 @@ public ObjectSet Departments
}
}
private ObjectSet _Departments;
-
+
///
/// No Metadata Documentation available.
///
@@ -121,7 +121,7 @@ public ObjectSet OfficeAssignments
}
}
private ObjectSet _OfficeAssignments;
-
+
///
/// No Metadata Documentation available.
///
@@ -137,7 +137,7 @@ public ObjectSet People
}
}
private ObjectSet _People;
-
+
///
/// No Metadata Documentation available.
///
@@ -156,7 +156,7 @@ public ObjectSet StudentGrades
#endregion
#region AddTo Methods
-
+
///
/// Deprecated Method for adding a new object to the Courses EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -164,7 +164,7 @@ public void AddToCourses(Course course)
{
base.AddObject("Courses", course);
}
-
+
///
/// Deprecated Method for adding a new object to the Departments EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -172,7 +172,7 @@ public void AddToDepartments(Department department)
{
base.AddObject("Departments", department);
}
-
+
///
/// Deprecated Method for adding a new object to the OfficeAssignments EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -180,7 +180,7 @@ public void AddToOfficeAssignments(OfficeAssignment officeAssignment)
{
base.AddObject("OfficeAssignments", officeAssignment);
}
-
+
///
/// Deprecated Method for adding a new object to the People EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -188,7 +188,7 @@ public void AddToPeople(Person person)
{
base.AddObject("People", person);
}
-
+
///
/// Deprecated Method for adding a new object to the StudentGrades EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
///
@@ -199,7 +199,7 @@ public void AddToStudentGrades(StudentGrade studentGrade)
#endregion
#region Function Imports
-
+
///
/// No Metadata Documentation available.
///
@@ -215,7 +215,7 @@ public ObjectResult GetStudentGrades(Nullable("GetStudentGrades", studentIDParameter);
}
///
@@ -234,10 +234,10 @@ public ObjectResult GetStudentGrades(Nullable("GetStudentGrades", mergeOption, studentIDParameter);
}
-
+
///
/// No Metadata Documentation available.
///
@@ -254,18 +254,18 @@ public int GetDepartmentName(Nullable iD, ObjectParameter
{
iDParameter = new ObjectParameter("ID", typeof(global::System.Int32));
}
-
+
return base.ExecuteFunction("GetDepartmentName", iDParameter, name);
}
#endregion
}
-
+
#endregion
-
+
#region Entities
-
+
///
/// No Metadata Documentation available.
///
@@ -277,7 +277,7 @@ public int GetDepartmentName(Nullable iD, ObjectParameter
public abstract partial class Course : EntityObject
{
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -304,7 +304,7 @@ public abstract partial class Course : EntityObject
private global::System.Int32 _CourseID;
partial void OnCourseIDChanging(global::System.Int32 value);
partial void OnCourseIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -328,7 +328,7 @@ public abstract partial class Course : EntityObject
private global::System.String _Title;
partial void OnTitleChanging(global::System.String value);
partial void OnTitleChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -352,7 +352,7 @@ public abstract partial class Course : EntityObject
private global::System.Int32 _Credits;
partial void OnCreditsChanging(global::System.Int32 value);
partial void OnCreditsChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -378,9 +378,9 @@ public abstract partial class Course : EntityObject
partial void OnDepartmentIDChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -418,7 +418,7 @@ public EntityReference DepartmentReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -440,7 +440,7 @@ public EntityCollection StudentGrades
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -465,7 +465,7 @@ public EntityCollection People
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -475,7 +475,7 @@ public EntityCollection People
public partial class Department : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Department object.
///
@@ -495,7 +495,7 @@ public static Department CreateDepartment(global::System.Int32 departmentID, glo
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -522,7 +522,7 @@ public static Department CreateDepartment(global::System.Int32 departmentID, glo
private global::System.Int32 _DepartmentID;
partial void OnDepartmentIDChanging(global::System.Int32 value);
partial void OnDepartmentIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -546,7 +546,7 @@ public static Department CreateDepartment(global::System.Int32 departmentID, glo
private global::System.String _Name;
partial void OnNameChanging(global::System.String value);
partial void OnNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -570,7 +570,7 @@ public static Department CreateDepartment(global::System.Int32 departmentID, glo
private global::System.Decimal _Budget;
partial void OnBudgetChanging(global::System.Decimal value);
partial void OnBudgetChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -594,7 +594,7 @@ public static Department CreateDepartment(global::System.Int32 departmentID, glo
private global::System.DateTime _StartDate;
partial void OnStartDateChanging(global::System.DateTime value);
partial void OnStartDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -620,9 +620,9 @@ public static Department CreateDepartment(global::System.Int32 departmentID, glo
partial void OnAdministratorChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -647,7 +647,7 @@ public EntityCollection Courses
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -657,7 +657,7 @@ public EntityCollection Courses
public partial class OfficeAssignment : EntityObject
{
#region Factory Method
-
+
///
/// Create a new OfficeAssignment object.
///
@@ -675,7 +675,7 @@ public static OfficeAssignment CreateOfficeAssignment(global::System.Int32 instr
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -702,7 +702,7 @@ public static OfficeAssignment CreateOfficeAssignment(global::System.Int32 instr
private global::System.Int32 _InstructorID;
partial void OnInstructorIDChanging(global::System.Int32 value);
partial void OnInstructorIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -726,7 +726,7 @@ public static OfficeAssignment CreateOfficeAssignment(global::System.Int32 instr
private global::System.String _Location;
partial void OnLocationChanging(global::System.String value);
partial void OnLocationChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -752,9 +752,9 @@ public static OfficeAssignment CreateOfficeAssignment(global::System.Int32 instr
partial void OnTimestampChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -795,7 +795,7 @@ public EntityReference PersonReference
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -805,7 +805,7 @@ public EntityReference PersonReference
public partial class OnlineCourse : Course
{
#region Factory Method
-
+
///
/// Create a new OnlineCourse object.
///
@@ -827,7 +827,7 @@ public static OnlineCourse CreateOnlineCourse(global::System.Int32 courseID, glo
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -853,9 +853,9 @@ public static OnlineCourse CreateOnlineCourse(global::System.Int32 courseID, glo
partial void OnURLChanged();
#endregion
-
+
}
-
+
///
/// No Metadata Documentation available.
///
@@ -865,7 +865,7 @@ public static OnlineCourse CreateOnlineCourse(global::System.Int32 courseID, glo
public partial class OnsiteCourse : Course
{
#region Factory Method
-
+
///
/// Create a new OnsiteCourse object.
///
@@ -891,7 +891,7 @@ public static OnsiteCourse CreateOnsiteCourse(global::System.Int32 courseID, glo
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -915,7 +915,7 @@ public static OnsiteCourse CreateOnsiteCourse(global::System.Int32 courseID, glo
private global::System.String _Location;
partial void OnLocationChanging(global::System.String value);
partial void OnLocationChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -939,7 +939,7 @@ public static OnsiteCourse CreateOnsiteCourse(global::System.Int32 courseID, glo
private global::System.String _Days;
partial void OnDaysChanging(global::System.String value);
partial void OnDaysChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -965,9 +965,9 @@ public static OnsiteCourse CreateOnsiteCourse(global::System.Int32 courseID, glo
partial void OnTimeChanged();
#endregion
-
+
}
-
+
///
/// No Metadata Documentation available.
///
@@ -977,7 +977,7 @@ public static OnsiteCourse CreateOnsiteCourse(global::System.Int32 courseID, glo
public partial class Person : EntityObject
{
#region Factory Method
-
+
///
/// Create a new Person object.
///
@@ -995,7 +995,7 @@ public static Person CreatePerson(global::System.Int32 personID, global::System.
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1022,7 +1022,7 @@ public static Person CreatePerson(global::System.Int32 personID, global::System.
private global::System.Int32 _PersonID;
partial void OnPersonIDChanging(global::System.Int32 value);
partial void OnPersonIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1046,7 +1046,7 @@ public static Person CreatePerson(global::System.Int32 personID, global::System.
private global::System.String _LastName;
partial void OnLastNameChanging(global::System.String value);
partial void OnLastNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1070,7 +1070,7 @@ public static Person CreatePerson(global::System.Int32 personID, global::System.
private global::System.String _FirstName;
partial void OnFirstNameChanging(global::System.String value);
partial void OnFirstNameChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1094,7 +1094,7 @@ public static Person CreatePerson(global::System.Int32 personID, global::System.
private Nullable _HireDate;
partial void OnHireDateChanging(Nullable value);
partial void OnHireDateChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1120,9 +1120,9 @@ public static Person CreatePerson(global::System.Int32 personID, global::System.
partial void OnEnrollmentDateChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1160,7 +1160,7 @@ public EntityReference OfficeAssignmentReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1182,7 +1182,7 @@ public EntityCollection StudentGrades
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1207,7 +1207,7 @@ public EntityCollection Courses
#endregion
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1217,7 +1217,7 @@ public EntityCollection Courses
public partial class StudentGrade : EntityObject
{
#region Factory Method
-
+
///
/// Create a new StudentGrade object.
///
@@ -1235,7 +1235,7 @@ public static StudentGrade CreateStudentGrade(global::System.Int32 enrollmentID,
#endregion
#region Primitive Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1262,7 +1262,7 @@ public static StudentGrade CreateStudentGrade(global::System.Int32 enrollmentID,
private global::System.Int32 _EnrollmentID;
partial void OnEnrollmentIDChanging(global::System.Int32 value);
partial void OnEnrollmentIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1286,7 +1286,7 @@ public static StudentGrade CreateStudentGrade(global::System.Int32 enrollmentID,
private global::System.Int32 _CourseID;
partial void OnCourseIDChanging(global::System.Int32 value);
partial void OnCourseIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1310,7 +1310,7 @@ public static StudentGrade CreateStudentGrade(global::System.Int32 enrollmentID,
private global::System.Int32 _StudentID;
partial void OnStudentIDChanging(global::System.Int32 value);
partial void OnStudentIDChanged();
-
+
///
/// No Metadata Documentation available.
///
@@ -1336,9 +1336,9 @@ public static StudentGrade CreateStudentGrade(global::System.Int32 enrollmentID,
partial void OnGradeChanged();
#endregion
-
+
#region Navigation Properties
-
+
///
/// No Metadata Documentation available.
///
@@ -1376,7 +1376,7 @@ public EntityReference CourseReference
}
}
}
-
+
///
/// No Metadata Documentation available.
///
@@ -1419,5 +1419,5 @@ public EntityReference PersonReference
}
#endregion
-
+
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/IHasXmlNode.GetNode/CS/hasxmlnode.cs b/samples/snippets/csharp/VS_Snippets_Data/IHasXmlNode.GetNode/CS/hasxmlnode.cs
index b27247ef287..c0752466437 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/IHasXmlNode.GetNode/CS/hasxmlnode.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/IHasXmlNode.GetNode/CS/hasxmlnode.cs
@@ -10,7 +10,7 @@ public static void Main()
{
XmlDocument doc = new XmlDocument();
doc.Load("books.xml");
-
+
// Create an XPathNavigator and select all books by Plato.
XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator ni = nav.Select("descendant::book[author/name='Plato']");
diff --git a/samples/snippets/csharp/VS_Snippets_Data/IXmlLineInfo/CS/lineinfo.cs b/samples/snippets/csharp/VS_Snippets_Data/IXmlLineInfo/CS/lineinfo.cs
index 1bbbb69566c..e72f7ad3810 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/IXmlLineInfo/CS/lineinfo.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/IXmlLineInfo/CS/lineinfo.cs
@@ -8,7 +8,7 @@ public class Sample{
public static void Main(){
// Create the XML fragment to be parsed.
- string xmlFrag =
+ string xmlFrag =
@"
@@ -28,7 +28,7 @@ public static void Main(){
IXmlLineInfo lineInfo = ((IXmlLineInfo)reader);
if (lineInfo.HasLineInfo()){
-
+
// Parse the XML and display each node.
while (reader.Read()){
switch (reader.NodeType){
@@ -44,12 +44,12 @@ public static void Main(){
Console.Write("{0} {1},{2} ", reader.Depth, lineInfo.LineNumber, lineInfo.LinePosition);
Console.WriteLine("{0}>", reader.Name);
break;
- }
- }
+ }
+ }
}
// Close the reader.
- reader.Close();
+ reader.Close();
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/NameTable/CS/nametable.cs b/samples/snippets/csharp/VS_Snippets_Data/NameTable/CS/nametable.cs
index d802be7c9de..78e4808f7e3 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/NameTable/CS/nametable.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/NameTable/CS/nametable.cs
@@ -1,7 +1,7 @@
using System;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main(){
//
@@ -22,8 +22,8 @@ public static void Main(){
// Do additional processing.
}
-//
+//
//Close the reader.
- reader.Close();
+ reader.Close();
}
} // End class
diff --git a/samples/snippets/csharp/VS_Snippets_Data/NameTable_v2/CS/nametable.cs b/samples/snippets/csharp/VS_Snippets_Data/NameTable_v2/CS/nametable.cs
index a486c2b7fb0..309c0a2986d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/NameTable_v2/CS/nametable.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/NameTable_v2/CS/nametable.cs
@@ -31,11 +31,11 @@ public static void Main() {
if (title == localname) {
// Add additional processing here.
}
- }
+ }
} // End While
// Close the reader.
- reader.Close();
+ reader.Close();
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XML_Migration/CS/migration.cs b/samples/snippets/csharp/VS_Snippets_Data/XML_Migration/CS/migration.cs
index b8ebaa0a335..435c97585f6 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XML_Migration/CS/migration.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XML_Migration/CS/migration.cs
@@ -26,7 +26,7 @@ public void XmlReader_Creation_Old() {
}
//==============================
-//
+//
static void XmlReader_Creation_New() {
//
// Supply the credentials necessary to access the Web server.
@@ -41,7 +41,7 @@ static void XmlReader_Creation_New() {
//
}
//==============================
-//
+//
static void XML_Validation_Old() {
//
XmlValidatingReader reader = new XmlValidatingReader(new XmlTextReader("books.xml"));
@@ -58,7 +58,7 @@ private static void ValidationCallBack(object sender, ValidationEventArgs e) {
//
//==============================
-//
+//
static void XML_Validation_New() {
//
XmlReaderSettings settings = new XmlReaderSettings();
@@ -76,8 +76,8 @@ private static void ValidationCallBack1(object sender, ValidationEventArgs e) {
//
//==============================
-//
-static void XmlWriter_Creation_Old() {
+//
+static void XmlWriter_Creation_Old() {
//
XmlTextWriter writer = new XmlTextWriter("books.xml", Encoding.Unicode);
writer.Formatting = Formatting.Indented;
@@ -85,8 +85,8 @@ static void XmlWriter_Creation_Old() {
}
//==============================
-//
-static void XmlWriter_Creation_New() {
+//
+static void XmlWriter_Creation_New() {
//
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
@@ -96,8 +96,8 @@ static void XmlWriter_Creation_New() {
}
//==============================
-//
-static void XSLT_Old() {
+//
+static void XSLT_Old() {
string filename = "books.xml";
//
// Create the XslTransform.
@@ -118,8 +118,8 @@ static void XSLT_Old() {
}
//==============================
-//
-static void XSLT_New() {
+//
+static void XSLT_New() {
//
// Create the XslCompiledTransform object.
XslCompiledTransform xslt = new XslCompiledTransform();
@@ -138,8 +138,8 @@ static void XSLT_New() {
}
//==============================
-//
-static void XSLT_URI_Old() {
+//
+static void XSLT_URI_Old() {
//
XslTransform xslt = new XslTransform();
xslt.Load("output.xsl");
@@ -148,8 +148,8 @@ static void XSLT_URI_Old() {
}
//==============================
-//
-static void XSLT_URI_New() {
+//
+static void XSLT_URI_New() {
//
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load("output.xsl");
@@ -158,8 +158,8 @@ static void XSLT_URI_New() {
}
//==============================
-//
-static void Stylesheet_Credentials_Old() {
+//
+static void Stylesheet_Credentials_Old() {
//
XslTransform xslt = new XslTransform();
XmlUrlResolver resolver = new XmlUrlResolver();
@@ -169,8 +169,8 @@ static void Stylesheet_Credentials_Old() {
}
//==============================
-//
-static void Stylesheet_Credentials_New() {
+//
+static void Stylesheet_Credentials_New() {
//
XslCompiledTransform xslt = new XslCompiledTransform();
XmlUrlResolver resolver = new XmlUrlResolver();
@@ -180,8 +180,8 @@ static void Stylesheet_Credentials_New() {
}
//==============================
-//
-static void XSLT_Param_Old() {
+//
+static void XSLT_Param_Old() {
string filename = "books.xml";
//
XslTransform xslt = new XslTransform();
@@ -203,8 +203,8 @@ static void XSLT_Param_Old() {
}
//==============================
-//
-static void XSLT_Param_New() {
+//
+static void XSLT_Param_New() {
string filename = "books.xml";
//
XslCompiledTransform xslt = new XslCompiledTransform();
@@ -217,7 +217,7 @@ static void XSLT_Param_New() {
DateTime d = DateTime.Now;
argList.AddParam("date", "", d.ToString());
-// Create the XmlWriter.
+// Create the XmlWriter.
XmlWriter writer = XmlWriter.Create("output.xml", null);
// Transform the file.
@@ -226,8 +226,8 @@ static void XSLT_Param_New() {
}
//==============================
-//
-static void XSLT_Script_Old() {
+//
+static void XSLT_Script_Old() {
//
XslTransform xslt = new XslTransform();
xslt.Load("output.xsl");
@@ -236,8 +236,8 @@ static void XSLT_Script_Old() {
}
//==============================
-//
-static void XSLT_Script_New() {
+//
+static void XSLT_Script_New() {
//
// Create the XsltSettings object with script enabled.
XsltSettings settings = new XsltSettings(false,true);
@@ -250,8 +250,8 @@ static void XSLT_Script_New() {
}
//==============================
-//
-static void XSLT_Roundtrip_Old() {
+//
+static void XSLT_Roundtrip_Old() {
//
// Execute the transformation.
XslTransform xslt = new XslTransform();
@@ -264,8 +264,8 @@ static void XSLT_Roundtrip_Old() {
}
//==============================
-//
-static void XSLT_Roundtrip_New() {
+//
+static void XSLT_Roundtrip_New() {
//
// Execute the transformation.
XslCompiledTransform xslt = new XslCompiledTransform();
@@ -280,8 +280,8 @@ static void XSLT_Roundtrip_New() {
}
//==============================
-//
-static void XSLT_DOM_Old() {
+//
+static void XSLT_DOM_Old() {
//
// Execute the transformation.
XslTransform xslt = new XslTransform();
@@ -295,8 +295,8 @@ static void XSLT_DOM_Old() {
}
//==============================
-//
-static void XSLT_DOM_New() {
+//
+static void XSLT_DOM_New() {
//
// Execute the transformation.
XslCompiledTransform xslt = new XslCompiledTransform();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XPathNavigatorMethods/CS/xpathnavigatormethods.cs b/samples/snippets/csharp/VS_Snippets_Data/XPathNavigatorMethods/CS/xpathnavigatormethods.cs
index 24aee976f43..926bb8e09c5 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XPathNavigatorMethods/CS/xpathnavigatormethods.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XPathNavigatorMethods/CS/xpathnavigatormethods.cs
@@ -88,7 +88,7 @@ static void XPathNavigatorMethods_AppendChild4()
childNodes.Load(new StringReader("100"));
XPathNavigator childNodesNavigator = childNodes.CreateNavigator();
- if(childNodesNavigator.MoveToChild("pages", "http://www.contoso.com/books"))
+ if(childNodesNavigator.MoveToChild("pages", "http://www.contoso.com/books"))
{
navigator.AppendChild(childNodesNavigator);
}
@@ -130,7 +130,7 @@ static void XPathNavigatorMethods_Clone()
while (nodes.MoveNext())
{
- // Clone the navigator returned by the Current property.
+ // Clone the navigator returned by the Current property.
// Use the cloned navigator to get the title element.
XPathNavigator clone = nodes.Current.Clone();
clone.MoveToFirstChild();
@@ -887,13 +887,13 @@ static void XPathNavigatorMethods_Select1()
//
XPathDocument document = new XPathDocument("books.xml");
XPathNavigator navigator = document.CreateNavigator();
-
+
XPathNodeIterator nodes = navigator.Select("/bookstore/book");
nodes.MoveNext();
XPathNavigator nodesNavigator = nodes.Current;
-
+
XPathNodeIterator nodesText = nodesNavigator.SelectDescendants(XPathNodeType.Text, false);
-
+
while (nodesText.MoveNext())
Console.WriteLine(nodesText.Current.Value);
//
@@ -934,7 +934,7 @@ static void XPathNavigatorMethods_Select3()
XPathNavigator nodesNavigator = nodes.Current;
//select all the descendants of the current price node
- XPathNodeIterator nodesText =
+ XPathNodeIterator nodesText =
nodesNavigator.SelectDescendants(XPathNodeType.Text, false);
while(nodesText.MoveNext())
@@ -1145,27 +1145,27 @@ static void XPathNavigatorMethods_BasicMoveTos()
navigator = navigator.SelectSingleNode("//bk:book[last()]", manager);
Console.WriteLine("Last book node: \n===============\n{0}", navigator.OuterXml);
- // Move to the previous book node and write it to the console
+ // Move to the previous book node and write it to the console
// if the move was successful.
if (navigator.MoveToPrevious())
{
- Console.WriteLine("\nSecond book node: \n=================\n{0}",
+ Console.WriteLine("\nSecond book node: \n=================\n{0}",
navigator.OuterXml);
}
- // Move to the first book node and write it to the console
+ // Move to the first book node and write it to the console
// if the move was successful.
if (navigator.MoveToFirst())
{
- Console.WriteLine("\nFirst book node: \n================\n{0}",
+ Console.WriteLine("\nFirst book node: \n================\n{0}",
navigator.OuterXml);
}
- // Move to the parent bookstore node and write it to the console
+ // Move to the parent bookstore node and write it to the console
// if the move was successful.
if (navigator.MoveToParent())
{
- Console.WriteLine("\nParent bookstore node: \n======================\n{0}",
+ Console.WriteLine("\nParent bookstore node: \n======================\n{0}",
navigator.OuterXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlCachingResolver_ex/CS/XmlCachingResolver_ex.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlCachingResolver_ex/CS/XmlCachingResolver_ex.cs
index 23538c6df03..f62e14a34f0 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlCachingResolver_ex/CS/XmlCachingResolver_ex.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlCachingResolver_ex/CS/XmlCachingResolver_ex.cs
@@ -13,7 +13,7 @@ class XmlCachingResolver : XmlUrlResolver
ICredentials credentials;
//resolve resources from cache (if possible) when enableHttpCaching is set to true
- //resolve resources from source when enableHttpcaching is set to false
+ //resolve resources from source when enableHttpcaching is set to false
public XmlCachingResolver(bool enableHttpCaching)
{
this.enableHttpCaching = enableHttpCaching;
@@ -57,8 +57,8 @@ public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToRe
class Program
{
static void Main(string[] args)
- {
- //
+ {
+ //
XmlCachingResolver resolver = new XmlCachingResolver(true);
Uri baseUri = new Uri("http://serverName/");
Uri fulluri = resolver.ResolveUri(baseUri, "fileName.xml");
@@ -72,7 +72,7 @@ static void Main(string[] args)
{
Console.WriteLine(reader.ReadOuterXml());
}
- //
+ //
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlConvert.ToDouble/CS/readdata.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlConvert.ToDouble/CS/readdata.cs
index c1fee1cf96e..c4e6999e357 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlConvert.ToDouble/CS/readdata.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlConvert.ToDouble/CS/readdata.cs
@@ -27,7 +27,7 @@ public static void Main()
}
//Close the reader.
- reader.Close();
+ reader.Close();
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlConvert.VerifyName/CS/verifyname.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlConvert.VerifyName/CS/verifyname.cs
index 833d7d52139..70930db144f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlConvert.VerifyName/CS/verifyname.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlConvert.VerifyName/CS/verifyname.cs
@@ -7,7 +7,7 @@ public class Sample{
public static void Main(){
XmlTextWriter writer = new XmlTextWriter ("out.xml", null);
string tag = "item name";
-
+
try{
// Write the root element.
@@ -26,7 +26,7 @@ public static void Main(){
// Write the end tag for the root element.
writer.WriteEndElement();
-
+
writer.Close();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.CreateNavigator/CS/dataset_trans.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.CreateNavigator/CS/dataset_trans.cs
index 33e8fcbb271..2a7587ab2dd 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.CreateNavigator/CS/dataset_trans.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.CreateNavigator/CS/dataset_trans.cs
@@ -13,19 +13,19 @@ public static void Main()
{
// Create a DataSet and load it with customer data.
- DataSet dsNorthwind = new DataSet();
+ DataSet dsNorthwind = new DataSet();
String sConnect;
- sConnect="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind";
+ sConnect="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind";
SqlConnection nwconnect = new SqlConnection(sConnect);
String sCommand = "Select * from Customers where Region='WA'";
SqlDataAdapter myDataAdapter = new SqlDataAdapter(sCommand, nwconnect);
- myDataAdapter.Fill(dsNorthwind,"Customers");
+ myDataAdapter.Fill(dsNorthwind,"Customers");
// Load the DataSet into an XmlDataDocument.
- XmlDataDocument doc = new XmlDataDocument(dsNorthwind);
+ XmlDataDocument doc = new XmlDataDocument(dsNorthwind);
// Create the XslTransform object and load the stylesheet.
- XslTransform xsl = new XslTransform();
+ XslTransform xsl = new XslTransform();
xsl.Load("customers.xsl");
// Create an XPathNavigator to use in the transform.
@@ -33,7 +33,7 @@ public static void Main()
// Create a FileStream object.
FileStream fs = new FileStream("cust.html", FileMode.Create);
-
+
// Transform the data.
xsl.Transform(nav, null, fs, null);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.GetRowFromElement/CS/getrow.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.GetRowFromElement/CS/getrow.cs
index df8bd716cc8..8607e344dbd 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.GetRowFromElement/CS/getrow.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.GetRowFromElement/CS/getrow.cs
@@ -6,18 +6,18 @@ public class Sample {
public static void Main() {
// Create an XmlDataDocument.
XmlDataDocument doc = new XmlDataDocument();
-
+
// Load the schema file.
doc.DataSet.ReadXmlSchema("store.xsd");
-
+
// Load the XML data.
doc.Load("2books.xml");
-
+
//Change the price on the first book.
XmlElement root = doc.DocumentElement;
DataRow row = doc.GetRowFromElement((XmlElement)root.FirstChild);
row["price"] = "12.95";
-
+
Console.WriteLine("Display the modified XML data...");
Console.WriteLine(doc.DocumentElement.OuterXml);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.Load/CS/loadrdr.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.Load/CS/loadrdr.cs
index 17fa2a44971..fcb59c9e435 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.Load/CS/loadrdr.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlDataDocument.Load/CS/loadrdr.cs
@@ -6,19 +6,19 @@ public class Sample {
public static void Main() {
// Create an XmlDataDocument.
XmlDataDocument doc = new XmlDataDocument();
-
+
// Load the schema file.
doc.DataSet.ReadXmlSchema("store.xsd");
-
+
// Load the XML data.
XmlTextReader reader = new XmlTextReader("2books.xml");
reader.MoveToContent(); // Moves the reader to the root node.
doc.Load(reader);
-
+
// Update the price on the first book using the DataSet methods.
DataTable books = doc.DataSet.Tables["book"];
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/XmlDocument.cctor/CS/docload.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlDocument.cctor/CS/docload.cs
index 7331a0e7d98..2ab40918949 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlDocument.cctor/CS/docload.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlDocument.cctor/CS/docload.cs
@@ -28,7 +28,7 @@ public static void Main()
reader = XmlReader.Create(filename, settings);
// Pass the validating reader to the XML document.
- // Validation fails due to an undefined attribute, but the
+ // Validation fails due to an undefined attribute, but the
// data is still loaded into the document.
XmlDocument doc = new XmlDocument();
doc.Load(reader);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlEntity/CS/entities.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlEntity/CS/entities.cs
index 8088c90e240..750537a2bb3 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlEntity/CS/entities.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlEntity/CS/entities.cs
@@ -2,23 +2,23 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample
{
private const String filename = "doment.xml";
-
+
public static void Main()
- {
+ {
XmlDocument doc = new XmlDocument();
doc.Load(filename);
-
- Console.WriteLine("Display information on all entities...");
+
+ Console.WriteLine("Display information on all entities...");
XmlNamedNodeMap nMap = doc.DocumentType.Entities;
DisplayEntities(nMap);
}
-
+
public static void DisplayEntities(XmlNamedNodeMap nMap)
- {
+ {
for (int i=0; i < nMap.Count; i++)
{
XmlEntity ent = (XmlEntity) nMap.Item(i);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlNodeChangedEventHandler/CS/nodeevent.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlNodeChangedEventHandler/CS/nodeevent.cs
index 969691b4c81..8d522be0be6 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlNodeChangedEventHandler/CS/nodeevent.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlNodeChangedEventHandler/CS/nodeevent.cs
@@ -66,6 +66,6 @@ private void MyNodeInsertedEvent(Object source, XmlNodeChangedEventArgs args)
Console.WriteLine("");
}
}
- } // End class
+ } // End class
//
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlNotation/CS/notation.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlNotation/CS/notation.cs
index 7bae3359623..94d6fb575ba 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlNotation/CS/notation.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlNotation/CS/notation.cs
@@ -2,23 +2,23 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample
{
private const String filename = "doment.xml";
-
+
public static void Main()
- {
+ {
XmlDocument doc = new XmlDocument();
doc.Load(filename);
- Console.WriteLine("Display information on all notations...");
+ Console.WriteLine("Display information on all notations...");
XmlNamedNodeMap nMap = doc.DocumentType.Notations;
- DisplayNotations(nMap);
+ DisplayNotations(nMap);
}
-
+
public static void DisplayNotations(XmlNamedNodeMap nMap)
- {
+ {
for (int i=0; i < nMap.Count; i++)
{
XmlNotation note = (XmlNotation) nMap.Item(i);
@@ -28,6 +28,6 @@ public static void DisplayNotations(XmlNamedNodeMap nMap)
Console.Write("{0} ", note.SystemId);
Console.WriteLine();
}
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReader.Create/CS/XmlReader_Create.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReader.Create/CS/XmlReader_Create.cs
index 584d6744b56..08364b2a353 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReader.Create/CS/XmlReader_Create.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReader.Create/CS/XmlReader_Create.cs
@@ -11,7 +11,7 @@ static void Main()
{
}
- //
+ //
static void String_Fragment()
{
//
@@ -27,7 +27,7 @@ static void String_Fragment()
// Create the XmlParserContext.
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
-// Create the reader.
+// Create the reader.
XmlReaderSettings settings = new XmlReaderSettings();
settings.ConformanceLevel = ConformanceLevel.Fragment;
XmlReader reader = XmlReader.Create(new StringReader(xmlFrag), settings, context);
@@ -45,7 +45,7 @@ static void Settings_Resolver()
//
// Create an XmlUrlResolver with the credentials necessary to access the Web server.
var resolver = new XmlUrlResolver();
-var myCred = new NetworkCredential(UserName, SecurelyStoredPassword, Domain);
+var myCred = new NetworkCredential(UserName, SecurelyStoredPassword, Domain);
resolver.Credentials = myCred;
var settings = new XmlReaderSettings();
@@ -65,11 +65,11 @@ static void Settings_ProhibitDtd()
settings.DtdProcessing = DtdProcessing.Parse;
settings.ValidationType = ValidationType.DTD;
settings.ValidationEventHandler += new ValidationEventHandler (ValidationCallBack);
-
+
// Create the XmlReader object.
XmlReader reader = XmlReader.Create("itemDTD.xml", settings);
-// Parse the file.
+// Parse the file.
while (reader.Read()) {}
//
}
@@ -128,7 +128,7 @@ static void FileStream()
{
//
-FileStream fs = new FileStream(@"C:\data\books.xml", FileMode.OpenOrCreate,
+FileStream fs = new FileStream(@"C:\data\books.xml", FileMode.OpenOrCreate,
FileAccess.Read, FileShare.Read);
// Create the XmlReader object.
@@ -140,7 +140,7 @@ static void FileStream_Settings()
{
//
-FileStream fs = new FileStream(@"C:\data\books.xml", FileMode.OpenOrCreate,
+FileStream fs = new FileStream(@"C:\data\books.xml", FileMode.OpenOrCreate,
FileAccess.Read, FileShare.Read);
XmlUrlResolver resolver = new XmlUrlResolver();
@@ -170,7 +170,7 @@ static void Settings_SecureResolver()
//
}
- //
+ //
static void GeneralSettings()
{
//
@@ -183,7 +183,7 @@ static void GeneralSettings()
//
}
- //
+ //
static void ChainReaders()
{
//
@@ -196,7 +196,7 @@ static void ChainReaders()
//
}
- //
+ //
static void WrapTextReader()
{
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReader.ReadContentAs/CS/readContentAs.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReader.ReadContentAs/CS/readContentAs.cs
index fccbc5e80c3..463610ecbb7 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReader.ReadContentAs/CS/readContentAs.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReader.ReadContentAs/CS/readContentAs.cs
@@ -8,7 +8,7 @@ class Typed_Read_Methods {
static void Main() {
ReadContentAsBoolean();
- ReadContentAs();
+ ReadContentAs();
}
public static void ReadContentAsBoolean() {
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReader.ReadElementContentAs/CS/readElementContentAs.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReader.ReadElementContentAs/CS/readElementContentAs.cs
index a260c3101bb..8e43f4c9658 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReader.ReadElementContentAs/CS/readElementContentAs.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReader.ReadElementContentAs/CS/readElementContentAs.cs
@@ -76,9 +76,9 @@ public static void ReadElementContentAsObject() {
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.Schema;
settings.Schemas.Add("urn:items", "item.xsd");
- XmlReader reader = XmlReader.Create("item.xml", settings);
+ XmlReader reader = XmlReader.Create("item.xml", settings);
- // Get the CLR type of the price element.
+ // Get the CLR type of the price element.
reader.ReadToFollowing("price");
Console.WriteLine(reader.ValueType);
@@ -88,7 +88,7 @@ public static void ReadElementContentAsObject() {
// Add 2.50 to the price.
price = Decimal.Add(price, 2.50m);
-//
+//
}
public static void ReadElementContentAsDouble_1() {
@@ -103,7 +103,7 @@ public static void ReadElementContentAsDouble_1() {
public static void ReadTypedData1() {
//
-// Create a validating XmlReader object. The schema
+// Create a validating XmlReader object. The schema
// provides the necessary type information.
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.Schema;
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReaderBasic/CS/XmlReader_Basic.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReaderBasic/CS/XmlReader_Basic.cs
index f125daea3cb..1651ffdd6a3 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReaderBasic/CS/XmlReader_Basic.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReaderBasic/CS/XmlReader_Basic.cs
@@ -19,13 +19,13 @@ static void AttributeCount() {
Console.WriteLine(" {0}", reader[i]);
}
// Move the reader back to the element node.
- reader.MoveToElement();
+ reader.MoveToElement();
}
//
}
//==============================//
-//
+//
static void GetAttribute1() {
XmlReader reader = XmlReader.Create("books.xml");
//
@@ -34,7 +34,7 @@ static void GetAttribute1() {
//
}
//==============================//
-//
+//
static void GetAttribute2() {
XmlReader reader = XmlReader.Create("books.xml");
//
@@ -45,7 +45,7 @@ static void GetAttribute2() {
}
//==============================//
-//
+//
static void MoveToAttribute1() {
XmlReader reader = XmlReader.Create("books.xml");
reader.ReadToFollowing("book");
@@ -62,8 +62,8 @@ static void MoveToAttribute1() {
}
//==============================//
-//
-static void MoveToFirstAttribute() {
+//
+static void MoveToFirstAttribute() {
XmlReader reader = XmlReader.Create("books.xml");
//
reader.ReadToFollowing("book");
@@ -74,8 +74,8 @@ static void MoveToFirstAttribute() {
}
//==============================//
-//
-static void MoveToNextAttribute() {
+//
+static void MoveToNextAttribute() {
XmlReader reader = XmlReader.Create("books.xml");
reader.ReadToFollowing("book");
//
@@ -91,7 +91,7 @@ static void MoveToNextAttribute() {
}
//==============================//
-//
+//
static void Item() {
XmlReader reader = XmlReader.Create("books.xml");
//
@@ -102,14 +102,14 @@ static void Item() {
}
//==============================//
-//
+//
static void Node_Value() {
-
+
//
XmlReaderSettings settings = new XmlReaderSettings();
settings.DtdProcessing = DtdProcessing.Parse;
XmlReader reader = XmlReader.Create("items.xml", settings);
-
+
reader.MoveToContent();
// Parse the file and display each of the nodes.
while (reader.Read()) {
@@ -143,18 +143,18 @@ static void Node_Value() {
case XmlNodeType.EndElement:
Console.Write("{0}>", reader.Name);
break;
- }
+ }
}
//
}
//==============================//
-//
+//
static void NamespaceURI() {
//
XmlReader reader = XmlReader.Create("book2.xml");
-// Parse the file. If they exist, display the prefix and
+// Parse the file. If they exist, display the prefix and
// namespace URI of each node.
while (reader.Read()) {
if (reader.IsStartElement()) {
@@ -167,13 +167,13 @@ static void NamespaceURI() {
Console.WriteLine(" The namespace URI is " + reader.NamespaceURI);
}
}
-}
+}
reader.Close();
//
}
//==============================//
-//
+//
static void IsStartElement() {
XmlReader reader = XmlReader.Create("elems.xml");
//
@@ -190,22 +190,22 @@ static void IsStartElement() {
Console.Write("\r\n<{0}>", reader.Name);
Console.WriteLine(reader.ReadString()); //Read the text content of the element.
}
- }
-}
+ }
+}
//
}
//==============================//
-//
+//
static void ReadEndElement() {
//
using (XmlReader reader = XmlReader.Create("book3.xml")) {
- // Parse the XML document. ReadString is used to
+ // Parse the XML document. ReadString is used to
// read the text content of the elements.
- reader.Read();
- reader.ReadStartElement("book");
- reader.ReadStartElement("title");
+ reader.Read();
+ reader.ReadStartElement("book");
+ reader.ReadStartElement("title");
Console.Write("The content of the title element: ");
Console.WriteLine(reader.ReadString());
reader.ReadEndElement();
@@ -218,7 +218,7 @@ static void ReadEndElement() {
//
}
//==============================//
-//
+//
static void ReadInnerXml() {
//
// Load the file and ignore all white space.
@@ -228,9 +228,9 @@ static void ReadInnerXml() {
// Moves the reader to the root element.
reader.MoveToContent();
-
+
// Moves to book node.
- reader.Read();
+ reader.Read();
// Note that ReadInnerXml only returns the markup of the node's children
// so the book's attributes are not returned.
@@ -240,13 +240,13 @@ static void ReadInnerXml() {
// ReadOuterXml returns the markup for the current node and its children
// so the book's attributes are also returned.
Console.WriteLine("Read the second book using ReadOuterXml...");
- Console.WriteLine(reader.ReadOuterXml());
+ Console.WriteLine(reader.ReadOuterXml());
}
//
}
//==============================//
-//
+//
static void ReadSubtree() {
//
XmlReaderSettings settings = new XmlReaderSettings();
@@ -256,29 +256,29 @@ static void ReadSubtree() {
// Position the reader on the second book node
reader.ReadToFollowing("Book");
reader.Skip();
-
+
// Create another reader that contains just the second book node.
XmlReader inner = reader.ReadSubtree();
inner.ReadToDescendant("Title");
Console.WriteLine(inner.Name);
- // Do additional processing on the inner reader. After you
- // are done, call Close on the inner reader and
+ // Do additional processing on the inner reader. After you
+ // are done, call Close on the inner reader and
// continue processing using the original reader.
- inner.Close();
+ inner.Close();
}
//
}
//==============================//
-//
+//
static void ReadtoDescendant() {
//
using (XmlReader reader = XmlReader.Create("2books.xml")) {
// Move the reader to the second book node.
- reader.MoveToContent();
+ reader.MoveToContent();
reader.ReadToDescendant("book");
reader.Skip(); //Skip the first book.
@@ -298,27 +298,27 @@ static void ReadtoDescendant() {
case XmlNodeType.EndElement:
Console.Write("{0}>", reader.Name);
break;
- }
- } while (reader.Read());
+ }
+ } while (reader.Read());
}
//
}
//==============================//
-//
+//
static void ReadToFollowing() {
//
using (XmlReader reader = XmlReader.Create("books.xml")) {
reader.ReadToFollowing("book");
do {
- Console.WriteLine("ISBN: {0}", reader.GetAttribute("ISBN"));
+ Console.WriteLine("ISBN: {0}", reader.GetAttribute("ISBN"));
} while (reader.ReadToNextSibling("book"));
}
//
}
//==============================//
-//
+//
static void HasValue() {
//
XmlReaderSettings settings = new XmlReaderSettings();
@@ -330,13 +330,13 @@ static void HasValue() {
Console.WriteLine("({0}) {1}={2}", reader.NodeType, reader.Name, reader.Value);
else
Console.WriteLine("({0}) {1}", reader.NodeType, reader.Name);
- }
+ }
}
//
}
//==============================//
-//
+//
static void IsStartElement_2() {
using (XmlReader reader = XmlReader.Create("books.xml")) {
//
@@ -345,8 +345,8 @@ static void IsStartElement_2() {
if (reader.IsStartElement("price")) {
Console.WriteLine(reader.ReadInnerXml());
}
- }
-//
+ }
+//
}
}
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.DtdValidate/CS/validdtd.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.DtdValidate/CS/validdtd.cs
index f45bfe6670e..3b2d8daa8b6 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.DtdValidate/CS/validdtd.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.DtdValidate/CS/validdtd.cs
@@ -13,11 +13,11 @@ public static void Main() {
settings.DtdProcessing = DtdProcessing.Parse;
settings.ValidationType = ValidationType.DTD;
settings.ValidationEventHandler += new ValidationEventHandler (ValidationCallBack);
-
+
// Create the XmlReader object.
XmlReader reader = XmlReader.Create("itemDTD.xml", settings);
- // Parse the file.
+ // Parse the file.
while (reader.Read());
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.IgnoreInlineSchema/CS/factory_rdr_cctor.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.IgnoreInlineSchema/CS/factory_rdr_cctor.cs
index 442dbfb0f3c..47af7b42ad2 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.IgnoreInlineSchema/CS/factory_rdr_cctor.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.IgnoreInlineSchema/CS/factory_rdr_cctor.cs
@@ -18,7 +18,7 @@ public static void Main() {
// Create the XmlReader object.
XmlReader reader = XmlReader.Create("inlineSchema.xml", settings);
- // Parse the file.
+ // Parse the file.
while (reader.Read());
}
@@ -28,6 +28,6 @@ private static void ValidationCallBack (object sender, ValidationEventArgs args)
Console.WriteLine("\tWarning: Matching schema not found. No validation occurred." + args.Message);
else
Console.WriteLine("\tValidation error: " + args.Message);
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.cctor/CS/factory_rdr_cctor2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.cctor/CS/factory_rdr_cctor2.cs
index ba072f37775..e60ce5723cc 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.cctor/CS/factory_rdr_cctor2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReaderSettings.cctor/CS/factory_rdr_cctor2.cs
@@ -19,7 +19,7 @@ public static void Main() {
// Create a resolver with default credentials.
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;
-
+
// Set the reader settings object to use the resolver.
settings.XmlResolver = resolver;
@@ -27,7 +27,7 @@ public static void Main() {
XmlReader reader = XmlReader.Create("http://ServerName/data/books.xml", settings);
//
- // Parse the file.
+ // Parse the file.
while (reader.Read());
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Read_Write_Binary/CS/readBinary.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Read_Write_Binary/CS/readBinary.cs
index 264bb5b2a03..60c90f13af7 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Read_Write_Binary/CS/readBinary.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Read_Write_Binary/CS/readBinary.cs
@@ -22,7 +22,7 @@ public static void BinHexEncodeImageFile() {
int readBytes = 0;
using (XmlWriter writer = XmlWriter.Create("output.xml")) {
- FileStream inputFile = new FileStream(@"C:\artFiles\sunset.jpg", FileMode.OpenOrCreate,
+ FileStream inputFile = new FileStream(@"C:\artFiles\sunset.jpg", FileMode.OpenOrCreate,
FileAccess.Read, FileShare.Read);
writer.WriteStartDocument();
writer.WriteStartElement("image");
@@ -48,8 +48,8 @@ public static void BinHexDecodeImageFile() {
int readBytes = 0;
using (XmlReader reader = XmlReader.Create("output.xml")) {
-
- FileStream outputFile = new FileStream(@"C:\artFiles\data\newImage.jpg", FileMode.OpenOrCreate,
+
+ FileStream outputFile = new FileStream(@"C:\artFiles\data\newImage.jpg", FileMode.OpenOrCreate,
FileAccess.Write, FileShare.Write);
// Read to the image element.
reader.ReadToFollowing("image");
@@ -101,7 +101,7 @@ public static void Base64DecodeImageFile() {
int readBytes = 0;
using (XmlReader reader = XmlReader.Create("output.xml")) {
-
+
FileStream outputFile = new FileStream(@"C:\artFiles\data\newImage.jpg",
FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write);
// Read to the image element.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Validate_DOM/CS/valid_dom.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Validate_DOM/CS/valid_dom.cs
index 66919bc3018..a3edd35a750 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Validate_DOM/CS/valid_dom.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Validate_DOM/CS/valid_dom.cs
@@ -27,7 +27,7 @@ public static void Main() {
// Create a validating reader that wraps the XmlNodeReader object.
XmlReader reader = XmlReader.Create(nodeReader, settings);
-
+
// Parse the XML file.
while (reader.Read());
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Validate_SchemaSet/CS/validschemaset.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Validate_SchemaSet/CS/validschemaset.cs
index b886775e646..ab5f75909e6 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Validate_SchemaSet/CS/validschemaset.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlReader_Validate_SchemaSet/CS/validschemaset.cs
@@ -4,7 +4,7 @@
using System.Xml.Schema;
using System.IO;
-public class Sample
+public class Sample
{
public static void Main() {
@@ -19,11 +19,11 @@ public static void Main() {
settings.ValidationType = ValidationType.Schema;
settings.Schemas = sc;
settings.ValidationEventHandler += ValidationCallBack;
-
+
// Create the XmlReader object.
XmlReader reader = XmlReader.Create("booksSchemaFail.xml", settings);
- // Parse the file.
+ // Parse the file.
while (reader.Read());
}
@@ -33,13 +33,13 @@ private static void ValidationCallBack(object sender, ValidationEventArgs e) {
}
}
// The example displays output like the following:
-// Validation Error:
-// The element 'book' in namespace 'urn:bookstore-schema' has invalid child element 'author'
-// in namespace 'urn:bookstore-schema'. List of possible elements expected: 'title' in
+// Validation Error:
+// The element 'book' in namespace 'urn:bookstore-schema' has invalid child element 'author'
+// in namespace 'urn:bookstore-schema'. List of possible elements expected: 'title' in
// namespace 'urn:bookstore-schema'.
//
-// Validation Error:
-// The element 'author' in namespace 'urn:bookstore-schema' has invalid child element 'name'
-// in namespace 'urn:bookstore-schema'. List of possible elements expected: 'first-name' in
+// Validation Error:
+// The element 'author' in namespace 'urn:bookstore-schema' has invalid child element 'name'
+// in namespace 'urn:bookstore-schema'. List of possible elements expected: 'first-name' in
// namespace 'urn:bookstore-schema'.
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlResolver_Samples/CS/XmlResolver_Samples.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlResolver_Samples/CS/XmlResolver_Samples.cs
index 2149a9536c4..6c66c8ffb9f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlResolver_Samples/CS/XmlResolver_Samples.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlResolver_Samples/CS/XmlResolver_Samples.cs
@@ -22,9 +22,9 @@ static void XmlUrlResolver_Credentials1()
// Create the reader.
XmlReaderSettings settings = new XmlReaderSettings();
settings.XmlResolver = resolver;
- XmlReader reader =
+ XmlReader reader =
XmlReader.Create("http://serverName/data/books.xml", settings);
-
+
//
}
@@ -41,7 +41,7 @@ static void XmlUrlResolver_Credentials2()
// Create a resolver and specify the necessary credentials.
XmlUrlResolver resolver = new XmlUrlResolver();
System.Net.NetworkCredential myCred;
- myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
+ myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
resolver.Credentials = myCred;
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlSchema.ValidationEventHandler/CS/schemaevent.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlSchema.ValidationEventHandler/CS/schemaevent.cs
index 8e37567716a..c820dd34159 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlSchema.ValidationEventHandler/CS/schemaevent.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlSchema.ValidationEventHandler/CS/schemaevent.cs
@@ -15,13 +15,13 @@ public static void Main (){
//Set an event handler to manage invalid schemas.
xsc.ValidationEventHandler += new ValidationEventHandler (ValidationCallBack);
- //Add the schema to the collection.
+ //Add the schema to the collection.
xsc.Add(null, "invalid.xsd");
- }
+ }
//Display the schema error information.
private static void ValidationCallBack (object sender, ValidationEventArgs args){
Console.WriteLine("Invalid XSD schema: " + args.Exception.Message);
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver.Credentials/CS/secresolver2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver.Credentials/CS/secresolver2.cs
index 8293a2fd49a..76c22eb751d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver.Credentials/CS/secresolver2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver.Credentials/CS/secresolver2.cs
@@ -10,7 +10,7 @@ public static void Main() {
// Create the reader.
XmlTextReader reader = new XmlTextReader("http://myServer/data/books.xml");
-
+
// Create a secure resolver with default credentials.
XmlUrlResolver resolver = new XmlUrlResolver();
XmlSecureResolver sResolver = new XmlSecureResolver(resolver, "http://myServer/data/");
@@ -22,10 +22,10 @@ public static void Main() {
// Parse the file.
while (reader.Read()) {
// Do any additional processing here.
- }
-
+ }
+
// Close the reader.
- reader.Close();
+ reader.Close();
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver.cctor/CS/secresolver.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver.cctor/CS/secresolver.cs
index 9bd22a54ef7..c5e5cd1662e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver.cctor/CS/secresolver.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver.cctor/CS/secresolver.cs
@@ -4,24 +4,24 @@
using System.Security;
using System.Security.Policy;
using System.Net;
-
+
public class Sample
{
-
+
private const String filename = @"http://localhost/data/books.xml";
-
+
public static void Main () {
-
+
Stream s = (Stream) GetFile(filename, new XmlUrlResolver());
XmlTextReader reader = new XmlTextReader(s);
}
-
+
// NOTE: To test, replace www.contoso.com w/ the local string
//
public static Object GetFile (String fileURL, XmlResolver resolver) {
-
+
// Generate the default PermissionSet using the file URL.
Evidence evidence = XmlSecureResolver.CreateEvidenceForUrl(fileURL);
PermissionSet myPermissions = SecurityManager.ResolvePolicy(evidence);
@@ -38,6 +38,6 @@ public static Object GetFile (String fileURL, XmlResolver resolver) {
// Get the object.
Uri fullUri = sResolver.ResolveUri(null, fileURL);
return sResolver.GetEntity(fullUri, null, null);
- }
-//
+ }
+//
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver_Samples/CS/XmlSecureResolver_ex.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver_Samples/CS/XmlSecureResolver_ex.cs
index 5950f1e2928..8a05dde620f 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver_Samples/CS/XmlSecureResolver_ex.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlSecureResolver_Samples/CS/XmlSecureResolver_ex.cs
@@ -22,7 +22,7 @@ public void Assembly_Evidence() {
}
//==============================
-//
+//
static void URI_Evidence() {
string sourceURI = "http://serverName/data";
//
@@ -32,7 +32,7 @@ static void URI_Evidence() {
//
}
//==============================
-//
+//
static void Use_URL() {
//
XmlSecureResolver myResolver = new XmlSecureResolver(new XmlUrlResolver(), "http://myLocalSite/");
@@ -40,7 +40,7 @@ static void Use_URL() {
}
//==============================
-//
+//
static void Use_PermissionSet() {
//
WebPermission myWebPermission = new WebPermission(PermissionState.None);
@@ -59,8 +59,8 @@ static void Use_PermissionSet() {
}
//==============================
-//
-static void Reader_Resolver() {
+//
+static void Reader_Resolver() {
XmlSecureResolver myResolver = new XmlSecureResolver(new XmlUrlResolver(), "http://myLocalSite/");
//
XmlReaderSettings settings = new XmlReaderSettings();
@@ -72,8 +72,8 @@ static void Reader_Resolver() {
}
//==============================
-//
-static void XSLT_Resolver() {
+//
+static void XSLT_Resolver() {
XmlSecureResolver myResolver = new XmlSecureResolver(new XmlUrlResolver(), "http://myLocalSite/");
//
XslCompiledTransform xslt = new XslCompiledTransform();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.Cctor/CS/readfrag.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.Cctor/CS/readfrag.cs
index a7ea827b999..8ccb9425ce3 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.Cctor/CS/readfrag.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.Cctor/CS/readfrag.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -12,7 +12,7 @@ public static void Main()
string xmlFrag =" " +
"Pride And Prejudice" +
"novel" +
- "";
+ "";
//Create the XmlNamespaceManager.
NameTable nt = new NameTable();
@@ -22,10 +22,10 @@ public static void Main()
//Create the XmlParserContext.
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
- //Create the reader.
+ //Create the reader.
XmlTextReader reader = new XmlTextReader(xmlFrag, XmlNodeType.Element, context);
-
- //Parse the XML. If they exist, display the prefix and
+
+ //Parse the XML. If they exist, display the prefix and
//namespace URI of each element.
while (reader.Read()){
if (reader.IsStartElement()){
@@ -40,9 +40,9 @@ public static void Main()
}
}
}
-
+
//Close the reader.
- reader.Close();
+ reader.Close();
}
} // End class
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.LineNum/CS/readlinenum.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.LineNum/CS/readlinenum.cs
index 377b15740da..1b5f31e8c68 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.LineNum/CS/readlinenum.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.LineNum/CS/readlinenum.cs
@@ -8,12 +8,12 @@ public class Sample{
public static void Main(){
// Create the XML fragment to be parsed.
- string xmlFrag =
- @"
+ string xmlFrag =
+ @"
-
+
240
-
+
";
// Create the XmlNamespaceManager.
@@ -41,11 +41,11 @@ public static void Main(){
Console.Write("{0} {1},{2} ", reader.Depth, reader.LineNumber, reader.LinePosition);
Console.WriteLine("{0}>", reader.Name);
break;
- }
- }
+ }
+ }
// Close the reader.
- reader.Close();
+ reader.Close();
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.Normalization/CS/readnormal.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.Normalization/CS/readnormal.cs
index 78e6c2c7d77..5fea94bafd2 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.Normalization/CS/readnormal.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.Normalization/CS/readnormal.cs
@@ -8,10 +8,10 @@ public class Sample{
public static void Main(){
// Create the XML fragment to be parsed.
- string xmlFrag =
+ string xmlFrag =
@"
- ";
+ ";
// Create the XmlNamespaceManager.
XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
@@ -36,9 +36,9 @@ 1 2 3'/>
reader.Read();
reader.MoveToContent();
Console.WriteLine("Attribute value:{0}", reader.GetAttribute("attr2"));
-
+
// Close the reader.
- reader.Close();
+ reader.Close();
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.ReadAttributeValue/CS/readattrval.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.ReadAttributeValue/CS/readattrval.cs
index 549129a4a22..416fbf9b732 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.ReadAttributeValue/CS/readattrval.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.ReadAttributeValue/CS/readattrval.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main()
{
@@ -13,15 +13,15 @@ public static void Main()
{
//Create the XML fragment to be parsed.
string xmlFrag ="";
-
+
//Create the XmlParserContext.
XmlParserContext context;
string subset = "";
context = new XmlParserContext(null, null, "book", null, null, subset, "", "", XmlSpace.None);
-
+
//Create the reader.
reader = new XmlTextReader(xmlFrag, XmlNodeType.Element, context);
-
+
//Read the misc attribute. The attribute is parsed
//into multiple text and entity reference nodes.
reader.MoveToContent();
@@ -31,9 +31,9 @@ public static void Main()
Console.WriteLine("{0} {1}", reader.NodeType, reader.Name);
else
Console.WriteLine("{0} {1}", reader.NodeType, reader.Value);
- }
- }
- finally
+ }
+ }
+ finally
{
if (reader != null)
reader.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.ResetState/CS/resetstate.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.ResetState/CS/resetstate.cs
index 1a5b21e7821..4c0af0d8243 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.ResetState/CS/resetstate.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.ResetState/CS/resetstate.cs
@@ -9,7 +9,7 @@ public class Sample
public static void Main(){
Encoding enc = new UTF8Encoding();
- byte[] utf8Buffer = enc.GetBytes(" 12345 ");
+ byte[] utf8Buffer = enc.GetBytes(" 12345 ");
enc = new UnicodeEncoding();
byte[] unicodeBuffer = enc.GetBytes(" root ");
@@ -30,7 +30,7 @@ public static void Main(){
if (XmlNodeType.EndElement == reader.NodeType) {
reader.ResetState();
}
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlLang/CS/readlang.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlLang/CS/readlang.cs
index d3dc9089c08..6caf873bd8b 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlLang/CS/readlang.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlLang/CS/readlang.cs
@@ -11,7 +11,7 @@ public static void Main(){
string xmlFrag = " " +
" Colour Analysis" +
" Color Analysis" +
- "";
+ "";
//Create the XmlNamespaceManager.
NameTable nt = new NameTable();
@@ -36,11 +36,11 @@ public static void Main(){
case XmlNodeType.EndElement:
Console.WriteLine("{0}: {1}>", reader.XmlLang, reader.Name);
break;
- }
- }
-
+ }
+ }
+
//Close the reader.
- reader.Close();
+ reader.Close();
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlResolver/CS/rdr_resolver.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlResolver/CS/rdr_resolver.cs
index 70332a8beb6..c887b9d4f3d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlResolver/CS/rdr_resolver.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlResolver/CS/rdr_resolver.cs
@@ -10,7 +10,7 @@ public static void Main() {
// Create the reader.
XmlTextReader reader = new XmlTextReader("http://myServer/data/books.xml");
-
+
// Supply the credentials necessary to access the Web server.
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = CredentialCache.DefaultCredentials;
@@ -19,10 +19,10 @@ public static void Main() {
// Parse the file.
while (reader.Read()) {
// Do any additional processing here.
- }
-
+ }
+
// Close the reader.
- reader.Close();
+ reader.Close();
}
-}
+}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlSpace/CS/readspace.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlSpace/CS/readspace.cs
index aff486fef56..ba1da3bc0f2 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlSpace/CS/readspace.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.XmlSpace/CS/readspace.cs
@@ -27,8 +27,8 @@ public static void Main(){
break;
case XmlNodeType.SignificantWhitespace:
Console.Write(reader.Value);
- break;
- }
+ break;
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.cctor1/CS/rdrcctor1.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.cctor1/CS/rdrcctor1.cs
index 9339184f475..9b953f7596c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.cctor1/CS/rdrcctor1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextReader.cctor1/CS/rdrcctor1.cs
@@ -7,7 +7,7 @@ public class Sample {
public static void Main() {
- string xmlData =
+ string xmlData =
@"Oberon's Legacy5.95
@@ -29,11 +29,11 @@ public static void Main() {
case XmlNodeType.EndElement:
Console.Write("{0}>", reader.Name);
break;
- }
- }
+ }
+ }
// Close the reader.
- reader.Close();
+ reader.Close();
}
} // End class
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlTextWriter.Flush/CS/write2docs.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlTextWriter.Flush/CS/write2docs.cs
index 9df5d7d974c..d7e96a1a890 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlTextWriter.Flush/CS/write2docs.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlTextWriter.Flush/CS/write2docs.cs
@@ -22,7 +22,7 @@ public static void Main()
writer.WriteStartElement("cd");
writer.WriteElementString("title", "Americana");
writer.WriteEndElement();
- writer.Flush();
+ writer.Flush();
//Close the writer.
writer.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.Cctor/CS/valid_xsd2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.Cctor/CS/valid_xsd2.cs
index aa1be9ae264..ae76bc16aee 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.Cctor/CS/valid_xsd2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.Cctor/CS/valid_xsd2.cs
@@ -12,11 +12,11 @@ public class Sample
public Sample ()
{
//Validate the document using an external XSD schema. Validation should fail.
- Validate("notValidXSD.xml");
+ Validate("notValidXSD.xml");
//Validate the document using an inline XSD. Validation should succeed.
Validate("inlineXSD.xml");
- }
+ }
public static void Main ()
{
@@ -24,7 +24,7 @@ public static void Main ()
}
private void Validate(String filename)
- {
+ {
m_success = true;
Console.WriteLine("\r\n******");
Console.WriteLine("Validating XML file " + filename.ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.IsDefault/CS/readdefattr.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.IsDefault/CS/readdefattr.cs
index 7052b415c1d..acf75d1c741 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.IsDefault/CS/readdefattr.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.IsDefault/CS/readdefattr.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
-public class Sample
+public class Sample
{
public static void Main(){
@@ -17,11 +17,11 @@ public static void Main(){
while (reader.MoveToNextAttribute()){
if (reader.IsDefault)
Console.Write("(default attribute) ");
- Console.WriteLine("{0} = {1}", reader.Name, reader.Value);
- }
-
+ Console.WriteLine("{0} = {1}", reader.Name, reader.Value);
+ }
+
//Close the reader.
- reader.Close();
+ reader.Close();
}
} // End class
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.SchemaType/CS/schematype.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.SchemaType/CS/schematype.cs
index 842ed3a1920..384da5a6440 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.SchemaType/CS/schematype.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.SchemaType/CS/schematype.cs
@@ -7,14 +7,14 @@
public class Sample{
public static void Main(){
-
+
XmlTextReader tr = new XmlTextReader("booksSchema.xml");
XmlValidatingReader vr = new XmlValidatingReader(tr);
-
+
vr.Schemas.Add(null, "books.xsd");
vr.ValidationType = ValidationType.Schema;
vr.ValidationEventHandler += new ValidationEventHandler (ValidationCallBack);
-
+
while(vr.Read()){
if(vr.NodeType == XmlNodeType.Element){
if(vr.SchemaType is XmlSchemaComplexType){
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.XmlResolver/CS/vrdr_resolver.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.XmlResolver/CS/vrdr_resolver.cs
index b9d9d1f4873..92b4cbb4192 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.XmlResolver/CS/vrdr_resolver.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlValidatingReader.XmlResolver/CS/vrdr_resolver.cs
@@ -40,11 +40,11 @@ public static void Main(string[] args) {
case XmlNodeType.EndElement:
Console.Write("{0}>", reader.Name);
break;
- }
- }
+ }
+ }
//
-
+
//Close the reader.
- reader.Close();
+ reader.Close();
}
} // End class
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Close/CS/writeelems.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Close/CS/writeelems.cs
index 0221e72da54..1cfbf9dfc10 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Close/CS/writeelems.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Close/CS/writeelems.cs
@@ -4,9 +4,9 @@
using System.Xml;
public class Sample {
-
+
public static void Main() {
-
+
// Create a writer to write XML to the console.
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
@@ -23,9 +23,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();
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Flush/CS/write2docs_v2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Flush/CS/write2docs_v2.cs
index 0deb18f8da9..2dbdf6c4361 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Flush/CS/write2docs_v2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.Flush/CS/write2docs_v2.cs
@@ -6,13 +6,13 @@
public class Sample {
public static void Main() {
-
+
// Create an XmlWriter to write XML fragments.
XmlWriterSettings settings = new XmlWriterSettings();
settings.ConformanceLevel = ConformanceLevel.Fragment;
settings.Indent = true;
XmlWriter writer = XmlWriter.Create(Console.Out, settings);
-
+
// Write an XML fragment.
writer.WriteStartElement("book");
writer.WriteElementString("title", "Pride And Prejudice");
@@ -23,7 +23,7 @@ public static void Main() {
writer.WriteStartElement("cd");
writer.WriteElementString("title", "Americana");
writer.WriteEndElement();
- writer.Flush();
+ writer.Flush();
// Close the writer.
writer.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributeString/CS/writeattrstring.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributeString/CS/writeattrstring.cs
index ca828b642a1..8a4ef958e27 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributeString/CS/writeattrstring.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributeString/CS/writeattrstring.cs
@@ -6,17 +6,17 @@
public class Sample {
public static void Main() {
-
+
XmlWriter writer = null;
writer = XmlWriter.Create("sampledata.xml");
-
+
// Write the root element.
writer.WriteStartElement("book");
// Write the xmlns:bk="urn:book" namespace declaration.
writer.WriteAttributeString("xmlns","bk", null,"urn:book");
-
+
// Write the bk:ISBN="1-800-925" attribute.
writer.WriteAttributeString("ISBN", "urn:book", "1-800-925");
@@ -24,10 +24,10 @@ public static void Main() {
// Write the close tag for the root element.
writer.WriteEndElement();
-
+
// Write the XML to file and close the writer.
writer.Flush();
- writer.Close();
+ writer.Close();
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributes/CS/writeattrs_v2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributes/CS/writeattrs_v2.cs
index 6fb67ae23c9..d89607ee504 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributes/CS/writeattrs_v2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteAttributes/CS/writeattrs_v2.cs
@@ -6,7 +6,7 @@
public class Sample {
public static void Main() {
-
+
XmlReader reader = XmlReader.Create("test1.xml");
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteBase64/CS/writebase64.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteBase64/CS/writebase64.cs
index 9e4825592ca..e816ac7f9d8 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteBase64/CS/writebase64.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteBase64/CS/writebase64.cs
@@ -41,7 +41,7 @@ public static void Main(string[] args)
fileNew.Close();
}
- // Use the WriteBase64 method to create an XML document. The object
+ // Use the WriteBase64 method to create an XML document. The object
// passed by the user is encoded and included in the document.
public static void EncodeXmlFile(string xmlFileName, FileStream fileOld)
{
@@ -84,7 +84,7 @@ public static void EncodeXmlFile(string xmlFileName, FileStream fileOld)
xw.Close();
}
- // Use the ReadBase64 method to decode the new XML document
+ // Use the ReadBase64 method to decode the new XML document
// and generate the original object.
public static void DecodeOrignalObject(string xmlFileName, FileStream fileNew)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteElementString/CS/writeelemstring_v2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteElementString/CS/writeelemstring_v2.cs
index 2e16be2980d..cd3a7cb83f8 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteElementString/CS/writeelemstring_v2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteElementString/CS/writeelemstring_v2.cs
@@ -2,40 +2,40 @@
using System;
using System.IO;
using System.Xml;
-
+
public class Sample
{
private const string m_Document = "sampledata.xml";
-
+
public static void Main() {
-
+
XmlWriter writer = null;
try {
-
+
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
writer = XmlWriter.Create (m_Document, settings);
-
+
writer.WriteComment("sample XML fragment");
-
+
// Write an element (this one is the root).
writer.WriteStartElement("book");
-
+
// Write the namespace declaration.
writer.WriteAttributeString("xmlns", "bk", null, "urn:samples");
-
+
// Write the genre attribute.
writer.WriteAttributeString("genre", "novel");
-
+
// Write the title.
writer.WriteStartElement("title");
writer.WriteString("The Handmaid's Tale");
writer.WriteEndElement();
-
+
// Write the price.
writer.WriteElementString("price", "19.95");
-
+
// Lookup the prefix and write the ISBN element.
string prefix = writer.LookupPrefix("urn:samples");
writer.WriteStartElement(prefix, "ISBN", "urn:samples");
@@ -44,10 +44,10 @@ public static void Main() {
// Write the style element (shows a different way to handle prefixes).
writer.WriteElementString("style", "urn:samples", "hardcover");
-
+
// Write the close tag for the root element.
writer.WriteEndElement();
-
+
// Write the XML to file and close the writer.
writer.Flush();
writer.Close();
@@ -56,7 +56,7 @@ public static void Main() {
finally {
if (writer != null)
writer.Close();
- }
+ }
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteFullEndElement/CS/writerfullend_v2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteFullEndElement/CS/writerfullend_v2.cs
index e0e479d18dd..478b46363c7 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteFullEndElement/CS/writerfullend_v2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteFullEndElement/CS/writerfullend_v2.cs
@@ -6,7 +6,7 @@
public class Sample {
public static void Main() {
-
+
// Create a writer to write XML to the console.
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
@@ -26,9 +26,9 @@ public static void Main() {
writer.WriteFullEndElement();
writer.WriteEndElement();
-
+
// Write the XML to file and close the writer
- writer.Close();
+ writer.Close();
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteStartDocument/CS/writerbook_v2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteStartDocument/CS/writerbook_v2.cs
index 4cd693f5b83..e3360910d76 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteStartDocument/CS/writerbook_v2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter.WriteStartDocument/CS/writerbook_v2.cs
@@ -8,7 +8,7 @@ public class Sample {
private const string filename = "sampledata.xml";
public static void Main() {
-
+
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
XmlWriter writer = XmlWriter.Create(filename, settings);
@@ -19,26 +19,26 @@ public static void Main() {
// Write the DocumentType node.
writer.WriteDocType("book", null , null, "");
-
+
// Write a Comment node.
writer.WriteComment("sample XML");
-
+
// Write the root element.
writer.WriteStartElement("book");
// Write the genre attribute.
writer.WriteAttributeString("genre", "novel");
-
+
// Write the ISBN attribute.
writer.WriteAttributeString("ISBN", "1-8630-014");
// Write the title.
writer.WriteElementString("title", "The Handmaid's Tale");
-
+
// Write the style element.
writer.WriteStartElement("style");
writer.WriteEntityRef("h");
- writer.WriteEndElement();
+ writer.WriteEndElement();
// Write the price.
writer.WriteElementString("price", "19.95");
@@ -48,12 +48,12 @@ public static void Main() {
// Write the close tag for the root element.
writer.WriteEndElement();
-
+
writer.WriteEndDocument();
// Write the XML to file and close the writer.
writer.Flush();
- writer.Close();
+ writer.Close();
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.CloseOutput/CS/writestream2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.CloseOutput/CS/writestream2.cs
index 4acddbd9f33..25cb64d7b94 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.CloseOutput/CS/writestream2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.CloseOutput/CS/writestream2.cs
@@ -7,7 +7,7 @@ public class Sample {
public static void Main() {
-//
+//
XmlWriterSettings settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = true;
settings.ConformanceLevel = ConformanceLevel.Fragment;
@@ -23,5 +23,5 @@ public static void Main() {
// Do additional processing on the stream.
//
- }
-}
\ No newline at end of file
+ }
+}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.Indent/CS/writeindent.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.Indent/CS/writeindent.cs
index ea82d02c108..85266fa4d72 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.Indent/CS/writeindent.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.Indent/CS/writeindent.cs
@@ -7,12 +7,12 @@
public class Sample {
public static void Main() {
-
+
XmlWriter writer = null;
try {
- // Create an XmlWriterSettings object with the correct options.
+ // Create an XmlWriterSettings object with the correct options.
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.IndentChars = ("\t");
@@ -25,11 +25,11 @@ public static void Main() {
writer.WriteEndElement();
writer.Flush();
- }
+ }
finally {
if (writer != null)
writer.Close();
}
- }
-}
+ }
+}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.NewLineOnAttributes/CS/writenewlineattrs.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.NewLineOnAttributes/CS/writenewlineattrs.cs
index e048c55e0ce..1b367def91b 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.NewLineOnAttributes/CS/writenewlineattrs.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriterSettings.NewLineOnAttributes/CS/writenewlineattrs.cs
@@ -5,7 +5,7 @@
public class Sample {
public static void Main() {
-
+
XmlWriter writer = null;
try {
@@ -14,7 +14,7 @@ public static void Main() {
settings.Indent = true;
settings.OmitXmlDeclaration = true;
settings.NewLineOnAttributes = true;
-
+
writer = XmlWriter.Create(Console.Out, settings);
writer.WriteStartElement("order");
@@ -25,10 +25,10 @@ public static void Main() {
writer.Flush();
//
- }
+ }
finally {
if (writer != null)
writer.Close();
}
- }
-}
\ No newline at end of file
+ }
+}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs
index a77d612173a..878d01c5f91 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XmlWriter_v2/CS/writer_v2.cs
@@ -185,7 +185,7 @@ public static void Attrs3()
settings.Indent = true;
using (XmlWriter writer = XmlWriter.Create(Console.Out, settings))
{
-
+
writer.WriteStartElement("root");
writer.WriteAttributes(reader, true);
writer.WriteEndElement();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.Load/CS/Xslt_Load_v2.cs b/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.Load/CS/Xslt_Load_v2.cs
index 775fa0f8637..6f13c5a6982 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.Load/CS/Xslt_Load_v2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.Load/CS/Xslt_Load_v2.cs
@@ -29,7 +29,7 @@ static void XslCompiledTransform_Load2() {
// Create a resolver and set the credentials to use.
XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
resolver.Credentials = CredentialCache.DefaultCredentials;
-
+
// Load the style sheet.
xslt.Load("http://serverName/data/xsl/sort.xsl", null, resolver);
//
@@ -44,7 +44,7 @@ static void XslCompiledTransform_Load3() {
// Create a resolver and set the credentials to use.
XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
resolver.Credentials = CredentialCache.DefaultCredentials;
-
+
XmlReader reader = XmlReader.Create("http://serverName/data/xsl/sort.xsl");
// Create the XsltSettings object with script enabled.
@@ -67,9 +67,9 @@ static void XslCompiledTransform_Load4() {
// Create a resolver and specify the necessary credentials.
XmlUrlResolver resolver = new XmlUrlResolver();
System.Net.NetworkCredential myCred;
-myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
+myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
resolver.Credentials = myCred;
-
+
// Load the style sheet.
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(new XPathDocument("http://serverName/data/xsl/sort.xsl"), XsltSettings.Default, resolver);
@@ -78,7 +78,7 @@ static void XslCompiledTransform_Load4() {
//==============================//
// Load with XmlReader
-static void XslCompiledTransform_Load5() {
+static void XslCompiledTransform_Load5() {
//
// Create a reader that contains the style sheet.
XmlReader reader = XmlReader.Create("titles.xsl");
@@ -92,7 +92,7 @@ static void XslCompiledTransform_Load5() {
//==============================//
// Load with script enabled.
-static void XslCompiledTransform_Load6() {
+static void XslCompiledTransform_Load6() {
//
// Create the XsltSettings object with script enabled.
XsltSettings settings = new XsltSettings(false,true);
@@ -120,12 +120,12 @@ static void XslCompiledTransform_Load8() {
string UserName = "username";
string SecurelyStoredPassword = "psswd";
string Domain= "domain";
-
+
//
// Create a resolver and specify the necessary credentials.
XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
System.Net.NetworkCredential myCred;
-myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
+myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
resolver.Credentials = myCred;
// Create the XslCompiledTransform object and load the style sheet.
@@ -151,7 +151,7 @@ static void XslCompiledTransform_Load9() {
//
}
//==============================//
-//
+//
static void XslCompiledTransform_Debug() {
//
// Enable XSLT debugging.
@@ -178,12 +178,12 @@ static void Cache() {
string UserName = "username";
string SecurelyStoredPassword = "psswd";
string Domain= "domain";
-
+
//
// Create the credentials.
-NetworkCredential myCred = new NetworkCredential(UserName,SecurelyStoredPassword,Domain);
-CredentialCache myCache = new CredentialCache();
-myCache.Add(new Uri("http://www.contoso.com/"), "Basic", myCred);
+NetworkCredential myCred = new NetworkCredential(UserName,SecurelyStoredPassword,Domain);
+CredentialCache myCache = new CredentialCache();
+myCache.Add(new Uri("http://www.contoso.com/"), "Basic", myCred);
myCache.Add(new Uri("http://app.contoso.com/"), "Basic", myCred);
// Set the credentials on the XmlUrlResolver object.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.OutputSettings/CS/xslt_OutputSettings.cs b/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.OutputSettings/CS/xslt_OutputSettings.cs
index af3b7e245cc..d4716eccf75 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.OutputSettings/CS/xslt_OutputSettings.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.OutputSettings/CS/xslt_OutputSettings.cs
@@ -19,7 +19,7 @@ public static void Main() {
// Load the file to transform.
XPathDocument doc = new XPathDocument(filename);
- // Create the writer.
+ // Create the writer.
XmlWriter writer = XmlWriter.Create(Console.Out, xslt.OutputSettings);
// Transform the file and send the output to the console.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.Transform/CS/Xslt_Transform_v2.cs b/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.Transform/CS/Xslt_Transform_v2.cs
index c778b49e76f..c60f26871ec 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.Transform/CS/Xslt_Transform_v2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslCompiledTransform.Transform/CS/Xslt_Transform_v2.cs
@@ -71,12 +71,12 @@ static void XslCompiledTransform_Transform4() {
// Create a resolver and specify the necessary credentials.
XmlSecureResolver resolver = new XmlSecureResolver(new XmlUrlResolver(), "http://serverName/data/");
System.Net.NetworkCredential myCred;
-myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
+myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
resolver.Credentials = myCred;
XsltSettings settings = new XsltSettings();
settings.EnableDocumentFunction = true;
-
+
// Load the style sheet.
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load("http://serverName/data/xsl/sort.xsl", settings, resolver);
@@ -84,7 +84,7 @@ static void XslCompiledTransform_Transform4() {
// Transform the file.
using (XmlReader reader = XmlReader.Create("books.xml"))
{
- using (XmlWriter writer = XmlWriter.Create("output.xml"))
+ using (XmlWriter writer = XmlWriter.Create("output.xml"))
{
xslt.Transform(reader, null, writer, resolver);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load2/CS/trans2.cs b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load2/CS/trans2.cs
index bac07ff043a..67f19c26241 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load2/CS/trans2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load2/CS/trans2.cs
@@ -19,14 +19,14 @@ public static void Main()
//Create a resolver and set the credentials to use.
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = CredentialCache.DefaultCredentials;
-
+
//Load the stylesheet.
xslt.Load(stylesheet, resolver);
//Load the XML data file.
XPathDocument doc = new XPathDocument(filename);
- //Create the XmlTextWriter to output to the console.
+ //Create the XmlTextWriter to output to the console.
XmlTextWriter writer = new XmlTextWriter(Console.Out);
//Transform the file.
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load3/CS/trans3.cs b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load3/CS/trans3.cs
index 7b314ab7105..5f52743415a 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load3/CS/trans3.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load3/CS/trans3.cs
@@ -12,7 +12,7 @@ public class Sample
public static void Main()
{
- //Create the reader to load the stylesheet.
+ //Create the reader to load the stylesheet.
//Move the reader to the xsl:stylesheet node.
XmlTextReader reader = new XmlTextReader(stylesheet);
reader.Read();
@@ -24,13 +24,13 @@ public static void Main()
//Load the file to transform.
XPathDocument doc = new XPathDocument(filename);
-
+
//Create an XmlTextWriter which outputs to the console.
XmlTextWriter writer = new XmlTextWriter(Console.Out);
//Transform the file and send the output to the console.
xslt.Transform(doc, null, writer);
- writer.Close();
+ writer.Close();
}
}
//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load4/CS/trans_ev.cs b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load4/CS/trans_ev.cs
index 9c82a8b77ef..1ce2b1f4fd0 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load4/CS/trans_ev.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load4/CS/trans_ev.cs
@@ -2,31 +2,31 @@
using System.IO;
using System.Xml;
using System.Xml.Xsl;
-
+
public class Sample
{
private const String stylesheet = @"c:\tmp\output.xsl";
private const String myURL = @"http://localhost/data";
-
+
public static void Main () {
-
+
XmlTextReader reader = new XmlTextReader(stylesheet);
TransformFile(reader, myURL);
}
-
+
// Perform an XSLT transformation where xsltReader is an XmlReader containing
// a stylesheet and secureURI is a trusted URI that can be used to create Evidence.
//
public static void TransformFile (XmlReader xsltReader, String secureURL) {
-
- // Load the stylesheet using a default XmlUrlResolver and Evidence
+
+ // Load the stylesheet using a default XmlUrlResolver and Evidence
// created using the trusted URL.
XslTransform xslt = new XslTransform();
xslt.Load(xsltReader, new XmlUrlResolver(), XmlSecureResolver.CreateEvidenceForUrl(secureURL));
// Transform the file.
xslt.Transform("books.xml", "books.html", new XmlUrlResolver());
- }
-//
+ }
+//
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load5/CS/trans_noev.cs b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load5/CS/trans_noev.cs
index 1c3a0fd265e..d83dfdf9c54 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load5/CS/trans_noev.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Load5/CS/trans_noev.cs
@@ -3,31 +3,31 @@
using System.Xml;
using System.Xml.Xsl;
using System.Xml.XPath;
-
+
public class Sample
{
private const String stylesheet = @"c:\tmp\output.xsl";
-
+
public static void Main () {
-
+
XmlDocument doc = new XmlDocument();
doc.Load(stylesheet);
-
+
TransformFile(doc.CreateNavigator());
}
-
+
// Perform an XSLT transformation where xsltNav is an XPathNavigator containing
// a stylesheet from an untrusted source.
//
public static void TransformFile (XPathNavigator xsltNav) {
-
- // Load the stylesheet.
+
+ // Load the stylesheet.
XslTransform xslt = new XslTransform();
xslt.Load(xsltNav, null, null);
// Transform the file.
xslt.Transform("books.xml", "books.html", null);
- }
-//
+ }
+//
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform2/CS/trans_snip.cs b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform2/CS/trans_snip.cs
index 06d15d6ead3..2907bfb87c5 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform2/CS/trans_snip.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform2/CS/trans_snip.cs
@@ -4,7 +4,7 @@
using System.Xml.XPath;
public class Sample{
-
+
public static void Main(){
//
@@ -17,7 +17,7 @@ public static void Main(){
// Create an XPathNavigator to use for the transform.
XPathNavigator nav = root.CreateNavigator();
-
+
// Transform the file.
XslTransform xslt = new XslTransform();
xslt.Load("output.xsl");
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform4/CS/trans_snip3.cs b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform4/CS/trans_snip3.cs
index 5245c8f336f..49ad24c2c61 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform4/CS/trans_snip3.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform4/CS/trans_snip3.cs
@@ -22,7 +22,7 @@ public static void Main(string[] args) {
// Create a resolver and specify the necessary credentials.
XmlUrlResolver resolver = new XmlUrlResolver();
System.Net.NetworkCredential myCred;
-myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
+myCred = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
resolver.Credentials = myCred;
// Transform the file using the resolver. The resolver is used
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform6/CS/transstring.cs b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform6/CS/transstring.cs
index 45052e536bd..cad5d7fa59d 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform6/CS/transstring.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XslTransform.Transform6/CS/transstring.cs
@@ -8,7 +8,7 @@
public class Sample {
public static void Main() {
-
+
// Create a string containing the XSLT stylesheet.
String xsltString =
@"
diff --git a/samples/snippets/csharp/VS_Snippets_Data/XsltArgumentList.AddExtensionObject/CS/addextobj.cs b/samples/snippets/csharp/VS_Snippets_Data/XsltArgumentList.AddExtensionObject/CS/addextobj.cs
index 8567e352ba2..ad69a31aca3 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/XsltArgumentList.AddExtensionObject/CS/addextobj.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/XsltArgumentList.AddExtensionObject/CS/addextobj.cs
@@ -15,7 +15,7 @@ public static void Main() {
// Create an XsltArgumentList.
XsltArgumentList xslArg = new XsltArgumentList();
-
+
// Add an object to calculate the new book price.
BookPrice obj = new BookPrice();
xslArg.AddExtensionObject("urn:price-conv", obj);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/eSQLBasicExamples/CS/AdventureWorksModel.Designer.cs b/samples/snippets/csharp/VS_Snippets_Data/eSQLBasicExamples/CS/AdventureWorksModel.Designer.cs
index d10f8939a45..32a812626eb 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/eSQLBasicExamples/CS/AdventureWorksModel.Designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/eSQLBasicExamples/CS/AdventureWorksModel.Designer.cs
@@ -18,7 +18,7 @@
// Generation date: 5/21/2008 3:50:32 PM
namespace AdventureWorksModel
{
-
+
///
/// There are no comments for AdventureWorksEntities in the schema.
///
@@ -27,7 +27,7 @@ public partial class AdventureWorksEntities : global::System.Data.Objects.Object
///
/// Initializes a new AdventureWorksEntities object using the connection string found in the 'AdventureWorksEntities' section of the application configuration file.
///
- public AdventureWorksEntities() :
+ public AdventureWorksEntities() :
base("name=AdventureWorksEntities", "AdventureWorksEntities")
{
this.OnContextCreated();
@@ -35,7 +35,7 @@ public AdventureWorksEntities() :
///
/// Initialize a new AdventureWorksEntities object.
///
- public AdventureWorksEntities(string connectionString) :
+ public AdventureWorksEntities(string connectionString) :
base(connectionString, "AdventureWorksEntities")
{
this.OnContextCreated();
@@ -43,7 +43,7 @@ public AdventureWorksEntities(string connectionString) :
///
/// Initialize a new AdventureWorksEntities object.
///
- public AdventureWorksEntities(global::System.Data.EntityClient.EntityConnection connection) :
+ public AdventureWorksEntities(global::System.Data.EntityClient.EntityConnection connection) :
base(connection, "AdventureWorksEntities")
{
this.OnContextCreated();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/eSQLBasicExamples/CS/Program.cs b/samples/snippets/csharp/VS_Snippets_Data/eSQLBasicExamples/CS/Program.cs
index 927f2e80883..e403fa5ecf3 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/eSQLBasicExamples/CS/Program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/eSQLBasicExamples/CS/Program.cs
@@ -48,13 +48,13 @@ static private void PolymorphicQuery()
using (EntityConnection conn = new EntityConnection("name=SchoolEntities"))
{
conn.Open();
- // Create a query that specifies to
+ // Create a query that specifies to
// get a collection of only Students
- // with enrollment dates from
+ // with enrollment dates from
// a collection of People.
- string esqlQuery = @"SELECT Student.LastName,
- Student.EnrollmentDate FROM
- OFTYPE(SchoolEntities.Person,
+ string esqlQuery = @"SELECT Student.LastName,
+ Student.EnrollmentDate FROM
+ OFTYPE(SchoolEntities.Person,
SchoolModel.Student) AS Student";
using (EntityCommand cmd = new EntityCommand(esqlQuery, conn))
@@ -84,7 +84,7 @@ static private void Transactions()
EntityTransaction transaction = con.BeginTransaction();
DbCommand cmd = con.CreateCommand();
cmd.Transaction = transaction;
- cmd.CommandText = @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact
+ cmd.CommandText = @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact
AS Contact WHERE Contact.LastName = 'Adams'";
using (DbDataReader rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
@@ -96,7 +96,7 @@ static private void Transactions()
Console.WriteLine("\tLast Name: " + rdr["LastName"]);
}
}
- transaction.Commit();
+ transaction.Commit();
}
//
}
@@ -124,7 +124,7 @@ static private void ComplexTypeWithEntityCommand()
using (EntityDataReader rdr =
cmd.ExecuteReader(CommandBehavior.SequentialAccess))
{
- // The result returned by this query contains
+ // The result returned by this query contains
// Address complex Types.
while (rdr.Read())
{
@@ -252,7 +252,7 @@ static private void ParameterizedQueryWithEntityCommand()
conn.Open();
// Create a query that takes two parameters.
string esqlQuery =
- @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact
+ @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact
AS Contact WHERE Contact.LastName = @ln AND
Contact.FirstName = @fn";
@@ -260,8 +260,8 @@ static private void ParameterizedQueryWithEntityCommand()
{
using (EntityCommand cmd = new EntityCommand(esqlQuery, conn))
{
- // Create two parameters and add them to
- // the EntityCommand's Parameters collection
+ // Create two parameters and add them to
+ // the EntityCommand's Parameters collection
EntityParameter param1 = new EntityParameter();
param1.ParameterName = "ln";
param1.Value = "Adams";
@@ -306,8 +306,8 @@ static private void NavigateWithNavOperatorWithEntityCommand()
{
// Create an Entity SQL query.
string esqlQuery =
- @"SELECT address.AddressID, (SELECT VALUE DEREF(soh) FROM
- NAVIGATE(address, AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID)
+ @"SELECT address.AddressID, (SELECT VALUE DEREF(soh) FROM
+ NAVIGATE(address, AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID)
AS soh) FROM AdventureWorksEntities.Address AS address";
cmd.CommandText = esqlQuery;
@@ -354,7 +354,7 @@ static private void ReturnNestedCollectionWithEntityCommand()
using (EntityDataReader rdr =
cmd.ExecuteReader(CommandBehavior.SequentialAccess))
{
- // The result returned by this query contains
+ // The result returned by this query contains
// ContactID and a nested collection of SalesOrderHeader items.
// associated with this Contact.
while (rdr.Read())
@@ -362,7 +362,7 @@ static private void ReturnNestedCollectionWithEntityCommand()
// the first column contains Contact ID.
Console.WriteLine("Contact ID: {0}", rdr["ContactID"]);
- // The second column contains a collection of SalesOrderHeader
+ // The second column contains a collection of SalesOrderHeader
// items associated with the Contact.
DbDataReader nestedReader = rdr.GetDataReader(1);
while (nestedReader.Read())
@@ -424,7 +424,7 @@ static private void ParameterizedQueryWithObjectQuery()
{
// Create a query that takes two parameters.
string queryString =
- @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact
+ @"SELECT VALUE Contact FROM AdventureWorksEntities.Contact
AS Contact WHERE Contact.LastName = @ln AND
Contact.FirstName = @fn";
@@ -459,7 +459,7 @@ static private void NavRelationshipWithNavProperties()
using (AdventureWorksEntities advWorksContext =
new AdventureWorksEntities())
{
- string esqlQuery = @"SELECT c.FirstName, c.SalesOrderHeader
+ string esqlQuery = @"SELECT c.FirstName, c.SalesOrderHeader
FROM AdventureWorksEntities.Contact AS c where c.LastName = 'Zhou'";
try
@@ -471,7 +471,7 @@ static private void NavRelationshipWithNavProperties()
// Display contact's first name.
Console.WriteLine("First Name {0}: ", rec[0]);
List list = rec[1] as List;
- // Display SalesOrderHeader information
+ // Display SalesOrderHeader information
// associated with the contact.
foreach (SalesOrderHeader soh in list)
{
@@ -498,7 +498,7 @@ static private void ReturnAnonymousTypeWithObjectQuery()
using (AdventureWorksEntities advWorksContext =
new AdventureWorksEntities())
{
- string myQuery = @"SELECT p.ProductID, p.Name FROM
+ string myQuery = @"SELECT p.ProductID, p.Name FROM
AdventureWorksEntities.Product as p";
try
{
@@ -526,7 +526,7 @@ static private void ReturnPrimitiveTypeWithObjectQuery()
using (AdventureWorksEntities advWorksContext =
new AdventureWorksEntities())
{
- string queryString = @"SELECT VALUE Length(p.Name)FROM
+ string queryString = @"SELECT VALUE Length(p.Name)FROM
AdventureWorksEntities.Product AS p";
try
@@ -553,10 +553,10 @@ static private void GroupDataWithObjectQuery()
using (AdventureWorksEntities advWorksContext =
new AdventureWorksEntities())
{
- string esqlQuery = @"SELECT ln,
- (SELECT c1.LastName FROM AdventureWorksEntities.Contact
- AS c1 WHERE SUBSTRING(c1.LastName ,1,1) = ln)
- AS CONTACT
+ string esqlQuery = @"SELECT ln,
+ (SELECT c1.LastName FROM AdventureWorksEntities.Contact
+ AS c1 WHERE SUBSTRING(c1.LastName ,1,1) = ln)
+ AS CONTACT
FROM AdventureWorksEntities.CONTACT AS c2 GROUP BY SUBSTRING(c2.LastName ,1,1) AS ln
ORDER BY ln";
try
@@ -595,8 +595,8 @@ static private void AggregateDataWithObjectQuery()
using (AdventureWorksEntities advWorksContext =
new AdventureWorksEntities())
{
- string esqlQuery = @"SELECT contactID, AVG(order.TotalDue)
- FROM AdventureWorksEntities.SalesOrderHeader
+ string esqlQuery = @"SELECT contactID, AVG(order.TotalDue)
+ FROM AdventureWorksEntities.SalesOrderHeader
AS order GROUP BY order.Contact.ContactID as contactID";
try
@@ -627,11 +627,11 @@ static private void OrderTwoUnionizedQueriesWithObjectQuery()
new AdventureWorksEntities())
{
String esqlQuery = @"SELECT P2.Name, P2.ListPrice
- FROM ((SELECT P1.Name, P1.ProductID as Pid, P1.ListPrice
+ FROM ((SELECT P1.Name, P1.ProductID as Pid, P1.ListPrice
FROM AdventureWorksEntities.Product as P1
where P1.Name like 'A%')
union all
- (SELECT P1.Name, P1.ProductID as Pid, P1.ListPrice
+ (SELECT P1.Name, P1.ProductID as Pid, P1.ListPrice
FROM AdventureWorksEntities.Product as P1
WHERE P1.Name like 'B%')
) as P2
@@ -666,8 +666,8 @@ static private void ESQLPagingWithObjectQuery()
{
// Create a query that takes two parameters.
string queryString =
- @"SELECT VALUE product FROM
- AdventureWorksEntities.Product AS product
+ @"SELECT VALUE product FROM
+ AdventureWorksEntities.Product AS product
order by product.ListPrice SKIP @skip LIMIT @limit";
ObjectQuery productQuery =
@@ -749,7 +749,7 @@ static void StructuralTypeVisitRecord(IExtendedDataRecord record)
BuiltInTypeKind fieldTypeKind = record.DataRecordInfo.FieldMetadata[fieldIndex].
FieldType.TypeUsage.EdmType.BuiltInTypeKind;
// The EntityType, ComplexType and RowType are structural types
- // that have members.
+ // that have members.
// Read only the PrimitiveType members of this structural type.
if (fieldTypeKind == BuiltInTypeKind.PrimitiveType)
{
@@ -816,7 +816,7 @@ static void RefTypeVisitRecord(IExtendedDataRecord record)
//read only fields that contain PrimitiveType
if (fieldTypeKind == BuiltInTypeKind.RefType)
{
- // Ref types are surfaced as EntityKey instances.
+ // Ref types are surfaced as EntityKey instances.
// The containing record sees them as atomic.
EntityKey key = record.GetValue(fieldIndex) as EntityKey;
// Get the EntitySet name.
@@ -861,7 +861,7 @@ static void ExecutePrimitiveTypeQuery(string esqlQuery)
while (rdr.Read())
{
IExtendedDataRecord record = rdr as IExtendedDataRecord;
- // For PrimitiveType
+ // For PrimitiveType
// the record contains exactly one field.
int fieldIndex = 0;
Console.WriteLine("Value: " + record.GetValue(fieldIndex));
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.conflictmodeenumeration/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.conflictmodeenumeration/cs/northwind.cs
index 64f93a5445c..ced5749b886 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.conflictmodeenumeration/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.conflictmodeenumeration/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3721,7 +3721,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.dataloadoptions/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.dataloadoptions/cs/northwind.cs
index 64f93a5445c..ced5749b886 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.dataloadoptions/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.dataloadoptions/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3721,7 +3721,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.dataloadoptions/cs/program.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.dataloadoptions/cs/program.cs
index a5e725682dc..9cdc7ff42ba 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.dataloadoptions/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.dataloadoptions/cs/program.cs
@@ -11,12 +11,12 @@ class Program
{
static void Main(string[] args)
{
- //
+ //
Northwnd db = new Northwnd(@"c:\northwnd.mdf");
DataLoadOptions dlo = new DataLoadOptions();
dlo.AssociateWith(c => c.Orders.Where(p => p.ShippedDate != DateTime.Today));
db.LoadOptions = dlo;
- var custOrderQuery =
+ var custOrderQuery =
from cust in db.Customers
where cust.City == "London"
select cust;
@@ -27,7 +27,7 @@ from cust in db.Customers
foreach (Order ord in custObj.Orders)
{
Console.WriteLine("\t {0}",ord.OrderDate);
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.mapping.updatecheck/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.mapping.updatecheck/cs/northwind.cs
index 23b033dd575..477ce416417 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.mapping.updatecheck/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.mapping.updatecheck/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3722,7 +3722,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.memberchangeconflict/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.memberchangeconflict/cs/northwind.cs
index 64f93a5445c..ced5749b886 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.memberchangeconflict/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.memberchangeconflict/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3721,7 +3721,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.memberchangeconflict/cs/program.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.memberchangeconflict/cs/program.cs
index 24f3e9809bb..9ce40328a2c 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.memberchangeconflict/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.memberchangeconflict/cs/program.cs
@@ -15,7 +15,7 @@ static void Main(string[] args)
//
// Add 'using System.Reflection' for this section.
Northwnd db = new Northwnd("...");
-
+
try
{
db.SubmitChanges(ConflictMode.ContinueOnConflict);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.objectchangeconflict/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.objectchangeconflict/cs/northwind.cs
index 64f93a5445c..ced5749b886 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.objectchangeconflict/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.objectchangeconflict/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3721,7 +3721,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.refreshmode/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.refreshmode/cs/northwind.cs
index d9c1c247f74..597f7a2c99a 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.refreshmode/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.refreshmode/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3550,7 +3550,7 @@ public string HomePage
}
}
}
-
+
[Association(Name="FK_Products_Suppliers", Storage="_Products", OtherKey="SupplierID", DeleteRule="NO ACTION")]
public EntitySet Products
@@ -3722,7 +3722,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.refreshmode/cs/program.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.refreshmode/cs/program.cs
index 07446b663c0..583fa7fd5e1 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.refreshmode/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.refreshmode/cs/program.cs
@@ -29,7 +29,7 @@ static void Main(string[] args)
}
//
- //
+ //
try
{
db.SubmitChanges(ConflictMode.ContinueOnConflict);
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.table/cs/northwind.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.table/cs/northwind.cs
index 87e0e7642c5..3ea08e89d23 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.table/cs/northwind.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.table/cs/northwind.cs
@@ -73,25 +73,25 @@ static Northwnd()
{
}
- public Northwnd(string connection) :
+ public Northwnd(string connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection) :
+ public Northwnd(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}
- public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
+ public Northwnd(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
@@ -504,7 +504,7 @@ public CustomerDemographic CustomerDemographic
set
{
CustomerDemographic previousValue = this._CustomerDemographic.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._CustomerDemographic.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -538,7 +538,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1536,7 +1536,7 @@ public Employee ReportsToEmployee
set
{
Employee previousValue = this._ReportsToEmployee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._ReportsToEmployee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1751,7 +1751,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1785,7 +1785,7 @@ public Territory Territory
set
{
Territory previousValue = this._Territory.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Territory.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -1991,7 +1991,7 @@ public Order Order
set
{
Order previousValue = this._Order.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Order.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2025,7 +2025,7 @@ public Product Product
set
{
Product previousValue = this._Product.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Product.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2470,7 +2470,7 @@ public Customer Customer
set
{
Customer previousValue = this._Customer.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Customer.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2504,7 +2504,7 @@ public Employee Employee
set
{
Employee previousValue = this._Employee.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Employee.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2538,7 +2538,7 @@ public Shipper Shipper
set
{
Shipper previousValue = this._Shipper.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Shipper.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2894,7 +2894,7 @@ public Category Category
set
{
Category previousValue = this._Category.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Category.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -2928,7 +2928,7 @@ public Supplier Supplier
set
{
Supplier previousValue = this._Supplier.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Supplier.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
@@ -3721,7 +3721,7 @@ public Region Region
set
{
Region previousValue = this._Region.Entity;
- if (((previousValue != value)
+ if (((previousValue != value)
|| (this._Region.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.table/cs/program.cs b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.table/cs/program.cs
index 6b375beff16..59ddc35cc34 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.table/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/system.data.linq.table/cs/program.cs
@@ -89,7 +89,7 @@ from details in db.OrderDetails
{
db.OrderDetails.DeleteOnSubmit(detail);
}
-
+
try
{
db.SubmitChanges();
diff --git a/samples/snippets/csharp/VS_Snippets_Data/xmlconvert.newverify/cs/xmlconvertnewverify.cs b/samples/snippets/csharp/VS_Snippets_Data/xmlconvert.newverify/cs/xmlconvertnewverify.cs
index 3e846490ea9..678ccaae8bd 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/xmlconvert.newverify/cs/xmlconvertnewverify.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/xmlconvert.newverify/cs/xmlconvertnewverify.cs
@@ -21,7 +21,7 @@ static void Main(string[] args)
writer5.WriteStartElement("legalElement");
// Throw an exception due illegal white space character.
- writer5.WriteString("ValueText" +
+ writer5.WriteString("ValueText" +
XmlConvert.VerifyWhitespace("\t" + illegalWhiteSpaceChar));
// Write the end tag for the legal element.
@@ -45,13 +45,13 @@ static void Main(string[] args)
{
// Write document type Declaration.
// Throw an exception due illegal public id character.
- writer4.WriteDocType("testPublic",
+ writer4.WriteDocType("testPublic",
XmlConvert.VerifyPublicId("pubId" + illegalPubIdChar),
null, null);
// Write the root element.
- writer4.WriteStartElement("root");
-
+ writer4.WriteStartElement("root");
+
writer4.WriteStartElement("legalElement");
writer4.WriteString("ValueText");
writer4.WriteEndElement();
@@ -72,7 +72,7 @@ static void Main(string[] args)
//
XmlTextWriter writer3 = new XmlTextWriter("outFile.xml", null);
char illegalChar = '\uFFFE';
- string charsToVerify = "Test String ";
+ string charsToVerify = "Test String ";
try
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/form1.cs b/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/form1.cs
index 13e89a8dbc5..8abc6913f43 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/form1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/form1.cs
@@ -50,7 +50,7 @@ private void loadXML(bool generateXML, bool validateXML, bool generateSchema)
else
{
XmlTextBox.Text = _doc.InnerXml;
- populateTreeView(_doc);
+ populateTreeView(_doc);
}
}
@@ -63,7 +63,7 @@ private void populateTreeView(XmlDocument doc)
{
xmlTreeView.Nodes.Clear();
addTreeNodes(doc.DocumentElement.ChildNodes, xmlTreeView);
- xmlTreeView.ExpandAll();
+ xmlTreeView.ExpandAll();
}
//************************************************************************************
@@ -160,7 +160,7 @@ private bool highlightXML()
if (selectedBookNode != null)
{
_currentlySelectedNode = selectedBookNode;
-
+
// Use node to get search string.
string stringToHighlight = selectedBookNode.OuterXml;
@@ -168,7 +168,7 @@ private bool highlightXML()
int numberOfCharactersBefore = stringToHighlight.Substring(0, stringToHighlight.IndexOf(_ISBNOfSelectedBookNode)).Length;
int lengthOfSelection = stringToHighlight.Length - Constants.lengthOfNamespaceDeclaration;
- // Highlight the new selected text.
+ // Highlight the new selected text.
XmlTextBox.SelectionLength = _ISBNOfSelectedBookNode.Length;
int tempSelectionIndex = XmlTextBox.Find(_ISBNOfSelectedBookNode);
@@ -249,14 +249,14 @@ private void addNewBookButton_Click(object sender, EventArgs e)
selectedBookNode = _xmlHelperMethods.GetBook(_ISBNOfSelectedBookNode, _doc);
}
- //Insert book element at the beginning, end, before a specific element
+ //Insert book element at the beginning, end, before a specific element
// or after one depending on what option the user selects.
_xmlHelperMethods.InsertBookElement(bookElement, positionComboBox.Text, selectedBookNode, validateCheckBox.Checked, generateSchemaCheckBox.Checked);
// Populate the RichTextBox again.
-
+
XmlTextBox.Text = _doc.InnerXml;
- populateTreeView(_doc);
+ populateTreeView(_doc);
// Highlight the newly added item.
_ISBNOfSelectedBookNode = newISBNTextBox.Text;
@@ -314,7 +314,7 @@ private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
//************************************************************************************
private void loadButton_Click(object sender, EventArgs e)
{
- loadXML(generateCheckBox.Checked,
+ loadXML(generateCheckBox.Checked,
validateCheckBox.Checked, generateSchemaCheckBox.Checked);
// Clear the text box controls.
@@ -357,7 +357,7 @@ private void submitButton_Click(object sender, EventArgs e)
// Populate the RichTextBox again.
XmlTextBox.Text = _doc.InnerXml;
- populateTreeView(_doc);
+ populateTreeView(_doc);
highlightXML();
}
@@ -746,7 +746,7 @@ private void FilterChecked(ArrayList conditions, ArrayList operatorSymbols, Arra
if (conditionCheckBox.Checked == true)
{
XmlNodeList nodes = null;
-
+
bool failure = false;
foreach (string _condition in conditions)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/form1.designer.cs b/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/form1.designer.cs
index 552aa68fcd9..7ad0f03bd06 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/form1.designer.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/form1.designer.cs
@@ -121,9 +121,9 @@ private void InitializeComponent()
this.condition1Panel.SuspendLayout();
this.filterBox.SuspendLayout();
this.SuspendLayout();
- //
+ //
// TreeViewGroupBox
- //
+ //
this.TreeViewGroupBox.Controls.Add(this.xmlTreeView);
this.TreeViewGroupBox.ForeColor = System.Drawing.Color.White;
this.TreeViewGroupBox.Location = new System.Drawing.Point(373, 12);
@@ -132,9 +132,9 @@ private void InitializeComponent()
this.TreeViewGroupBox.TabIndex = 4;
this.TreeViewGroupBox.TabStop = false;
this.TreeViewGroupBox.Text = "Book List";
- //
+ //
// xmlTreeView
- //
+ //
this.xmlTreeView.BackColor = System.Drawing.Color.Black;
this.xmlTreeView.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.xmlTreeView.ForeColor = System.Drawing.Color.White;
@@ -143,9 +143,9 @@ private void InitializeComponent()
this.xmlTreeView.Size = new System.Drawing.Size(258, 656);
this.xmlTreeView.TabIndex = 3;
this.xmlTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.xmlTreeView_AfterSelect);
- //
+ //
// TextGroupBox
- //
+ //
this.TextGroupBox.Controls.Add(this.saveButton);
this.TextGroupBox.Controls.Add(this.refreshTreeButton);
this.TextGroupBox.Controls.Add(this.positionDownButton);
@@ -158,9 +158,9 @@ private void InitializeComponent()
this.TextGroupBox.TabIndex = 5;
this.TextGroupBox.TabStop = false;
this.TextGroupBox.Text = "Xml View";
- //
+ //
// saveButton
- //
+ //
this.saveButton.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.saveButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.saveButton.Image = ((System.Drawing.Image)(resources.GetObject("saveButton.Image")));
@@ -171,9 +171,9 @@ private void InitializeComponent()
this.toolTip1.SetToolTip(this.saveButton, "Save XML with new element positions");
this.saveButton.UseVisualStyleBackColor = true;
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
- //
+ //
// refreshTreeButton
- //
+ //
this.refreshTreeButton.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.refreshTreeButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.refreshTreeButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshTreeButton.Image")));
@@ -183,9 +183,9 @@ private void InitializeComponent()
this.refreshTreeButton.TabIndex = 37;
this.toolTip1.SetToolTip(this.refreshTreeButton, "Refresh tree view to reflect new order of elements");
this.refreshTreeButton.UseVisualStyleBackColor = true;
- //
+ //
// positionDownButton
- //
+ //
this.positionDownButton.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.positionDownButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.positionDownButton.Image = ((System.Drawing.Image)(resources.GetObject("positionDownButton.Image")));
@@ -196,9 +196,9 @@ private void InitializeComponent()
this.toolTip1.SetToolTip(this.positionDownButton, "Move selected item down in the list");
this.positionDownButton.UseVisualStyleBackColor = true;
this.positionDownButton.Click += new System.EventHandler(this.positionDownButton_Click);
- //
+ //
// positionUpButton
- //
+ //
this.positionUpButton.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.positionUpButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.positionUpButton.Image = ((System.Drawing.Image)(resources.GetObject("positionUpButton.Image")));
@@ -209,9 +209,9 @@ private void InitializeComponent()
this.toolTip1.SetToolTip(this.positionUpButton, "Move selected item up in the list");
this.positionUpButton.UseVisualStyleBackColor = true;
this.positionUpButton.Click += new System.EventHandler(this.positionUpButton_Click);
- //
+ //
// XmlTextBox
- //
+ //
this.XmlTextBox.BackColor = System.Drawing.Color.Black;
this.XmlTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.XmlTextBox.ForeColor = System.Drawing.Color.White;
@@ -220,9 +220,9 @@ private void InitializeComponent()
this.XmlTextBox.Size = new System.Drawing.Size(477, 656);
this.XmlTextBox.TabIndex = 6;
this.XmlTextBox.Text = "";
- //
+ //
// tabControl1
- //
+ //
this.tabControl1.Controls.Add(this.loadTab);
this.tabControl1.Controls.Add(this.addTab);
this.tabControl1.Controls.Add(this.editTab);
@@ -235,9 +235,9 @@ private void InitializeComponent()
this.tabControl1.Size = new System.Drawing.Size(354, 247);
this.tabControl1.TabIndex = 7;
this.tabControl1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl1_DrawItem);
- //
+ //
// loadTab
- //
+ //
this.loadTab.BackColor = System.Drawing.Color.Black;
this.loadTab.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.loadTab.Controls.Add(this.optionsGroupBox);
@@ -250,9 +250,9 @@ private void InitializeComponent()
this.loadTab.Size = new System.Drawing.Size(346, 218);
this.loadTab.TabIndex = 1;
this.loadTab.Text = "Load XML";
- //
+ //
// optionsGroupBox
- //
+ //
this.optionsGroupBox.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.optionsGroupBox.Controls.Add(this.generateSchemaCheckBox);
this.optionsGroupBox.Controls.Add(this.generateCheckBox);
@@ -264,9 +264,9 @@ private void InitializeComponent()
this.optionsGroupBox.TabIndex = 8;
this.optionsGroupBox.TabStop = false;
this.optionsGroupBox.Text = "Options";
- //
+ //
// generateSchemaCheckBox
- //
+ //
this.generateSchemaCheckBox.AutoSize = true;
this.generateSchemaCheckBox.Enabled = false;
this.generateSchemaCheckBox.Location = new System.Drawing.Point(14, 77);
@@ -276,9 +276,9 @@ private void InitializeComponent()
this.generateSchemaCheckBox.Text = "If the schema file is not found, then generate it.";
this.generateSchemaCheckBox.UseVisualStyleBackColor = true;
this.generateSchemaCheckBox.Visible = false;
- //
+ //
// generateCheckBox
- //
+ //
this.generateCheckBox.AutoSize = true;
this.generateCheckBox.ForeColor = System.Drawing.Color.White;
this.generateCheckBox.Location = new System.Drawing.Point(13, 24);
@@ -287,9 +287,9 @@ private void InitializeComponent()
this.generateCheckBox.TabIndex = 9;
this.generateCheckBox.Text = "If the file is not found, generate the XML.";
this.generateCheckBox.UseVisualStyleBackColor = true;
- //
+ //
// validateCheckBox
- //
+ //
this.validateCheckBox.AutoSize = true;
this.validateCheckBox.ForeColor = System.Drawing.Color.White;
this.validateCheckBox.Location = new System.Drawing.Point(13, 51);
@@ -299,9 +299,9 @@ private void InitializeComponent()
this.validateCheckBox.Text = "Validate the XML against a schema.";
this.validateCheckBox.UseVisualStyleBackColor = true;
this.validateCheckBox.CheckedChanged += new System.EventHandler(this.validateCheckBox_CheckedChanged);
- //
+ //
// loadButton
- //
+ //
this.loadButton.BackColor = System.Drawing.Color.Black;
this.loadButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.loadButton.Location = new System.Drawing.Point(16, 16);
@@ -311,9 +311,9 @@ private void InitializeComponent()
this.loadButton.Text = "Load XML from file";
this.loadButton.UseVisualStyleBackColor = false;
this.loadButton.Click += new System.EventHandler(this.loadButton_Click);
- //
+ //
// addTab
- //
+ //
this.addTab.BackColor = System.Drawing.Color.Black;
this.addTab.Controls.Add(this.addElementGroupBox);
this.addTab.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@@ -324,9 +324,9 @@ private void InitializeComponent()
this.addTab.Size = new System.Drawing.Size(346, 218);
this.addTab.TabIndex = 0;
this.addTab.Text = "Add Book";
- //
+ //
// addElementGroupBox
- //
+ //
this.addElementGroupBox.Controls.Add(this.newPositionLabel);
this.addElementGroupBox.Controls.Add(this.positionComboBox);
this.addElementGroupBox.Controls.Add(this.newTitleTextBox);
@@ -345,18 +345,18 @@ private void InitializeComponent()
this.addElementGroupBox.Size = new System.Drawing.Size(334, 201);
this.addElementGroupBox.TabIndex = 0;
this.addElementGroupBox.TabStop = false;
- //
+ //
// newPositionLabel
- //
+ //
this.newPositionLabel.AutoSize = true;
this.newPositionLabel.Location = new System.Drawing.Point(18, 164);
this.newPositionLabel.Name = "newPositionLabel";
this.newPositionLabel.Size = new System.Drawing.Size(59, 16);
this.newPositionLabel.TabIndex = 28;
this.newPositionLabel.Text = "Position:";
- //
+ //
// positionComboBox
- //
+ //
this.positionComboBox.BackColor = System.Drawing.Color.Black;
this.positionComboBox.ForeColor = System.Drawing.Color.White;
this.positionComboBox.FormattingEnabled = true;
@@ -370,90 +370,90 @@ private void InitializeComponent()
this.positionComboBox.Size = new System.Drawing.Size(128, 24);
this.positionComboBox.TabIndex = 27;
this.positionComboBox.Text = "Top";
- //
+ //
// newTitleTextBox
- //
+ //
this.newTitleTextBox.BackColor = System.Drawing.Color.Black;
this.newTitleTextBox.ForeColor = System.Drawing.Color.White;
this.newTitleTextBox.Location = new System.Drawing.Point(111, 21);
this.newTitleTextBox.Name = "newTitleTextBox";
this.newTitleTextBox.Size = new System.Drawing.Size(192, 22);
this.newTitleTextBox.TabIndex = 16;
- //
+ //
// newTitleLabel
- //
+ //
this.newTitleLabel.AutoSize = true;
this.newTitleLabel.Location = new System.Drawing.Point(18, 21);
this.newTitleLabel.Name = "newTitleLabel";
this.newTitleLabel.Size = new System.Drawing.Size(37, 16);
this.newTitleLabel.TabIndex = 18;
this.newTitleLabel.Text = "Title:";
- //
+ //
// newISBNLabel
- //
+ //
this.newISBNLabel.AutoSize = true;
this.newISBNLabel.Location = new System.Drawing.Point(18, 48);
this.newISBNLabel.Name = "newISBNLabel";
this.newISBNLabel.Size = new System.Drawing.Size(42, 16);
this.newISBNLabel.TabIndex = 19;
this.newISBNLabel.Text = "ISBN:";
- //
+ //
// newPriceLabel
- //
+ //
this.newPriceLabel.AutoSize = true;
this.newPriceLabel.Location = new System.Drawing.Point(18, 107);
this.newPriceLabel.Name = "newPriceLabel";
this.newPriceLabel.Size = new System.Drawing.Size(42, 16);
this.newPriceLabel.TabIndex = 26;
this.newPriceLabel.Text = "Price:";
- //
+ //
// newISBNTextBox
- //
+ //
this.newISBNTextBox.BackColor = System.Drawing.Color.Black;
this.newISBNTextBox.ForeColor = System.Drawing.Color.White;
this.newISBNTextBox.Location = new System.Drawing.Point(111, 48);
this.newISBNTextBox.Name = "newISBNTextBox";
this.newISBNTextBox.Size = new System.Drawing.Size(192, 22);
this.newISBNTextBox.TabIndex = 20;
- //
+ //
// newPriceTextBox
- //
+ //
this.newPriceTextBox.BackColor = System.Drawing.Color.Black;
this.newPriceTextBox.ForeColor = System.Drawing.Color.White;
this.newPriceTextBox.Location = new System.Drawing.Point(111, 100);
this.newPriceTextBox.Name = "newPriceTextBox";
this.newPriceTextBox.Size = new System.Drawing.Size(75, 22);
this.newPriceTextBox.TabIndex = 25;
- //
+ //
// newPubDateLabel
- //
+ //
this.newPubDateLabel.AutoSize = true;
this.newPubDateLabel.Location = new System.Drawing.Point(18, 74);
this.newPubDateLabel.Name = "newPubDateLabel";
this.newPubDateLabel.Size = new System.Drawing.Size(87, 16);
this.newPubDateLabel.TabIndex = 21;
this.newPubDateLabel.Text = "Publish Date:";
- //
+ //
// newGenreLabel
- //
+ //
this.newGenreLabel.AutoSize = true;
this.newGenreLabel.Location = new System.Drawing.Point(18, 135);
this.newGenreLabel.Name = "newGenreLabel";
this.newGenreLabel.Size = new System.Drawing.Size(48, 16);
this.newGenreLabel.TabIndex = 24;
this.newGenreLabel.Text = "Genre:";
- //
+ //
// newPubDateTextBox
- //
+ //
this.newPubDateTextBox.BackColor = System.Drawing.Color.Black;
this.newPubDateTextBox.ForeColor = System.Drawing.Color.White;
this.newPubDateTextBox.Location = new System.Drawing.Point(111, 74);
this.newPubDateTextBox.Name = "newPubDateTextBox";
this.newPubDateTextBox.Size = new System.Drawing.Size(125, 22);
this.newPubDateTextBox.TabIndex = 22;
- //
+ //
// addNewBookButton
- //
+ //
this.addNewBookButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.addNewBookButton.Location = new System.Drawing.Point(245, 157);
this.addNewBookButton.Name = "addNewBookButton";
@@ -462,18 +462,18 @@ private void InitializeComponent()
this.addNewBookButton.Text = "Add";
this.addNewBookButton.UseVisualStyleBackColor = true;
this.addNewBookButton.Click += new System.EventHandler(this.addNewBookButton_Click);
- //
+ //
// newGenreTextBox
- //
+ //
this.newGenreTextBox.BackColor = System.Drawing.Color.Black;
this.newGenreTextBox.ForeColor = System.Drawing.Color.White;
this.newGenreTextBox.Location = new System.Drawing.Point(111, 128);
this.newGenreTextBox.Name = "newGenreTextBox";
this.newGenreTextBox.Size = new System.Drawing.Size(125, 22);
this.newGenreTextBox.TabIndex = 23;
- //
+ //
// editTab
- //
+ //
this.editTab.BackColor = System.Drawing.Color.Black;
this.editTab.Controls.Add(this.EditElementGroupBox);
this.editTab.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@@ -484,9 +484,9 @@ private void InitializeComponent()
this.editTab.Size = new System.Drawing.Size(346, 218);
this.editTab.TabIndex = 2;
this.editTab.Text = "Edit Books";
- //
+ //
// EditElementGroupBox
- //
+ //
this.EditElementGroupBox.Controls.Add(this.deleteButton);
this.EditElementGroupBox.Controls.Add(this.editTitleTextBox);
this.EditElementGroupBox.Controls.Add(this.editTitleLabel);
@@ -504,9 +504,9 @@ private void InitializeComponent()
this.EditElementGroupBox.Size = new System.Drawing.Size(334, 201);
this.EditElementGroupBox.TabIndex = 1;
this.EditElementGroupBox.TabStop = false;
- //
+ //
// deleteButton
- //
+ //
this.deleteButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.deleteButton.Location = new System.Drawing.Point(21, 163);
this.deleteButton.Name = "deleteButton";
@@ -515,90 +515,90 @@ private void InitializeComponent()
this.deleteButton.Text = "Delete Book";
this.deleteButton.UseVisualStyleBackColor = true;
this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click);
- //
+ //
// editTitleTextBox
- //
+ //
this.editTitleTextBox.BackColor = System.Drawing.Color.Black;
this.editTitleTextBox.ForeColor = System.Drawing.Color.White;
this.editTitleTextBox.Location = new System.Drawing.Point(111, 21);
this.editTitleTextBox.Name = "editTitleTextBox";
this.editTitleTextBox.Size = new System.Drawing.Size(192, 22);
this.editTitleTextBox.TabIndex = 16;
- //
+ //
// editTitleLabel
- //
+ //
this.editTitleLabel.AutoSize = true;
this.editTitleLabel.Location = new System.Drawing.Point(18, 21);
this.editTitleLabel.Name = "editTitleLabel";
this.editTitleLabel.Size = new System.Drawing.Size(37, 16);
this.editTitleLabel.TabIndex = 18;
this.editTitleLabel.Text = "Title:";
- //
+ //
// editISBNLabel
- //
+ //
this.editISBNLabel.AutoSize = true;
this.editISBNLabel.Location = new System.Drawing.Point(18, 48);
this.editISBNLabel.Name = "editISBNLabel";
this.editISBNLabel.Size = new System.Drawing.Size(42, 16);
this.editISBNLabel.TabIndex = 19;
this.editISBNLabel.Text = "ISBN:";
- //
+ //
// editPriceLabel
- //
+ //
this.editPriceLabel.AutoSize = true;
this.editPriceLabel.Location = new System.Drawing.Point(18, 107);
this.editPriceLabel.Name = "editPriceLabel";
this.editPriceLabel.Size = new System.Drawing.Size(42, 16);
this.editPriceLabel.TabIndex = 26;
this.editPriceLabel.Text = "Price:";
- //
+ //
// editISBNTextBox
- //
+ //
this.editISBNTextBox.BackColor = System.Drawing.Color.Black;
this.editISBNTextBox.ForeColor = System.Drawing.Color.White;
this.editISBNTextBox.Location = new System.Drawing.Point(111, 48);
this.editISBNTextBox.Name = "editISBNTextBox";
this.editISBNTextBox.Size = new System.Drawing.Size(192, 22);
this.editISBNTextBox.TabIndex = 20;
- //
+ //
// editPriceTextBox
- //
+ //
this.editPriceTextBox.BackColor = System.Drawing.Color.Black;
this.editPriceTextBox.ForeColor = System.Drawing.Color.White;
this.editPriceTextBox.Location = new System.Drawing.Point(111, 100);
this.editPriceTextBox.Name = "editPriceTextBox";
this.editPriceTextBox.Size = new System.Drawing.Size(75, 22);
this.editPriceTextBox.TabIndex = 25;
- //
+ //
// editPubDateLabel
- //
+ //
this.editPubDateLabel.AutoSize = true;
this.editPubDateLabel.Location = new System.Drawing.Point(18, 74);
this.editPubDateLabel.Name = "editPubDateLabel";
this.editPubDateLabel.Size = new System.Drawing.Size(87, 16);
this.editPubDateLabel.TabIndex = 21;
this.editPubDateLabel.Text = "Publish Date:";
- //
+ //
// editGenreLabel
- //
+ //
this.editGenreLabel.AutoSize = true;
this.editGenreLabel.Location = new System.Drawing.Point(18, 135);
this.editGenreLabel.Name = "editGenreLabel";
this.editGenreLabel.Size = new System.Drawing.Size(48, 16);
this.editGenreLabel.TabIndex = 24;
this.editGenreLabel.Text = "Genre:";
- //
+ //
// editPubDateTextBox
- //
+ //
this.editPubDateTextBox.BackColor = System.Drawing.Color.Black;
this.editPubDateTextBox.ForeColor = System.Drawing.Color.White;
this.editPubDateTextBox.Location = new System.Drawing.Point(111, 74);
this.editPubDateTextBox.Name = "editPubDateTextBox";
this.editPubDateTextBox.Size = new System.Drawing.Size(125, 22);
this.editPubDateTextBox.TabIndex = 22;
- //
+ //
// submitButton
- //
+ //
this.submitButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.submitButton.Location = new System.Drawing.Point(184, 163);
this.submitButton.Name = "submitButton";
@@ -607,18 +607,18 @@ private void InitializeComponent()
this.submitButton.Text = "Submit Updates";
this.submitButton.UseVisualStyleBackColor = true;
this.submitButton.Click += new System.EventHandler(this.submitButton_Click);
- //
+ //
// editGenreTextBox
- //
+ //
this.editGenreTextBox.BackColor = System.Drawing.Color.Black;
this.editGenreTextBox.ForeColor = System.Drawing.Color.White;
this.editGenreTextBox.Location = new System.Drawing.Point(111, 128);
this.editGenreTextBox.Name = "editGenreTextBox";
this.editGenreTextBox.Size = new System.Drawing.Size(125, 22);
this.editGenreTextBox.TabIndex = 23;
- //
+ //
// filterTab
- //
+ //
this.filterTab.BackColor = System.Drawing.Color.Black;
this.filterTab.Controls.Add(this.groupBox1);
this.filterTab.ForeColor = System.Drawing.Color.White;
@@ -627,9 +627,9 @@ private void InitializeComponent()
this.filterTab.Size = new System.Drawing.Size(346, 218);
this.filterTab.TabIndex = 3;
this.filterTab.Text = "Filter";
- //
+ //
// groupBox1
- //
+ //
this.groupBox1.Controls.Add(this.matchesComboBox);
this.groupBox1.Controls.Add(this.matchesLabel);
this.groupBox1.Controls.Add(this.applyLabel);
@@ -644,9 +644,9 @@ private void InitializeComponent()
this.groupBox1.Size = new System.Drawing.Size(334, 201);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
- //
+ //
// matchesComboBox
- //
+ //
this.matchesComboBox.BackColor = System.Drawing.Color.Black;
this.matchesComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.matchesComboBox.ForeColor = System.Drawing.Color.White;
@@ -661,9 +661,9 @@ private void InitializeComponent()
this.matchesComboBox.Text = "Any";
this.matchesComboBox.Visible = false;
this.matchesComboBox.SelectedValueChanged += new System.EventHandler(this.matchesComboBox_SelectedValueChanged);
- //
+ //
// matchesLabel
- //
+ //
this.matchesLabel.AutoSize = true;
this.matchesLabel.Location = new System.Drawing.Point(187, 33);
this.matchesLabel.Name = "matchesLabel";
@@ -671,9 +671,9 @@ private void InitializeComponent()
this.matchesLabel.TabIndex = 58;
this.matchesLabel.Text = "Matches:";
this.matchesLabel.Visible = false;
- //
+ //
// applyLabel
- //
+ //
this.applyLabel.AutoSize = true;
this.applyLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.applyLabel.Location = new System.Drawing.Point(7, 53);
@@ -682,9 +682,9 @@ private void InitializeComponent()
this.applyLabel.TabIndex = 57;
this.applyLabel.Text = "Apply";
this.applyLabel.Visible = false;
- //
+ //
// condition4Panel
- //
+ //
this.condition4Panel.Controls.Add(this.condition4CheckBox);
this.condition4Panel.Controls.Add(this.operator4ComboBox);
this.condition4Panel.Controls.Add(this.condition4ComboBox);
@@ -694,9 +694,9 @@ private void InitializeComponent()
this.condition4Panel.Size = new System.Drawing.Size(324, 36);
this.condition4Panel.TabIndex = 56;
this.condition4Panel.Visible = false;
- //
+ //
// condition4CheckBox
- //
+ //
this.condition4CheckBox.AutoSize = true;
this.condition4CheckBox.Location = new System.Drawing.Point(7, 11);
this.condition4CheckBox.Name = "condition4CheckBox";
@@ -704,9 +704,9 @@ private void InitializeComponent()
this.condition4CheckBox.TabIndex = 54;
this.condition4CheckBox.UseVisualStyleBackColor = true;
this.condition4CheckBox.CheckedChanged += new System.EventHandler(this.condition4CheckBox_CheckedChanged);
- //
+ //
// operator4ComboBox
- //
+ //
this.operator4ComboBox.BackColor = System.Drawing.Color.Black;
this.operator4ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.operator4ComboBox.ForeColor = System.Drawing.Color.White;
@@ -722,9 +722,9 @@ private void InitializeComponent()
this.operator4ComboBox.Size = new System.Drawing.Size(78, 24);
this.operator4ComboBox.TabIndex = 53;
this.operator4ComboBox.Text = "=";
- //
+ //
// condition4ComboBox
- //
+ //
this.condition4ComboBox.BackColor = System.Drawing.Color.Black;
this.condition4ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.condition4ComboBox.ForeColor = System.Drawing.Color.White;
@@ -741,18 +741,18 @@ private void InitializeComponent()
this.condition4ComboBox.TabIndex = 52;
this.condition4ComboBox.Text = "Condition";
this.condition4ComboBox.SelectedIndexChanged += new System.EventHandler(this.condition4ComboBox_SelectedIndexChanged);
- //
+ //
// condition4TextBox
- //
+ //
this.condition4TextBox.BackColor = System.Drawing.Color.Black;
this.condition4TextBox.ForeColor = System.Drawing.Color.White;
this.condition4TextBox.Location = new System.Drawing.Point(215, 6);
this.condition4TextBox.Name = "condition4TextBox";
this.condition4TextBox.Size = new System.Drawing.Size(102, 22);
this.condition4TextBox.TabIndex = 51;
- //
+ //
// condition3Panel
- //
+ //
this.condition3Panel.Controls.Add(this.condition3CheckBox);
this.condition3Panel.Controls.Add(this.operator3ComboBox);
this.condition3Panel.Controls.Add(this.condition3ComboBox);
@@ -762,9 +762,9 @@ private void InitializeComponent()
this.condition3Panel.Size = new System.Drawing.Size(324, 36);
this.condition3Panel.TabIndex = 55;
this.condition3Panel.Visible = false;
- //
+ //
// condition3CheckBox
- //
+ //
this.condition3CheckBox.AutoSize = true;
this.condition3CheckBox.Location = new System.Drawing.Point(7, 11);
this.condition3CheckBox.Name = "condition3CheckBox";
@@ -772,9 +772,9 @@ private void InitializeComponent()
this.condition3CheckBox.TabIndex = 54;
this.condition3CheckBox.UseVisualStyleBackColor = true;
this.condition3CheckBox.CheckedChanged += new System.EventHandler(this.condition3CheckBox_CheckedChanged);
- //
+ //
// operator3ComboBox
- //
+ //
this.operator3ComboBox.BackColor = System.Drawing.Color.Black;
this.operator3ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.operator3ComboBox.ForeColor = System.Drawing.Color.White;
@@ -790,9 +790,9 @@ private void InitializeComponent()
this.operator3ComboBox.Size = new System.Drawing.Size(78, 24);
this.operator3ComboBox.TabIndex = 53;
this.operator3ComboBox.Text = "=";
- //
+ //
// condition3ComboBox
- //
+ //
this.condition3ComboBox.BackColor = System.Drawing.Color.Black;
this.condition3ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.condition3ComboBox.ForeColor = System.Drawing.Color.White;
@@ -809,18 +809,18 @@ private void InitializeComponent()
this.condition3ComboBox.TabIndex = 52;
this.condition3ComboBox.Text = "Condition";
this.condition3ComboBox.SelectedIndexChanged += new System.EventHandler(this.condition3ComboBox_SelectedIndexChanged);
- //
+ //
// condition3TextBox
- //
+ //
this.condition3TextBox.BackColor = System.Drawing.Color.Black;
this.condition3TextBox.ForeColor = System.Drawing.Color.White;
this.condition3TextBox.Location = new System.Drawing.Point(215, 6);
this.condition3TextBox.Name = "condition3TextBox";
this.condition3TextBox.Size = new System.Drawing.Size(102, 22);
this.condition3TextBox.TabIndex = 51;
- //
+ //
// condition2Panel
- //
+ //
this.condition2Panel.Controls.Add(this.condition2CheckBox);
this.condition2Panel.Controls.Add(this.operator2ComboBox);
this.condition2Panel.Controls.Add(this.condition2ComboBox);
@@ -830,9 +830,9 @@ private void InitializeComponent()
this.condition2Panel.Size = new System.Drawing.Size(324, 36);
this.condition2Panel.TabIndex = 50;
this.condition2Panel.Visible = false;
- //
+ //
// condition2CheckBox
- //
+ //
this.condition2CheckBox.AutoSize = true;
this.condition2CheckBox.Location = new System.Drawing.Point(7, 11);
this.condition2CheckBox.Name = "condition2CheckBox";
@@ -840,9 +840,9 @@ private void InitializeComponent()
this.condition2CheckBox.TabIndex = 54;
this.condition2CheckBox.UseVisualStyleBackColor = true;
this.condition2CheckBox.CheckedChanged += new System.EventHandler(this.condition2CheckBox_CheckedChanged);
- //
+ //
// operator2ComboBox
- //
+ //
this.operator2ComboBox.BackColor = System.Drawing.Color.Black;
this.operator2ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.operator2ComboBox.ForeColor = System.Drawing.Color.White;
@@ -858,9 +858,9 @@ private void InitializeComponent()
this.operator2ComboBox.Size = new System.Drawing.Size(78, 24);
this.operator2ComboBox.TabIndex = 53;
this.operator2ComboBox.Text = "=";
- //
+ //
// condition2ComboBox
- //
+ //
this.condition2ComboBox.BackColor = System.Drawing.Color.Black;
this.condition2ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.condition2ComboBox.ForeColor = System.Drawing.Color.White;
@@ -877,18 +877,18 @@ private void InitializeComponent()
this.condition2ComboBox.TabIndex = 52;
this.condition2ComboBox.Text = "Condition";
this.condition2ComboBox.SelectedIndexChanged += new System.EventHandler(this.condition2ComboBox_SelectedIndexChanged);
- //
+ //
// condition2TextBox
- //
+ //
this.condition2TextBox.BackColor = System.Drawing.Color.Black;
this.condition2TextBox.ForeColor = System.Drawing.Color.White;
this.condition2TextBox.Location = new System.Drawing.Point(215, 6);
this.condition2TextBox.Name = "condition2TextBox";
this.condition2TextBox.Size = new System.Drawing.Size(102, 22);
this.condition2TextBox.TabIndex = 51;
- //
+ //
// condition1Panel
- //
+ //
this.condition1Panel.Controls.Add(this.condition1CheckBox);
this.condition1Panel.Controls.Add(this.operator1ComboBox);
this.condition1Panel.Controls.Add(this.condition1ComboBox);
@@ -898,9 +898,9 @@ private void InitializeComponent()
this.condition1Panel.Size = new System.Drawing.Size(324, 36);
this.condition1Panel.TabIndex = 49;
this.condition1Panel.Visible = false;
- //
+ //
// condition1CheckBox
- //
+ //
this.condition1CheckBox.AutoSize = true;
this.condition1CheckBox.Location = new System.Drawing.Point(7, 11);
this.condition1CheckBox.Name = "condition1CheckBox";
@@ -908,9 +908,9 @@ private void InitializeComponent()
this.condition1CheckBox.TabIndex = 54;
this.condition1CheckBox.UseVisualStyleBackColor = true;
this.condition1CheckBox.CheckedChanged += new System.EventHandler(this.condition1CheckBox_CheckedChanged);
- //
+ //
// operator1ComboBox
- //
+ //
this.operator1ComboBox.BackColor = System.Drawing.Color.Black;
this.operator1ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.operator1ComboBox.ForeColor = System.Drawing.Color.White;
@@ -926,9 +926,9 @@ private void InitializeComponent()
this.operator1ComboBox.Size = new System.Drawing.Size(78, 24);
this.operator1ComboBox.TabIndex = 53;
this.operator1ComboBox.Text = "=";
- //
+ //
// condition1ComboBox
- //
+ //
this.condition1ComboBox.BackColor = System.Drawing.Color.Black;
this.condition1ComboBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.condition1ComboBox.ForeColor = System.Drawing.Color.White;
@@ -945,18 +945,18 @@ private void InitializeComponent()
this.condition1ComboBox.TabIndex = 52;
this.condition1ComboBox.Text = "Condition";
this.condition1ComboBox.SelectedIndexChanged += new System.EventHandler(this.condition1ComboBox_SelectedIndexChanged);
- //
+ //
// condition1TextBox
- //
+ //
this.condition1TextBox.BackColor = System.Drawing.Color.Black;
this.condition1TextBox.ForeColor = System.Drawing.Color.White;
this.condition1TextBox.Location = new System.Drawing.Point(215, 6);
this.condition1TextBox.Name = "condition1TextBox";
this.condition1TextBox.Size = new System.Drawing.Size(102, 22);
this.condition1TextBox.TabIndex = 51;
- //
+ //
// clearButton
- //
+ //
this.clearButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.clearButton.Location = new System.Drawing.Point(94, 19);
this.clearButton.Name = "clearButton";
@@ -965,9 +965,9 @@ private void InitializeComponent()
this.clearButton.Text = "Clear last";
this.clearButton.UseVisualStyleBackColor = true;
this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
- //
+ //
// addFilterButton
- //
+ //
this.addFilterButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.addFilterButton.Location = new System.Drawing.Point(11, 19);
this.addFilterButton.Name = "addFilterButton";
@@ -976,9 +976,9 @@ private void InitializeComponent()
this.addFilterButton.Text = "Add Filter";
this.addFilterButton.UseVisualStyleBackColor = true;
this.addFilterButton.Click += new System.EventHandler(this.addFilterButton_Click);
- //
+ //
// filterBox
- //
+ //
this.filterBox.Controls.Add(this.filterTreeView);
this.filterBox.ForeColor = System.Drawing.Color.White;
this.filterBox.Location = new System.Drawing.Point(34, 278);
@@ -988,9 +988,9 @@ private void InitializeComponent()
this.filterBox.TabStop = false;
this.filterBox.Text = "Filtered Book List";
this.filterBox.Visible = false;
- //
+ //
// filterTreeView
- //
+ //
this.filterTreeView.BackColor = System.Drawing.Color.Black;
this.filterTreeView.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.filterTreeView.ForeColor = System.Drawing.Color.White;
@@ -999,9 +999,9 @@ private void InitializeComponent()
this.filterTreeView.Size = new System.Drawing.Size(258, 366);
this.filterTreeView.TabIndex = 3;
this.filterTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.filterTreeView_AfterSelect);
- //
+ //
// Form1
- //
+ //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
diff --git a/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/xmlhelpermethods.cs b/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/xmlhelpermethods.cs
index 6fa88fda65e..5c77c35502e 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/xmlhelpermethods.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/xmlprocessingapp/cs/xmlhelpermethods.cs
@@ -17,7 +17,7 @@ public class XMLHelperMethods
// Loads XML from a file. If the file is not found, load XML from a string.
//
//************************************************************************************
-
+
public XmlDocument LoadDocument(bool generateXML)
{
//
@@ -36,10 +36,10 @@ public XmlDocument LoadDocument(bool generateXML)
" The Handmaid's Tale \n" +
" 29.95 \n" +
" \n" +
- "");
+ "");
}
//
-
+
return doc;
}
@@ -48,7 +48,7 @@ public XmlDocument LoadDocument(bool generateXML)
// Helper method that generates an XML string.
//
//************************************************************************************
-
+
private string generateXMLString()
{
string xml = " \n" +
@@ -244,11 +244,11 @@ void settings_ValidationEventHandler(object sender,
#endregion
#region Find XML elements and attributes
-
+
//************************************************************************************
//
// Search the XML tree for a specific XMLNode element by using an attribute value.
- // Description: Must identify the namespace of the nodes and define a prefix. Also include the
+ // Description: Must identify the namespace of the nodes and define a prefix. Also include the
// prefix in the XPath string.
//
//************************************************************************************
@@ -264,17 +264,17 @@ public XmlNode GetBook(string uniqueAttribute, XmlDocument doc)
//
//************************************************************************************
//
- // Get information about a specific book. Pass in an XMLNode that
+ // Get information about a specific book. Pass in an XMLNode that
// represents the book and populate strings passed in by reference.
//
- // **********************************************************************************
+ // **********************************************************************************
//
public void GetBookInformation(ref string title, ref string ISBN, ref string publicationDate,
ref string price, ref string genre, XmlNode book)
{
XmlElement bookElement = (XmlElement)book;
- // Get the attributes of a book.
+ // Get the attributes of a book.
XmlAttribute attr = bookElement.GetAttributeNode("ISBN");
ISBN = attr.InnerXml;
@@ -404,15 +404,15 @@ public XmlNodeList ApplyFilters(ArrayList conditions, ArrayList operatorSymbols,
//************************************************************************************
//
// Add an element to the XML document.
- // This method creates a new book element and saves that element to the
+ // This method creates a new book element and saves that element to the
// XMLDocument object. It addes attributes for the new element and introduces
// newline characters between elements fora nice readable format.
- //
+ //
//
//************************************************************************************
//
- public XmlElement AddNewBook(string genre, string ISBN, string misc,
+ public XmlElement AddNewBook(string genre, string ISBN, string misc,
string title, string price, XmlDocument doc)
{
// Create a new book element.
@@ -437,10 +437,10 @@ public XmlElement AddNewBook(string genre, string ISBN, string misc,
bookElement.AppendChild(titleElement);
// Introduce a newline character so that XML is nicely formatted.
- bookElement.InnerXml =
- bookElement.InnerXml.Replace(titleElement.OuterXml,
+ bookElement.InnerXml =
+ bookElement.InnerXml.Replace(titleElement.OuterXml,
"\n " + titleElement.OuterXml + " \n ");
-
+
// Create and append a child element for the price of the book.
XmlElement priceElement = doc.CreateElement("price");
priceElement.InnerText= price;
@@ -459,8 +459,8 @@ public XmlElement AddNewBook(string genre, string ISBN, string misc,
// Add an element to the XML document at a specific location
// Takes a string that describes where the user wants the new node
// to be positioned. The string comes from a series of radio buttons in a UI.
- // this method also accepts the XMLDocument in context. You have to use the
- // this instance because it is the object that was used to generate the
+ // this method also accepts the XMLDocument in context. You have to use the
+ // this instance because it is the object that was used to generate the
// selectedBook XMLNode.
//
//************************************************************************************
@@ -486,25 +486,25 @@ public void InsertBookElement(XmlElement bookElement, string position, XmlNode s
XmlNode appendedNode = doc.DocumentElement.AppendChild(bookElement);
doc.DocumentElement.InsertBefore(whitespace, appendedNode);
sigWhiteSpace = doc.CreateSignificantWhitespace("\n");
- doc.DocumentElement.InsertAfter(sigWhiteSpace, appendedNode);
+ doc.DocumentElement.InsertAfter(sigWhiteSpace, appendedNode);
break;
-
+
case Constants.positionAbove:
// Add newline characters to make XML more readable.
XmlNode currNode = doc.DocumentElement.InsertBefore(bookElement, selectedBook);
sigWhiteSpace = doc.CreateSignificantWhitespace("\n ");
doc.DocumentElement.InsertAfter(sigWhiteSpace, currNode);
break;
-
+
case Constants.positionBelow:
// Add newline characters to make XML more readable.
sigWhiteSpace = doc.CreateSignificantWhitespace("\n ");
XmlNode whiteSpaceNode = doc.DocumentElement.InsertAfter(sigWhiteSpace, selectedBook);
- doc.DocumentElement.InsertAfter(bookElement, whiteSpaceNode);
+ doc.DocumentElement.InsertAfter(bookElement, whiteSpaceNode);
break;
-
+
default:
- doc.DocumentElement.AppendChild(bookElement);
+ doc.DocumentElement.AppendChild(bookElement);
break;
}
@@ -531,7 +531,7 @@ public void editBook(string title, string ISBN, string publicationDate,
XmlElement bookElement = (XmlElement)book;
- // Get the attributes of a book.
+ // Get the attributes of a book.
bookElement.SetAttribute("ISBN", ISBN);
bookElement.SetAttribute("genre", genre);
bookElement.SetAttribute("publicationdate", publicationDate);
@@ -554,17 +554,17 @@ public void editBook(string title, string ISBN, string publicationDate,
//************************************************************************************
//
// Summary: Delete a book node from the XMLDocument.
- //
+ //
//
//************************************************************************************
//
public void deleteBook(XmlNode book)
{
XmlNode prevNode = book.PreviousSibling;
-
+
book.OwnerDocument.DocumentElement.RemoveChild(book);
- if (prevNode.NodeType == XmlNodeType.Whitespace ||
+ if (prevNode.NodeType == XmlNodeType.Whitespace ||
prevNode.NodeType == XmlNodeType.SignificantWhitespace)
{
prevNode.OwnerDocument.DocumentElement.RemoveChild(prevNode);
@@ -578,10 +578,10 @@ public void deleteBook(XmlNode book)
//************************************************************************************
//
// Summary: Move elements up in the XML.
- //
+ //
//
//************************************************************************************
-
+
public void MoveElementUp(XmlNode book)
{
XmlNode previousNode = book.PreviousSibling;
@@ -593,12 +593,12 @@ public void MoveElementUp(XmlNode book)
{
XmlNode newLineNode = book.NextSibling;
book.OwnerDocument.DocumentElement.RemoveChild(book);
- if (newLineNode.NodeType == XmlNodeType.Whitespace |
+ if (newLineNode.NodeType == XmlNodeType.Whitespace |
newLineNode.NodeType == XmlNodeType.SignificantWhitespace)
{
newLineNode.OwnerDocument.DocumentElement.RemoveChild(newLineNode);
}
- InsertBookElement((XmlElement)book, Constants.positionAbove,
+ InsertBookElement((XmlElement)book, Constants.positionAbove,
previousNode, false, false);
}
}
@@ -606,7 +606,7 @@ public void MoveElementUp(XmlNode book)
//************************************************************************************
//
// Summary: Move elements down in the XML.
- //
+ //
//
//************************************************************************************
public void MoveElementDown(XmlNode book)
@@ -627,7 +627,7 @@ public void MoveElementDown(XmlNode book)
newLineNode.OwnerDocument.DocumentElement.RemoveChild(newLineNode);
}
- InsertBookElement((XmlElement)book, Constants.positionBelow,
+ InsertBookElement((XmlElement)book, Constants.positionBelow,
NextNode, false, false);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Data/xmlschematype/cs/xmlschematype.cs b/samples/snippets/csharp/VS_Snippets_Data/xmlschematype/cs/xmlschematype.cs
index 31afa853de8..3204f2434cf 100644
--- a/samples/snippets/csharp/VS_Snippets_Data/xmlschematype/cs/xmlschematype.cs
+++ b/samples/snippets/csharp/VS_Snippets_Data/xmlschematype/cs/xmlschematype.cs
@@ -13,9 +13,9 @@ static void Main(string[] args)
XmlSchemaSimpleType stringType = new XmlSchemaSimpleType();
stringType.Name = "myString";
schema.Items.Add(stringType);
- XmlSchemaSimpleTypeRestriction stringRestriction =
+ XmlSchemaSimpleTypeRestriction stringRestriction =
new XmlSchemaSimpleTypeRestriction();
- stringRestriction.BaseTypeName =
+ stringRestriction.BaseTypeName =
new XmlQualifiedName("string",
"http://www.w3.org/2001/XMLSchema");
stringType.Content = stringRestriction;
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/system.device.location.locationevent1/cs/locationevent.cs b/samples/snippets/csharp/VS_Snippets_Misc/system.device.location.locationevent1/cs/locationevent.cs
index fe4b705b236..6496a6dd504 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/system.device.location.locationevent1/cs/locationevent.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/system.device.location.locationevent1/cs/locationevent.cs
@@ -17,7 +17,7 @@ static void Main(string[] args)
Console.WriteLine("Lat: {0}, Long: {1}", coordinate.Latitude,
coordinate.Longitude);
// Uncomment to get only one event.
- // watcher.Stop();
+ // watcher.Stop();
};
// Begin listening for location updates.
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclient/cs/source.cs b/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclient/cs/source.cs
index 9e6ad1dce2d..b21e0e5674b 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclient/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclient/cs/source.cs
@@ -9,7 +9,7 @@ class HttpClient_Example
//
// HttpClient is intended to be instantiated once per application, rather than per-use. See Remarks.
static readonly HttpClient client = new HttpClient();
-
+
static async Task Main()
{
// Call asynchronous network methods in a try/catch block to handle exceptions.
@@ -22,7 +22,7 @@ static async Task Main()
// string responseBody = await client.GetStringAsync(uri);
Console.WriteLine(responseBody);
- }
+ }
catch(HttpRequestException e)
{
Console.WriteLine("\nException Caught!");
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/source.cs b/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/source.cs
index c43d4aa951f..61defd9e9d6 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/source.cs
@@ -24,14 +24,14 @@ static async Task Main()
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
- }
+ }
catch(HttpRequestException e)
{
Console.WriteLine("\nException Caught!");
Console.WriteLine("Message :{0} ",e.Message);
}
- // Need to call dispose on the HttpClient and HttpClientHandler objects
+ // Need to call dispose on the HttpClient and HttpClientHandler objects
// when done using them, so the app doesn't leak resources
handler.Dispose(true);
client.Dispose(true);
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange/cs/source.cs b/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange/cs/source.cs
index f5d3f253e3b..de9bfc992c2 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange/cs/source.cs
@@ -1,7 +1,7 @@
/*System.Net.HttpWebRequest.AddRange(int,int)
This program demonstrates 'AddRange(int)' method of 'HttpWebRequest class.
-A new 'HttpWebRequest' object is created.The number of characters of the response to be received can be
-restricted by the 'AddRange' method.By calling 'AddRange(50,150)' on the 'HttpWebRequest' object the content
+A new 'HttpWebRequest' object is created.The number of characters of the response to be received can be
+restricted by the 'AddRange' method.By calling 'AddRange(50,150)' on the 'HttpWebRequest' object the content
of the response page is restricted from the 50th character to 150th charater.The response of the request is
obtained and displayed to the console.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange2/cs/source.cs b/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange2/cs/source.cs
index 19ee2bbb99e..bf2353ffc03 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange2/cs/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange2/cs/source.cs
@@ -1,7 +1,7 @@
/*System.Net.HttpWebRequest.AddRange(int,int)
This program demonstrates 'AddRange(int,int)' method of 'HttpWebRequest class.
-A new 'HttpWebRequest' object is created.The number of characters of the response to be received can be
-restricted by the 'AddRange' method.By calling 'AddRange(50,150)' on the 'HttpWebRequest' object the content
+A new 'HttpWebRequest' object is created.The number of characters of the response to be received can be
+restricted by the 'AddRange' method.By calling 'AddRange(50,150)' on the 'HttpWebRequest' object the content
of the response page is restricted from the 50th character to 150th charater.The response of the request is
obtained and displayed to the console.
*/
@@ -37,7 +37,7 @@ static void Main()
Char[] readBuffer = new Char[256];
int count = streamRead.Read( readBuffer, 0, 256 );
Console.WriteLine("\nThe HTML contents of the page from 50th to 150 characters are :\n ");
- while (count > 0)
+ while (count > 0)
{
String outputData = new String(readBuffer, 0, count);
Console.WriteLine(outputData);
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/continuewith.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/continuewith.cs
index cdbd8ef446a..fdcc613d953 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/continuewith.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/continuewith.cs
@@ -80,4 +80,4 @@ private static double GetStandardDeviation(int[] values, double mean)
}
}
}
-//
\ No newline at end of file
+//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/tpl.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/tpl.cs
index 24b4a15b0d4..ed7329bbce7 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/tpl.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/tpl.cs
@@ -43,13 +43,13 @@ static double TrySolution1()
static double TrySolution2()
{
// Pretend to do something.
- Thread.SpinWait(10000000); // ticks, not milliseconds
+ Thread.SpinWait(10000000); // ticks, not milliseconds
return DateTime.Now.Millisecond;
}
static double TrySolution3()
{
// Pretend to do something.
- Thread.SpinWait(1000000); // ticks, not milliseconds
+ Thread.SpinWait(1000000); // ticks, not milliseconds
return DateTime.Now.Millisecond;
}
@@ -129,7 +129,7 @@ static void RethrowAllExceptions()
// 15 was moved to tpl_cancellation and so number is available in tpl
- //
+ //
public class TreeWalk
{
static void Main()
@@ -190,7 +190,7 @@ public static void DoTree2(Tree tree, Action action)
//
//not used
- //
+ //
public class OrderPreservation
{
}
@@ -227,7 +227,7 @@ static void Main()
//
//
- // Sequential version
+ // Sequential version
foreach (var item in sourceCollection)
{
Process(item);
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/waitontasks_11.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/waitontasks_11.cs
index 98de3db805e..9c280e47084 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/waitontasks_11.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpl/cs/waitontasks_11.cs
@@ -1,6 +1,6 @@
//
- using System;
+ using System;
using System.Threading;
using System.Threading.Tasks;
@@ -56,21 +56,21 @@ static double TrySolution1()
{
int i = rand.Next(1000000);
// Simulate work by spinning
- Thread.SpinWait(i);
+ Thread.SpinWait(i);
return DateTime.Now.Millisecond;
}
static double TrySolution2()
{
int i = rand.Next(1000000);
// Simulate work by spinning
- Thread.SpinWait(i);
+ Thread.SpinWait(i);
return DateTime.Now.Millisecond;
}
static double TrySolution3()
{
int i = rand.Next(1000000);
// Simulate work by spinning
- Thread.SpinWait(i);
+ Thread.SpinWait(i);
Thread.SpinWait(1000000);
return DateTime.Now.Millisecond;
}
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpl_continuationstate/cs/continuationstate.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpl_continuationstate/cs/continuationstate.cs
index 78d3b8e80b6..8641fe58982 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpl_continuationstate/cs/continuationstate.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpl_continuationstate/cs/continuationstate.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using System.Collections.Generic;
using System.Threading;
@@ -11,7 +11,7 @@ class ContinuationState
// the operation completed.
public static DateTime DoWork()
{
- // Simulate work by suspending the current thread
+ // Simulate work by suspending the current thread
// for two seconds.
Thread.Sleep(2000);
@@ -24,7 +24,7 @@ static void Main(string[] args)
// Start a root task that performs work.
Task t = Task.Run(delegate { return DoWork(); });
- // Create a chain of continuation tasks, where each task is
+ // Create a chain of continuation tasks, where each task is
// followed by another task that performs work.
List> continuations = new List>();
for (int i = 0; i < 5; i++)
@@ -57,4 +57,4 @@ static void Main(string[] args)
Task was created at 10:56:21.1610677 and finished at 10:56:31.1779883.
Task was created at 10:56:21.1610677 and finished at 10:56:33.1837083.
*/
-//
\ No newline at end of file
+//
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpl_exceptions/cs/exceptions.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpl_exceptions/cs/exceptions.cs
index 7f13d01c779..fec408c5763 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpl_exceptions/cs/exceptions.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpl_exceptions/cs/exceptions.cs
@@ -121,7 +121,7 @@ private static void ProcessDataInParallel(byte[] data)
else
Console.Write(d + " ");
}
- // Store the exception and continue with the loop.
+ // Store the exception and continue with the loop.
catch (Exception e)
{
exceptions.Enqueue(e);
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpl_factories/cs/program.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpl_factories/cs/program.cs
index caded0c615c..aaf2a38905e 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpl_factories/cs/program.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpl_factories/cs/program.cs
@@ -7,7 +7,7 @@
class Example
{
static CancellationTokenSource cts = new CancellationTokenSource();
-
+
static TaskFactory factory = new TaskFactory(
cts.Token,
TaskCreationOptions.PreferFairness,
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpl_schedulers/cs/limitex1.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpl_schedulers/cs/limitex1.cs
index e9ce88804f7..fff3e17bdc9 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpl_schedulers/cs/limitex1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpl_schedulers/cs/limitex1.cs
@@ -8,52 +8,52 @@ class Example
{
static void Main()
{
- // Create a scheduler that uses two threads.
+ // Create a scheduler that uses two threads.
LimitedConcurrencyLevelTaskScheduler lcts = new LimitedConcurrencyLevelTaskScheduler(2);
List tasks = new List();
-
- // Create a TaskFactory and pass it our custom scheduler.
+
+ // Create a TaskFactory and pass it our custom scheduler.
TaskFactory factory = new TaskFactory(lcts);
CancellationTokenSource cts = new CancellationTokenSource();
-
- // Use our factory to run a set of tasks.
+
+ // Use our factory to run a set of tasks.
Object lockObj = new Object();
int outputItem = 0;
-
+
for (int tCtr = 0; tCtr <= 4; tCtr++) {
int iteration = tCtr;
Task t = factory.StartNew(() => {
for (int i = 0; i < 1000; i++) {
lock (lockObj) {
- Console.Write("{0} in task t-{1} on thread {2} ",
+ Console.Write("{0} in task t-{1} on thread {2} ",
i, iteration, Thread.CurrentThread.ManagedThreadId);
outputItem++;
if (outputItem % 3 == 0)
Console.WriteLine();
}
- }
+ }
}, cts.Token);
- tasks.Add(t);
+ tasks.Add(t);
}
- // Use it to run a second set of tasks.
+ // Use it to run a second set of tasks.
for (int tCtr = 0; tCtr <= 4; tCtr++) {
int iteration = tCtr;
Task t1 = factory.StartNew(() => {
for (int outer = 0; outer <= 10; outer++) {
for (int i = 0x21; i <= 0x7E; i++) {
lock (lockObj) {
- Console.Write("'{0}' in task t1-{1} on thread {2} ",
+ Console.Write("'{0}' in task t1-{1} on thread {2} ",
Convert.ToChar(i), iteration, Thread.CurrentThread.ManagedThreadId);
outputItem++;
if (outputItem % 3 == 0)
Console.WriteLine();
- }
+ }
}
- }
- }, cts.Token);
+ }
+ }, cts.Token);
tasks.Add(t1);
}
-
+
// Wait for the tasks to complete before displaying a completion message.
Task.WaitAll(tasks.ToArray());
cts.Dispose();
@@ -61,7 +61,7 @@ static void Main()
}
}
-// Provides a task scheduler that ensures a maximum concurrency level while
+// Provides a task scheduler that ensures a maximum concurrency level while
// running on top of the thread pool.
public class LimitedConcurrencyLevelTaskScheduler : TaskScheduler
{
@@ -69,27 +69,27 @@ public class LimitedConcurrencyLevelTaskScheduler : TaskScheduler
[ThreadStatic]
private static bool _currentThreadIsProcessingItems;
- // The list of tasks to be executed
+ // The list of tasks to be executed
private readonly LinkedList _tasks = new LinkedList(); // protected by lock(_tasks)
- // The maximum concurrency level allowed by this scheduler.
+ // The maximum concurrency level allowed by this scheduler.
private readonly int _maxDegreeOfParallelism;
- // Indicates whether the scheduler is currently processing work items.
+ // Indicates whether the scheduler is currently processing work items.
private int _delegatesQueuedOrRunning = 0;
- // Creates a new instance with the specified degree of parallelism.
+ // Creates a new instance with the specified degree of parallelism.
public LimitedConcurrencyLevelTaskScheduler(int maxDegreeOfParallelism)
{
if (maxDegreeOfParallelism < 1) throw new ArgumentOutOfRangeException("maxDegreeOfParallelism");
_maxDegreeOfParallelism = maxDegreeOfParallelism;
}
- // Queues a task to the scheduler.
+ // Queues a task to the scheduler.
protected sealed override void QueueTask(Task task)
{
- // Add the task to the list of tasks to be processed. If there aren't enough
- // delegates currently queued or running to process tasks, schedule another.
+ // Add the task to the list of tasks to be processed. If there aren't enough
+ // delegates currently queued or running to process tasks, schedule another.
lock (_tasks)
{
_tasks.AddLast(task);
@@ -101,7 +101,7 @@ protected sealed override void QueueTask(Task task)
}
}
- // Inform the ThreadPool that there's work to be executed for this scheduler.
+ // Inform the ThreadPool that there's work to be executed for this scheduler.
private void NotifyThreadPoolOfPendingWork()
{
ThreadPool.UnsafeQueueUserWorkItem(_ =>
@@ -139,33 +139,33 @@ private void NotifyThreadPoolOfPendingWork()
}, null);
}
- // Attempts to execute the specified task on the current thread.
+ // Attempts to execute the specified task on the current thread.
protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
{
// If this thread isn't already processing a task, we don't support inlining
if (!_currentThreadIsProcessingItems) return false;
// If the task was previously queued, remove it from the queue
- if (taskWasPreviouslyQueued)
- // Try to run the task.
- if (TryDequeue(task))
+ if (taskWasPreviouslyQueued)
+ // Try to run the task.
+ if (TryDequeue(task))
return base.TryExecuteTask(task);
else
- return false;
- else
+ return false;
+ else
return base.TryExecuteTask(task);
}
- // Attempt to remove a previously scheduled task from the scheduler.
+ // Attempt to remove a previously scheduled task from the scheduler.
protected sealed override bool TryDequeue(Task task)
{
lock (_tasks) return _tasks.Remove(task);
}
- // Gets the maximum concurrency level supported by this scheduler.
+ // Gets the maximum concurrency level supported by this scheduler.
public sealed override int MaximumConcurrencyLevel { get { return _maxDegreeOfParallelism; } }
- // Gets an enumerable of the tasks currently scheduled on this scheduler.
+ // Gets an enumerable of the tasks currently scheduled on this scheduler.
protected sealed override IEnumerable GetScheduledTasks()
{
bool lockTaken = false;
@@ -182,29 +182,29 @@ protected sealed override IEnumerable GetScheduledTasks()
}
}
// The following is a portion of the output from a single run of the example:
-// 'T' in task t1-4 on thread 3 'U' in task t1-4 on thread 3 'V' in task t1-4 on thread 3
-// 'W' in task t1-4 on thread 3 'X' in task t1-4 on thread 3 'Y' in task t1-4 on thread 3
-// 'Z' in task t1-4 on thread 3 '[' in task t1-4 on thread 3 '\' in task t1-4 on thread 3
-// ']' in task t1-4 on thread 3 '^' in task t1-4 on thread 3 '_' in task t1-4 on thread 3
-// '`' in task t1-4 on thread 3 'a' in task t1-4 on thread 3 'b' in task t1-4 on thread 3
-// 'c' in task t1-4 on thread 3 'd' in task t1-4 on thread 3 'e' in task t1-4 on thread 3
-// 'f' in task t1-4 on thread 3 'g' in task t1-4 on thread 3 'h' in task t1-4 on thread 3
-// 'i' in task t1-4 on thread 3 'j' in task t1-4 on thread 3 'k' in task t1-4 on thread 3
-// 'l' in task t1-4 on thread 3 'm' in task t1-4 on thread 3 'n' in task t1-4 on thread 3
-// 'o' in task t1-4 on thread 3 'p' in task t1-4 on thread 3 ']' in task t1-2 on thread 4
-// '^' in task t1-2 on thread 4 '_' in task t1-2 on thread 4 '`' in task t1-2 on thread 4
-// 'a' in task t1-2 on thread 4 'b' in task t1-2 on thread 4 'c' in task t1-2 on thread 4
-// 'd' in task t1-2 on thread 4 'e' in task t1-2 on thread 4 'f' in task t1-2 on thread 4
-// 'g' in task t1-2 on thread 4 'h' in task t1-2 on thread 4 'i' in task t1-2 on thread 4
-// 'j' in task t1-2 on thread 4 'k' in task t1-2 on thread 4 'l' in task t1-2 on thread 4
-// 'm' in task t1-2 on thread 4 'n' in task t1-2 on thread 4 'o' in task t1-2 on thread 4
-// 'p' in task t1-2 on thread 4 'q' in task t1-2 on thread 4 'r' in task t1-2 on thread 4
-// 's' in task t1-2 on thread 4 't' in task t1-2 on thread 4 'u' in task t1-2 on thread 4
-// 'v' in task t1-2 on thread 4 'w' in task t1-2 on thread 4 'x' in task t1-2 on thread 4
-// 'y' in task t1-2 on thread 4 'z' in task t1-2 on thread 4 '{' in task t1-2 on thread 4
-// '|' in task t1-2 on thread 4 '}' in task t1-2 on thread 4 '~' in task t1-2 on thread 4
-// 'q' in task t1-4 on thread 3 'r' in task t1-4 on thread 3 's' in task t1-4 on thread 3
-// 't' in task t1-4 on thread 3 'u' in task t1-4 on thread 3 'v' in task t1-4 on thread 3
-// 'w' in task t1-4 on thread 3 'x' in task t1-4 on thread 3 'y' in task t1-4 on thread 3
-// 'z' in task t1-4 on thread 3 '{' in task t1-4 on thread 3 '|' in task t1-4 on thread 3
+// 'T' in task t1-4 on thread 3 'U' in task t1-4 on thread 3 'V' in task t1-4 on thread 3
+// 'W' in task t1-4 on thread 3 'X' in task t1-4 on thread 3 'Y' in task t1-4 on thread 3
+// 'Z' in task t1-4 on thread 3 '[' in task t1-4 on thread 3 '\' in task t1-4 on thread 3
+// ']' in task t1-4 on thread 3 '^' in task t1-4 on thread 3 '_' in task t1-4 on thread 3
+// '`' in task t1-4 on thread 3 'a' in task t1-4 on thread 3 'b' in task t1-4 on thread 3
+// 'c' in task t1-4 on thread 3 'd' in task t1-4 on thread 3 'e' in task t1-4 on thread 3
+// 'f' in task t1-4 on thread 3 'g' in task t1-4 on thread 3 'h' in task t1-4 on thread 3
+// 'i' in task t1-4 on thread 3 'j' in task t1-4 on thread 3 'k' in task t1-4 on thread 3
+// 'l' in task t1-4 on thread 3 'm' in task t1-4 on thread 3 'n' in task t1-4 on thread 3
+// 'o' in task t1-4 on thread 3 'p' in task t1-4 on thread 3 ']' in task t1-2 on thread 4
+// '^' in task t1-2 on thread 4 '_' in task t1-2 on thread 4 '`' in task t1-2 on thread 4
+// 'a' in task t1-2 on thread 4 'b' in task t1-2 on thread 4 'c' in task t1-2 on thread 4
+// 'd' in task t1-2 on thread 4 'e' in task t1-2 on thread 4 'f' in task t1-2 on thread 4
+// 'g' in task t1-2 on thread 4 'h' in task t1-2 on thread 4 'i' in task t1-2 on thread 4
+// 'j' in task t1-2 on thread 4 'k' in task t1-2 on thread 4 'l' in task t1-2 on thread 4
+// 'm' in task t1-2 on thread 4 'n' in task t1-2 on thread 4 'o' in task t1-2 on thread 4
+// 'p' in task t1-2 on thread 4 'q' in task t1-2 on thread 4 'r' in task t1-2 on thread 4
+// 's' in task t1-2 on thread 4 't' in task t1-2 on thread 4 'u' in task t1-2 on thread 4
+// 'v' in task t1-2 on thread 4 'w' in task t1-2 on thread 4 'x' in task t1-2 on thread 4
+// 'y' in task t1-2 on thread 4 'z' in task t1-2 on thread 4 '{' in task t1-2 on thread 4
+// '|' in task t1-2 on thread 4 '}' in task t1-2 on thread 4 '~' in task t1-2 on thread 4
+// 'q' in task t1-4 on thread 3 'r' in task t1-4 on thread 3 's' in task t1-4 on thread 3
+// 't' in task t1-4 on thread 3 'u' in task t1-4 on thread 3 'v' in task t1-4 on thread 3
+// 'w' in task t1-4 on thread 3 'x' in task t1-4 on thread 3 'y' in task t1-4 on thread 3
+// 'z' in task t1-4 on thread 3 '{' in task t1-4 on thread 3 '|' in task t1-4 on thread 3
//
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpl_schedulers/cs/tpl_schedulers.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpl_schedulers/cs/tpl_schedulers.cs
index 17bdc090060..256f4a08625 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpl_schedulers/cs/tpl_schedulers.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpl_schedulers/cs/tpl_schedulers.cs
@@ -17,9 +17,9 @@ void QueueTasks()
{
// TaskA is a top level task.
Task taskA = Task.Factory.StartNew( () =>
- {
- Console.WriteLine("I was enqueued on the thread pool's global queue.");
-
+ {
+ Console.WriteLine("I was enqueued on the thread pool's global queue.");
+
// TaskB is a nested task and TaskC is a child task. Both go to local queue.
Task taskB = new Task( ()=> Console.WriteLine("I was enqueued on the local queue."));
Task taskC = new Task(() => Console.WriteLine("I was enqueued on the local queue, too."),
@@ -48,7 +48,7 @@ static void Main()
LimitedConcurrencyLevelTaskScheduler lcts = new LimitedConcurrencyLevelTaskScheduler(1);
TaskFactory factory = new TaskFactory(lcts);
- factory.StartNew(()=>
+ factory.StartNew(()=>
{
for (int i = 0; i < 500; i++)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpl_synccontext/cs/mainwindow.xaml.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpl_synccontext/cs/mainwindow.xaml.cs
index ee7b7ef9366..7b4ecdb7d02 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpl_synccontext/cs/mainwindow.xaml.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpl_synccontext/cs/mainwindow.xaml.cs
@@ -87,7 +87,7 @@ private void button_Click(object sender, RoutedEventArgs e)
byte[] LoadImage(string filename)
{
- // Use the WPF BitmapImage class to load and
+ // Use the WPF BitmapImage class to load and
// resize the bitmap. NOTE: Only 32bpp formats are supported correctly.
// Support for additional color formats is left as an exercise
// for the reader. For more information, see documentation for ColorConvertedBitmap.
@@ -116,7 +116,7 @@ int Stride(int pixelWidth, int bitsPerPixel)
// Map the individual image tiles to the large image
// in parallel. Any kind of raw image manipulation can be
- // done here because we are not attempting to access any
+ // done here because we are not attempting to access any
// WPF controls from multiple threads.
byte[] TileImages(Task[] sourceImages)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_degreeofparallelism/cs/dataflowdegreeofparallelism.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_degreeofparallelism/cs/dataflowdegreeofparallelism.cs
index 2a5eec2a7bf..7a4aafbd8e0 100644
--- a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_degreeofparallelism/cs/dataflowdegreeofparallelism.cs
+++ b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_degreeofparallelism/cs/dataflowdegreeofparallelism.cs
@@ -4,7 +4,7 @@
using System.Threading;
using System.Threading.Tasks.Dataflow;
-// Demonstrates how to specify the maximum degree of parallelism
+// Demonstrates how to specify the maximum degree of parallelism
// when using dataflow.
class Program
{
@@ -24,7 +24,7 @@ static TimeSpan TimeDataflowComputations(int maxDegreeOfParallelism,
MaxDegreeOfParallelism = maxDegreeOfParallelism
});
- // Compute the time that it takes for several messages to
+ // Compute the time that it takes for several messages to
// flow through the dataflow block.
Stopwatch stopwatch = new Stopwatch();
@@ -63,7 +63,7 @@ static void Main(string[] args)
Console.WriteLine("Degree of parallelism = {0}; message count = {1}; " +
"elapsed time = {2}ms.", 1, messageCount, (int)elapsed.TotalMilliseconds);
- // Perform the computations again. This time, specify the number of
+ // Perform the computations again. This time, specify the number of
// processors as the maximum degree of parallelism. This causes
// multiple messages to be processed in parallel.
elapsed = TimeDataflowComputations(processorCount, messageCount);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ActivatedServiceTypeEntry_ObjectType_Client/CS/activatedservicetypeentry_objecttype_server.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ActivatedServiceTypeEntry_ObjectType_Client/CS/activatedservicetypeentry_objecttype_server.cs
index c55cc4a3fe8..ac24e8b2173 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ActivatedServiceTypeEntry_ObjectType_Client/CS/activatedservicetypeentry_objecttype_server.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ActivatedServiceTypeEntry_ObjectType_Client/CS/activatedservicetypeentry_objecttype_server.cs
@@ -3,10 +3,10 @@
// System.Runtime.Remoting.ActivatedServiceTypeEntry.ToString
/*
-The following example demonstrates the 'ActivatedServiceTypeEntry' class and
+The following example demonstrates the 'ActivatedServiceTypeEntry' class and
the 'ObjectType' property ,'ToString' method of 'ActivatedServiceTypeEntry' class.
It registers a 'TcpChannel' object with the channel services. Then registers the 'HelloServer'
-object at the service end that can be activated on request from a client.By using the
+object at the service end that can be activated on request from a client.By using the
'GetRegisteredActivatedServiceTypes' method it gets the registered activated service types
and displays it's information to the console.
*/
@@ -26,7 +26,7 @@ public static void Main()
// which holds the values for 'HelloServer' type.
ActivatedServiceTypeEntry myActivatedServiceTypeEntry =
new ActivatedServiceTypeEntry(typeof(HelloServer));
- // Register an object Type on the service end so that
+ // Register an object Type on the service end so that
// it can be activated on request from a client.
RemotingConfiguration.RegisterActivatedServiceType(
myActivatedServiceTypeEntry);
@@ -39,7 +39,7 @@ public static void Main()
+" service type :");
Console.WriteLine("Object type: "
+myActivatedServiceEntries[0].ObjectType);
- Console.WriteLine("Description: "
+ Console.WriteLine("Description: "
+myActivatedServiceEntries[0].ToString());
//
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/AuthenticationManager_UnRegister2/CS/authenticationmanager_unregister2.cs b/samples/snippets/csharp/VS_Snippets_Remoting/AuthenticationManager_UnRegister2/CS/authenticationmanager_unregister2.cs
index 8d6f0e6b725..7c905a9faa2 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/AuthenticationManager_UnRegister2/CS/authenticationmanager_unregister2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/AuthenticationManager_UnRegister2/CS/authenticationmanager_unregister2.cs
@@ -2,14 +2,14 @@
// System.Net.AuthenticationManager.Register.
// Grouping Clause : 1,3 AND 2,3.
-/*This program demonstrates the 'UnRegister(String)' and 'Register' methods of
-'AuthenticationManager' class. It gets all the authentication modules registered with the system into an
-IEnumerator instance ,unregisters the first authentication module and displays to show that it was
+/*This program demonstrates the 'UnRegister(String)' and 'Register' methods of
+'AuthenticationManager' class. It gets all the authentication modules registered with the system into an
+IEnumerator instance ,unregisters the first authentication module and displays to show that it was
unregistered. Then registers the same module back again and displays all the modules again.*/
using System;
using System.Net;
-using System.Collections;
+using System.Collections;
namespace Authentication2
{
@@ -21,19 +21,19 @@ public static void Main()
{
//
//
- IEnumerator registeredModules = AuthenticationManager.RegisteredModules;
+ IEnumerator registeredModules = AuthenticationManager.RegisteredModules;
// Display all the modules that are already registered with the system.
- DisplayAllModules();
+ DisplayAllModules();
registeredModules.Reset();
registeredModules.MoveNext();
// Get the first Authentication module registered with the system.
- IAuthenticationModule authenticationModule1 = (IAuthenticationModule)registeredModules.Current;
+ IAuthenticationModule authenticationModule1 = (IAuthenticationModule)registeredModules.Current;
// Call the UnRegister() method to unregister the first authentication module from the system.
String authenticationScheme = authenticationModule1.AuthenticationType;
AuthenticationManager.Unregister(authenticationScheme);
- Console.WriteLine("\nSuccessfully unregistered '{0}",authenticationModule1+"'.");
+ Console.WriteLine("\nSuccessfully unregistered '{0}",authenticationModule1+"'.");
// Display all modules to see that the module was unregistered.
- DisplayAllModules();
+ DisplayAllModules();
//
// Calling 'Register()' method to register 'authenticationModule1' module back again.
AuthenticationManager.Register(authenticationModule1);
@@ -42,7 +42,7 @@ public static void Main()
DisplayAllModules();
//
Console.WriteLine("Press any key to continue");
- Console.ReadLine();
+ Console.ReadLine();
}
catch(Exception e)
{
@@ -52,13 +52,13 @@ public static void Main()
//
static void DisplayAllModules()
{
- IEnumerator registeredModules = AuthenticationManager.RegisteredModules;
- Console.WriteLine("\n\tThe following modules are now registered with the system:");
+ IEnumerator registeredModules = AuthenticationManager.RegisteredModules;
+ Console.WriteLine("\n\tThe following modules are now registered with the system:");
while(registeredModules.MoveNext())
{
- Console.WriteLine("\n\t\tModule : {0}",registeredModules.Current);
+ Console.WriteLine("\n\t\tModule : {0}",registeredModules.Current);
IAuthenticationModule currentAuthenticationModule = (IAuthenticationModule)registeredModules.Current;
- Console.WriteLine("\t\t\t CanPreAuthenticate : {0}",currentAuthenticationModule.CanPreAuthenticate);
+ Console.WriteLine("\t\t\t CanPreAuthenticate : {0}",currentAuthenticationModule.CanPreAuthenticate);
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_Constructor3/CS/ClientCloneBasic.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_Constructor3/CS/ClientCloneBasic.cs
index 036649e713c..f61b2dc4196 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_Constructor3/CS/ClientCloneBasic.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_Constructor3/CS/ClientCloneBasic.cs
@@ -2,7 +2,7 @@
*
* To demonstrate the functionality of CloneBasic, Client class has been made which makes
* the webrequest for the protected resource. A site for such a protected resource
- (http://gopik/clonebasicsite/WebForm1.aspx), which would use CloneBasic authentication, has been developed.
+ (http://gopik/clonebasicsite/WebForm1.aspx), which would use CloneBasic authentication, has been developed.
Pl. see the guidelines.txt file for more information in setting up the site at your environment. While
running this program make sure to refer the 'Authroization_Constructor3.dll'
*/
@@ -13,11 +13,11 @@ running this program make sure to refer the 'Authroization_Constructor3.dll'
using System.IO;
using System.Collections;
using CloneBasicAuthentication;
-
+
namespace CloneBasicAuthenticationClient
{
-
- // To test our authentication module, we write a client class.
+
+ // To test our authentication module, we write a client class.
class Client
{
public static void Main(string[] args)
@@ -42,7 +42,7 @@ public static void Main(string[] args)
{
return;
}
- }
+ }
else
{
url = args[0];
@@ -60,16 +60,16 @@ public static void Main(string[] args)
// an authorization instance. We have to unregister "Basic" here as it almost always returns an authorization;
// thereby defeating our purpose to test CloneBasic.
AuthenticationManager.Unregister("Basic");
-
- IEnumerator registeredModules = AuthenticationManager.RegisteredModules;
+
+ IEnumerator registeredModules = AuthenticationManager.RegisteredModules;
Console.WriteLine("\r\nThe following authentication modules are now registered with the system");
while(registeredModules.MoveNext())
{
- Console.WriteLine("\r \n Module : {0}",registeredModules.Current);
+ Console.WriteLine("\r \n Module : {0}",registeredModules.Current);
IAuthenticationModule currentAuthenticationModule = (IAuthenticationModule)registeredModules.Current;
- Console.WriteLine("\t CanPreAuthenticate : {0}",currentAuthenticationModule.CanPreAuthenticate);
+ Console.WriteLine("\t CanPreAuthenticate : {0}",currentAuthenticationModule.CanPreAuthenticate);
}
- // Calling Our Test Client.
+ // Calling Our Test Client.
GetPage(url,userName,passwd,domain);
}
catch(Exception e)
@@ -77,34 +77,34 @@ public static void Main(string[] args)
Console.WriteLine("\n The following exception was raised : {0}",e.Message);
}
}
- public static void PrintUsage()
+ public static void PrintUsage()
{
Console.WriteLine("\r\nUsage: Try a site which requires CloneBasic(custom made) authentication as below");
Console.WriteLine(" ClientCloneBasic URLname username password domainname");
Console.WriteLine("\nExample:");
Console.WriteLine("\n ClientCloneBasic http://www.microsoft.com/net/ george george123 microsoft");
}
- public static void GetPage(string url,string username,string passwd,string domain)
+ public static void GetPage(string url,string username,string passwd,string domain)
{
- try
+ try
{
- HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
+ HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
NetworkCredential credentials = new NetworkCredential(username,passwd,domain);
myHttpWebRequest.Credentials = credentials;
- HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
+ HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Console.WriteLine("\nRequest for protected resource {0} sent",url);
Stream receiveStream = myHttpWebResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
StreamReader readStream = new StreamReader( receiveStream, encode );
Console.WriteLine("\r\nResponse stream received");
-
+
Char[] read = new Char[256];
- // Read 256 characters at a time.
+ // Read 256 characters at a time.
int count = readStream.Read( read, 0, 256 );
Console.WriteLine("Contents of the response received follows...\r\n");
- while (count > 0)
+ while (count > 0)
{
// Dump the 256 characters on a string and display the string onto the console.
Console.Write(read);
@@ -114,14 +114,14 @@ public static void GetPage(string url,string username,string passwd,string domai
// Release the resources of stream object.
readStream.Close();
// Release the resources of response object.
- myHttpWebResponse.Close();
- }
- catch(WebException e)
+ myHttpWebResponse.Close();
+ }
+ catch(WebException e)
{
if(e.Response != null)
- Console.WriteLine("\r\n Exception Raised. The following error occurred : {0}",((HttpWebResponse)(e.Response)).StatusDescription);
+ Console.WriteLine("\r\n Exception Raised. The following error occurred : {0}",((HttpWebResponse)(e.Response)).StatusDescription);
else
- Console.WriteLine("\r\n Exception Raised. The following error occurred : {0}",e.Status);
+ Console.WriteLine("\r\n Exception Raised. The following error occurred : {0}",e.Status);
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_Constructor3/CS/authorization_constructor3.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_Constructor3/CS/authorization_constructor3.cs
index 6f97c9ffc40..ab1a4c2d0c2 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_Constructor3/CS/authorization_constructor3.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_Constructor3/CS/authorization_constructor3.cs
@@ -1,13 +1,13 @@
// System.Net.Authorization.Authorization(string,bool,string)
-/* This program demonstrates the contructor 'Authorization(string,bool,string)' of the authorization
+/* This program demonstrates the contructor 'Authorization(string,bool,string)' of the authorization
* class.
- *
+ *
* We implement the interface "IAuthenticationModule" to make CloneBasic which is a custom authentication module.
- * The custom authentication module encodes username and password as base64 strings and then returns
- * back an authorization instance. This authorization is internally used by the HttpWebRequest for
+ * The custom authentication module encodes username and password as base64 strings and then returns
+ * back an authorization instance. This authorization is internally used by the HttpWebRequest for
* authentication.
- * *
+ * *
* Please Note : This program has to be compiled as a dll.
*/
using System;
@@ -48,7 +48,7 @@ public Authorization Authenticate( string challenge,WebRequest request,ICredenti
string message;
// Check if Challenge string was raised by a site which requires CloneBasic authentication.
if ((challenge == null) || (!challenge.StartsWith("CloneBasic")))
- return null;
+ return null;
NetworkCredential myCredentials;
if (credentials is CredentialCache)
{
@@ -60,7 +60,7 @@ public Authorization Authenticate( string challenge,WebRequest request,ICredenti
{
myCredentials = (NetworkCredential)credentials;
}
- // Message encryption scheme :
+ // Message encryption scheme :
// a)Concatenate username and password seperated by space;
// b)Apply ASCII encoding to obtain a stream of bytes;
// c)Apply Base64 Encoding to this array of bytes to obtain our encoded authorization message.
@@ -81,13 +81,13 @@ public Authorization Authenticate( string challenge,WebRequest request,ICredenti
}
catch(Exception e)
{
- Console.WriteLine("Exception Raised ...:"+e.Message);
+ Console.WriteLine("Exception Raised ...:"+e.Message);
return null;
}
}
//
-
+
public Authorization PreAuthenticate(WebRequest request,ICredentials credentials)
{
return null;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_ProtectionRealm/CS/authorization_protectionrealm.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_ProtectionRealm/CS/authorization_protectionrealm.cs
index f367eab009a..1611a13c124 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_ProtectionRealm/CS/authorization_protectionrealm.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Authorization_ProtectionRealm/CS/authorization_protectionrealm.cs
@@ -1,6 +1,6 @@
// System.Net.Authorization.Authorization(string,bool);System.Net.Authorization.ProtectionRealm
-/* This program demonstrates the 'ProtectionRealm' property and 'Authorization(string,bool)' constructor of
+/* This program demonstrates the 'ProtectionRealm' property and 'Authorization(string,bool)' constructor of
the "Authorization" class. The "IAuthenticationModule" interface is implemented in 'CloneBasic' to make
it a custom authentication module. The custom authentication module encodes username and password as
base64 strings and then returns back an 'Authorization' instance. The 'Authorization' instance encapsulates
@@ -44,7 +44,7 @@ public Authorization Authenticate( string challenge,WebRequest request,ICredenti
string message;
// Check if Challenge string was raised by a site which requires 'CloneBasic' authentication.
if ((challenge == null) || (!challenge.StartsWith("CloneBasic")))
- return null;
+ return null;
NetworkCredential myCredentials;
if (credentials is CredentialCache)
{
@@ -56,7 +56,7 @@ public Authorization Authenticate( string challenge,WebRequest request,ICredenti
{
myCredentials = (NetworkCredential)credentials;
}
- // Message encryption scheme :
+ // Message encryption scheme :
// a)Concatenate username and password seperated by space;
// b)Apply ASCII encoding to obtain a stream of bytes;
// c)Apply Base64 Encoding to this array of bytes to obtain our encoded authorization message.
@@ -97,47 +97,47 @@ class Client
public static void Main(string[] args)
{
string url,userName,passwd;
- if (args.Length < 3)
+ if (args.Length < 3)
{
Client.PrintUsage();
return;
- }
+ }
else
- {
+ {
url = args[0];
userName = args[1];
- passwd = args[2];
+ passwd = args[2];
}
Console.WriteLine();
CloneBasic authenticationModule = new CloneBasic();
AuthenticationManager.Register(authenticationModule);
AuthenticationManager.Unregister("Basic");
- // Get response from Uri.
- GetPage(url,userName,passwd);
+ // Get response from Uri.
+ GetPage(url,userName,passwd);
}
-
- public static void GetPage(String url,string username,string passwd)
+
+ public static void GetPage(String url,string username,string passwd)
{
try
{
string challenge = null;
HttpWebRequest myHttpWebRequest = null;
- try
+ try
{
// Create a 'HttpWebRequest' object for the above 'url'.
- myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
+ myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
// The following method call throws the 'WebException'.
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
// Release resources of response object.
myHttpWebResponse.Close();
- }
- catch(WebException e)
+ }
+ catch(WebException e)
{
- for(int i=0; i < e.Response.Headers.Count; ++i)
+ for(int i=0; i < e.Response.Headers.Count; ++i)
{
// Retrieve the challenge string from the header "WWW-Authenticate".
if((String.Compare(e.Response.Headers.Keys[i],"WWW-Authenticate",true) == 0))
- challenge = e.Response.Headers[i];
+ challenge = e.Response.Headers[i];
}
}
@@ -147,7 +147,7 @@ public static void GetPage(String url,string username,string passwd)
NetworkCredential myCredentials = new NetworkCredential(username,passwd);
// Pass the challenge , 'NetworkCredential' object and the 'HttpWebRequest' object to the
// 'Authenticate' method of the "AuthenticationManager" to retrieve an "Authorization" ;
- // instance.
+ // instance.
Authorization urlAuthorization = AuthenticationManager.Authenticate(challenge,myHttpWebRequest,myCredentials);
if (urlAuthorization != null)
{
@@ -172,12 +172,12 @@ public static void GetPage(String url,string username,string passwd)
}
}
- public static void PrintUsage()
- {
+ public static void PrintUsage()
+ {
Console.WriteLine("\r\nUsage: Try a site which requires CloneBasic(custom made) authentication as below");
Console.WriteLine(" Authorization_ProtectionRealm URLname username password");
Console.WriteLine("\nExample:");
Console.WriteLine("\n Authorization_ProtectionRealm http://www.microsoft.com/net/ george george123");
}
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/BinaryFormatterClass Example/CS/binaryformatter.cs b/samples/snippets/csharp/VS_Snippets_Remoting/BinaryFormatterClass Example/CS/binaryformatter.cs
index ff60b9cadf2..f75c37832d5 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/BinaryFormatterClass Example/CS/binaryformatter.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/BinaryFormatterClass Example/CS/binaryformatter.cs
@@ -5,16 +5,16 @@
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization;
-public class App
+public class App
{
[STAThread]
- static void Main()
+ static void Main()
{
Serialize();
Deserialize();
}
- static void Serialize()
+ static void Serialize()
{
// Create a hashtable of values that will eventually be serialized.
Hashtable addresses = new Hashtable();
@@ -22,56 +22,56 @@ static void Serialize()
addresses.Add("Fred", "987 Pine Road, Phila., PA 19116");
addresses.Add("Mary", "PO Box 112233, Palo Alto, CA 94301");
- // To serialize the hashtable and its key/value pairs,
- // you must first open a stream for writing.
+ // To serialize the hashtable and its key/value pairs,
+ // you must first open a stream for writing.
// In this case, use a file stream.
FileStream fs = new FileStream("DataFile.dat", FileMode.Create);
// Construct a BinaryFormatter and use it to serialize the data to the stream.
BinaryFormatter formatter = new BinaryFormatter();
- try
+ try
{
formatter.Serialize(fs, addresses);
}
- catch (SerializationException e)
+ catch (SerializationException e)
{
Console.WriteLine("Failed to serialize. Reason: " + e.Message);
throw;
}
- finally
+ finally
{
fs.Close();
}
}
- static void Deserialize()
+ static void Deserialize()
{
// Declare the hashtable reference.
Hashtable addresses = null;
// Open the file containing the data that you want to deserialize.
FileStream fs = new FileStream("DataFile.dat", FileMode.Open);
- try
+ try
{
BinaryFormatter formatter = new BinaryFormatter();
- // Deserialize the hashtable from the file and
+ // Deserialize the hashtable from the file and
// assign the reference to the local variable.
addresses = (Hashtable) formatter.Deserialize(fs);
}
- catch (SerializationException e)
+ catch (SerializationException e)
{
Console.WriteLine("Failed to deserialize. Reason: " + e.Message);
throw;
}
- finally
+ finally
{
fs.Close();
}
- // To prove that the table deserialized correctly,
+ // To prove that the table deserialized correctly,
// display the key/value pairs.
- foreach (DictionaryEntry de in addresses)
+ foreach (DictionaryEntry de in addresses)
{
Console.WriteLine("{0} lives at {1}.", de.Key, de.Value);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionSample2/CS/bindingcollectionsample2.cs b/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionSample2/CS/bindingcollectionsample2.cs
index ac3b6e0e9d0..c709e35c537 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionSample2/CS/bindingcollectionsample2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionSample2/CS/bindingcollectionsample2.cs
@@ -7,13 +7,13 @@
/* The following example demonstrates the constructor 'Binding()' and properties 'Extensions','Name','Operations',
'ServiceDescription' and 'Type' property of 'Binding' class AND method 'Insert' of 'BindingCollection' class.
- The input to the program is a WSDL file 'MathService_input.wsdl' with all information related to SOAP protocol
- removed from it.In a way it tries to simulate a scenario wherein a service initially did not support a protocol, however later
- on happen to support it.
+ The input to the program is a WSDL file 'MathService_input.wsdl' with all information related to SOAP protocol
+ removed from it.In a way it tries to simulate a scenario wherein a service initially did not support a protocol, however later
+ on happen to support it.
IN this example the WSDL file is modified to insert a new Binding for SOAP. The binding is populated based on
WSDL document structure defined in WSDL specification. The ServiceDescription instance is loaded with values
for 'Messages', 'PortTypes','Bindings' and 'Port'.The instance is then written to an external file 'MathService_new.wsdl'.
-
+
* */
using System;
using System.Web.Services.Description;
@@ -27,14 +27,14 @@ public static void Main()
ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_input.wsdl");
// Create SOAP Messages.
myServiceDescription.Messages.Add(CreateMessage("AddSoapIn","parameters","Add",myServiceDescription.TargetNamespace));
- myServiceDescription.Messages.Add(CreateMessage("AddSoapOut","parameters","AddResponse",myServiceDescription.TargetNamespace));
+ myServiceDescription.Messages.Add(CreateMessage("AddSoapOut","parameters","AddResponse",myServiceDescription.TargetNamespace));
myServiceDescription.Messages.Add(CreateMessage("SubtractSoapIn","parameters","Subtract",myServiceDescription.TargetNamespace));
myServiceDescription.Messages.Add(CreateMessage("SubtractSoapOut","parameters","SubtractResponse",myServiceDescription.TargetNamespace));
myServiceDescription.Messages.Add(CreateMessage("MultiplySoapIn","parameters","Multiply",myServiceDescription.TargetNamespace));
myServiceDescription.Messages.Add(CreateMessage("MultiplySoapOut","parameters","MultiplyResponse",myServiceDescription.TargetNamespace));
myServiceDescription.Messages.Add(CreateMessage("DivideSoapIn","parameters","Divide",myServiceDescription.TargetNamespace));
myServiceDescription.Messages.Add(CreateMessage("DivideSoapOut","parameters","DivideResponse",myServiceDescription.TargetNamespace));
-
+
// Create a new PortType.
PortType soapPortType = new PortType();
soapPortType.Name = "MathServiceSoap";
@@ -106,7 +106,7 @@ public static Message CreateMessage(string messageName,string partName,string el
myMessage.Parts.Add(myMessagePart);
return myMessage;
}
-//
+//
// Used to create OperationBinding instances within 'Binding'.
public static OperationBinding CreateOperationBinding(string operation,string targetNamespace)
{
@@ -121,7 +121,7 @@ public static OperationBinding CreateOperationBinding(string operation,string ta
// Create OutputBinding for operation.
OutputBinding myOutputBinding = new OutputBinding();
myOutputBinding.Extensions.Add(mySoapBodyBinding);
- // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'.
+ // Add 'InputBinding' and 'OutputBinding' to 'OperationBinding'.
myOperationBinding.Input = myInputBinding;
myOperationBinding.Output = myOutputBinding;
// Create extensibility element for 'SoapOperationBinding'.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionsample1/CS/bindingcollectionsample1.cs b/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionsample1/CS/bindingcollectionsample1.cs
index 166c8a45760..2be5bb5eb69 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionsample1/CS/bindingcollectionsample1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionsample1/CS/bindingcollectionsample1.cs
@@ -1,9 +1,9 @@
// System.Web.Services.Description.BindingCollection;System.Web.Services.Description.BindingCollection.Item[Int32];
// System.Web.Services.Description.BindingCollection.Item[String];System.Web.Services.Description.BindingCollection.CopyTo
-/* The program reads a wsdl document "MathService.wsdl" and instantiates a ServiceDescription instance
- from the WSDL document.A BindingCollection instance is then retrieved from this ServiceDescription instance
- and it's members are demonstrated.
+/* The program reads a wsdl document "MathService.wsdl" and instantiates a ServiceDescription instance
+ from the WSDL document.A BindingCollection instance is then retrieved from this ServiceDescription instance
+ and it's members are demonstrated.
*/
using System;
using System.Web.Services.Description;
@@ -17,10 +17,10 @@ public static void Main()
Binding myBinding;
ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_input.wsdl");
Console.WriteLine("Total Number of bindings :" + myServiceDescription.Bindings.Count);
-//
+//
for(int i=0; i < myServiceDescription.Bindings.Count; ++i)
{
- Console.WriteLine("\nBinding " + i );
+ Console.WriteLine("\nBinding " + i );
// Get Binding at index i.
myBinding = myServiceDescription.Bindings[i];
Console.WriteLine("\t Name : " + myBinding.Name);
@@ -34,12 +34,12 @@ public static void Main()
Console.WriteLine("\n\n Displaying array copied from BindingCollection");
for(int i=0;i < myServiceDescription.Bindings.Count; ++i)
{
- Console.WriteLine("\nBinding " + i );
+ Console.WriteLine("\nBinding " + i );
Console.WriteLine("\t Name : " + myBindings[i].Name);
Console.WriteLine("\t Type : " + myBindings[i].Type);
}
//
-//
+//
// Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.Bindings["MathServiceHttpGet"];
if (myBinding != null)
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionsample3/CS/bindingcollectionsample3.cs b/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionsample3/CS/bindingcollectionsample3.cs
index 42af8c986e6..9e7f1d3ea64 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionsample3/CS/bindingcollectionsample3.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/BindingCollectionsample3/CS/bindingcollectionsample3.cs
@@ -2,7 +2,7 @@
// System.Web.Services.Description.Contains;System.Web.Services.Description.IndexOf
/*The following example reads the contents of a file 'MathService.wsdl' into a ServiceDescription instance.
- Removes first binding in the BindingCollection of the ServiceDescription instance and writes the current
+ Removes first binding in the BindingCollection of the ServiceDescription instance and writes the current
'ServiceDescription' instance into a temporary file.
Adds the same binding back again into the instance and writes to another temporary file.
*/
@@ -14,20 +14,20 @@ class MyClass
public static void Main()
{
Binding myBinding;
-//
+//
//
//
//
ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_input.wsdl");
Console.WriteLine("Total Number of bindings defined are:" + myServiceDescription.Bindings.Count);
myBinding = myServiceDescription.Bindings[0];
-
+
// Remove the first binding in the collection.
myServiceDescription.Bindings.Remove(myBinding);
Console.WriteLine("Successfully removed binding " + myBinding.Name);
Console.WriteLine("Total Number of bindings defined now are:" + myServiceDescription.Bindings.Count);
myServiceDescription.Write("MathService_temp.wsdl");
-//
+//
// Add binding to the ServiceDescription instance.
myServiceDescription.Bindings.Add(myBinding);
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CallContext/CS/client.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CallContext/CS/client.cs
index 13bf94ff170..1ee214ee47e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CallContext/CS/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CallContext/CS/client.cs
@@ -10,12 +10,12 @@
public class ClientClass {
[PermissionSet(SecurityAction.LinkDemand)]
public static void Main() {
-
+
GenericIdentity ident = new GenericIdentity("Bob");
- GenericPrincipal prpal = new GenericPrincipal(ident,
+ GenericPrincipal prpal = new GenericPrincipal(ident,
new string[] {"Level1"});
- LogicalCallContextData data = new LogicalCallContextData(prpal);
-
+ LogicalCallContextData data = new LogicalCallContextData(prpal);
+
//Enter data into the CallContext
CallContext.SetData("test data", data);
@@ -43,7 +43,7 @@ public static void Main() {
Console.WriteLine();
//Extract the returned data from the call context
- LogicalCallContextData returnedData =
+ LogicalCallContextData returnedData =
(LogicalCallContextData)CallContext.GetData("test data");
Console.WriteLine(data.numOfAccesses);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CallContext/CS/service.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CallContext/CS/service.cs
index 23edfd67bc3..e63940e5aa0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CallContext/CS/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CallContext/CS/service.cs
@@ -17,16 +17,16 @@ public HelloServiceClass() {
}
~HelloServiceClass() {
- Console.WriteLine("Destroyed instance {0} of HelloServiceClass.", instanceNum);
+ Console.WriteLine("Destroyed instance {0} of HelloServiceClass.", instanceNum);
}
[PermissionSet(SecurityAction.LinkDemand)]
public String HelloMethod(String name) {
//Extract the call context data
- LogicalCallContextData data = (LogicalCallContextData)CallContext.GetData("test data");
+ LogicalCallContextData data = (LogicalCallContextData)CallContext.GetData("test data");
IPrincipal myPrincipal = data.Principal;
-
+
//Check the user identity
if(myPrincipal.Identity.Name == "Bob") {
Console.WriteLine("\nHello {0}, you are identified!", myPrincipal.Identity.Name);
@@ -52,19 +52,19 @@ public class LogicalCallContextData : ILogicalThreadAffinative
public string numOfAccesses {
get {
- return String.Format("The identity of {0} has been accessed {1} times.",
- _principal.Identity.Name,
+ return String.Format("The identity of {0} has been accessed {1} times.",
+ _principal.Identity.Name,
_nAccesses);
}
}
public IPrincipal Principal {
- get {
+ get {
_nAccesses ++;
return _principal;
}
}
-
+
public LogicalCallContextData(IPrincipal p) {
_nAccesses = 0;
_principal = p;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/ChannelServices_GetChannel_Server.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/ChannelServices_GetChannel_Server.cs
index 6dfe4a31991..72ea98de28c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/ChannelServices_GetChannel_Server.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/ChannelServices_GetChannel_Server.cs
@@ -1,12 +1,12 @@
/*
This program registers the remote object.
- */
+ */
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
-using System.Collections.Specialized;
-namespace RemotingSamples
+using System.Collections.Specialized;
+namespace RemotingSamples
{
public class MyChannelServices_Server
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/ChannelServices_GetChannel_Share.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/ChannelServices_GetChannel_Share.cs
index 8d381336138..d20fed25080 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/ChannelServices_GetChannel_Share.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/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/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/channelservices_getchannel_client.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/channelservices_getchannel_client.cs
index 5d6e96ae67a..9b7a08e834c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/channelservices_getchannel_client.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_GetChannel/CS/channelservices_getchannel_client.cs
@@ -1,7 +1,7 @@
// System.Runtime.Remoting.Channels.ChannelServices.GetChannel
// System.Runtime.Remoting.Channels.ChannelServices.GetChannelSinkProperties
/*
- This example demonstrates the usage of the properties 'GetChannel' and
+ This example demonstrates the usage of the properties 'GetChannel' and
'GetChannelSinkProperties' of the 'ChannelServices' class. It displays
the registered channel name, priority and channelsinkproperties
for a given proxy and executes a remote method 'HelloMethod'.
@@ -9,8 +9,8 @@ This example demonstrates the usage of the properties 'GetChannel' and
using System;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
-using System.Collections;
-using System.Collections.Specialized;
+using System.Collections;
+using System.Collections.Specialized;
using System.Security.Permissions;
namespace RemotingSamples
@@ -28,7 +28,7 @@ public static void Main()
new SoapClientFormatterSinkProvider(),
new SoapServerFormatterSinkProvider());
ChannelServices.RegisterChannel(myClientChannel);
- // Get the registered channel.
+ // Get the registered channel.
Console.WriteLine("Channel Name : "+ChannelServices.GetChannel(
myClientChannel.ChannelName).ChannelName);
Console.WriteLine("Channel Priorty : "+ChannelServices.GetChannel(
@@ -48,7 +48,7 @@ public static void Main()
myValuesCollection.CopyTo(myValuesArray,0);
for(int iIndex=0;iIndex
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/ChannelServices_RegisteredChannels_Share.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/ChannelServices_RegisteredChannels_Share.cs
index 537feddd7a6..c785b1ef3c6 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/ChannelServices_RegisteredChannels_Share.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/ChannelServices_RegisteredChannels_Share.cs
@@ -1,21 +1,21 @@
/*
- The class 'HelloServer' is derived from 'MarshalByRefObject' to
- make it remotable.
+ The class 'HelloServer' is derived from 'MarshalByRefObject' to
+ make it remotable.
*/
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
-namespace RemotingSamples
+namespace RemotingSamples
{
- public class HelloServer : MarshalByRefObject
+ public class HelloServer : MarshalByRefObject
{
- public HelloServer()
+ public HelloServer()
{
Console.WriteLine("HelloServer activated");
}
- public String HelloMethod(String myName)
+ public String HelloMethod(String myName)
{
Console.WriteLine("Hello.HelloMethod : {0}", myName);
return "Hi there " + myName;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/channelservices_registeredchannels_client.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/channelservices_registeredchannels_client.cs
index 8aaed90dac1..feb0d00272a 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/channelservices_registeredchannels_client.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/channelservices_registeredchannels_client.cs
@@ -1,11 +1,11 @@
// System.Runtime.Remoting.Channels.ChannelServices.GetUrlsForObject(MarshalByRefObject)
/*
- The following example demonstrates the method 'GetUrlsForObject'
- of the class 'ChannelServices'. The example is just a client, it
- locates and connects to the server, retrieves a proxy for the remote
- object, and calls the 'HelloMethod' on the remote object, passing the
+ The following example demonstrates the method 'GetUrlsForObject'
+ of the class 'ChannelServices'. The example is just a client, it
+ locates and connects to the server, retrieves a proxy for the remote
+ object, and calls the 'HelloMethod' on the remote object, passing the
string 'Caveman' as a parameter. The server returns the string
- 'Hi there Caveman'.
+ 'Hi there Caveman'.
*/
using System;
using System.Runtime.Remoting;
@@ -47,7 +47,7 @@ public static void Main()
Console.WriteLine("Exception caught!!!");
Console.WriteLine("The source of exception: "+e.Source);
Console.WriteLine("The Message of exception: "+e.Message);
- }
- }
+ }
+ }
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/channelservices_registeredchannels_server.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/channelservices_registeredchannels_server.cs
index 70b10bc8a15..6df29d0d323 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/channelservices_registeredchannels_server.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_RegisteredChannels/CS/channelservices_registeredchannels_server.cs
@@ -4,8 +4,8 @@
/*
The following example demonstrates the property 'RegisteredChannels'
- of the class 'ChannelServices', its method 'UnregisterChannel',
- and usage of the class 'ChannelServices'. The example demonstrates
+ of the class 'ChannelServices', its method 'UnregisterChannel',
+ and usage of the class 'ChannelServices'. The example demonstrates
the remoting version of a server. When a client calls the
'HelloMethod' on the 'HelloServer' class, the server object appends the
string passed from the client to the string "Hi There" and returns the
@@ -18,12 +18,12 @@ resulting string back to the client.
using System.Runtime.Remoting.Channels.Http;
using System.Security.Permissions;
-namespace RemotingSamples
+namespace RemotingSamples
{
public class MyChannelServices_Server
{
[PermissionSet(SecurityAction.LinkDemand)]
- public static void Main()
+ public static void Main()
{
try
{
@@ -45,16 +45,16 @@ public static void Main()
}
//
RemotingConfiguration.RegisterWellKnownServiceType(Type.GetType
- ("RemotingSamples.HelloServer,ChannelServices_RegisteredChannels_Share"),
+ ("RemotingSamples.HelloServer,ChannelServices_RegisteredChannels_Share"),
"SayHello", WellKnownObjectMode.SingleCall);
-//
+//
System.Console.WriteLine("Hit to unregister the channels...");
System.Console.ReadLine();
// Unregister the 'HttpChannel' and 'TcpChannel' channels.
ChannelServices.UnregisterChannel(myTcpChannel);
ChannelServices.UnregisterChannel(myHttpChannel);
Console.WriteLine("Unregistered the channels.");
-//
+//
System.Console.WriteLine("Hit to exit...");
System.Console.ReadLine();
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/ChannelServices_SyncDispatchMessage_Server.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/ChannelServices_SyncDispatchMessage_Server.cs
index 4bc208fa36b..3e423bc0184 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/ChannelServices_SyncDispatchMessage_Server.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/ChannelServices_SyncDispatchMessage_Server.cs
@@ -1,8 +1,8 @@
/*
The example demonstrates the remoting version of a server. When a client
- calls the 'MyPrintMethod' on the 'PrintServer' class, the server object
- prints the parameters passed from the client and returns the last
- parameter back to the client.
+ calls the 'MyPrintMethod' on the 'PrintServer' class, the server object
+ prints the parameters passed from the client and returns the last
+ parameter back to the client.
*/
using System;
using System.Runtime.Remoting;
@@ -18,6 +18,6 @@ public static void Main() {
(Type.GetType("PrintServer,ChannelServices_SyncDispatchMessage_Share"),
"SayHello", WellKnownObjectMode.SingleCall);
Console.WriteLine("Hit to exit...");
- Console.ReadLine();
+ Console.ReadLine();
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/ChannelServices_SyncDispatchMessage_Share.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/ChannelServices_SyncDispatchMessage_Share.cs
index 8c7f8320c66..06572db6df6 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/ChannelServices_SyncDispatchMessage_Share.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/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/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/channelservices_syncdispatchmessage_client.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/channelservices_syncdispatchmessage_client.cs
index 736d75595f3..bce11b6e504 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/channelservices_syncdispatchmessage_client.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ChannelServices_SyncDispatchMessage/CS/channelservices_syncdispatchmessage_client.cs
@@ -1,12 +1,12 @@
// System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(IMessage)
/*
- The following example demonstrates 'SyncDispatchMessage' method of
+ The following example demonstrates 'SyncDispatchMessage' method of
'ChannelServices' class. In the example, 'MyProxy' extends 'RealProxy'
- class and overrides its constructor and 'Invoke' messages. In the 'Main'
- method, the 'MyProxy' class is instantiated and 'MyPrintMethod' method
+ class and overrides its constructor and 'Invoke' messages. In the 'Main'
+ method, the 'MyProxy' class is instantiated and 'MyPrintMethod' method
is called on it.
-*/
+*/
using System;
using System.Collections;
@@ -22,7 +22,7 @@ is called on it.
public class MyProxy : RealProxy
{
String myURIString;
- MarshalByRefObject myMarshalByRefObject;
+ MarshalByRefObject myMarshalByRefObject;
[PermissionSet(SecurityAction.LinkDemand)]
public MyProxy(Type myType) : base(myType)
@@ -54,7 +54,7 @@ public override IMessage Invoke(IMessage myIMessage)
IDictionary myIDictionary = myIMessage.Properties;
// Set the '__Uri' property of 'IMessage' to 'URI' property of 'ObjRef'.
myIDictionary["__Uri"] = myURIString;
- IDictionaryEnumerator myIDictionaryEnumerator =
+ IDictionaryEnumerator myIDictionaryEnumerator =
(IDictionaryEnumerator) myIDictionary.GetEnumerator();
while (myIDictionaryEnumerator.MoveNext())
@@ -63,13 +63,13 @@ public override IMessage Invoke(IMessage myIMessage)
String myKeyName = myKey.ToString();
Object myValue = myIDictionaryEnumerator.Value;
- Console.WriteLine("\t{0} : {1}", myKeyName,
+ Console.WriteLine("\t{0} : {1}", myKeyName,
myIDictionaryEnumerator.Value);
if (myKeyName == "__Args")
{
Object[] myObjectArray = (Object[])myValue;
for (int aIndex = 0; aIndex < myObjectArray.Length; aIndex++)
- Console.WriteLine("\t\targ: {0} myValue: {1}", aIndex,
+ Console.WriteLine("\t\targ: {0} myValue: {1}", aIndex,
myObjectArray[aIndex]);
}
@@ -77,11 +77,11 @@ public override IMessage Invoke(IMessage myIMessage)
{
Object[] myObjectArray = (Object[])myValue;
for (int aIndex = 0; aIndex < myObjectArray.Length; aIndex++)
- Console.WriteLine("\t\targ: {0} myValue: {1}", aIndex,
+ Console.WriteLine("\t\targ: {0} myValue: {1}", aIndex,
myObjectArray[aIndex]);
}
}
-
+
IMessage myReturnMessage;
myIDictionary["__Uri"] = myURIString;
@@ -94,7 +94,7 @@ public override IMessage Invoke(IMessage myIMessage)
IMethodReturnMessage myMethodReturnMessage = (IMethodReturnMessage)
myReturnMessage;
- Console.WriteLine("IMethodReturnMessage.ReturnValue: {0}",
+ Console.WriteLine("IMethodReturnMessage.ReturnValue: {0}",
myMethodReturnMessage.ReturnValue);
Console.WriteLine("MyProxy.Invoke - Finish");
@@ -114,31 +114,31 @@ public static void Main()
ChannelServices.RegisterChannel(myTcpChannel);
MyProxy myProxyObject = new MyProxy(typeof(PrintServer));
PrintServer myPrintServer = (PrintServer)myProxyObject.GetTransparentProxy();
- if (myPrintServer == null)
+ if (myPrintServer == null)
Console.WriteLine("Could not locate server");
- else
+ else
Console.WriteLine(myPrintServer.MyPrintMethod("String1", 1.2, 6));
Console.WriteLine("Calling the Proxy");
int kValue = myPrintServer.MyPrintMethod("String1", 1.2, 6);
- Console.WriteLine("Checking result");
-
+ Console.WriteLine("Checking result");
+
if (kValue == 6)
{
- Console.WriteLine("PrintServer.MyPrintMethod PASSED : returned {0}",
- kValue);
+ Console.WriteLine("PrintServer.MyPrintMethod PASSED : returned {0}",
+ kValue);
}
else
{
- Console.WriteLine("PrintServer.MyPrintMethod FAILED : returned {0}",
- kValue);
+ Console.WriteLine("PrintServer.MyPrintMethod FAILED : returned {0}",
+ kValue);
}
- Console.WriteLine("Sample Done");
- }
+ Console.WriteLine("Sample Done");
+ }
catch(Exception e)
{
Console.WriteLine("Exception caught!!!");
Console.WriteLine("The source of exception: "+e.Source);
Console.WriteLine("The Message of exception: "+e.Message);
- }
- }
+ }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic DnsPermissionAttributeExample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic DnsPermissionAttributeExample/CS/source.cs
index f24120bc49a..2d81c40d8b1 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic DnsPermissionAttributeExample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic DnsPermissionAttributeExample/CS/source.cs
@@ -18,7 +18,7 @@ public static void Main()
try
{
//Grants Access.
- Console.WriteLine(" Access granted\n The local host IP Address is :" +
+ Console.WriteLine(" Access granted\n The local host IP Address is :" +
MyClass.GetIPAddress().ToString());
}
// Denies Access.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpGetClientProtocol Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpGetClientProtocol Example/CS/source.cs
index 9c81ed5c718..a6aa02f69f1 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpGetClientProtocol Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpGetClientProtocol Example/CS/source.cs
@@ -6,29 +6,29 @@
using System.Web.Services;
public class MyMath : System.Web.Services.Protocols.HttpGetClientProtocol {
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public MyMath()
{
this.Url = "http://www.contoso.com/math.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.HttpMethodAttribute(typeof(System.Web.Services.Protocols.XmlReturnReader), typeof(System.Web.Services.Protocols.UrlParameterWriter))]
[return: System.Xml.Serialization.XmlRootAttribute("int", Namespace = "http://www.contoso.com/", IsNullable = false)]
public int Add(string num1, string num2)
{
- return ((int)(this.Invoke("Add", (this.Url + "/Add"),
+ return ((int)(this.Invoke("Add", (this.Url + "/Add"),
new object[] { num1, num2 })));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public System.IAsyncResult BeginAdd(string num1, string num2, System.AsyncCallback callback, object asyncState)
{
- return this.BeginInvoke("Add", (this.Url + "/Add"),
+ return this.BeginInvoke("Add", (this.Url + "/Add"),
new object[] { num1, num2 }, callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public int EndAdd(System.IAsyncResult asyncResult)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpMethodAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpMethodAttribute Example/CS/source.cs
index 580384bcb49..715c71ae7a0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpMethodAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpMethodAttribute Example/CS/source.cs
@@ -9,18 +9,18 @@ public MyUser()
{
this.Url = "http://www.contoso.com/username.asmx";
}
-
+
[System.Web.Services.Protocols.HttpMethodAttribute(typeof(System.Web.Services.Protocols.XmlReturnReader), typeof(System.Web.Services.Protocols.HtmlFormParameterWriter))]
public UserName GetUserName()
{
return ((UserName)(this.Invoke("GetUserName", (this.Url + "/GetUserName"), new object[0])));
}
-
+
public System.IAsyncResult BeginGetUserName(System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("GetUserName", (this.Url + "/GetUserName"), new object[0], callback, asyncState);
}
-
+
public UserName EndGetUserName(System.IAsyncResult asyncResult)
{
return ((UserName)(this.EndInvoke(asyncResult)));
@@ -32,5 +32,5 @@ public class UserName
{
public string Name;
public string Domain;
-}
+}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpMethodAttribute.ReturnFormatter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpMethodAttribute.ReturnFormatter Example/CS/source.cs
index 1c3c3ad0a2b..a29c94ae5b9 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpMethodAttribute.ReturnFormatter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpMethodAttribute.ReturnFormatter Example/CS/source.cs
@@ -9,18 +9,18 @@ public MyUser()
{
this.Url = "http://www.contoso.com/username.asmx";
}
-
+
[System.Web.Services.Protocols.HttpMethodAttribute(typeof(System.Web.Services.Protocols.XmlReturnReader), typeof(System.Web.Services.Protocols.UrlParameterWriter))]
public UserName GetUserName()
{
return ((UserName)(this.Invoke("GetUserName", (this.Url + "/GetUserName"), new object[0])));
}
-
+
public System.IAsyncResult BeginGetUserName(System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("GetUserName", (this.Url + "/GetUserName"), new object[0], callback, asyncState);
}
-
+
public UserName EndGetUserName(System.IAsyncResult asyncResult)
{
return ((UserName)(this.EndInvoke(asyncResult)));
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpPostClientProtocol Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpPostClientProtocol Example/CS/source.cs
index 22595691c3f..68084e6e720 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpPostClientProtocol Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpPostClientProtocol Example/CS/source.cs
@@ -12,23 +12,23 @@ public MyMath()
{
this.Url = "http://www.contoso.com/math.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.HttpMethodAttribute(typeof(System.Web.Services.Protocols.XmlReturnReader), typeof(System.Web.Services.Protocols.HtmlFormParameterWriter))]
[return: System.Xml.Serialization.XmlRootAttribute("int", Namespace = "http://www.contoso.com/", IsNullable = false)]
public int Add(string num1, string num2)
{
- return ((int)(this.Invoke("Add", (this.Url + "/Add"),
+ return ((int)(this.Invoke("Add", (this.Url + "/Add"),
new object[] { num1, num2 })));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public System.IAsyncResult BeginAdd(string num1, string num2, System.AsyncCallback callback, object asyncState)
{
- return this.BeginInvoke("Add", (this.Url + "/Add"),
+ return this.BeginInvoke("Add", (this.Url + "/Add"),
new object[] { num1, num2 }, callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public int EndAdd(System.IAsyncResult asyncResult)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpSimpleClientProtocol Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpSimpleClientProtocol Example/CS/source.cs
index 0782b65d3ba..df6a4179640 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpSimpleClientProtocol Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpSimpleClientProtocol Example/CS/source.cs
@@ -1,7 +1,7 @@
//
using System.Web.Services;
using System;
-
+
public class Math
{
[WebMethod]
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpSimpleClientProtocol.EndInvoke Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpSimpleClientProtocol.EndInvoke Example/CS/source.cs
index 5fac3d9a24a..de803649015 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpSimpleClientProtocol.EndInvoke Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpSimpleClientProtocol.EndInvoke Example/CS/source.cs
@@ -12,21 +12,21 @@ public Math()
{
this.Url = "http://www.contoso.com/math.asmx";
}
-
- [HttpMethodAttribute(typeof(System.Web.Services.Protocols.XmlReturnReader),
+
+ [HttpMethodAttribute(typeof(System.Web.Services.Protocols.XmlReturnReader),
typeof(System.Web.Services.Protocols.UrlParameterWriter))]
public int Add(int num1, int num2)
{
- return ((int)(this.Invoke("Add", ((this.Url) + ("/Add")),
+ return ((int)(this.Invoke("Add", ((this.Url) + ("/Add")),
new object[] { num1, num2 })));
}
-
+
public IAsyncResult BeginAdd(int num1, int num2, AsyncCallback callback, object asyncState)
{
- return this.BeginInvoke("Add", ((this.Url) + ("/Add")),
+ return this.BeginInvoke("Add", ((this.Url) + ("/Add")),
new object[] { num1, num2 }, callback, asyncState);
}
-
+
public int EndAdd(IAsyncResult asyncResult)
{
return ((int)(this.EndInvoke(asyncResult)));
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpStatusCode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpStatusCode Example/CS/source.cs
index 2e4a75d1276..ba94878985e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpStatusCode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpStatusCode Example/CS/source.cs
@@ -10,10 +10,10 @@ private void Page_Load(Object sender, EventArgs e)
//
HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create("http://www.contoso.com");
httpReq.AllowAutoRedirect = false;
-
+
HttpWebResponse httpRes = (HttpWebResponse)httpReq.GetResponse();
-
- if (httpRes.StatusCode==HttpStatusCode.Moved)
+
+ if (httpRes.StatusCode==HttpStatusCode.Moved)
{
// Code for moved resources goes here.
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest Example/CS/source.cs
index 50a83d2dc1b..0a43053345f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest Example/CS/source.cs
@@ -9,7 +9,7 @@ public void Method() {
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create("http://www.contoso.com/");
-
+
//
}
public void Method1() {
@@ -17,7 +17,7 @@ public void Method1() {
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create("http://www.contoso.com/");
-
+
myReq.ReadWriteTimeout = 100000;
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/CS/source.cs
index a656403bb83..84d53fc5650 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/CS/source.cs
@@ -10,7 +10,7 @@ public class TestClass: Page
public static int Main(String[] args)
{
-//
+//
// Create a secure group name.
SHA1Managed Sha1 = new SHA1Managed();
Byte[] updHash = Sha1.ComputeHash(Encoding.UTF8.GetBytes("username" + "password" + "domain"));
@@ -19,8 +19,8 @@ public static int Main(String[] args)
// Create a request for a specific URL.
WebRequest myWebRequest=WebRequest.Create("http://www.contoso.com");
- // Set the authentication credentials for the request.
- myWebRequest.Credentials = new NetworkCredential("username", "password", "domain");
+ // Set the authentication credentials for the request.
+ myWebRequest.Credentials = new NetworkCredential("username", "password", "domain");
myWebRequest.ConnectionGroupName = secureGroupName;
// Get the response.
@@ -30,7 +30,7 @@ public static int Main(String[] args)
// Close the response.
myWebResponse.Close();
-
+
//
return 0;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.RequestUri Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.RequestUri Example/CS/source.cs
index 7897b8eb4e9..34c5fc3de34 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.RequestUri Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.RequestUri Example/CS/source.cs
@@ -10,7 +10,7 @@ private void Page_Load(Object sender, EventArgs e)
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://www.contoso.com/");
//
bool hasChanged = (req.RequestUri != req.Address);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebResponse Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebResponse Example/CS/source.cs
index a3621cf02d0..9466dbe7726 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebResponse Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebResponse Example/CS/source.cs
@@ -8,9 +8,9 @@ public class Page1: Page
private void Page_Load(Object sender, EventArgs e)
{
//
- HttpWebRequest HttpWReq =
+ HttpWebRequest HttpWReq =
(HttpWebRequest)WebRequest.Create("http://www.contoso.com");
-
+
HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();
// Insert code that uses the response object.
HttpWResp.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic ICertificatePolicy Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic ICertificatePolicy Example/CS/source.cs
index 3717d6c4cf8..9e5e4bc867a 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic ICertificatePolicy Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic ICertificatePolicy Example/CS/source.cs
@@ -22,25 +22,25 @@ public enum CertificateProblem : long
CertWRONG_USAGE = 0x800B0110,
CertUNTRUSTEDCA = 0x800B0112
}
-
+
public class MyCertificateValidation : ICertificatePolicy
{
// Default policy for certificate validation.
- public static bool DefaultValidate = false;
-
+ public static bool DefaultValidate = false;
+
public bool CheckValidationResult(ServicePoint sp, X509Certificate cert,
WebRequest request, int problem)
- {
+ {
bool ValidationResult=false;
Console.WriteLine("Certificate Problem with accessing " +
request.RequestUri);
Console.Write("Problem code 0x{0:X8},",(int)problem);
Console.WriteLine(GetProblemMessage((CertificateProblem)problem));
-
+
ValidationResult = DefaultValidate;
- return ValidationResult;
+ return ValidationResult;
}
-
+
private String GetProblemMessage(CertificateProblem Problem)
{
String ProblemMessage = "";
@@ -54,5 +54,5 @@ private String GetProblemMessage(CertificateProblem Problem)
return ProblemMessage;
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic LingerOption Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic LingerOption Example/CS/source.cs
index 2ecc22d1600..ee69ef68f09 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic LingerOption Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic LingerOption Example/CS/source.cs
@@ -9,9 +9,9 @@ protected void Method(Socket mySocket)
{
//
LingerOption myOpts = new LingerOption(true,1);
-
+
mySocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, myOpts);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic NetworkCredential Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic NetworkCredential Example/CS/source.cs
index 1d5e9cc9459..da6a00cc3ee 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic NetworkCredential Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic NetworkCredential Example/CS/source.cs
@@ -13,12 +13,12 @@ public void Method()
//
NetworkCredential myCred = new NetworkCredential(
SecurelyStoredUserName,SecurelyStoredPassword,SecurelyStoredDomain);
-
+
CredentialCache myCache = new CredentialCache();
-
+
myCache.Add(new Uri("www.contoso.com"), "Basic", myCred);
myCache.Add(new Uri("app.contoso.com"), "Basic", myCred);
-
+
WebRequest wr = WebRequest.Create("www.contoso.com");
wr.Credentials = myCache;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SerializationInfo.GetValue Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SerializationInfo.GetValue Example/CS/source.cs
index 2ca3e4d807d..f97bb6b5abf 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SerializationInfo.GetValue Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SerializationInfo.GetValue Example/CS/source.cs
@@ -12,7 +12,7 @@ public static void Main() {}
Node m_head = null;
Node m_tail = null;
-
+
// Serializes the object.
[SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter=true)]
public void GetObjectData(SerializationInfo info, StreamingContext context){
@@ -20,12 +20,12 @@ public void GetObjectData(SerializationInfo info, StreamingContext context){
info.AddValue("head", m_head, m_head.GetType());
info.AddValue("tail", m_tail, m_tail.GetType());
}
-
+
// Constructor that is called automatically during deserialization.
// Reconstructs the object from the information in SerializationInfo info
[SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter=true)]
private LinkedList(SerializationInfo info, StreamingContext context)
- {
+ {
Node temp = new Node(0);
// Retrieves the values of Type temp.GetType() from SerializationInfo info
m_head = (Node)info.GetValue("head", temp.GetType());
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic ServicePoint Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic ServicePoint Example/CS/source.cs
index a3a3b376f24..e1778c2161f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic ServicePoint Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic ServicePoint Example/CS/source.cs
@@ -9,7 +9,7 @@ public void Method()
{
//
Uri myUri = new Uri("http://www.contoso.com/");
-
+
ServicePoint mySP = ServicePointManager.FindServicePoint(myUri);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic ServicePointManager.CertificatePolicy Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic ServicePointManager.CertificatePolicy Example/CS/source.cs
index 95b2562371e..25e05f6288c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic ServicePointManager.CertificatePolicy Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic ServicePointManager.CertificatePolicy Example/CS/source.cs
@@ -11,7 +11,7 @@ public void Method(Uri myUri)
{
//
ServicePointManager.CertificatePolicy = new MyCertificatePolicy();
-
+
// Create the request and receive the response
try
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension Example/CS/source.cs
index f4d5d922d13..51b7ed646a7 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension Example/CS/source.cs
@@ -9,7 +9,7 @@
// response for the XML Web service method the SOAP extension is
// applied to.
- public class TraceExtension : SoapExtension
+ public class TraceExtension : SoapExtension
{
Stream oldStream;
Stream newStream;
@@ -27,7 +27,7 @@ public override Stream ChainStream( Stream stream )
// When the SOAP extension is accessed for the first time, the XML Web
// service method it is applied to is accessed to store the file
// name passed in, using the corresponding SoapExtensionAttribute.
- public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute)
+ public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute)
{
return ((TraceExtensionAttribute) attribute).Filename;
}
@@ -35,16 +35,16 @@ public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensio
// The SOAP extension was configured to run using a configuration file
// instead of an attribute applied to a specific XML Web service
// method.
- public override object GetInitializer(Type WebServiceType)
+ public override object GetInitializer(Type WebServiceType)
{
// Return a file name to log the trace information to, based on the
// type.
- return "C:\\" + WebServiceType.FullName + ".log";
+ return "C:\\" + WebServiceType.FullName + ".log";
}
// Receive the file name stored by GetInitializer and store it in a
// member variable for this specific instance.
- public override void Initialize(object initializer)
+ public override void Initialize(object initializer)
{
filename = (string) initializer;
}
@@ -52,9 +52,9 @@ public override void Initialize(object initializer)
// If the SoapMessageStage is such that the SoapRequest or
// SoapResponse is still in the SOAP format to be sent or received,
// save it out to a file.
- public override void ProcessMessage(SoapMessage message)
+ public override void ProcessMessage(SoapMessage message)
{
- switch (message.Stage)
+ switch (message.Stage)
{
case SoapMessageStage.BeforeSerialize:
break;
@@ -94,7 +94,7 @@ public void WriteInput(SoapMessage message)
string soapString = (message is SoapServerMessage) ?
"SoapRequest" : "SoapResponse";
- w.WriteLine("-----" + soapString +
+ w.WriteLine("-----" + soapString +
" at " + DateTime.Now);
w.Flush();
newStream.Position = 0;
@@ -103,7 +103,7 @@ public void WriteInput(SoapMessage message)
newStream.Position = 0;
}
- void Copy(Stream from, Stream to)
+ void Copy(Stream from, Stream to)
{
TextReader reader = new StreamReader(from);
TextWriter writer = new StreamWriter(to);
@@ -115,30 +115,30 @@ void Copy(Stream from, Stream to)
// Create a SoapExtensionAttribute for the SOAP Extension that can be
// applied to an XML Web service method.
[AttributeUsage(AttributeTargets.Method)]
- public class TraceExtensionAttribute : SoapExtensionAttribute
+ public class TraceExtensionAttribute : SoapExtensionAttribute
{
private string filename = "c:\\log.txt";
private int priority;
- public override Type ExtensionType
+ public override Type ExtensionType
{
get { return typeof(TraceExtension); }
}
- public override int Priority
+ public override int Priority
{
get { return priority; }
set { priority = value; }
}
- public string Filename
+ public string Filename
{
- get
+ get
{
return filename;
}
- set
+ set
{
filename = value;
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.ChainStream Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.ChainStream Example/CS/source.cs
index 9b0fac94d6b..d881afa2272 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.ChainStream Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.ChainStream Example/CS/source.cs
@@ -13,26 +13,26 @@ public class TraceExtension : SoapExtension {
string filename;
// When the SOAP extension is accessed for the first time the XML Web service method it is applied
- // is accessed store the filename passed in using the corresponding SoapExtensionAttribute.
+ // is accessed store the filename passed in using the corresponding SoapExtensionAttribute.
public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute) {
return ((TraceExtensionAttribute) attribute).Filename;
}
- // The extension was configured to run using a configuration file instead of an attribute applied to a
+ // The extension was configured to run using a configuration file instead of an attribute applied to a
// specific XML Web service method. Return a file name based on the class implementing the XML Web service's type.
- public override object GetInitializer(Type WebServiceType)
+ public override object GetInitializer(Type WebServiceType)
{
// Return a file name to log the trace information to based on the passed in type.
- return "C:\\" + WebServiceType.FullName + ".log";
+ return "C:\\" + WebServiceType.FullName + ".log";
}
-
+
// Receive the filename stored by GetInitializer and store it in a member variable
// for this specific instance.
public override void Initialize(object initializer) {
filename = (string) initializer;
}
- // If the SoapMessageStage is such that the SoapRequest or SoapResponse is still in the SOAP
+ // If the SoapMessageStage is such that the SoapRequest or SoapResponse is still in the SOAP
// format to be sent or received over the wire, save it out to filename passed in using the SoapExtensionAttribute
public override void ProcessMessage(SoapMessage message) {
switch (message.Stage) {
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.GetInitializer Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.GetInitializer Example/CS/source.cs
index 7818881366d..65efd0e1e7e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.GetInitializer Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.GetInitializer Example/CS/source.cs
@@ -13,31 +13,31 @@ public class TraceExtension : SoapExtension {
string filename;
//
- // When the SOAP extension is accessed for the first time, cache the
- // file name passed in by the SoapExtensionAttribute.
+ // When the SOAP extension is accessed for the first time, cache the
+ // file name passed in by the SoapExtensionAttribute.
public override object GetInitializer(LogicalMethodInfo methodInfo,
- SoapExtensionAttribute attribute)
+ SoapExtensionAttribute attribute)
{
return ((TraceExtensionAttribute) attribute).Filename;
}
//
- // The extension was configured to run using a configuration file instead of an attribute applied to a
+ // The extension was configured to run using a configuration file instead of an attribute applied to a
// specific XML Web service method. Return a file name based on the class implementing the XML Web service's type.
- public override object GetInitializer(Type WebServiceType)
+ public override object GetInitializer(Type WebServiceType)
{
// Return a file name to log the trace information to based on the passed in type.
- return "C:\\" + WebServiceType.FullName + ".log";
+ return "C:\\" + WebServiceType.FullName + ".log";
}
// Receive the filename stored by GetInitializer and store it in a member variable
// for this specific instance.
- public override void Initialize(object initializer)
+ public override void Initialize(object initializer)
{
filename = (string) initializer;
}
- // If the SoapMessageStage is such that the SoapRequest or SoapResponse is still in the SOAP
+ // If the SoapMessageStage is such that the SoapRequest or SoapResponse is still in the SOAP
// format to be sent or received over the wire, save it out to filename passed in using the SoapExtensionAttribute
public override void ProcessMessage(SoapMessage message) {
switch (message.Stage) {
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.Initialize Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.Initialize Example/CS/source.cs
index caf896446f3..83e3ee8f772 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.Initialize Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.Initialize Example/CS/source.cs
@@ -13,7 +13,7 @@ public class TraceExtension : SoapExtension {
string filename;
// When the SOAP extension is accessed for the first time the XML Web service method it is applied
- // is accessed store the filename passed in using the corresponding SoapExtensionAttribute.
+ // is accessed store the filename passed in using the corresponding SoapExtensionAttribute.
public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute) {
return ((TraceExtensionAttribute) attribute).Filename;
}
@@ -30,7 +30,7 @@ public override void Initialize(object initializer) {
}
//
- // If the SoapMessageStage is such that the SoapRequest or SoapResponse is still in the SOAP
+ // If the SoapMessageStage is such that the SoapRequest or SoapResponse is still in the SOAP
// format to be sent or received over the wire, save it out to filename passed in using the SoapExtensionAttribute
public override void ProcessMessage(SoapMessage message) {
switch (message.Stage) {
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.ProcessMessage Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.ProcessMessage Example/CS/source.cs
index 8d74aafd1c8..d47f000c906 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.ProcessMessage Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtension.ProcessMessage Example/CS/source.cs
@@ -4,7 +4,7 @@
using System.Web.Services.Protocols;
public class Sample : SoapExtension {
-
+
//
public override void ProcessMessage(SoapMessage message) {
switch (message.Stage) {
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtensionAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtensionAttribute Example/CS/source.cs
index 99f6852afee..6f269f95d3e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtensionAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapExtensionAttribute Example/CS/source.cs
@@ -31,19 +31,19 @@ public override Type ExtensionType
}
// User can set priority of the 'SoapExtension'.
- public override int Priority
+ public override int Priority
{
- get
+ get
{
return myPriority;
}
- set
- {
+ set
+ {
myPriority = value;
}
}
- public string Filename
+ public string Filename
{
get
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeader.Actor Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeader.Actor Example/CS/source.cs
index 1f59034aa31..0eb433eb095 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeader.Actor Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeader.Actor Example/CS/source.cs
@@ -3,7 +3,7 @@
using System;
public class Sample {
-
+
public static void Main() {
MyWebService ws = new MyWebService();
@@ -12,7 +12,7 @@ public static void Main() {
customHeader.MyValue = "Header Value for MyValue";
customHeader.Actor = "http://www.contoso.com/MySoapHeaderHandler";
ws.myHeader = customHeader;
-
+
int results = ws.MyWebMethod(3,5);
}
catch (Exception e) {
@@ -23,7 +23,7 @@ public static void Main() {
//
-// Following was added to make the sample compile.
+// Following was added to make the sample compile.
public class MyHeader : SoapHeader {
public string MyValue;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeader.MustUnderstand Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeader.MustUnderstand Example/CS/source.cs
index f5c6fa7424a..57dde293f9e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeader.MustUnderstand Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeader.MustUnderstand Example/CS/source.cs
@@ -3,7 +3,7 @@
using System;
public class Sample {
-
+
public static void Main() {
MyWebService ws = new MyWebService();
@@ -12,7 +12,7 @@ public static void Main() {
customHeader.MyValue = "Header Value for MyValue";
customHeader.MustUnderstand = true;
ws.myHeader = customHeader;
-
+
int results = ws.MyWebMethod(3,5);
}
catch (Exception e) {
@@ -23,7 +23,7 @@ public static void Main() {
//
-// Following was added to make the sample compile.
+// Following was added to make the sample compile.
public class MyHeader : SoapHeader {
public string MyValue;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeaderAttribute.MemberName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeaderAttribute.MemberName Example/CS/source.cs
index 65e3fa0a406..630eb7abb2d 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeaderAttribute.MemberName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeaderAttribute.MemberName Example/CS/source.cs
@@ -12,7 +12,7 @@ public class MyHeader : SoapHeader {
public class MyWebService {
// Member variable to receive the contents of the MyHeader SOAP header.
public MyHeader myHeader;
-
+
[WebMethod]
[SoapHeader("myHeader", Direction=SoapHeaderDirection.InOut)]
public void Hello() {
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeaderDirection Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeaderDirection Example/CS/source.cs
index b3110ca2bde..6cdfa549853 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeaderDirection Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHeaderDirection Example/CS/source.cs
@@ -13,12 +13,12 @@ public class MyWebService {
public MyHeader myHeader;
[WebMethod]
- [SoapHeader("myHeader",
+ [SoapHeader("myHeader",
Direction=SoapHeaderDirection.InOut | SoapHeaderDirection.Fault)]
public void MySoapHeaderReceivingMethod() {
// Set myHeader.MyValue to some value.
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol Example/CS/source.cs
index fc966b9f66c..12ad16f46a2 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol Example/CS/source.cs
@@ -9,12 +9,12 @@ namespace MyMath {
[System.Web.Services.WebServiceBindingAttribute(Name="MyMathSoap", Namespace="http://www.contoso.com/")]
public class MyMath : System.Web.Services.Protocols.SoapHttpClientProtocol {
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public MyMath() {
this.Url = "http://www.contoso.com/math.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.contoso.com/Add", RequestNamespace="http://www.contoso.com/", ResponseNamespace="http://www.contoso.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int Add(int num1, int num2) {
@@ -22,13 +22,13 @@ public int Add(int num1, int num2) {
num2});
return ((int)(results[0]));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public System.IAsyncResult BeginAdd(int num1, int num2, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Add", new object[] {num1,
num2}, callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public int EndAdd(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.BeginInvoke Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.BeginInvoke Example/CS/source.cs
index fc966b9f66c..12ad16f46a2 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.BeginInvoke Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.BeginInvoke Example/CS/source.cs
@@ -9,12 +9,12 @@ namespace MyMath {
[System.Web.Services.WebServiceBindingAttribute(Name="MyMathSoap", Namespace="http://www.contoso.com/")]
public class MyMath : System.Web.Services.Protocols.SoapHttpClientProtocol {
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public MyMath() {
this.Url = "http://www.contoso.com/math.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.contoso.com/Add", RequestNamespace="http://www.contoso.com/", ResponseNamespace="http://www.contoso.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int Add(int num1, int num2) {
@@ -22,13 +22,13 @@ public int Add(int num1, int num2) {
num2});
return ((int)(results[0]));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public System.IAsyncResult BeginAdd(int num1, int num2, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Add", new object[] {num1,
num2}, callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public int EndAdd(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.EndInvoke Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.EndInvoke Example/CS/source.cs
index fc966b9f66c..12ad16f46a2 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.EndInvoke Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.EndInvoke Example/CS/source.cs
@@ -9,12 +9,12 @@ namespace MyMath {
[System.Web.Services.WebServiceBindingAttribute(Name="MyMathSoap", Namespace="http://www.contoso.com/")]
public class MyMath : System.Web.Services.Protocols.SoapHttpClientProtocol {
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public MyMath() {
this.Url = "http://www.contoso.com/math.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.contoso.com/Add", RequestNamespace="http://www.contoso.com/", ResponseNamespace="http://www.contoso.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int Add(int num1, int num2) {
@@ -22,13 +22,13 @@ public int Add(int num1, int num2) {
num2});
return ((int)(results[0]));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public System.IAsyncResult BeginAdd(int num1, int num2, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Add", new object[] {num1,
num2}, callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public int EndAdd(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.Invoke Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.Invoke Example/CS/source.cs
index fc966b9f66c..12ad16f46a2 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.Invoke Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SoapHttpClientProtocol.Invoke Example/CS/source.cs
@@ -9,12 +9,12 @@ namespace MyMath {
[System.Web.Services.WebServiceBindingAttribute(Name="MyMathSoap", Namespace="http://www.contoso.com/")]
public class MyMath : System.Web.Services.Protocols.SoapHttpClientProtocol {
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public MyMath() {
this.Url = "http://www.contoso.com/math.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.contoso.com/Add", RequestNamespace="http://www.contoso.com/", ResponseNamespace="http://www.contoso.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int Add(int num1, int num2) {
@@ -22,13 +22,13 @@ public int Add(int num1, int num2) {
num2});
return ((int)(results[0]));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public System.IAsyncResult BeginAdd(int num1, int num2, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Add", new object[] {num1,
num2}, callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public int EndAdd(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Bind Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Bind Example/CS/source.cs
index 902a2b823e6..0fa79ce20e9 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Bind Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Bind Example/CS/source.cs
@@ -14,7 +14,7 @@ protected void Method(Socket aSocket, EndPoint anEndPoint)
catch (Exception e) {
Console.WriteLine("Winsock error: " + e.ToString());
}
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Close Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Close Example/CS/source.cs
index 5b8e70fe12a..c16a70976bc 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Close Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Close Example/CS/source.cs
@@ -19,9 +19,9 @@ public static void SocketClose()
}
//
}
-
+
public static void Main()
{
SocketClose();
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Connect Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Connect Example/CS/source.cs
index 4e56ae95a12..d4049614349 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Connect Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Connect Example/CS/source.cs
@@ -21,7 +21,7 @@ static void ConnectAndCheck(Socket client, EndPoint anEndPoint)
client.Send(tmp, 0, 0);
Console.WriteLine("Connected!");
}
- catch (SocketException e)
+ catch (SocketException e)
{
// 10035 == WSAEWOULDBLOCK
if (e.NativeErrorCode.Equals(10035))
@@ -45,7 +45,7 @@ static void ConnectAndCheck(Socket client, EndPoint anEndPoint)
[STAThread]
static void Main()
{
- Socket s = new Socket(AddressFamily.InterNetwork,
+ Socket s = new Socket(AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.Tcp);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Listen Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Listen Example/CS/source.cs
index 274037150aa..f63c7c5b332 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Listen Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Socket.Listen Example/CS/source.cs
@@ -9,14 +9,14 @@ static void CreateAndListen(int port, int backlog)
{
//
// create the socket
- Socket listenSocket = new Socket(AddressFamily.InterNetwork,
+ Socket listenSocket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.Tcp);
// bind the listening socket to the port
IPAddress hostIP = (Dns.Resolve(IPAddress.Any.ToString())).AddressList[0];
IPEndPoint ep = new IPEndPoint(hostIP, port);
- listenSocket.Bind(ep);
+ listenSocket.Bind(ep);
// start listening
listenSocket.Listen(backlog);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SocketAddressExample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SocketAddressExample/CS/source.cs
index 3227032b5e2..31f7585efdb 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic SocketAddressExample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic SocketAddressExample/CS/source.cs
@@ -1,6 +1,6 @@
using System;
using System.Text;
-using System.Net;
+using System.Net;
using System.Net.Sockets;
public class MySerializeExample{
@@ -13,7 +13,7 @@ public static void MySerializeIPEndPointClassMethod(){
IPAddress ipAddress = Dns.Resolve("www.contoso.com").AddressList[0];
IPEndPoint ipLocalEndPoint = new IPEndPoint(ipAddress, 11000);
-//Serializes the IPEndPoint.
+//Serializes the IPEndPoint.
SocketAddress socketAddress = ipLocalEndPoint.Serialize();
//Verifies that ipLocalEndPoint is now serialized by printing its contents.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic TcpListener.PublicMethodsAndPropertiesExample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic TcpListener.PublicMethodsAndPropertiesExample/CS/source.cs
index 4ec81ec37a1..c7dc4363be3 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic TcpListener.PublicMethodsAndPropertiesExample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic TcpListener.PublicMethodsAndPropertiesExample/CS/source.cs
@@ -19,7 +19,7 @@ public static int Main(string [] args){
//Creates an instance of the TcpListener class by providing a local endpoint.
IPAddress ipAddress = Dns.Resolve(Dns.GetHostName()).AddressList[0];
- IPEndPoint ipLocalEndPoint = new IPEndPoint(ipAddress, 11000);
+ IPEndPoint ipLocalEndPoint = new IPEndPoint(ipAddress, 11000);
try{
TcpListener tcpListener = new TcpListener(ipLocalEndPoint);
@@ -37,21 +37,21 @@ public static int Main(string [] args){
IPAddress ipAddress = Dns.Resolve("localhost").AddressList[0];
try{
- TcpListener tcpListener = new TcpListener(ipAddress, 13);
+ TcpListener tcpListener = new TcpListener(ipAddress, 13);
}
catch ( Exception e){
Console.WriteLine( e.ToString());
}
-
+
//
}
else if (args[0] == "portNumberExample"){
//
- //Creates an instance of the TcpListener class by providing a local port number.
+ //Creates an instance of the TcpListener class by providing a local port number.
IPAddress ipAddress = Dns.Resolve("localhost").AddressList[0];
try{
- TcpListener tcpListener = new TcpListener(ipAddress, 13);
+ TcpListener tcpListener = new TcpListener(ipAddress, 13);
}
catch ( Exception e ){
Console.WriteLine( e.ToString());
@@ -59,18 +59,18 @@ public static int Main(string [] args){
//
}
- else {
+ else {
IPAddress ipAddress = Dns.Resolve("localhost").AddressList[0];
- TcpListener tcpListener = new TcpListener(ipAddress, 13);
+ TcpListener tcpListener = new TcpListener(ipAddress, 13);
tcpListener.Start();
Console.WriteLine("Waiting for a connection....");
-
+
try{
//
-
+
// Accepts the pending client connection and returns a socket for communciation.
Socket socket = tcpListener.AcceptSocket();
Console.WriteLine("Connection accepted.");
@@ -81,7 +81,7 @@ public static int Main(string [] args){
Byte[] sendBytes = Encoding.ASCII.GetBytes(responseString);
int i = socket.Send(sendBytes);
Console.WriteLine("Message Sent /> : " + responseString);
- //
+ //
//Any communication with the remote client using the socket can go here.
//Closes the tcpListener and the socket.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic TcpListenerExample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic TcpListenerExample/CS/source.cs
index fd97dde372b..3a3a5a614e8 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic TcpListenerExample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic TcpListenerExample/CS/source.cs
@@ -2,13 +2,13 @@
/**
* The following sample is intended to demonstrate how to use a
* TcpListener for synchronous communcation with a TCP client
-* It creates a TcpListener that listens on the specified port (13000).
-* Any TCP client that wants to use this TcpListener has to explicitly connect
+* It creates a TcpListener that listens on the specified port (13000).
+* Any TCP client that wants to use this TcpListener has to explicitly connect
* to an address obtained by the combination of the server
* on which this TcpListener is running and the port 13000.
* This TcpListener simply echoes back the message sent by the client
-* after translating it into uppercase.
-* Refer to the related client in the TcpClient class.
+* after translating it into uppercase.
+* Refer to the related client in the TcpClient class.
*/
using System;
using System.Text;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClient.ProtectedMethodsAndPropertiesExample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClient.ProtectedMethodsAndPropertiesExample/CS/source.cs
index b093039b106..c0af639a308 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClient.ProtectedMethodsAndPropertiesExample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClient.ProtectedMethodsAndPropertiesExample/CS/source.cs
@@ -1,6 +1,6 @@
using System;
using System.Text;
-using System.Net;
+using System.Net;
using System.Net.Sockets;
public class MyUdpClientTestClass{
@@ -17,7 +17,7 @@ public static void Main(string[] args)
Socket uSocket = uClient.Client;
// use the underlying socket to enable broadcast.
- uSocket.SetSocketOption(SocketOptionLevel.Socket,
+ uSocket.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.Broadcast, 1);
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClient.PublicMethodsAndPropertiesExample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClient.PublicMethodsAndPropertiesExample/CS/source.cs
index 5261418b6eb..4fa796b2ba4 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClient.PublicMethodsAndPropertiesExample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClient.PublicMethodsAndPropertiesExample/CS/source.cs
@@ -1,6 +1,6 @@
using System;
using System.Text;
-using System.Net;
+using System.Net;
using System.Net.Sockets;
public class MyUdpClientExample{
@@ -14,11 +14,11 @@ public static void MyUdpClientConstructor(string myConstructorType){
// the default interface using a particular port.
try{
UdpClient udpClient = new UdpClient(11000);
- }
+ }
catch (Exception e ) {
Console.WriteLine(e.ToString());
}
- //
+ //
}
else if (myConstructorType == "LocalEndPointExample"){
//
@@ -26,7 +26,7 @@ public static void MyUdpClientConstructor(string myConstructorType){
//Creates an instance of the UdpClient class using a local endpoint.
IPAddress ipAddress = Dns.Resolve(Dns.GetHostName()).AddressList[0];
IPEndPoint ipLocalEndPoint = new IPEndPoint(ipAddress, 11000);
-
+
try{
UdpClient udpClient = new UdpClient(ipLocalEndPoint);
}
@@ -51,7 +51,7 @@ public static void MyUdpClientConstructor(string myConstructorType){
//
//Creates an instance of the UdpClient class using the default constructor.
UdpClient udpClient = new UdpClient();
- //
+ //
}
else{
// Do nothing.
@@ -115,7 +115,7 @@ public static void MyUdpClientCommunicator(string mySendType){
UdpClient udpClient = new UdpClient();
IPAddress ipAddress = Dns.Resolve("www.contoso.com").AddressList[0];
IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, 11004);
-
+
Byte[] sendBytes = Encoding.ASCII.GetBytes("Is anybody there?");
try{
udpClient.Send(sendBytes, sendBytes.Length, ipEndPoint);
@@ -138,7 +138,7 @@ public static void MyUdpClientCommunicator(string mySendType){
Console.WriteLine(e.ToString());
}
//
- }
+ }
else if (mySendType == "StraightSendExample"){
//
UdpClient udpClient = new UdpClient("www.contoso.com", 11000);
@@ -155,21 +155,21 @@ public static void MyUdpClientCommunicator(string mySendType){
else{
// Do nothing.
}
-
+
//
//Creates a UdpClient for reading incoming data.
UdpClient receivingUdpClient = new UdpClient(11000);
- //Creates an IPEndPoint to record the IP Address and port number of the sender.
+ //Creates an IPEndPoint to record the IP Address and port number of the sender.
// The IPEndPoint will allow you to read datagrams sent from any source.
IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
try{
// Blocks until a message returns on this socket from a remote host.
- Byte[] receiveBytes = receivingUdpClient.Receive(ref RemoteIpEndPoint);
+ Byte[] receiveBytes = receivingUdpClient.Receive(ref RemoteIpEndPoint);
string returnData = Encoding.ASCII.GetString(receiveBytes);
-
+
Console.WriteLine("This is the message you received " +
returnData.ToString());
Console.WriteLine("This message was sent from " +
@@ -178,20 +178,20 @@ public static void MyUdpClientCommunicator(string mySendType){
RemoteIpEndPoint.Port.ToString());
}
catch ( Exception e ){
- Console.WriteLine(e.ToString());
+ Console.WriteLine(e.ToString());
}
-
+
//
}
// This example class demonstrates methods used to join and drop multicast groups.
-
+
public static void MyUdpClientMulticastConfiguration(string myAction){
if (myAction == "JoinMultiCastExample"){
//
UdpClient udpClient = new UdpClient();
- IPAddress multicastIpAddress = Dns.Resolve("MulticastGroupName").AddressList[0];
+ IPAddress multicastIpAddress = Dns.Resolve("MulticastGroupName").AddressList[0];
try{
udpClient.JoinMulticastGroup(multicastIpAddress);
}
@@ -206,7 +206,7 @@ public static void MyUdpClientMulticastConfiguration(string myAction){
UdpClient udpClient = new UdpClient();
// Creates an IPAddress to use to join and drop the multicast group.
IPAddress multicastIpAddress = IPAddress.Parse("239.255.255.255");
-
+
try{
// The packet dies after 50 router hops.
udpClient.JoinMulticastGroup(multicastIpAddress, 50);
@@ -241,5 +241,5 @@ public static void Main(){
MyUdpClientConnection("HostNameAndPortNumExample");
MyUdpClientCommunicator("EndPointExample");
MyUdpClientMulticastConfiguration("JoinMultiCastExample");
- }
+ }
} //end class
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClientExample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClientExample/CS/source.cs
index e3cc0de7c5d..fcafe1d012a 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClientExample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic UdpClientExample/CS/source.cs
@@ -1,6 +1,6 @@
using System;
using System.Text;
-using System.Net;
+using System.Net;
using System.Net.Sockets;
public class MyUdpClientExample{
@@ -15,7 +15,7 @@ public static void Main(){
// Sends a message to the host to which you have connected.
Byte[] sendBytes = Encoding.ASCII.GetBytes("Is anybody there?");
-
+
udpClient.Send(sendBytes, sendBytes.Length);
// Sends a message to a different host using optional hostname and port parameters.
@@ -26,9 +26,9 @@ public static void Main(){
IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
// Blocks until a message returns on this socket from a remote host.
- Byte[] receiveBytes = udpClient.Receive(ref RemoteIpEndPoint);
+ Byte[] receiveBytes = udpClient.Receive(ref RemoteIpEndPoint);
string returnData = Encoding.ASCII.GetString(receiveBytes);
-
+
// Uses the IPEndPoint object to determine which of these two hosts responded.
Console.WriteLine("This is the message you received " +
returnData.ToString());
@@ -39,7 +39,7 @@ public static void Main(){
udpClient.Close();
udpClientB.Close();
- }
+ }
catch (Exception e ) {
Console.WriteLine(e.ToString());
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri Example/CS/source.cs
index 43490fcda8e..836927f967e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri Example/CS/source.cs
@@ -9,7 +9,7 @@ protected void Method()
{
//
Uri siteUri = new Uri("http://www.contoso.com/");
-
+
WebRequest wr = WebRequest.Create(siteUri);
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsolutePath Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsolutePath Example/CS/source.cs
index c074e860e56..6a2fb05d09b 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsolutePath Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsolutePath Example/CS/source.cs
@@ -10,9 +10,9 @@ protected void Method()
//
Uri baseUri = new Uri("http://www.contoso.com/");
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
-
+
Console.WriteLine(myUri.AbsolutePath);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsoluteUri Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsoluteUri Example/CS/source.cs
index 996272d2d36..87a50d7e929 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsoluteUri Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsoluteUri Example/CS/source.cs
@@ -11,7 +11,7 @@ protected void Method()
Uri baseUri= new Uri("http://www.contoso.com");
Uri myUri = new Uri(baseUri,"catalog/shownew.htm?date=today");
Console.WriteLine(myUri.AbsoluteUri);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Authority Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Authority Example/CS/source.cs
index 730b03c02e1..f1d5925e21b 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Authority Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Authority Example/CS/source.cs
@@ -10,9 +10,9 @@ protected void Method()
//
Uri baseUri = new Uri("http://www.contoso.com:8080/");
Uri myUri = new Uri(baseUri,"shownew.htm?date=today");
-
+
Console.WriteLine(myUri.Authority);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/CS/source.cs
index 7ae0d74bb49..bddbb6e463f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/CS/source.cs
@@ -9,7 +9,7 @@ protected void Method()
{
//
Console.WriteLine(Uri.CheckHostName("www.contoso.com"));
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Host Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Host Example/CS/source.cs
index 7a996c96748..ab566fc65be 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Host Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Host Example/CS/source.cs
@@ -10,9 +10,9 @@ protected void Method()
//
Uri baseUri = new Uri("http://www.contoso.com:8080/");
Uri myUri = new Uri(baseUri, "shownew.htm?date=today");
-
+
Console.WriteLine(myUri.Host);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.PathAndQuery Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.PathAndQuery Example/CS/source.cs
index 67227eff86e..5400d29b0b7 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.PathAndQuery Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.PathAndQuery Example/CS/source.cs
@@ -10,7 +10,7 @@ protected void Method()
//
Uri baseUri = new Uri("http://www.contoso.com/");
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
-
+
Console.WriteLine(myUri.PathAndQuery);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Port Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Port Example/CS/source.cs
index f667b9f5924..8d3b5e3727b 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Port Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Port Example/CS/source.cs
@@ -10,9 +10,9 @@ protected void Method()
//
Uri baseUri = new Uri("http://www.contoso.com/");
Uri myUri = new Uri(baseUri,"catalog/shownew.htm?date=today");
-
+
Console.WriteLine(myUri.Port);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Scheme Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Scheme Example/CS/source.cs
index 44ed8b6aa07..b8dd9888f4b 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Scheme Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Scheme Example/CS/source.cs
@@ -10,9 +10,9 @@ protected void Method()
//
Uri baseUri = new Uri("http://www.contoso.com/");
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
-
+
Console.WriteLine(myUri.Scheme);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Uri3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Uri3 Example/CS/source.cs
index e3b890d6605..3d19db31291 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Uri3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Uri3 Example/CS/source.cs
@@ -13,7 +13,7 @@ protected void Method()
Uri myUri = new Uri(baseUri, "catalog/shownew.htm");
Console.WriteLine(myUri.ToString());
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Uri4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Uri4 Example/CS/source.cs
index ac6c4eb0616..07affc2b9f7 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Uri4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Uri4 Example/CS/source.cs
@@ -7,7 +7,7 @@ public static void Main()
//
Uri baseUri = new Uri("http://www.contoso.com");
Uri myUri = new Uri(baseUri, "Hello%20World.htm",false);
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic UriBuilder.Fragment Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic UriBuilder.Fragment Example/CS/source.cs
index 9b57b556b21..d6e4b756bca 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic UriBuilder.Fragment Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic UriBuilder.Fragment Example/CS/source.cs
@@ -13,7 +13,7 @@ protected void Method()
uBuild.Fragment = "main";
Uri myUri = uBuild.Uri;
-
+
//
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic WebRequest Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic WebRequest Example/CS/source.cs
index 200a3ca1c25..a568c69f388 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic WebRequest Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic WebRequest Example/CS/source.cs
@@ -8,7 +8,7 @@ private void sampleFunction() {
// Initialize the WebRequest.
WebRequest myRequest = WebRequest.Create("http://www.contoso.com");
-// Return the response.
+// Return the response.
WebResponse myResponse = myRequest.GetResponse();
// Code to use the WebResponse goes here.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute Example/CS/source.cs
index 9a69a543186..9a64764c5a0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml.Serialization;
using System.Xml;
-
+
public class Run
{
public static void Main()
@@ -11,52 +11,52 @@ public static void Main()
Run test = new Run();
test.SerializeDocument("books.xml");
}
-
+
public void SerializeDocument(string filename)
{
// Creates a new XmlSerializer.
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(MyRootClass));
// Writing the file requires a StreamWriter.
TextWriter myWriter= new StreamWriter(filename);
- // Creates an instance of the class to serialize.
+ // Creates an instance of the class to serialize.
MyRootClass myRootClass = new MyRootClass();
- /* Uses a basic method of creating an XML array: Create and
- populate a string array, and assign it to the
+ /* Uses a basic method of creating an XML array: Create and
+ populate a string array, and assign it to the
MyStringArray property. */
string [] myString = {"Hello", "world", "!"};
myRootClass.MyStringArray = myString;
-
+
/* Uses a more advanced method of creating an array:
- create instances of the Item and BookItem, where BookItem
+ create instances of the Item and BookItem, where BookItem
is derived from Item. */
Item item1 = new Item();
BookItem item2 = new BookItem();
-
+
// Sets the objects' properties.
item1.ItemName = "Widget1";
item1.ItemCode = "w1";
item1.ItemPrice = 231;
item1.ItemQuantity = 3;
-
+
item2.ItemCode = "w2";
item2.ItemPrice = 123;
item2.ItemQuantity = 7;
item2.ISBN = "34982333";
item2.Title = "Book of Widgets";
item2.Author = "John Smith";
-
+
// Fills the array with the items.
Item [] myItems = {item1,item2};
-
+
// Sets the class's Items property to the array.
myRootClass.Items = myItems;
-
- /* Serializes the class, writes it to disk, and closes
+
+ /* Serializes the class, writes it to disk, and closes
the TextWriter. */
s.Serialize(myWriter, myRootClass);
myWriter.Close();
@@ -67,27 +67,27 @@ the TextWriter. */
public class MyRootClass
{
private Item [] items;
-
+
/* Here is a simple way to serialize the array as XML. Using the
XmlArrayAttribute, assign an element name and namespace. The
- IsNullable property determines whether the element will be
+ IsNullable property determines whether the element will be
generated if the field is set to a null value. If set to true,
the default, setting it to a null value will cause the XML
xsi:null attribute to be generated. */
[XmlArray(ElementName = "MyStrings",
Namespace = "http://www.cpandl.com", IsNullable = true)]
public string[] MyStringArray;
-
- /* Here is a more complex example of applying an
- XmlArrayAttribute. The Items property can contain both Item
+
+ /* Here is a more complex example of applying an
+ XmlArrayAttribute. The Items property can contain both Item
and BookItem objects. Use the XmlArrayItemAttribute to specify
that both types can be inserted into the array. */
- [XmlArrayItem(ElementName= "Item",
+ [XmlArrayItem(ElementName= "Item",
IsNullable=true,
Type = typeof(Item),
Namespace = "http://www.cpandl.com"),
- XmlArrayItem(ElementName = "BookItem",
- IsNullable = true,
+ XmlArrayItem(ElementName = "BookItem",
+ IsNullable = true,
Type = typeof(BookItem),
Namespace = "http://www.cohowinery.com")]
[XmlArray]
@@ -97,7 +97,7 @@ public Item []Items
set{items = value;}
}
}
-
+
public class Item{
[XmlElement(ElementName = "OrderItem")]
public string ItemName;
@@ -105,12 +105,12 @@ public class Item{
public decimal ItemPrice;
public int ItemQuantity;
}
-
+
public class BookItem:Item
{
public string Title;
public string Author;
public string ISBN;
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.ElementName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.ElementName Example/CS/source.cs
index 92d093c37f5..7311319f7f5 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.ElementName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.ElementName Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
using System.Xml.Serialization;
-
+
public class Library
{
private Book[] books;
@@ -14,14 +14,14 @@ public Book[] Books
set{books = value;}
}
}
-
+
public class Book
{
public string Title;
public string Author;
public string ISBN;
}
-
+
public class Run
{
public static void Main()
@@ -29,31 +29,31 @@ public static void Main()
Run test = new Run();
test.WriteBook("ArrayExample.xml");
}
-
+
public void WriteBook(string filename)
{
XmlSerializer mySerializer = new XmlSerializer(typeof(Library));
TextWriter t = new StreamWriter(filename);
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("bk", "http://wwww.contoso.com");
-
+
Book b1 = new Book();
b1.Title = "MyBook Title";
b1.Author = "An Author";
b1.ISBN = "00000000";
-
+
Book b2 = new Book();
b2.Title = "Another Title";
b2.Author = "Another Author";
b2.ISBN = "0000000";
-
+
Library myLibrary = new Library();
Book[] myBooks = {b1,b2};
myLibrary.Books = myBooks;
-
+
mySerializer.Serialize(t,myLibrary,ns);
t.Close();
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.Form Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.Form Example/CS/source.cs
index cba81fb435c..9aa2a002622 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.Form Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.Form Example/CS/source.cs
@@ -4,36 +4,36 @@
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
-
+
public class Enterprises
{
private Winery[] wineries;
private VacationCompany[] companies;
- // Sets the Form property to qualified, and specifies the namespace.
- [XmlArray(Form = XmlSchemaForm.Qualified, ElementName="Company",
+ // Sets the Form property to qualified, and specifies the namespace.
+ [XmlArray(Form = XmlSchemaForm.Qualified, ElementName="Company",
Namespace="http://www.cohowinery.com")]
public Winery[] Wineries{
get{return wineries;}
set{wineries = value;}
}
- [XmlArray(Form = XmlSchemaForm.Qualified, ElementName = "Company",
+ [XmlArray(Form = XmlSchemaForm.Qualified, ElementName = "Company",
Namespace = "http://www.treyresearch.com")]
public VacationCompany [] Companies{
get{return companies;}
set{companies = value;}
}
}
-
+
public class Winery
{
public string Name;
}
-
+
public class VacationCompany{
public string Name;
}
-
+
public class Run
{
public static void Main()
@@ -41,11 +41,11 @@ public static void Main()
Run test = new Run();
test.WriteEnterprises("MyEnterprises.xml");
}
-
+
public void WriteEnterprises(string filename)
{
// Creates an instance of the XmlSerializer class.
- XmlSerializer mySerializer =
+ XmlSerializer mySerializer =
new XmlSerializer(typeof(Enterprises));
// Writing file requires a TextWriter.
TextWriter writer = new StreamWriter(filename);
@@ -59,13 +59,13 @@ public void WriteEnterprises(string filename)
// Creates an instance of the class that will be serialized.
Enterprises myEnterprises = new Enterprises();
-
- // Creates objects and adds to the array.
+
+ // Creates objects and adds to the array.
Winery w1= new Winery();
w1.Name = "cohowinery";
Winery[]myWinery = {w1};
myEnterprises.Wineries = myWinery;
-
+
VacationCompany com1 = new VacationCompany();
com1.Name = "adventure-works";
VacationCompany[] myCompany = {com1};
@@ -78,16 +78,16 @@ public void WriteEnterprises(string filename)
public void ReadEnterprises(string filename)
{
- XmlSerializer mySerializer =
+ XmlSerializer mySerializer =
new XmlSerializer(typeof(Enterprises));
FileStream fs = new FileStream(filename, FileMode.Open);
- Enterprises myEnterprises = (Enterprises)
+ Enterprises myEnterprises = (Enterprises)
mySerializer.Deserialize(fs);
-
+
for(int i = 0; i < myEnterprises.Wineries.Length;i++)
{
Console.WriteLine(myEnterprises.Wineries[i].Name);
- }
+ }
for(int i = 0; i < myEnterprises.Companies.Length;i++)
{
Console.WriteLine(myEnterprises.Companies[i].Name);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.IsNullable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.IsNullable Example/CS/source.cs
index e6b23e02877..ac97ecdefee 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.IsNullable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.IsNullable Example/CS/source.cs
@@ -12,5 +12,5 @@ public class MyClass
[XmlArray (IsNullable = false)]
public string [] IsNullableIsFalseArray;
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.Namespace Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.Namespace Example/CS/source.cs
index 199616ab016..14162b55e35 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.Namespace Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.Namespace Example/CS/source.cs
@@ -3,14 +3,14 @@
using System.IO;
using System.Xml;
using System.Xml.Serialization;
-
+
public class Library
{
private Book[] books;
private Periodical [] periodicals;
- /* This element will be qualified with the prefix
+ /* This element will be qualified with the prefix
that is associated with the namespace http://wwww.cpandl.com. */
- [XmlArray(ElementName = "Titles",
+ [XmlArray(ElementName = "Titles",
Namespace="http://wwww.cpandl.com")]
public Book[] Books
{
@@ -19,7 +19,7 @@ public Book[] Books
}
/* This element will be qualified with the prefix that is
associated with the namespace http://www.proseware.com. */
- [XmlArray(ElementName = "Titles", Namespace =
+ [XmlArray(ElementName = "Titles", Namespace =
"http://www.proseware.com")]
public Periodical[] Periodicals
{
@@ -27,7 +27,7 @@ public Periodical[] Periodicals
set{periodicals = value;}
}
}
-
+
public class Book
{
public string Title;
@@ -36,7 +36,7 @@ public class Book
[XmlAttribute]
public string Publisher;
}
-
+
public class Periodical
{
private string title;
@@ -46,56 +46,56 @@ public string Title
set{title = value;}
}
}
-
+
public class Run
{
public static void Main()
{
Run test = new Run();
test.WriteBook("MyLibrary.xml");
- test.ReadBook("MyLibrary.xml");
+ test.ReadBook("MyLibrary.xml");
}
-
+
public void WriteBook(string filename)
{
// Creates a new XmlSerializer.
XmlSerializer mySerializer = new XmlSerializer(typeof(Library));
// Writing the file requires a StreamWriter.
TextWriter myStreamWriter = new StreamWriter(filename);
- /* Creates an XmlSerializerNamespaces and adds prefixes and
+ /* Creates an XmlSerializerNamespaces and adds prefixes and
namespaces to be used. */
- XmlSerializerNamespaces myNamespaces =
+ XmlSerializerNamespaces myNamespaces =
new XmlSerializerNamespaces();
myNamespaces.Add("books", "http://wwww.cpandl.com");
myNamespaces.Add("magazines", "http://www.proseware.com");
// Creates an instance of the class to be serialized.
Library myLibrary = new Library();
-
+
// Creates two book objects.
Book b1 = new Book();
b1.Title = "My Book Title";
b1.Author = "An Author";
b1.ISBN = "000000000";
b1.Publisher = "Microsoft Press";
-
+
Book b2 = new Book();
b2.Title = "Another Book Title";
b2.Author = "Another Author";
b2.ISBN = "00000001";
b2.Publisher = "Another Press";
-
+
/* Creates an array using the objects, and sets the Books property
to the array. */
Book[] myBooks = {b1,b2};
myLibrary.Books = myBooks;
-
+
// Creates two Periodical objects.
Periodical per1 = new Periodical();
per1.Title = "My Magazine Title";
Periodical per2 = new Periodical();
per2.Title = "Another Magazine Title";
-
- // Sets the Periodicals property to the array.
+
+ // Sets the Periodicals property to the array.
Periodical[] myPeridocials = {per1, per2};
myLibrary.Periodicals = myPeridocials;
@@ -104,7 +104,7 @@ to the array. */
myStreamWriter.Close();
}
-
+
public void ReadBook(string filename)
{
/* Creates an instance of an XmlSerializer
@@ -115,7 +115,7 @@ with the class used to read the document. */
Library myLibrary = (Library) mySerializer.Deserialize(myFileStream);
- // Reads each book in the array returned by the Books property.
+ // Reads each book in the array returned by the Books property.
for(int i = 0; i< myLibrary.Books.Length;i++)
{
Console.WriteLine(myLibrary.Books[i].Title);
@@ -131,5 +131,5 @@ with the class used to read the document. */
}
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.XmlArrayAttribute1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.XmlArrayAttribute1 Example/CS/source.cs
index ee64a1f0631..adde5602521 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.XmlArrayAttribute1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayAttribute.XmlArrayAttribute1 Example/CS/source.cs
@@ -3,28 +3,28 @@
using System.IO;
using System.Xml;
using System.Xml.Serialization;
-
+
public class MyClass{
[XmlArrayAttribute("MyStrings")]
public string [] MyStringArray;
[XmlArrayAttribute(ElementName = "MyIntegers")]
public int [] MyIntegerArray;
}
-
+
public class Run{
public static void Main()
{
Run test = new Run();
test.SerializeObject("MyClass.xml");
}
-
+
public void SerializeObject(string filename)
{
// Creates a new instance of the XmlSerializer class.
XmlSerializer s = new XmlSerializer(typeof(MyClass));
// Needs a StreamWriter to write the file.
TextWriter myWriter= new StreamWriter(filename);
-
+
MyClass myClass = new MyClass();
// Creates and populates a string array, then assigns
// it to the MyStringArray property.
@@ -33,7 +33,7 @@ public void SerializeObject(string filename)
/* Creates and populates an integer array, and assigns
it to the MyIntegerArray property. */
int [] myIntegers = {1,2,3};
- myClass.MyIntegerArray = myIntegers;
+ myClass.MyIntegerArray = myIntegers;
// Serializes the class, and writes it to disk.
s.Serialize(myWriter, myClass);
myWriter.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute Example/CS/source.cs
index bc10d6a5825..d61b40a4c77 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute Example/CS/source.cs
@@ -4,9 +4,9 @@
using System.Xml.Serialization;
public class Group
-{
+{
/* The XmlArrayItemAttribute allows the XmlSerializer to insert
- both the base type (Employee) and derived type (Manager)
+ both the base type (Employee) and derived type (Manager)
into serialized arrays. */
[XmlArrayItem(typeof(Manager)),
@@ -22,7 +22,7 @@ in an array of Object items. */
ElementName = "MyString"),
XmlArrayItem(typeof(Manager))]
public object [] ExtraInfo;
-}
+}
public class Employee
{
@@ -50,7 +50,7 @@ public void SerializeObject(string filename)
// Writing the XML file to disk requires a TextWriter.
TextWriter writer = new StreamWriter(filename);
Group group = new Group();
-
+
Manager manager = new Manager();
Employee emp1 = new Employee();
Employee emp2 = new Employee();
@@ -75,12 +75,12 @@ public void DeserializeObject(string filename)
XmlSerializer x = new XmlSerializer(typeof(Group));
Group g = (Group) x.Deserialize(fs);
Console.WriteLine("Members:");
-
- foreach(Employee e in g.Employees)
+
+ foreach(Employee e in g.Employees)
{
Console.WriteLine("\t" + e.Name);
}
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.ElementName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.ElementName Example/CS/source.cs
index 946a4978282..e2c764a6b6c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.ElementName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.ElementName Example/CS/source.cs
@@ -5,22 +5,22 @@
//
public class Transportation
-{
+{
[XmlArray("Vehicles")]
- /* Specifies acceptable types and the ElementName generated
+ /* Specifies acceptable types and the ElementName generated
for each object type. */
- [XmlArrayItem(typeof(Vehicle), ElementName = "Transport"),
+ [XmlArrayItem(typeof(Vehicle), ElementName = "Transport"),
XmlArrayItem(typeof(Car), ElementName = "Automobile")]
public Vehicle[] MyVehicles;
}
-// By default, this class results in XML elements named "Vehicle".
+// By default, this class results in XML elements named "Vehicle".
public class Vehicle
{
public string id;
}
-// By default, this class results in XML elements named "Car".
+// By default, this class results in XML elements named "Car".
public class Car:Vehicle
{
public string Maker;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Form Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Form Example/CS/source.cs
index e0d27795d99..3b7169f8ba0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Form Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Form Example/CS/source.cs
@@ -6,12 +6,12 @@
//
public class Transportation
-{
+{
[XmlArray("Vehicles")]
// Specifies the Form property value.
- [XmlArrayItem(typeof(Vehicle),
- Form = XmlSchemaForm.Unqualified),
- XmlArrayItem(typeof(Car),
+ [XmlArrayItem(typeof(Vehicle),
+ Form = XmlSchemaForm.Unqualified),
+ XmlArrayItem(typeof(Car),
Form = XmlSchemaForm.Qualified)]
public Vehicle[] MyVehicles;
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.IsNullable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.IsNullable Example/CS/source.cs
index fff6dc8ff59..c662af4e760 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.IsNullable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.IsNullable Example/CS/source.cs
@@ -4,12 +4,12 @@
using System.Xml.Serialization;
public class Group
-{
+{
[XmlArray(IsNullable = true)]
[XmlArrayItem(typeof(Manager), IsNullable = false),
XmlArrayItem(typeof(Employee), IsNullable = false)]
public Employee[] Employees;
-}
+}
public class Employee
{
@@ -41,10 +41,10 @@ public void SerializeObject(string filename)
// Creates a null Manager object.
Manager mgr = null;
-
+
// Creates a null Employee object.
Employee y = null;
-
+
group.Employees = new Employee[2] {mgr, y};
// Serializes the object and closes the TextWriter.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Namespace Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Namespace Example/CS/source.cs
index 2b95cd13fd6..02f02a161f0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Namespace Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Namespace Example/CS/source.cs
@@ -5,7 +5,7 @@
//
public class Transportation
-{
+{
// Sets the Namespace property.
[XmlArrayItem(typeof(Car), Namespace = "http://www.cpandl.com")]
public Vehicle[] MyVehicles;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Type Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Type Example/CS/source.cs
index 0e45c90d31f..2c20dfcc325 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Type Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.Type Example/CS/source.cs
@@ -22,7 +22,7 @@ public class Manager:Person
public int Rank;
}
-public class Run
+public class Run
{
public static void Main()
{
@@ -33,7 +33,7 @@ public static void Main()
public void SerializeOrder(string filename)
{
// Creates an XmlSerializer.
- XmlSerializer xSer =
+ XmlSerializer xSer =
new XmlSerializer(typeof(Group));
// Creates the Group object, and two array items.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute Example/CS/source.cs
index c797e48ebeb..992742c8a8f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute Example/CS/source.cs
@@ -3,23 +3,23 @@
using System.IO;
using System.Xml;
using System.Xml.Serialization;
-
+
public class Vehicle
{
public string id;
}
public class Car:Vehicle
{
- public string Maker;
+ public string Maker;
}
-
+
public class Transportation
-{
- [XmlArrayItem(),
+{
+ [XmlArrayItem(),
XmlArrayItem(typeof(Car), ElementName = "Automobile")]
public Vehicle[] MyVehicles;
}
-
+
public class Run
{
public static void Main()
@@ -30,9 +30,9 @@ public static void Main()
}
private void SerializeObject(string filename){
- // Creates an XmlSerializer for the Transportation class.
+ // Creates an XmlSerializer for the Transportation class.
XmlSerializer MySerializer = new XmlSerializer(typeof(Transportation));
-
+
// Writing the XML file to disk requires a TextWriter.
TextWriter myTextWriter = new StreamWriter(filename);
@@ -47,14 +47,14 @@ private void SerializeObject(string filename){
myCar.id = "Car 34";
myCar.Maker = "FamousCarMaker";
- myTransportation.MyVehicles =
+ myTransportation.MyVehicles =
new Vehicle[2] {myVehicle, myCar};
-
+
// Serializes the object, and closes the StreamWriter.
MySerializer.Serialize(myTextWriter, myTransportation);
myTextWriter.Close();
}
-
+
private void DeserializeObject(string filename)
{
// Creates an XmlSerializer instance.
@@ -62,7 +62,7 @@ private void DeserializeObject(string filename)
FileStream myFileStream = new FileStream(filename,FileMode.Open);
Transportation myTransportation =
(Transportation) mySerializer.Deserialize(myFileStream);
-
+
for(int i = 0; i < myTransportation.MyVehicles.Length;i++)
{
Console.WriteLine(myTransportation.MyVehicles[i].id);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute1 Example/CS/source.cs
index 2a2a5cb9560..e3a8f0fe7f4 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute1 Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
using System.Xml.Serialization;
-
+
public class Vehicle
{
public string id;
@@ -12,14 +12,14 @@ public class Car:Vehicle
{
public string Maker;
}
-
+
public class Transportation
-{
- [XmlArrayItem(ElementName = "Transportation"),
+{
+ [XmlArrayItem(ElementName = "Transportation"),
XmlArrayItem(typeof(Car), ElementName = "Automobile")]
public Vehicle[] MyVehicles;
}
-
+
public class Run
{
public static void Main()
@@ -28,16 +28,16 @@ public static void Main()
test.SerializeObject("XmlArrayItem2.xml");
test.DeserializeObject("XmlArrayItem2.xml");
}
-
+
private void SerializeObject(string filename)
{
// Creates an XmlSerializer for the Transportation class.
- XmlSerializer MySerializer =
+ XmlSerializer MySerializer =
new XmlSerializer(typeof(Transportation));
// Writing the XML file to disk requires a TextWriter.
TextWriter myTextWriter = new StreamWriter(filename);
-
+
Transportation myTransportation = new Transportation();
Vehicle myVehicle= new Vehicle() ;
@@ -46,7 +46,7 @@ private void SerializeObject(string filename)
Car myCar = new Car();
myCar.id = "Car 34";
myCar.Maker = "FamousCarMaker";
-
+
Vehicle [] myVehicles = {myVehicle, myCar};
myTransportation.MyVehicles = myVehicles;
@@ -54,21 +54,21 @@ private void SerializeObject(string filename)
MySerializer.Serialize(myTextWriter, myTransportation);
myTextWriter.Close();
}
-
+
private void DeserializeObject(string filename)
{
// Creates the serializer with the type to deserialize.
- XmlSerializer mySerializer =
+ XmlSerializer mySerializer =
new XmlSerializer(typeof(Transportation));
FileStream myFileStream = new FileStream(filename,FileMode.Open);
Transportation myTransportation =
(Transportation) mySerializer.Deserialize(myFileStream);
-
+
for(int i = 0;i < myTransportation.MyVehicles.Length;i++)
{
Console.WriteLine(myTransportation.MyVehicles[i].id);
}
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute2 Example/CS/source.cs
index d12e3323ead..5fafe0625af 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute2 Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
using System.Xml.Serialization;
-
+
public class Vehicle
{
public string id;
@@ -12,14 +12,14 @@ public class Car:Vehicle
{
public string Maker;
}
-
+
public class Transportation
-{
- [XmlArrayItem(typeof(Vehicle)),
+{
+ [XmlArrayItem(typeof(Vehicle)),
XmlArrayItem(typeof(Car))]
public Vehicle[] MyVehicles;
}
-
+
public class Run
{
public static void Main()
@@ -28,16 +28,16 @@ public static void Main()
test.SerializeObject("XmlArrayItem3.xml");
test.DeserializeObject("XmlArrayItem3.xml");
}
-
+
private void SerializeObject(string filename)
{
- // Creates an XmlSerializer.
- XmlSerializer MySerializer =
+ // Creates an XmlSerializer.
+ XmlSerializer MySerializer =
new XmlSerializer(typeof(Transportation));
-
+
// Writing the XML file to disk requires a TextWriter.
TextWriter myTextWriter = new StreamWriter(filename);
-
+
Transportation myTransportation = new Transportation();
Vehicle myVehicle= new Vehicle() ;
@@ -46,7 +46,7 @@ private void SerializeObject(string filename)
Car myCar = new Car();
myCar.id = "Car 34";
myCar.Maker = "FamousCarMaker";
-
+
Vehicle [] myVehicles = {myVehicle, myCar};
myTransportation.MyVehicles = myVehicles;
@@ -54,21 +54,21 @@ private void SerializeObject(string filename)
MySerializer.Serialize(myTextWriter, myTransportation);
myTextWriter.Close();
}
-
+
private void DeserializeObject(string filename)
{
// Creates the serializer with the type to deserialize.
- XmlSerializer mySerializer =
+ XmlSerializer mySerializer =
new XmlSerializer(typeof(Transportation));
FileStream myFileStream = new FileStream(filename,FileMode.Open);
Transportation myTransportation =
(Transportation) mySerializer.Deserialize(myFileStream);
-
+
for(int i = 0;i < myTransportation.MyVehicles.Length;i++)
{
Console.WriteLine(myTransportation.MyVehicles[i].id);
}
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute3 Example/CS/source.cs
index cb20b44d98f..316f5620ded 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlArrayItemAttribute.XmlArrayItemAttribute3 Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
using System.Xml.Serialization;
-
+
public class Vehicle
{
public string id;
@@ -12,15 +12,15 @@ public class Car:Vehicle
{
public string Maker;
}
-
+
public class Transportation
-{
+{
[XmlArray]
- [XmlArrayItem("Transport", typeof(Vehicle)),
+ [XmlArrayItem("Transport", typeof(Vehicle)),
XmlArrayItem("Automobile", typeof(Car))]
public Vehicle[] MyVehicles;
}
-
+
public class Run
{
public static void Main()
@@ -29,16 +29,16 @@ public static void Main()
test.SerializeObject("XmlArrayItem4.xml");
test.DeserializeObject("XmlArrayItem4.xml");
}
-
+
private void SerializeObject(string filename)
{
// Creates an XmlSerializer for the Transportation class.
- XmlSerializer MySerializer =
+ XmlSerializer MySerializer =
new XmlSerializer(typeof(Transportation));
// Writing the XML file to disk requires a TextWriter.
TextWriter myTextWriter = new StreamWriter(filename);
-
+
Transportation myTransportation = new Transportation();
Vehicle myVehicle= new Vehicle() ;
@@ -47,7 +47,7 @@ private void SerializeObject(string filename)
Car myCar = new Car();
myCar.id = "Car 34";
myCar.Maker = "FamousCarMaker";
-
+
Vehicle [] myVehicles = {myVehicle, myCar};
myTransportation.MyVehicles = myVehicles;
@@ -55,21 +55,21 @@ private void SerializeObject(string filename)
MySerializer.Serialize(myTextWriter, myTransportation);
myTextWriter.Close();
}
-
+
private void DeserializeObject(string filename)
{
// Creates an XmlSerializer.
- XmlSerializer mySerializer =
+ XmlSerializer mySerializer =
new XmlSerializer(typeof(Transportation));
FileStream myFileStream = new FileStream(filename,FileMode.Open);
Transportation myTransportation =
(Transportation) mySerializer.Deserialize(myFileStream);
-
+
for(int i = 0;i < myTransportation.MyVehicles.Length;i++)
{
Console.WriteLine(myTransportation.MyVehicles[i].id);
}
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute Example/CS/source.cs
index 3f755c4727b..4b6c31286a4 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Group
{
[XmlAttribute (Namespace = "http://www.cpandl.com")]
public string GroupName;
-
+
[XmlAttribute(DataType = "base64Binary")]
public Byte [] GroupNumber;
@@ -28,7 +28,7 @@ public static void Main()
public void SerializeObject(string filename)
{
// Create an instance of the XmlSerializer class.
- XmlSerializer mySerializer =
+ XmlSerializer mySerializer =
new XmlSerializer(typeof(Group));
// Writing the file requires a TextWriter.
@@ -52,5 +52,5 @@ public void SerializeObject(string filename)
writer.Close();
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute.AttributeName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute.AttributeName Example/CS/source.cs
index 2e50bd2dfa1..a657df1a582 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute.AttributeName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute.AttributeName Example/CS/source.cs
@@ -18,7 +18,7 @@ public static void Main()
{
Run test = new Run();
/* To use the AttributeName to collect all the
- XML attributes. Call SerializeObject to generate
+ XML attributes. Call SerializeObject to generate
an XML document and alter the document by adding
new XML attributes to it. Then comment out the SerializeObject
method, and call DeserializeObject. */
@@ -53,5 +53,5 @@ public void DeserializeObject(string filename)
Console.WriteLine(myGroup.Name);
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute.Form Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute.Form Example/CS/source.cs
index 2e135192e01..8c3d11868df 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute.Form Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeAttribute.Form Example/CS/source.cs
@@ -9,7 +9,7 @@ public class Vehicle
{
[XmlAttribute(Form = XmlSchemaForm.Qualified)]
public string Maker;
-
+
[XmlAttribute(Form = XmlSchemaForm.Unqualified)]
public string ModelID;
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeEventArgs.ObjectBeingDeserialized Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeEventArgs.ObjectBeingDeserialized Example/CS/source.cs
index cec71b9ac2d..ef646d633f7 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeEventArgs.ObjectBeingDeserialized Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeEventArgs.ObjectBeingDeserialized Example/CS/source.cs
@@ -10,8 +10,8 @@ private void serializer_UnknownAttribute(
object sender, XmlAttributeEventArgs e)
{
System.Xml.XmlAttribute attr = e.Attr;
-
- Console.WriteLine("Unknown Attribute Name and Value:" +
+
+ Console.WriteLine("Unknown Attribute Name and Value:" +
attr.Name + "='" + attr.Value + "'");
Object x = e.ObjectBeingDeserialized;
Console.WriteLine("ObjectBeingDeserialized: " + x.ToString());
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides Example/CS/source.cs
index 9a41ceabd5a..ff1bd9aeed3 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides Example/CS/source.cs
@@ -6,7 +6,7 @@
public class Orchestra
{
public Instrument[] Instruments;
-}
+}
public class Instrument
{
@@ -29,11 +29,11 @@ public static void Main()
public void SerializeObject(string filename)
{
- /* Each overridden field, property, or type requires
+ /* Each overridden field, property, or type requires
an XmlAttributes object. */
XmlAttributes attrs = new XmlAttributes();
- /* Create an XmlElementAttribute to override the
+ /* Create an XmlElementAttribute to override the
field that returns Instrument objects. The overridden field
returns Brass objects instead. */
XmlElementAttribute attr = new XmlElementAttribute();
@@ -46,13 +46,13 @@ returns Brass objects instead. */
// Create the XmlAttributeOverrides object.
XmlAttributeOverrides attrOverrides = new XmlAttributeOverrides();
- /* Add the type of the class that contains the overridden
- member and the XmlAttributes to override it with to the
+ /* Add the type of the class that contains the overridden
+ member and the XmlAttributes to override it with to the
XmlAttributeOverrides object. */
attrOverrides.Add(typeof(Orchestra), "Instruments", attrs);
// Create the XmlSerializer using the XmlAttributeOverrides.
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(Orchestra), attrOverrides);
// Writing the file requires a TextWriter.
@@ -60,7 +60,7 @@ XmlAttributeOverrides object. */
// Create the object that will be serialized.
Orchestra band = new Orchestra();
-
+
// Create an object of the derived type.
Brass i = new Brass();
i.Name = "Trumpet";
@@ -75,7 +75,7 @@ XmlAttributeOverrides object. */
public void DeserializeObject(string filename)
{
- XmlAttributeOverrides attrOverrides =
+ XmlAttributeOverrides attrOverrides =
new XmlAttributeOverrides();
XmlAttributes attrs = new XmlAttributes();
@@ -90,23 +90,23 @@ public void DeserializeObject(string filename)
attrOverrides.Add(typeof(Orchestra), "Instruments", attrs);
// Create the XmlSerializer using the XmlAttributeOverrides.
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(Orchestra), attrOverrides);
FileStream fs = new FileStream(filename, FileMode.Open);
Orchestra band = (Orchestra) s.Deserialize(fs);
Console.WriteLine("Brass:");
- /* The difference between deserializing the overridden
- XML document and serializing it is this: To read the derived
- object values, you must declare an object of the derived type
+ /* The difference between deserializing the overridden
+ XML document and serializing it is this: To read the derived
+ object values, you must declare an object of the derived type
(Brass), and cast the Instrument instance to it. */
Brass b;
- foreach(Instrument i in band.Instruments)
+ foreach(Instrument i in band.Instruments)
{
b = (Brass)i;
Console.WriteLine(
- b.Name + "\n" +
+ b.Name + "\n" +
b.IsValved);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.Add Example/CS/source.cs
index 15aadd04847..a4ef1c18355 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.Add Example/CS/source.cs
@@ -3,14 +3,14 @@
using System.IO;
using System.Xml.Serialization;
-/* This is the class that will be overridden. The XmlIncludeAttribute
+/* This is the class that will be overridden. The XmlIncludeAttribute
tells the XmlSerializer that the overriding type exists. */
[XmlInclude(typeof(Band))]
public class Orchestra
{
public Instrument[] Instruments;
-}
+}
// This is the overriding class.
public class Band:Orchestra
@@ -34,7 +34,7 @@ public static void Main()
public void SerializeObject(string filename)
{
- /* Each object that is being overridden requires
+ /* Each object that is being overridden requires
an XmlAttributes object. */
XmlAttributes attrs = new XmlAttributes();
@@ -45,14 +45,14 @@ an XmlAttributes object. */
attrs.XmlRoot = xmlRoot;
// Create an XmlAttributeOverrides object.
- XmlAttributeOverrides attrOverrides =
+ XmlAttributeOverrides attrOverrides =
new XmlAttributeOverrides();
// Add the XmlAttributes to the XmlAttributeOverrrides.
attrOverrides.Add(typeof(Orchestra), attrs);
// Create the XmlSerializer using the XmlAttributeOverrides.
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(Orchestra), attrOverrides);
// Writing the file requires a TextWriter.
@@ -78,12 +78,12 @@ public void DeserializeObject(string filename)
XmlAttributes attrs = new XmlAttributes();
XmlRootAttribute attr = new XmlRootAttribute();
attrs.XmlRoot = attr;
- XmlAttributeOverrides attrOverrides =
+ XmlAttributeOverrides attrOverrides =
new XmlAttributeOverrides();
attrOverrides.Add(typeof(Orchestra), "Instruments", attrs);
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(Orchestra), attrOverrides);
FileStream fs = new FileStream(filename, FileMode.Open);
@@ -92,7 +92,7 @@ public void DeserializeObject(string filename)
Band band = (Band) s.Deserialize(fs);
Console.WriteLine("Brass:");
- foreach(Instrument i in band.Instruments)
+ foreach(Instrument i in band.Instruments)
{
Console.WriteLine(i.Name);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.Add1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.Add1 Example/CS/source.cs
index 3beb3f73e14..d415dc914c0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.Add1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.Add1 Example/CS/source.cs
@@ -16,7 +16,7 @@ public class Sample
{
public XmlSerializer CreateOverrider()
{
- // Create an XmlAttributeOverrides object.
+ // Create an XmlAttributeOverrides object.
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
/* Create an XmlAttributeAttribute to override the base class
@@ -25,7 +25,7 @@ public XmlSerializer CreateOverrider()
XmlAttributeAttribute xAtt = new XmlAttributeAttribute();
xAtt.AttributeName = "Code";
- /* Create an instance of the XmlAttributes class and set the
+ /* Create an instance of the XmlAttributes class and set the
XmlAttribute property to the XmlAttributeAttribute object. */
XmlAttributes attrs = new XmlAttributes();
attrs.XmlAttribute = xAtt;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.this Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.this Example/CS/source.cs
index d11215d9d62..a7b061db833 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.this Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.this Example/CS/source.cs
@@ -19,13 +19,13 @@ public XmlSerializer CreateOverrider()
// Create an XmlSerializer with overriding attributes.
XmlAttributes attrs = new XmlAttributes();
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
-
+
XmlRootAttribute xRoot = new XmlRootAttribute();
// Set a new Namespace and ElementName for the root element.
xRoot.Namespace = "http://www.cpandl.com";
xRoot.ElementName = "NewGroup";
attrs.XmlRoot = xRoot;
-
+
xOver.Add(typeof(Group), attrs);
// Get the XmlAttributes object, based on the type.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.this1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.this1 Example/CS/source.cs
index 49890213520..9d613ce5939 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.this1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributeOverrides.this1 Example/CS/source.cs
@@ -19,12 +19,12 @@ public XmlSerializer CreateOverrider()
// Create an XmlSerializer with overriding attributes.
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
- /* Create an XmlAttributeAttribute object and set the
+ /* Create an XmlAttributeAttribute object and set the
AttributeName property. */
XmlAttributeAttribute xAtt = new XmlAttributeAttribute();
xAtt.AttributeName = "Code";
- /* Create a new XmlAttributes object and set the
+ /* Create a new XmlAttributes object and set the
XmlAttributeAttribute object to the XmlAttribute property. */
XmlAttributes attrs = new XmlAttributes();
attrs.XmlAttribute = xAtt;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlArray Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlArray Example/CS/source.cs
index c016b8e970f..7691e9eebaa 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlArray Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlArray Example/CS/source.cs
@@ -24,14 +24,14 @@ public static void Main()
test.SerializeObject("OverrideArray.xml");
test.DeserializeObject("OverrideArray.xml");
}
- // Return an XmlSerializer used for overriding.
+ // Return an XmlSerializer used for overriding.
public XmlSerializer CreateOverrider()
{
// Creating XmlAttributeOverrides and XmlAttributes objects.
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
XmlAttributes xAttrs = new XmlAttributes();
- // Add an override for the XmlArray.
+ // Add an override for the XmlArray.
XmlArrayAttribute xArray = new XmlArrayAttribute("Staff");
xArray.Namespace = "http://www.cpandl.com";
xAttrs.XmlArray = xArray;
@@ -55,7 +55,7 @@ public void SerializeObject(string filename)
Member m = new Member();
m.MemberName = "Paul";
myGroup.Members = new Member[1] {m};
-
+
// Serialize the class, and close the TextWriter.
mySerializer.Serialize(writer, myGroup);
writer.Close();
@@ -65,7 +65,7 @@ public void DeserializeObject(string filename)
{
XmlSerializer mySerializer = CreateOverrider();
FileStream fs = new FileStream(filename, FileMode.Open);
- Group myGroup = (Group)
+ Group myGroup = (Group)
mySerializer.Deserialize(fs);
foreach(Member m in myGroup.Members)
{
@@ -73,5 +73,5 @@ public void DeserializeObject(string filename)
}
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlArrayItems Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlArrayItems Example/CS/source.cs
index 7265dafb451..d72684b6b32 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlArrayItems Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlArrayItems Example/CS/source.cs
@@ -34,21 +34,21 @@ public static void Main()
test.DeserializeObject("OverrideArrayItem.xml");
}
- // Return an XmlSerializer used for overriding.
+ // Return an XmlSerializer used for overriding.
public XmlSerializer CreateOverrider()
{
// Create XmlAttributeOverrides and XmlAttributes objects.
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
XmlAttributes xAttrs = new XmlAttributes();
- // Add an override for the XmlArrayItem.
- XmlArrayItemAttribute xArrayItem =
+ // Add an override for the XmlArrayItem.
+ XmlArrayItemAttribute xArrayItem =
new XmlArrayItemAttribute(typeof(NewMember));
xArrayItem.Namespace = "http://www.cpandl.com";
xAttrs.XmlArrayItems.Add(xArrayItem);
// Add a second override.
- XmlArrayItemAttribute xArrayItem2 =
+ XmlArrayItemAttribute xArrayItem2 =
new XmlArrayItemAttribute(typeof(RetiredMember));
xArrayItem2.Namespace = "http://www.cpandl.com";
xAttrs.XmlArrayItems.Add(xArrayItem2);
@@ -82,7 +82,7 @@ public void SerializeObject(string filename)
m2.RetireDate = new DateTime(2000, 10,10);
myGroup.Members = new Member[2] {m, m2};
-
+
// Serialize the class, and close the TextWriter.
mySerializer.Serialize(writer, myGroup);
writer.Close();
@@ -92,7 +92,7 @@ public void DeserializeObject(string filename)
{
XmlSerializer mySerializer = CreateOverrider();
FileStream fs = new FileStream(filename, FileMode.Open);
- Group myGroup = (Group)
+ Group myGroup = (Group)
mySerializer.Deserialize(fs);
foreach(Member m in myGroup.Members)
{
@@ -100,5 +100,5 @@ public void DeserializeObject(string filename)
}
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlAttribute Example/CS/source.cs
index 72a96cce7a1..0e79ca46a66 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlAttribute Example/CS/source.cs
@@ -12,7 +12,7 @@ public class Group
public string GroupName;
public int GroupNumber;
}
-
+
public class Run
{
public static void Main()
@@ -21,14 +21,14 @@ public static void Main()
test.SerializeObject("OverrideAttribute.xml");
test.DeserializeObject("OverrideAttribute.xml");
}
- // Return an XmlSerializer used for overriding.
+ // Return an XmlSerializer used for overriding.
public XmlSerializer CreateOverrider()
{
// Create the XmlAttributeOverrides and XmlAttributes objects.
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
XmlAttributes xAttrs = new XmlAttributes();
- /* Create an overriding XmlAttributeAttribute set it to
+ /* Create an overriding XmlAttributeAttribute set it to
the XmlAttribute property of the XmlAttributes object.*/
XmlAttributeAttribute xAttribute = new XmlAttributeAttribute("SplinterName");
xAttrs.XmlAttribute = xAttribute;
@@ -39,7 +39,7 @@ the XmlAttribute property of the XmlAttributes object.*/
// Create the XmlSerializer and return it.
return new XmlSerializer(typeof(Group), xOver);
}
-
+
public void SerializeObject(string filename)
{
// Create an instance of the XmlSerializer class.
@@ -50,7 +50,7 @@ public void SerializeObject(string filename)
// Create an instance of the class that will be serialized.
Group myGroup = new Group();
- /* Set the Name property, which will be generated
+ /* Set the Name property, which will be generated
as an XML attribute. */
myGroup.GroupName = ".NET";
myGroup.GroupNumber = 1;
@@ -63,12 +63,12 @@ public void DeserializeObject(string filename)
{
XmlSerializer mySerializer = CreateOverrider();
FileStream fs = new FileStream(filename, FileMode.Open);
- Group myGroup = (Group)
+ Group myGroup = (Group)
mySerializer.Deserialize(fs);
-
+
Console.WriteLine(myGroup.GroupName);
Console.WriteLine(myGroup.GroupNumber);
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlAttributes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlAttributes Example/CS/source.cs
index 8d6eb2b1db5..7556d868186 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlAttributes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlAttributes Example/CS/source.cs
@@ -6,7 +6,7 @@
public class Orchestra
{
public Instrument[] Instruments;
-}
+}
public class Instrument
{
@@ -29,11 +29,11 @@ public static void Main()
public void SerializeObject(string filename)
{
- /* Each overridden field, property, or type requires
+ /* Each overridden field, property, or type requires
an XmlAttributes object. */
XmlAttributes attrs = new XmlAttributes();
- /* Create an XmlElementAttribute to override the
+ /* Create an XmlElementAttribute to override the
field that returns Instrument objects. The overridden field
returns Brass objects instead. */
XmlElementAttribute attr = new XmlElementAttribute();
@@ -46,13 +46,13 @@ returns Brass objects instead. */
// Create the XmlAttributeOverrides object.
XmlAttributeOverrides attrOverrides = new XmlAttributeOverrides();
- /* Add the type of the class that contains the overridden
- member and the XmlAttributes to override it with to the
+ /* Add the type of the class that contains the overridden
+ member and the XmlAttributes to override it with to the
XmlAttributeOverrides object. */
attrOverrides.Add(typeof(Orchestra), "Instruments", attrs);
// Create the XmlSerializer using the XmlAttributeOverrides.
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(Orchestra), attrOverrides);
// Writing the file requires a TextWriter.
@@ -60,7 +60,7 @@ XmlAttributeOverrides object. */
// Create the object that will be serialized.
Orchestra band = new Orchestra();
-
+
// Create an object of the derived type.
Brass i = new Brass();
i.Name = "Trumpet";
@@ -75,7 +75,7 @@ XmlAttributeOverrides object. */
public void DeserializeObject(string filename)
{
- XmlAttributeOverrides attrOverrides =
+ XmlAttributeOverrides attrOverrides =
new XmlAttributeOverrides();
XmlAttributes attrs = new XmlAttributes();
@@ -90,23 +90,23 @@ public void DeserializeObject(string filename)
attrOverrides.Add(typeof(Orchestra), "Instruments", attrs);
// Create the XmlSerializer using the XmlAttributeOverrides.
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(Orchestra), attrOverrides);
FileStream fs = new FileStream(filename, FileMode.Open);
Orchestra band = (Orchestra) s.Deserialize(fs);
Console.WriteLine("Brass:");
- /* The difference between deserializing the overridden
- XML document and serializing it is this: To read the derived
- object values, you must declare an object of the derived type
+ /* The difference between deserializing the overridden
+ XML document and serializing it is this: To read the derived
+ object values, you must declare an object of the derived type
(Brass), and cast the Instrument instance to it. */
Brass b;
- foreach(Instrument i in band.Instruments)
+ foreach(Instrument i in band.Instruments)
{
b = (Brass)i;
Console.WriteLine(
- b.Name + "\n" +
+ b.Name + "\n" +
b.IsValved);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlDefaultValue Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlDefaultValue Example/CS/source.cs
index f8508fd22ec..2801bc5ef19 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlDefaultValue Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlDefaultValue Example/CS/source.cs
@@ -1,40 +1,40 @@
//
-using System;
-using System.IO;
-using System.Xml;
-using System.Xml.Serialization;
-using System.ComponentModel;
+using System;
+using System.IO;
+using System.Xml;
+using System.Xml.Serialization;
+using System.ComponentModel;
-// This is the class that will be serialized.
-public class Pet
+// This is the class that will be serialized.
+public class Pet
{
- // The default value for the Animal field is "Dog".
- [DefaultValueAttribute("Dog")]
- public string Animal ;
-}
+ // The default value for the Animal field is "Dog".
+ [DefaultValueAttribute("Dog")]
+ public string Animal ;
+}
-public class Run
-{
- public static void Main()
- {
+public class Run
+{
+ public static void Main()
+ {
Run test = new Run();
test.SerializeObject("OverrideDefaultValue.xml");
- test.DeserializeObject("OverrideDefaultValue.xml");
+ test.DeserializeObject("OverrideDefaultValue.xml");
}
-
- // Return an XmlSerializer used for overriding.
- public XmlSerializer CreateOverrider()
- {
- // Create the XmlAttributeOverrides and XmlAttributes objects.
- XmlAttributeOverrides xOver = new XmlAttributeOverrides();
- XmlAttributes xAttrs = new XmlAttributes();
- // Add an override for the default value of the GroupName.
+ // Return an XmlSerializer used for overriding.
+ public XmlSerializer CreateOverrider()
+ {
+ // Create the XmlAttributeOverrides and XmlAttributes objects.
+ XmlAttributeOverrides xOver = new XmlAttributeOverrides();
+ XmlAttributes xAttrs = new XmlAttributes();
+
+ // Add an override for the default value of the GroupName.
Object defaultAnimal= "Cat";
- xAttrs.XmlDefaultValue = defaultAnimal;
+ xAttrs.XmlDefaultValue = defaultAnimal;
- // Add all the XmlAttributes to the XmlAttributeOverrides object.
- xOver.Add(typeof(Pet), "Animal", xAttrs);
+ // Add all the XmlAttributes to the XmlAttributeOverrides object.
+ xOver.Add(typeof(Pet), "Animal", xAttrs);
// Create the XmlSerializer and return it.
return new XmlSerializer(typeof(Pet), xOver);
@@ -43,13 +43,13 @@ public XmlSerializer CreateOverrider()
public void SerializeObject(string filename)
{
// Create an instance of the XmlSerializer class.
- XmlSerializer mySerializer = CreateOverrider();
+ XmlSerializer mySerializer = CreateOverrider();
// Writing the file requires a TextWriter.
- TextWriter writer = new StreamWriter(filename);
+ TextWriter writer = new StreamWriter(filename);
- // Create an instance of the class that will be serialized.
- Pet myPet = new Pet();
+ // Create an instance of the class that will be serialized.
+ Pet myPet = new Pet();
/* Set the Animal property. If you set it to the default value,
which is "Cat" (the value assigned to the XmlDefaultValue
@@ -58,22 +58,22 @@ If you change the value to any other value (including "Dog"),
the value will be serialized.
*/
// The default value "Cat" will be assigned (nothing serialized).
- myPet.Animal= "";
- // Uncommenting the next line also results in the default
+ myPet.Animal= "";
+ // Uncommenting the next line also results in the default
// value because Cat is the default value (not serialized).
- // myPet.Animal = "Cat";
-
+ // myPet.Animal = "Cat";
+
// Uncomment the next line to see the value serialized:
// myPet.Animal = "fish";
- // This will also be serialized because Dog is not the
+ // This will also be serialized because Dog is not the
// default anymore.
// myPet.Animal = "Dog";
- // Serialize the class, and close the TextWriter.
- mySerializer.Serialize(writer, myPet);
- writer.Close();
- }
+ // Serialize the class, and close the TextWriter.
+ mySerializer.Serialize(writer, myPet);
+ writer.Close();
+ }
- public void DeserializeObject(string filename)
+ public void DeserializeObject(string filename)
{
XmlSerializer mySerializer = CreateOverrider();
FileStream fs = new FileStream(filename, FileMode.Open);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlElements Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlElements Example/CS/source.cs
index 9b5fa026450..39557aaa93a 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlElements Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlElements Example/CS/source.cs
@@ -45,26 +45,26 @@ public XmlSerializer CreateOverrider()
// Create the XmlAttributes and XmlAttributeOverrides objects.
XmlAttributes attrs = new XmlAttributes();
- XmlAttributeOverrides xOver =
+ XmlAttributeOverrides xOver =
new XmlAttributeOverrides();
- /* Create an XmlElementAttribute to override
+ /* Create an XmlElementAttribute to override
the Vehicles property. */
- XmlElementAttribute xElement1 =
+ XmlElementAttribute xElement1 =
new XmlElementAttribute(typeof(Truck));
// Add the XmlElementAttribute to the collection.
attrs.XmlElements.Add(xElement1);
- /* Create a second XmlElementAttribute, and
+ /* Create a second XmlElementAttribute, and
add it to the collection. */
- XmlElementAttribute xElement2 =
+ XmlElementAttribute xElement2 =
new XmlElementAttribute(typeof(Train));
attrs.XmlElements.Add(xElement2);
/* Add the XmlAttributes to the XmlAttributeOverrides,
specifying the member to override. */
xOver.Add(typeof(Transportation), "Vehicles", attrs);
-
+
// Create the XmlSerializer, and return it.
XmlSerializer xSer = new XmlSerializer
(typeof(Transportation), xOver);
@@ -77,7 +77,7 @@ public void SerializeObject(string filename)
XmlSerializer xSer = CreateOverrider();
// Create the object and serialize it.
- Transportation myTransportation =
+ Transportation myTransportation =
new Transportation();
/* Create two new override objects that can be
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlEnum Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlEnum Example/CS/source.cs
index 40f56e45760..b4d4a09b293 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlEnum Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlEnum Example/CS/source.cs
@@ -26,7 +26,7 @@ public static void Main()
test.DeserializeObject("OverrideEnum.xml");
}
- // Return an XmlSerializer used for overriding.
+ // Return an XmlSerializer used for overriding.
public XmlSerializer CreateOverrider()
{
// Create the XmlAttributeOverrides and XmlAttributes objects.
@@ -72,11 +72,11 @@ public void DeserializeObject(string filename)
{
XmlSerializer mySerializer = CreateOverrider();
FileStream fs = new FileStream(filename, FileMode.Open);
- Food myFood = (Food)
+ Food myFood = (Food)
mySerializer.Deserialize(fs);
Console.WriteLine(myFood.Type);
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlIgnore Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlIgnore Example/CS/source.cs
index 87203b2e543..a114485a870 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlIgnore Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlIgnore Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml.Serialization;
-// This is the class that will be serialized.
+// This is the class that will be serialized.
public class Group
{
// The GroupName value will be serialized--unless it's overridden.
@@ -40,7 +40,7 @@ the GroupName instead. */
attrs = new XmlAttributes();
attrs.XmlIgnore = true;
xOver.Add(typeof(Group), "GroupName", attrs);
-
+
XmlSerializer xSer = new XmlSerializer(typeof(Group), xOver);
return xSer;
}
@@ -54,7 +54,7 @@ public void SerializeObject(string filename)
Group myGroup = new Group();
myGroup.GroupName = ".NET";
myGroup.Comment = "My Comment...";
-
+
// Writing the file requires a TextWriter.
TextWriter writer = new StreamWriter(filename);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlRoot Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlRoot Example/CS/source.cs
index 0035ae4573e..4f39df87f31 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlRoot Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlRoot Example/CS/source.cs
@@ -25,7 +25,7 @@ public XmlSerializer CreateOverrider()
// Create the XmlAttributes and XmlAttributeOverrides objects.
XmlAttributes attrs = new XmlAttributes();
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
-
+
XmlRootAttribute xRoot = new XmlRootAttribute();
// Set a new Namespace and ElementName for the root element.
@@ -33,8 +33,8 @@ public XmlSerializer CreateOverrider()
xRoot.ElementName = "NewGroup";
attrs.XmlRoot = xRoot;
- /* Add the XmlAttributes object to the XmlAttributeOverrides.
- No member name is needed because the whole class is
+ /* Add the XmlAttributes object to the XmlAttributeOverrides.
+ No member name is needed because the whole class is
overridden. */
xOver.Add(typeof(Group), attrs);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlText Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlText Example/CS/source.cs
index bd79259c579..ed840c5fad6 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlText Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlText Example/CS/source.cs
@@ -9,10 +9,10 @@ public class Group
{
public string GroupName;
- // This field will be serialized as XML text.
+ // This field will be serialized as XML text.
public string Comment;
}
-
+
public class Run
{
public static void Main()
@@ -22,16 +22,16 @@ public static void Main()
test.DeserializeObject("OverrideText.xml");
}
- // Return an XmlSerializer to be used for overriding.
+ // Return an XmlSerializer to be used for overriding.
public XmlSerializer CreateOverrider()
{
// Create the XmlAttributeOverrides and XmlAttributes objects.
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
XmlAttributes xAttrs = new XmlAttributes();
- /* Create an XmlTextAttribute and assign it to the XmlText
- property. This instructs the XmlSerializer to treat the
- Comment field as XML text. */
+ /* Create an XmlTextAttribute and assign it to the XmlText
+ property. This instructs the XmlSerializer to treat the
+ Comment field as XML text. */
XmlTextAttribute xText = new XmlTextAttribute();
xAttrs.XmlText = xText;
xOver.Add(typeof(Group), "Comment", xAttrs);
@@ -52,7 +52,7 @@ public void SerializeObject(string filename)
// Set the object properties.
myGroup.GroupName = ".NET";
- myGroup.Comment = "Great Stuff!";
+ myGroup.Comment = "Great Stuff!";
// Serialize the class, and close the TextWriter.
mySerializer.Serialize(writer, myGroup);
writer.Close();
@@ -62,11 +62,11 @@ public void DeserializeObject(string filename)
{
XmlSerializer mySerializer = CreateOverrider();
FileStream fs = new FileStream(filename, FileMode.Open);
- Group myGroup = (Group)
+ Group myGroup = (Group)
mySerializer.Deserialize(fs);
Console.WriteLine(myGroup.GroupName);
Console.WriteLine(myGroup.Comment);
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlType Example/CS/source.cs
index 19558758dbf..5f557a33d19 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlAttributes.XmlType Example/CS/source.cs
@@ -27,8 +27,8 @@ public XmlSerializer CreateOverrider()
// Create the XmlAttributes and XmlAttributeOverrides objects.
XmlAttributes attrs = new XmlAttributes();
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
-
- /* Create an XmlTypeAttribute and change the name of the
+
+ /* Create an XmlTypeAttribute and change the name of the
XML type. */
XmlTypeAttribute xType = new XmlTypeAttribute();
xType.TypeName = "Autos";
@@ -52,7 +52,7 @@ public void SerializeObject(string filename)
XmlSerializer xSer = CreateOverrider();
// Create object and serialize it.
- Transportation myTransportation =
+ Transportation myTransportation =
new Transportation();
Car c1 = new Car();
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute Example/CS/source.cs
index e5b02e0510a..4e1362302e5 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute Example/CS/source.cs
@@ -10,12 +10,12 @@ public class Group
By applying an XmlElementAttribute to an array, you instruct
the XmlSerializer to serialize the array as a series of XML
elements, instead of a nested set of elements. */
-
+
[XmlElement(
ElementName = "Members",
Namespace = "http://www.cpandl.com")]
public Employee[] Employees;
-
+
[XmlElement(DataType = "double",
ElementName = "Building")]
public double GroupID;
@@ -34,7 +34,7 @@ the XmlSerializer to serialize the array as a series of XML
XmlElement(typeof(string),
ElementName = "ObjectString")]
public ArrayList ExtraInfo;
-}
+}
public class Employee
{
@@ -67,7 +67,7 @@ its properties. */
Group group = new Group();
group.GroupID = 10.089f;
group.IsActive = false;
-
+
group.HexBytes = new byte[1]{Convert.ToByte(100)};
Employee x = new Employee();
@@ -75,7 +75,7 @@ its properties. */
x.Name = "Jack";
y.Name = "Jill";
-
+
group.Employees = new Employee[2]{x,y};
Manager mgr = new Manager();
@@ -83,13 +83,13 @@ its properties. */
mgr.Level = 4;
group.Manager = mgr;
- /* Add a number and a string to the
+ /* Add a number and a string to the
ArrayList returned by the ExtraInfo property. */
group.ExtraInfo = new ArrayList();
group.ExtraInfo.Add(42);
group.ExtraInfo.Add("Answer");
- // Serialize the object, and close the TextWriter.
+ // Serialize the object, and close the TextWriter.
s.Serialize(writer, group);
writer.Close();
}
@@ -108,5 +108,5 @@ public void DeserializeObject(string filename)
}
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.DataType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.DataType Example/CS/source.cs
index 8a4e5f3a2de..7d5142a7b21 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.DataType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.DataType Example/CS/source.cs
@@ -7,13 +7,13 @@
public class Group
{
/* Apply two XmlElementAttributes to the field. Set the DataType
- to string an int to allow the ArrayList to accept
+ to string an int to allow the ArrayList to accept
both types. The Namespace is also set to different values
- for each type. */
+ for each type. */
[XmlElement(DataType = "string",
Type = typeof(string),
Namespace = "http://www.cpandl.com"),
- XmlElement(DataType = "int",
+ XmlElement(DataType = "int",
Namespace = "http://www.cohowinery.com",
Type = typeof(int))]
public ArrayList ExtraInfo;
@@ -33,7 +33,7 @@ public void SerializeObject(string filename)
TextWriter writer = new StreamWriter(filename);
// Create the XmlSerializer using the XmlAttributeOverrides.
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(Group));
// Create the object to serialize.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.ElementName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.ElementName Example/CS/source.cs
index 69494854475..33a8149ebbe 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.ElementName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.ElementName Example/CS/source.cs
@@ -15,5 +15,5 @@ public class XClass
instead of the default ClassName. */
[XmlElement(ElementName = "XName")]
public string ClassName;
-}
+}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.Type Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.Type Example/CS/source.cs
index 85336cf6451..58717c320c0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.Type Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.Type Example/CS/source.cs
@@ -26,7 +26,7 @@ public class Manager:Employee
public int Level;
}
-public class Run
+public class Run
{
public static void Main()
{
@@ -37,12 +37,12 @@ public static void Main()
public void SerializeObject(string filename)
{
// Create an XmlSerializer instance.
- XmlSerializer xSer =
+ XmlSerializer xSer =
new XmlSerializer(typeof(Group));
// Create object and serialize it.
Group myGroup = new Group();
-
+
Manager e1 = new Manager();
e1.Name = "Manager1";
Manager m1 = new Manager();
@@ -56,7 +56,7 @@ public void SerializeObject(string filename)
myGroup.ExtraInfo.Add(".NET");
myGroup.ExtraInfo.Add(42);
myGroup.ExtraInfo.Add(new DateTime(2001,1,1));
-
+
TextWriter writer = new StreamWriter(filename);
xSer.Serialize(writer, myGroup);
writer.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.XmlElementAttribute2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.XmlElementAttribute2 Example/CS/source.cs
index a2e2a28ed70..4459d08523c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.XmlElementAttribute2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttribute.XmlElementAttribute2 Example/CS/source.cs
@@ -6,7 +6,7 @@
public class Orchestra
{
public Instrument[] Instruments;
-}
+}
public class Instrument
{
@@ -30,13 +30,13 @@ public void SerializeObject(string filename)
{
// To write the file, a TextWriter is required.
TextWriter writer = new StreamWriter(filename);
-
- XmlAttributeOverrides attrOverrides =
+
+ XmlAttributeOverrides attrOverrides =
new XmlAttributeOverrides();
XmlAttributes attrs = new XmlAttributes();
// Creates an XmlElementAttribute that overrides the Instrument type.
- XmlElementAttribute attr = new
+ XmlElementAttribute attr = new
XmlElementAttribute(typeof(Brass));
attr.ElementName = "Brass";
@@ -45,12 +45,12 @@ public void SerializeObject(string filename)
attrOverrides.Add(typeof(Orchestra), "Instruments", attrs);
// Creates the XmlSerializer using the XmlAttributeOverrides.
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(Orchestra), attrOverrides);
// Creates the object to serialize.
Orchestra band = new Orchestra();
-
+
// Creates an object of the derived type.
Brass i = new Brass();
i.Name = "Trumpet";
@@ -63,12 +63,12 @@ public void SerializeObject(string filename)
public void DeserializeObject(string filename)
{
- XmlAttributeOverrides attrOverrides =
+ XmlAttributeOverrides attrOverrides =
new XmlAttributeOverrides();
XmlAttributes attrs = new XmlAttributes();
// Creates an XmlElementAttribute that override the Instrument type.
- XmlElementAttribute attr = new
+ XmlElementAttribute attr = new
XmlElementAttribute(typeof(Brass));
attr.ElementName = "Brass";
@@ -77,22 +77,22 @@ public void DeserializeObject(string filename)
attrOverrides.Add(typeof(Orchestra), "Instruments", attrs);
// Creates the XmlSerializer using the XmlAttributeOverrides.
- XmlSerializer s =
+ XmlSerializer s =
new XmlSerializer(typeof(Orchestra), attrOverrides);
FileStream fs = new FileStream(filename, FileMode.Open);
Orchestra band = (Orchestra) s.Deserialize(fs);
Console.WriteLine("Brass:");
- /* Deserializing differs from serializing. To read the
- derived-object values, declare an object of the derived
+ /* Deserializing differs from serializing. To read the
+ derived-object values, declare an object of the derived
type (Brass) and cast the Instrument instance to it. */
Brass b;
- foreach(Instrument i in band.Instruments)
+ foreach(Instrument i in band.Instruments)
{
b= (Brass)i;
Console.WriteLine(
- b.Name + "\n" +
+ b.Name + "\n" +
b.IsValved);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttributes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttributes Example/CS/source.cs
index 5e1f8131d3d..4c8c5be1779 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttributes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttributes Example/CS/source.cs
@@ -43,30 +43,30 @@ public static void Main()
public XmlSerializer CreateOverrider()
{
- // Create XmlAtrributes and XmlAttributeOverrides instances.
-
+ // Create XmlAtrributes and XmlAttributeOverrides instances.
+
XmlAttributes attrs = new XmlAttributes();
- XmlAttributeOverrides xOver =
+ XmlAttributeOverrides xOver =
new XmlAttributeOverrides();
-
- /* Create an XmlElementAttributes object to override
+
+ /* Create an XmlElementAttributes object to override
one of the attributes applied to the Vehicles property. */
- XmlElementAttribute xElement1 =
+ XmlElementAttribute xElement1 =
new XmlElementAttribute(typeof(Truck));
// Add the XmlElementAttribute to the collection.
attrs.XmlElements.Add(xElement1);
- /* Create a second XmlElementAttribute and
+ /* Create a second XmlElementAttribute and
add it to the collection. */
- XmlElementAttribute xElement2 =
+ XmlElementAttribute xElement2 =
new XmlElementAttribute(typeof(Train));
attrs.XmlElements.Add(xElement2);
/* Add the XmlAttributes to the XmlAttributeOverrides,
specifying the member to override. */
xOver.Add(typeof(Transportation), "Vehicles", attrs);
-
+
// Create the XmlSerializer, and return it.
XmlSerializer xSer = new XmlSerializer
(typeof(Transportation), xOver);
@@ -79,7 +79,7 @@ public void SerializeObject(string filename)
XmlSerializer xSer = CreateOverrider();
// Create the object.
- Transportation myTransportation =
+ Transportation myTransportation =
new Transportation();
/* Create two new, overriding objects that can be
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttributes.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttributes.Add Example/CS/source.cs
index 4ee3d127de0..bbffffe05d6 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttributes.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlElementAttributes.Add Example/CS/source.cs
@@ -9,28 +9,28 @@ public class Sample
public XmlSerializer CreateOverrider()
{
// Create XmlAttributes and XmlAttributeOverrides instances.
-
+
XmlAttributes attrs = new XmlAttributes();
- XmlAttributeOverrides xOver =
+ XmlAttributeOverrides xOver =
new XmlAttributeOverrides();
-
- /* Create an XmlElementAttributes to override
+
+ /* Create an XmlElementAttributes to override
the Vehicles property. */
- XmlElementAttribute xElement1 =
+ XmlElementAttribute xElement1 =
new XmlElementAttribute(typeof(Truck));
// Add the XmlElementAttribute to the collection.
attrs.XmlElements.Add(xElement1);
- /* Create a second XmlElementAttribute, and
+ /* Create a second XmlElementAttribute, and
add to the collection. */
- XmlElementAttribute xElement2 =
+ XmlElementAttribute xElement2 =
new XmlElementAttribute(typeof(Train));
attrs.XmlElements.Add(xElement2);
/* Add the XmlAttributes to the XmlAttributeOverrides,
specifying the member to override. */
xOver.Add(typeof(Transportation), "Vehicles", attrs);
-
+
// Create the XmlSerializer, and return it.
XmlSerializer xSer = new XmlSerializer
(typeof(Transportation), xOver);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute Example/CS/source.cs
index f786b90a61f..3756e25503e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute Example/CS/source.cs
@@ -13,5 +13,5 @@ public enum EmployeeStatus
[XmlEnum(Name = "Triple")]
Three
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute.Name Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute.Name Example/CS/source.cs
index 4e922906d5e..51a3f26fff4 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute.Name Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute.Name Example/CS/source.cs
@@ -13,5 +13,5 @@ public enum EmployeeStatus
[XmlEnum("Triple")]
Three
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute.XmlEnumAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute.XmlEnumAttribute Example/CS/source.cs
index 4703ee603e6..de0c7773738 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute.XmlEnumAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlEnumAttribute.XmlEnumAttribute Example/CS/source.cs
@@ -26,7 +26,7 @@ public static void Main()
test.DeserializeObject("OverrideEnum.xml");
}
- // Return an XmlSerializer used for overriding.
+ // Return an XmlSerializer used for overriding.
public XmlSerializer CreateOverrider()
{
// Create the XmlOverrides and XmlAttributes objects.
@@ -72,7 +72,7 @@ public void DeserializeObject(string filename)
{
XmlSerializer mySerializer = CreateOverrider();
FileStream fs = new FileStream(filename, FileMode.Open);
- Food myFood = (Food)
+ Food myFood = (Food)
mySerializer.Deserialize(fs);
Console.WriteLine(myFood.Type);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIgnoreAttribute.XmlIgnoreAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIgnoreAttribute.XmlIgnoreAttribute Example/CS/source.cs
index ce6e48f82a4..82a938adad8 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIgnoreAttribute.XmlIgnoreAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIgnoreAttribute.XmlIgnoreAttribute Example/CS/source.cs
@@ -13,5 +13,5 @@ public class Group
// The XmlSerializer serializes this field.
public string GroupName;
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIncludeAttribute.Type Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIncludeAttribute.Type Example/CS/source.cs
index 2bbe0ba2ae9..c7b0d782993 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIncludeAttribute.Type Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIncludeAttribute.Type Example/CS/source.cs
@@ -4,9 +4,9 @@
using System.Xml.Serialization;
public class Group
-{
+{
public Employee[] Employees;
-}
+}
// Instruct the XmlSerializer to accept Manager types as well.
[XmlInclude(typeof(Manager))]
@@ -34,7 +34,7 @@ public void SerializeObject(string filename)
XmlSerializer s = new XmlSerializer(typeof(Group));
TextWriter writer = new StreamWriter(filename);
Group group = new Group();
-
+
Manager manager = new Manager();
Employee emp1 = new Employee();
Employee emp2 = new Employee();
@@ -59,8 +59,8 @@ public void DeserializeObject(string filename)
XmlSerializer x = new XmlSerializer(typeof(Group));
Group g = (Group) x.Deserialize(fs);
Console.Write("Members:");
-
- foreach(Employee e in g.Employees)
+
+ foreach(Employee e in g.Employees)
{
Console.WriteLine("\t" + e.Name);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIncludeAttribute.XmlIncludeAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIncludeAttribute.XmlIncludeAttribute Example/CS/source.cs
index d83a599e921..0c6379c1fd5 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIncludeAttribute.XmlIncludeAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlIncludeAttribute.XmlIncludeAttribute Example/CS/source.cs
@@ -5,11 +5,11 @@
//
public class Vehicle{}
-
+
public class Car:Vehicle{}
-
+
public class Truck:Vehicle{}
-
+
public class Sample
{
[WebMethodAttribute]
@@ -21,5 +21,5 @@ public Vehicle ReturnVehicle(int i){
else
return new Truck();
}
-}
+}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source.cs
index 1e35d8c4b26..3f669fed74c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source.cs
@@ -1,24 +1,24 @@
//
using System;
using System.Messaging;
-
+
public class Server{
-
+
public static void Main(){
-
+
Console.WriteLine("Processing Orders");
-
+
string queuePath = ".\\orders";
EnsureQueueExists(queuePath);
MessageQueue queue = new MessageQueue(queuePath);
((XmlMessageFormatter)queue.Formatter).TargetTypeNames = new string[]{"Order"};
-
+
while(true){
Order newOrder = (Order)queue.Receive().Body;
newOrder.ShipItems();
}
}
-
+
// Creates the queue if it does not already exist.
public static void EnsureQueueExists(string path){
if(!MessageQueue.Exists(path)){
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source2.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source2.cs
index a9a1fd29b36..af2ba3f87b0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source2.cs
@@ -1,19 +1,19 @@
//
using System;
-
+
public class Order{
-
+
public int itemId;
public int quantity;
public string address;
-
+
public void ShipItems(){
-
+
Console.WriteLine("Order Placed:");
Console.WriteLine("\tItem ID : {0}",itemId);
Console.WriteLine("\tQuantity : {0}",quantity);
Console.WriteLine("\tShip To : {0}",address);
-
+
// Add order to the database.
/* Insert code here. */
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source3.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source3.cs
index 792ec08f7da..b080513907f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source3.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlMessageFormatter Example/CS/source3.cs
@@ -1,25 +1,25 @@
//
using System;
using System.Messaging;
-
+
class Client{
-
+
public static void Main(){
-
+
string queuePath = ".\\orders";
EnsureQueueExists(queuePath);
MessageQueue queue = new MessageQueue(queuePath);
-
+
Order orderRequest = new Order();
orderRequest.itemId = 1025;
orderRequest.quantity = 5;
orderRequest.address = "One Microsoft Way";
-
+
queue.Send(orderRequest);
// This line uses a new method you define on the Order class:
// orderRequest.PrintReceipt();
}
-
+
// Creates the queue if it does not already exist.
public static void EnsureQueueExists(string path){
if(!MessageQueue.Exists(path)){
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.Name Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.Name Example/CS/source.cs
index a9fb3e686b6..48b5bef67c9 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.Name Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.Name Example/CS/source.cs
@@ -12,6 +12,6 @@ private void serializer_UnknownNode
Console.WriteLine
("UnknownNode Name: " + e.Name);
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.NamespaceURI Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.NamespaceURI Example/CS/source.cs
index ecac7544f40..81b6e40e6fa 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.NamespaceURI Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.NamespaceURI Example/CS/source.cs
@@ -12,6 +12,6 @@ private void serializer_UnknownNode
Console.WriteLine
("UnknownNode Namespace URI: " + e.NamespaceURI);
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.NodeType Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.NodeType Example/CS/source.cs
index 15e01fd2a8f..689c25a6d86 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.NodeType Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.NodeType Example/CS/source.cs
@@ -12,6 +12,6 @@ private void serializer_UnknownNode
XmlNodeType myNodeType = e.NodeType;
Console.WriteLine(myNodeType);
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.ObjectBeingDeserialized Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.ObjectBeingDeserialized Example/CS/source.cs
index 8d6d9f1dc18..6f119a11313 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.ObjectBeingDeserialized Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.ObjectBeingDeserialized Example/CS/source.cs
@@ -10,9 +10,9 @@ private void serializer_UnknownNode
(object sender, XmlNodeEventArgs e)
{
object o = e.ObjectBeingDeserialized;
- Console.WriteLine("Object being deserialized: "
+ Console.WriteLine("Object being deserialized: "
+ o.ToString());
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.Text Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.Text Example/CS/source.cs
index 8c19c321b8f..7583ee357d8 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.Text Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventArgs.Text Example/CS/source.cs
@@ -12,6 +12,6 @@ private void serializer_UnknownNode
Console.WriteLine
("UnknownNode Text: " + e.Text);
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventHandler Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventHandler Example/CS/source.cs
index 288168c3d52..358ac46bc85 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventHandler Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlNodeEventHandler Example/CS/source.cs
@@ -7,7 +7,7 @@ public class Class1 {
//
private void DeserializeItem(string filename) {
- XmlSerializer mySerializer =
+ XmlSerializer mySerializer =
new XmlSerializer(typeof(ObjectToDeserialize));
// Add an instance of the delegate to the event.
mySerializer.UnknownNode += new XmlNodeEventHandler
@@ -16,10 +16,10 @@ private void DeserializeItem(string filename) {
FileStream fs = new FileStream(filename, FileMode.Open);
ObjectToDeserialize o = (ObjectToDeserialize)mySerializer.Deserialize(fs);
}
-
+
private void Serializer_UnknownNode
(object sender, XmlNodeEventArgs e) {
-
+
Console.WriteLine("UnknownNode Name: "
+ e.Name);
Console.WriteLine("UnknownNode LocalName: "
@@ -28,11 +28,11 @@ private void Serializer_UnknownNode
+ e.NamespaceURI);
Console.WriteLine("UnknownNode Text: "
+ e.Text);
-
+
object o = e.ObjectBeingDeserialized;
- Console.WriteLine("Object being deserialized "
+ Console.WriteLine("Object being deserialized "
+ o.ToString());
-
+
XmlNodeType myNodeType = e.NodeType;
Console.WriteLine(myNodeType);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute Example/CS/source.cs
index 2a0bf3b2a57..83ee8987a89 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute Example/CS/source.cs
@@ -5,9 +5,9 @@
using System.Xml.Schema;
using System.Xml.Serialization;
-[XmlRoot(Namespace = "www.contoso.com",
- ElementName = "MyGroupName",
- DataType = "string",
+[XmlRoot(Namespace = "www.contoso.com",
+ ElementName = "MyGroupName",
+ DataType = "string",
IsNullable=true)]
public class Group
{
@@ -16,12 +16,12 @@ public class Group
public Group()
{
}
-
+
public Group(string groupNameVal)
{
groupNameValue = groupNameVal;
}
-
+
public string GroupName
{
get{return groupNameValue;}
@@ -35,7 +35,7 @@ static void Main()
Test t = new Test();
t.SerializeGroup();
}
-
+
private void SerializeGroup()
{
// Create an instance of the Group class, and an
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.IsNullable Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.IsNullable Example/CS/source.cs
index b16e2c88949..a3e666fb6c3 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.IsNullable Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.IsNullable Example/CS/source.cs
@@ -7,9 +7,9 @@
// Apply the XmlRootAttribute and set the IsNullable property to false.
[XmlRoot(IsNullable = false)]
public class Group
-{
+{
public string Name;
-}
+}
public class Run
{
@@ -29,11 +29,11 @@ public void SerializeObject(string filename)
// Create the object to serialize.
Group mygroup = null;
-
+
// Serialize the object, and close the TextWriter.
s.Serialize(writer, mygroup);
writer.Close();
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.Namespace Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.Namespace Example/CS/source.cs
index a30ed0d5580..7eeeac036b3 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.Namespace Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.Namespace Example/CS/source.cs
@@ -9,5 +9,5 @@ public class Group
{
// Insert the members of the Group class.
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.XmlRootAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.XmlRootAttribute Example/CS/source.cs
index 44e624d8d99..65683472942 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.XmlRootAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlRootAttribute.XmlRootAttribute Example/CS/source.cs
@@ -9,7 +9,7 @@ public class MyClass
public string Name;
}
-public class Run
+public class Run
{
public static void Main()
{
@@ -46,8 +46,8 @@ public XmlSerializer CreateOverrider()
// Set the XmlRoot property to the XmlRoot object.
attrs.XmlRoot = xRoot;
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
-
- /* Add the XmlAttributes object to the
+
+ /* Add the XmlAttributes object to the
XmlAttributeOverrides object. */
xOver.Add(typeof(MyClass), attrs);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer Example/CS/source.cs
index 2d6bdf39756..e2332d70f4d 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer Example/CS/source.cs
@@ -4,28 +4,28 @@
using System.Xml.Serialization;
using System.IO;
-/* The XmlRootAttribute allows you to set an alternate name
- (PurchaseOrder) of the XML element, the element namespace; by
- default, the XmlSerializer uses the class name. The attribute
+/* The XmlRootAttribute allows you to set an alternate name
+ (PurchaseOrder) of the XML element, the element namespace; by
+ default, the XmlSerializer uses the class name. The attribute
also allows you to set the XML namespace for the element. Lastly,
- the attribute sets the IsNullable property, which specifies whether
- the xsi:null attribute appears if the class instance is set to
+ the attribute sets the IsNullable property, which specifies whether
+ the xsi:null attribute appears if the class instance is set to
a null reference. */
-[XmlRootAttribute("PurchaseOrder", Namespace="http://www.cpandl.com",
+[XmlRootAttribute("PurchaseOrder", Namespace="http://www.cpandl.com",
IsNullable = false)]
public class PurchaseOrder
{
public Address ShipTo;
- public string OrderDate;
+ public string OrderDate;
/* The XmlArrayAttribute changes the XML element name
from the default of "OrderedItems" to "Items". */
[XmlArrayAttribute("Items")]
public OrderedItem[] OrderedItems;
public decimal SubTotal;
public decimal ShipCost;
- public decimal TotalCost;
+ public decimal TotalCost;
}
-
+
public class Address
{
/* The XmlAttribute instructs the XmlSerializer to serialize the Name
@@ -35,15 +35,15 @@ public class Address
public string Name;
public string Line1;
- /* Setting the IsNullable property to false instructs the
- XmlSerializer that the XML attribute will not appear if
+ /* Setting the IsNullable property to false instructs the
+ XmlSerializer that the XML attribute will not appear if
the City field is set to a null reference. */
[XmlElementAttribute(IsNullable = false)]
public string City;
public string State;
public string Zip;
}
-
+
public class OrderedItem
{
public string ItemName;
@@ -59,7 +59,7 @@ public void Calculate()
LineTotal = UnitPrice * Quantity;
}
}
-
+
public class Test
{
public static void Main()
@@ -74,11 +74,11 @@ private void CreatePO(string filename)
{
// Create an instance of the XmlSerializer class;
// specify the type of object to serialize.
- XmlSerializer serializer =
+ XmlSerializer serializer =
new XmlSerializer(typeof(PurchaseOrder));
TextWriter writer = new StreamWriter(filename);
PurchaseOrder po=new PurchaseOrder();
-
+
// Create an address to ship and bill to.
Address billAddress = new Address();
billAddress.Name = "Teresa Atkinson";
@@ -89,7 +89,7 @@ private void CreatePO(string filename)
// Set ShipTo and BillTo to the same addressee.
po.ShipTo = billAddress;
po.OrderDate = System.DateTime.Now.ToLongDateString();
-
+
// Create an OrderedItem object.
OrderedItem i1 = new OrderedItem();
i1.ItemName = "Widget S";
@@ -97,7 +97,7 @@ private void CreatePO(string filename)
i1.UnitPrice = (decimal) 5.23;
i1.Quantity = 3;
i1.Calculate();
-
+
// Insert the item into the array.
OrderedItem [] items = {i1};
po.OrderedItems = items;
@@ -108,26 +108,26 @@ private void CreatePO(string filename)
subTotal += oi.LineTotal;
}
po.SubTotal = subTotal;
- po.ShipCost = (decimal) 12.51;
- po.TotalCost = po.SubTotal + po.ShipCost;
+ po.ShipCost = (decimal) 12.51;
+ po.TotalCost = po.SubTotal + po.ShipCost;
// Serialize the purchase order, and close the TextWriter.
serializer.Serialize(writer, po);
writer.Close();
}
-
+
protected void ReadPO(string filename)
{
// Create an instance of the XmlSerializer class;
// specify the type of object to be deserialized.
XmlSerializer serializer = new XmlSerializer(typeof(PurchaseOrder));
- /* If the XML document has been altered with unknown
- nodes or attributes, handle them with the
+ /* If the XML document has been altered with unknown
+ nodes or attributes, handle them with the
UnknownNode and UnknownAttribute events.*/
- serializer.UnknownNode+= new
+ serializer.UnknownNode+= new
XmlNodeEventHandler(serializer_UnknownNode);
- serializer.UnknownAttribute+= new
+ serializer.UnknownAttribute+= new
XmlAttributeEventHandler(serializer_UnknownAttribute);
-
+
// A FileStream is needed to read the XML document.
FileStream fs = new FileStream(filename, FileMode.Open);
// Declare an object variable of the type to be deserialized.
@@ -137,7 +137,7 @@ data from the XML document. */
po = (PurchaseOrder) serializer.Deserialize(fs);
// Read the order date.
Console.WriteLine ("OrderDate: " + po.OrderDate);
-
+
// Read the shipping address.
Address shipTo = po.ShipTo;
ReadAddress(shipTo, "Ship To:");
@@ -147,7 +147,7 @@ data from the XML document. */
foreach(OrderedItem oi in items)
{
Console.WriteLine("\t"+
- oi.ItemName + "\t" +
+ oi.ItemName + "\t" +
oi.Description + "\t" +
oi.UnitPrice + "\t" +
oi.Quantity + "\t" +
@@ -155,10 +155,10 @@ data from the XML document. */
}
// Read the subtotal, shipping cost, and total cost.
Console.WriteLine("\t\t\t\t\t Subtotal\t" + po.SubTotal);
- Console.WriteLine("\t\t\t\t\t Shipping\t" + po.ShipCost);
+ Console.WriteLine("\t\t\t\t\t Shipping\t" + po.ShipCost);
Console.WriteLine("\t\t\t\t\t Total\t\t" + po.TotalCost);
}
-
+
protected void ReadAddress(Address a, string label)
{
// Read the fields of the Address object.
@@ -181,7 +181,7 @@ private void serializer_UnknownAttribute
(object sender, XmlAttributeEventArgs e)
{
System.Xml.XmlAttribute attr = e.Attr;
- Console.WriteLine("Unknown attribute " +
+ Console.WriteLine("Unknown attribute " +
attr.Name + "='" + attr.Value + "'");
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Deserialize Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Deserialize Example/CS/source.cs
index 8b1193dad00..20a596e789d 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Deserialize Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Deserialize Example/CS/source.cs
@@ -22,7 +22,7 @@ public void Calculate()
LineTotal = UnitPrice * Quantity;
}
}
-
+
public class Test
{
public static void Main()
@@ -33,19 +33,19 @@ public static void Main()
}
private void DeserializeObject(string filename)
- {
+ {
Console.WriteLine("Reading with Stream");
// Create an instance of the XmlSerializer.
- XmlSerializer serializer =
+ XmlSerializer serializer =
new XmlSerializer(typeof(OrderedItem));
-
+
// Declare an object variable of the type to be deserialized.
OrderedItem i;
using (Stream reader = new FileStream(filename, FileMode.Open))
{
// Call the Deserialize method to restore the object's state.
- i = (OrderedItem)serializer.Deserialize(reader);
+ i = (OrderedItem)serializer.Deserialize(reader);
}
// Write out the properties of the object.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Deserialize1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Deserialize1 Example/CS/source.cs
index 7b645bab53b..6e800937d8d 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Deserialize1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Deserialize1 Example/CS/source.cs
@@ -23,7 +23,7 @@ public void Calculate()
LineTotal = UnitPrice * Quantity;
}
}
-
+
public class Test
{
public static void Main()
@@ -34,17 +34,17 @@ public static void Main()
}
private void DeserializeObject(string filename)
- {
+ {
Console.WriteLine("Reading with TextReader");
// Create an instance of the XmlSerializer specifying type.
- XmlSerializer serializer =
+ XmlSerializer serializer =
new XmlSerializer(typeof(OrderedItem));
- // Create a TextReader to read the file.
+ // Create a TextReader to read the file.
FileStream fs = new FileStream(filename, FileMode.OpenOrCreate);
TextReader reader = new StreamReader(fs);
-
+
// Declare an object variable of the type to be deserialized.
OrderedItem i;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.FromTypes Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.FromTypes Example/CS/source.cs
index 9fa4757496f..c5720027319 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.FromTypes Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.FromTypes Example/CS/source.cs
@@ -20,7 +20,7 @@ public class Piece
{
public string PieceName;
}
-
+
public class Test
{
public static void Main()
@@ -36,7 +36,7 @@ public void GetSerializers()
types[0] = typeof(Instrument);
types[1] = typeof(Player);
types[2] = typeof(Piece);
-
+
// Create an array for XmlSerializer objects.
XmlSerializer[]serializers= new XmlSerializer[3];
serializers = XmlSerializer.FromTypes(types);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize Example/CS/source.cs
index e7f62a19b15..d23e8c57205 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize Example/CS/source.cs
@@ -18,7 +18,7 @@ public void Calculate()
LineTotal = UnitPrice * Quantity;
}
}
-
+
public class Test{
public static void Main(string[] args)
{
@@ -26,12 +26,12 @@ public static void Main(string[] args)
// Write a purchase order.
t.SerializeObject("simple.xml");
}
-
+
private void SerializeObject(string filename)
{
Console.WriteLine("Writing With TextWriter");
-
- XmlSerializer serializer =
+
+ XmlSerializer serializer =
new XmlSerializer(typeof(OrderedItem));
OrderedItem i = new OrderedItem();
i.ItemName = "Widget";
@@ -39,7 +39,7 @@ private void SerializeObject(string filename)
i.Quantity = 10;
i.UnitPrice = (decimal) 2.30;
i.Calculate();
-
+
/* Create a StreamWriter to write with. First create a FileStream
object, and create the StreamWriter specifying an Encoding to use. */
FileStream fs = new FileStream(filename, FileMode.Create);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize1 Example/CS/source.cs
index 0672f1776e6..4b1183b94ff 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize1 Example/CS/source.cs
@@ -22,7 +22,7 @@ public void Calculate()
LineTotal = UnitPrice * Quantity;
}
}
-
+
public class Test{
public static void Main(string[] args)
{
@@ -30,12 +30,12 @@ public static void Main(string[] args)
// Write a purchase order.
t.SerializeObject("simple.xml");
}
-
+
private void SerializeObject(string filename)
{
Console.WriteLine("Writing With TextWriter");
// Create an XmlSerializer instance using the type.
- XmlSerializer serializer =
+ XmlSerializer serializer =
new XmlSerializer(typeof(OrderedItem));
OrderedItem i = new OrderedItem();
i.ItemName = "Widget";
@@ -43,16 +43,16 @@ private void SerializeObject(string filename)
i.Quantity = 10;
i.UnitPrice = (decimal) 2.30;
i.Calculate();
-
+
// Create an XmlSerializerNamespaces object.
- XmlSerializerNamespaces ns =
+ XmlSerializerNamespaces ns =
new XmlSerializerNamespaces();
// Add two namespaces with prefixes.
ns.Add("inventory", "http://www.cpandl.com");
ns.Add("money", "http://www.cohowinery.com");
// Create a StreamWriter to write with.
TextWriter writer = new StreamWriter(filename);
- /* Serialize using the object using the TextWriter
+ /* Serialize using the object using the TextWriter
and namespaces. */
serializer.Serialize(writer, i, ns);
writer.Close();
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize2 Example/CS/source.cs
index 65e158bd503..5c592f8c783 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize2 Example/CS/source.cs
@@ -18,7 +18,7 @@ public void Calculate()
LineTotal = UnitPrice * Quantity;
}
}
-
+
public class Test{
public static void Main(string[] args)
{
@@ -26,12 +26,12 @@ public static void Main(string[] args)
// Write a purchase order.
t.SerializeObject("simple.xml");
}
-
+
private void SerializeObject(string filename)
{
Console.WriteLine("Writing With Stream");
-
- XmlSerializer serializer =
+
+ XmlSerializer serializer =
new XmlSerializer(typeof(OrderedItem));
OrderedItem i = new OrderedItem();
i.ItemName = "Widget";
@@ -39,7 +39,7 @@ private void SerializeObject(string filename)
i.Quantity = 10;
i.UnitPrice = (decimal) 2.30;
i.Calculate();
-
+
// Create a FileStream to write with.
Stream writer = new FileStream(filename, FileMode.Create);
// Serialize the object, and close the TextWriter
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize3 Example/CS/source.cs
index a64ee3c54c8..0edfb0296cd 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize3 Example/CS/source.cs
@@ -22,20 +22,20 @@ public void Calculate() {
LineTotal = UnitPrice * Quantity;
}
}
-
+
public class Test {
-
+
public static void Main() {
Test t = new Test();
// Write a purchase order.
t.SerializeObject("simple.xml");
t.DeserializeObject("simple.xml");
}
-
+
private void SerializeObject(string filename) {
Console.WriteLine("Writing With Stream");
-
- XmlSerializer serializer =
+
+ XmlSerializer serializer =
new XmlSerializer(typeof(OrderedItem));
OrderedItem i = new OrderedItem();
@@ -44,7 +44,7 @@ private void SerializeObject(string filename) {
i.Quantity = 10;
i.UnitPrice = (decimal) 2.30;
i.Calculate();
-
+
// Create an XmlSerializerNamespaces object.
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
@@ -59,7 +59,7 @@ private void SerializeObject(string filename) {
serializer.Serialize(writer, i, ns);
writer.Close();
}
-
+
private void DeserializeObject(string filename) {
Console.WriteLine("Reading with Stream");
// Create an instance of the XmlSerializer.
@@ -67,11 +67,11 @@ private void DeserializeObject(string filename) {
// Writing the file requires a Stream.
Stream reader= new FileStream(filename,FileMode.Open);
-
+
// Declare an object variable of the type to be deserialized.
OrderedItem i;
- /* Use the Deserialize method to restore the object's state
+ /* Use the Deserialize method to restore the object's state
using data from the XML document. */
i = (OrderedItem) serializer.Deserialize(reader);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize4 Example/CS/source.cs
index b3d058146b4..16b8a67bb16 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize4 Example/CS/source.cs
@@ -19,7 +19,7 @@ public void Calculate()
LineTotal = UnitPrice * Quantity;
}
}
-
+
public class Test{
public static void Main()
{
@@ -27,12 +27,12 @@ public static void Main()
// Write a purchase order.
t.SerializeObject("simple.xml");
}
-
+
private void SerializeObject(string filename)
{
Console.WriteLine("Writing With XmlTextWriter");
-
- XmlSerializer serializer =
+
+ XmlSerializer serializer =
new XmlSerializer(typeof(OrderedItem));
OrderedItem i = new OrderedItem();
i.ItemName = "Widget";
@@ -42,12 +42,12 @@ private void SerializeObject(string filename)
i.Calculate();
// Create an XmlTextWriter using a FileStream.
Stream fs = new FileStream(filename, FileMode.Create);
- XmlWriter writer =
+ XmlWriter writer =
new XmlTextWriter(fs, Encoding.Unicode);
// Serialize using the XmlTextWriter.
serializer.Serialize(writer, i);
writer.Close();
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize5 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize5 Example/CS/source.cs
index bb595f58d14..1b0741569d9 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize5 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.Serialize5 Example/CS/source.cs
@@ -24,7 +24,7 @@ public void Calculate()
LineTotal = UnitPrice * Quantity;
}
}
-
+
public class Test{
public static void Main()
{
@@ -32,12 +32,12 @@ public static void Main()
// Write a purchase order.
t.SerializeObject("simple.xml");
}
-
+
private void SerializeObject(string filename)
{
Console.WriteLine("Writing With XmlTextWriter");
- XmlSerializer serializer =
+ XmlSerializer serializer =
new XmlSerializer(typeof(OrderedItem));
OrderedItem i = new OrderedItem();
i.ItemName = "Widget";
@@ -45,16 +45,16 @@ private void SerializeObject(string filename)
i.Quantity = 10;
i.UnitPrice = (decimal) 2.30;
i.Calculate();
-
+
// Create an XmlSerializerNamespaces object.
- XmlSerializerNamespaces ns =
+ XmlSerializerNamespaces ns =
new XmlSerializerNamespaces();
// Add two namespaces with prefixes.
ns.Add("inventory", "http://www.cpandl.com");
ns.Add("money", "http://www.cohowinery.com");
// Create an XmlTextWriter using a FileStream.
Stream fs = new FileStream(filename, FileMode.Create);
- XmlWriter writer =
+ XmlWriter writer =
new XmlTextWriter(fs, new UTF8Encoding());
// Serialize using the XmlTextWriter.
serializer.Serialize(writer, i, ns);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/CS/source.cs
index 3fee3a2a59e..ae1ee19cda9 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownAttribute Example/CS/source.cs
@@ -20,7 +20,7 @@ private void Serializer_UnknownAttribute(object sender, XmlAttributeEventArgs e)
Console.WriteLine("\t" + e.Attr.Name + " " + e.Attr.InnerXml);
Console.WriteLine("\t LineNumber: " + e.LineNumber);
Console.WriteLine("\t LinePosition: " + e.LinePosition);
-
+
Group x = (Group) e.ObjectBeingDeserialized;
Console.WriteLine (x.GroupName);
Console.WriteLine (sender.ToString());
@@ -35,4 +35,4 @@ private void DeserializeObject(string filename){
fs.Close();
}
}
- //
+ //
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownNode Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownNode Example/CS/source.cs
index 03939a29d77..d569bf3a27d 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownNode Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.UnknownNode Example/CS/source.cs
@@ -18,7 +18,7 @@ static void Main(){
private void DeserializeObject(string filename){
XmlSerializer mySerializer = new XmlSerializer(typeof(Group));
FileStream fs = new FileStream(filename, FileMode.Open);
- mySerializer.UnknownNode += new
+ mySerializer.UnknownNode += new
XmlNodeEventHandler(serializer_UnknownNode);
Group myGroup = (Group) mySerializer.Deserialize(fs);
fs.Close();
@@ -36,7 +36,7 @@ private void serializer_UnknownNode
XmlNodeType myNodeType = e.NodeType;
Console.WriteLine("NodeType: {0}", myNodeType);
-
+
Group myGroup = (Group) e.ObjectBeingDeserialized;
Console.WriteLine("GroupName: {0}", myGroup.GroupName);
Console.WriteLine();
@@ -44,9 +44,9 @@ private void serializer_UnknownNode
}
/* Paste this XML into a file named UnknownNodes:
-MyGroup
@@ -61,5 +61,5 @@ private void serializer_UnknownNode
-*/
+*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer Example/CS/source.cs
index d16b9e43277..f765a621f6f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer Example/CS/source.cs
@@ -1,5 +1,5 @@
//
-// Beginning of the HighSchool.dll
+// Beginning of the HighSchool.dll
namespace HighSchool
{
@@ -8,7 +8,7 @@ public class Student
public string Name;
public int ID;
}
-
+
public class MyClass
{
public Student[] Students;
@@ -20,7 +20,7 @@ namespace College
using System;
using System.IO;
using System.Xml;
- using System.Xml.Serialization;
+ using System.Xml.Serialization;
using HighSchool;
public class Graduate:HighSchool.Student
@@ -31,17 +31,17 @@ public Graduate(){}
// Use extra types to use this field.
public object[]Info;
}
-
+
public class Address
{
public string City;
}
-
+
public class Phone
{
public string Number;
}
-
+
public class Run
{
public static void Main()
@@ -50,43 +50,43 @@ public static void Main()
test.WriteOverriddenAttributes("College.xml");
test.ReadOverriddenAttributes("College.xml");
}
-
+
private void WriteOverriddenAttributes(string filename)
{
// Writing the file requires a TextWriter.
TextWriter myStreamWriter = new StreamWriter(filename);
// Create an XMLAttributeOverrides class.
- XmlAttributeOverrides attrOverrides =
+ XmlAttributeOverrides attrOverrides =
new XmlAttributeOverrides();
// Create the XmlAttributes class.
XmlAttributes attrs = new XmlAttributes();
/* Override the Student class. "Alumni" is the name
of the overriding element in the XML output. */
- XmlElementAttribute attr =
+ XmlElementAttribute attr =
new XmlElementAttribute("Alumni", typeof(Graduate));
/* Add the XmlElementAttribute to the collection of
elements in the XmlAttributes object. */
attrs.XmlElements.Add(attr);
- /* Add the XmlAttributes to the XmlAttributeOverrides.
+ /* Add the XmlAttributes to the XmlAttributeOverrides.
"Students" is the name being overridden. */
- attrOverrides.Add(typeof(HighSchool.MyClass),
+ attrOverrides.Add(typeof(HighSchool.MyClass),
"Students", attrs);
-
+
// Create array of extra types.
Type [] extraTypes = new Type[2];
extraTypes[0]=typeof(Address);
extraTypes[1]=typeof(Phone);
-
+
// Create an XmlRootAttribute.
XmlRootAttribute root = new XmlRootAttribute("Graduates");
-
- /* Create the XmlSerializer with the
+
+ /* Create the XmlSerializer with the
XmlAttributeOverrides object. */
XmlSerializer mySerializer = new XmlSerializer
(typeof(HighSchool.MyClass), attrOverrides, extraTypes,
root, "http://www.microsoft.com");
-
+
MyClass myClass= new MyClass();
Graduate g1 = new Graduate();
@@ -102,7 +102,7 @@ XmlAttributeOverrides object. */
Student[] myArray = {g1,g2};
myClass.Students = myArray;
-
+
// Create extra information.
Address a1 = new Address();
a1.City = "Ionia";
@@ -112,10 +112,10 @@ XmlAttributeOverrides object. */
p1.Number = "555-0101";
Phone p2 = new Phone();
p2.Number = "555-0100";
-
+
Object[]o1 = new Object[2]{a1, p1};
Object[]o2 = new Object[2]{a2,p2};
-
+
g1.Info = o1;
g2.Info = o2;
mySerializer.Serialize(myStreamWriter,myClass);
@@ -127,36 +127,36 @@ private void ReadOverriddenAttributes(string filename)
/* The majority of the code here is the same as that in the
WriteOverriddenAttributes method. Because the XML being read
doesn't conform to the schema defined by the DLL, the
- XMLAttributesOverrides must be used to create an
+ XMLAttributesOverrides must be used to create an
XmlSerializer instance to read the XML document.*/
-
- XmlAttributeOverrides attrOverrides = new
+
+ XmlAttributeOverrides attrOverrides = new
XmlAttributeOverrides();
XmlAttributes attrs = new XmlAttributes();
- XmlElementAttribute attr =
+ XmlElementAttribute attr =
new XmlElementAttribute("Alumni", typeof(Graduate));
attrs.XmlElements.Add(attr);
- attrOverrides.Add(typeof(HighSchool.MyClass),
+ attrOverrides.Add(typeof(HighSchool.MyClass),
"Students", attrs);
Type [] extraTypes = new Type[2];
extraTypes[0] = typeof(Address);
extraTypes[1] = typeof(Phone);
-
+
XmlRootAttribute root = new XmlRootAttribute("Graduates");
-
+
XmlSerializer readSerializer = new XmlSerializer
(typeof(HighSchool.MyClass), attrOverrides, extraTypes,
root, "http://www.microsoft.com");
- // A FileStream object is required to read the file.
+ // A FileStream object is required to read the file.
FileStream fs = new FileStream(filename, FileMode.Open);
-
+
MyClass myClass;
myClass = (MyClass) readSerializer.Deserialize(fs);
- /* Here is the difference between reading and writing an
- XML document: You must declare an object of the derived
+ /* Here is the difference between reading and writing an
+ XML document: You must declare an object of the derived
type (Graduate) and cast the Student instance to it.*/
Graduate g;
Address a;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer1 Example/CS/source.cs
index e761187b65c..ddfb9a01f88 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer1 Example/CS/source.cs
@@ -9,31 +9,31 @@ public class Class1 {
private void SerializeObject(string filename) {
XmlSerializer serializer = new XmlSerializer
(typeof(OrderedItem), "http://www.cpandl.com");
-
+
// Create an instance of the class to be serialized.
OrderedItem i = new OrderedItem();
-
+
// Insert code to set property values.
-
+
// Writing the document requires a TextWriter.
TextWriter writer = new StreamWriter(filename);
// Serialize the object, and close the TextWriter
serializer.Serialize(writer, i);
writer.Close();
}
-
+
private void DeserializeObject(string filename) {
XmlSerializer serializer = new XmlSerializer
(typeof(OrderedItem), "http://www.cpandl.com");
// A FileStream is needed to read the XML document.
FileStream fs = new FileStream(filename, FileMode.Open);
-
+
// Declare an object variable of the type to be deserialized.
OrderedItem i;
-
+
// Deserialize the object.
i = (OrderedItem) serializer.Deserialize(fs);
-
+
// Insert code to use the properties and methods of the object.
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer2 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer2 Example/CS/source.cs
index 3bbd7f8aeed..72ba0450e3a 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer2 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer2 Example/CS/source.cs
@@ -11,18 +11,18 @@ private void SerializeObject(string filename) {
xRoot.ElementName = "CustomRoot";
xRoot.Namespace = "http://www.cpandl.com";
xRoot.IsNullable = true;
-
+
// Construct the XmlSerializer with the XmlRootAttribute.
XmlSerializer serializer = new XmlSerializer
(typeof(OrderedItem),xRoot);
-
+
// Create an instance of the object to serialize.
OrderedItem i = new OrderedItem();
// Insert code to set properties of the ordered item.
-
+
// Writing the document requires a TextWriter.
TextWriter writer = new StreamWriter(filename);
-
+
serializer.Serialize(writer, i);
writer.Close();
}
@@ -33,10 +33,10 @@ private void DeserializeObject(string filename) {
xRoot.ElementName = "CustomRoot";
xRoot.Namespace = "http://www.cpandl.com";
xRoot.IsNullable = true;
-
+
XmlSerializer serializer = new XmlSerializer
(typeof(OrderedItem),xRoot);
-
+
// A FileStream is needed to read the XML document.
FileStream fs = new FileStream(filename, FileMode.Open);
// Deserialize the object.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer3 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer3 Example/CS/source.cs
index d9f25fb1599..47097510dd6 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer3 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer3 Example/CS/source.cs
@@ -6,7 +6,7 @@
// This defines the object that will be serialized.
public class Teacher
-{
+{
public string Name;
public Teacher(){}
/* Note that the Info field returns an array of objects.
@@ -16,10 +16,10 @@ object type to the array passed to the extraTypes argument. */
public object[] Info;
public Phone PhoneInfo;
}
-
+
// This defines one of the extra types to be included.
public class Address
-{
+{
public string City;
public Address(){}
@@ -52,7 +52,7 @@ public InternationalPhone(string countryCode)
CountryCode = countryCode;
}
}
-
+
public class Run
{
public static void Main()
@@ -61,12 +61,12 @@ public static void Main()
test.SerializeObject("Teacher.xml");
test.DeserializeObject("Teacher.xml");
}
-
+
private void SerializeObject(string filename)
{
// Writing the file requires a TextWriter.
TextWriter myStreamWriter = new StreamWriter(filename);
-
+
// Create a Type array.
Type [] extraTypes= new Type[3];
extraTypes[0] = typeof(Address);
@@ -76,22 +76,22 @@ private void SerializeObject(string filename)
// Create the XmlSerializer instance.
XmlSerializer mySerializer = new XmlSerializer
(typeof(Teacher),extraTypes);
-
+
Teacher teacher = new Teacher();
teacher.Name = "Mike";
// Add extra types to the Teacher object
object [] info = new object[2];
info[0] = new Address("Springville");
info[1] = new Phone("555-0100");
-
+
teacher.Info = info;
- teacher.PhoneInfo = new InternationalPhone("000");
+ teacher.PhoneInfo = new InternationalPhone("000");
mySerializer.Serialize(myStreamWriter,teacher);
myStreamWriter.Close();
}
-
+
private void DeserializeObject(string filename)
{
// Create a Type array.
@@ -103,15 +103,15 @@ private void DeserializeObject(string filename)
// Create the XmlSerializer instance.
XmlSerializer mySerializer = new XmlSerializer
(typeof(Teacher),extraTypes);
-
+
// Reading a file requires a FileStream.
FileStream fs = new FileStream(filename, FileMode.Open);
Teacher teacher = (Teacher) mySerializer.Deserialize(fs);
-
+
// Read the extra information.
Address a = (Address)teacher.Info[0];
Phone p = (Phone) teacher.Info[1];
- InternationalPhone Ip =
+ InternationalPhone Ip =
(InternationalPhone) teacher.PhoneInfo;
Console.WriteLine(teacher.Name);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer4 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer4 Example/CS/source.cs
index 75b3696cf09..53b1ddaf15d 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer4 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer4 Example/CS/source.cs
@@ -7,7 +7,7 @@ public class Student
public string Name;
public int ID;
}
-
+
public class MyClass
{
public Student[] Students;
@@ -19,7 +19,7 @@ namespace College
using System;
using System.IO;
using System.Xml;
- using System.Xml.Serialization;
+ using System.Xml.Serialization;
using HighSchool;
public class Graduate:HighSchool.Student
@@ -37,35 +37,35 @@ public static void Main()
test.WriteOverriddenAttributes("College.xml");
test.ReadOverriddenAttributes("College.xml");
}
-
+
private void WriteOverriddenAttributes(string filename)
{
// Writing the file requires a TextWriter.
TextWriter myStreamWriter = new StreamWriter(filename);
// Create an XMLAttributeOverrides class.
- XmlAttributeOverrides attrOverrides =
+ XmlAttributeOverrides attrOverrides =
new XmlAttributeOverrides();
// Create the XmlAttributes class.
XmlAttributes attrs = new XmlAttributes();
/* Override the Student class. "Alumni" is the name
of the overriding element in the XML output. */
- XmlElementAttribute attr =
+ XmlElementAttribute attr =
new XmlElementAttribute("Alumni", typeof(Graduate));
/* Add the XmlElementAttribute to the collection of
elements in the XmlAttributes object. */
attrs.XmlElements.Add(attr);
- /* Add the XmlAttributes to the XmlAttributeOverrides.
+ /* Add the XmlAttributes to the XmlAttributeOverrides.
"Students" is the name being overridden. */
- attrOverrides.Add(typeof(HighSchool.MyClass),
+ attrOverrides.Add(typeof(HighSchool.MyClass),
"Students", attrs);
-
- // Create the XmlSerializer.
+
+ // Create the XmlSerializer.
XmlSerializer mySerializer = new XmlSerializer
(typeof(HighSchool.MyClass), attrOverrides);
-
+
MyClass myClass = new MyClass();
Graduate g1 = new Graduate();
@@ -80,7 +80,7 @@ elements in the XmlAttributes object. */
Student[] myArray = {g1,g2};
myClass.Students = myArray;
-
+
mySerializer.Serialize(myStreamWriter, myClass);
myStreamWriter.Close();
}
@@ -90,30 +90,30 @@ private void ReadOverriddenAttributes(string filename)
/* The majority of the code here is the same as that in the
WriteOverriddenAttributes method. Because the XML being read
doesn't conform to the schema defined by the DLL, the
- XMLAttributesOverrides must be used to create an
+ XMLAttributesOverrides must be used to create an
XmlSerializer instance to read the XML document.*/
-
- XmlAttributeOverrides attrOverrides = new
+
+ XmlAttributeOverrides attrOverrides = new
XmlAttributeOverrides();
XmlAttributes attrs = new XmlAttributes();
- XmlElementAttribute attr =
+ XmlElementAttribute attr =
new XmlElementAttribute("Alumni", typeof(Graduate));
attrs.XmlElements.Add(attr);
- attrOverrides.Add(typeof(HighSchool.MyClass),
+ attrOverrides.Add(typeof(HighSchool.MyClass),
"Students", attrs);
XmlSerializer readSerializer = new XmlSerializer
(typeof(HighSchool.MyClass), attrOverrides);
- // To read the file, a FileStream object is required.
+ // To read the file, a FileStream object is required.
FileStream fs = new FileStream(filename, FileMode.Open);
-
+
MyClass myClass;
myClass = (MyClass) readSerializer.Deserialize(fs);
- /* Here is the difference between reading and writing an
- XML document: You must declare an object of the derived
+ /* Here is the difference between reading and writing an
+ XML document: You must declare an object of the derived
type (Graduate) and cast the Student instance to it.*/
Graduate g;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer6 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer6 Example/CS/source.cs
index 27f594d3fe6..38c8d888f9b 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer6 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializer.XmlSerializer6 Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Sample
//
private void SerializeObject(string filename)
{
- XmlSerializer serializer =
+ XmlSerializer serializer =
new XmlSerializer(typeof(OrderedItem));
// Create an instance of the class to be serialized.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces Example/CS/source.cs
index 118785a3fb1..019e40085d3 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces Example/CS/source.cs
@@ -3,7 +3,7 @@
using System.IO;
using System.Xml;
using System.Xml.Serialization;
-
+
public class Run
{
public static void Main()
@@ -11,7 +11,7 @@ public static void Main()
Run test = new Run();
test.SerializeObject("XmlNamespaces.xml");
}
-
+
public void SerializeObject(string filename)
{
XmlSerializer s = new XmlSerializer(typeof(Books));
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces.Add Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces.Add Example/CS/source.cs
index 01b1daccd03..5d50ba551d5 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces.Add Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces.Add Example/CS/source.cs
@@ -8,7 +8,7 @@ public class Sample
//
private XmlSerializerNamespaces AddNamespaces()
{
- XmlSerializerNamespaces xmlNamespaces =
+ XmlSerializerNamespaces xmlNamespaces =
new XmlSerializerNamespaces();
// Add three prefix-namespace pairs.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces.XmlSerializerNamespaces1 Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces.XmlSerializerNamespaces1 Example/CS/source.cs
index d14ee60f8b7..4e7fcd2796b 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces.XmlSerializerNamespaces1 Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlSerializerNamespaces.XmlSerializerNamespaces1 Example/CS/source.cs
@@ -8,12 +8,12 @@ public class Sample
//
private XmlSerializerNamespaces CreateFromQNames()
{
- XmlQualifiedName q1 =
+ XmlQualifiedName q1 =
new XmlQualifiedName("money", "http://www.cohowinery.com");
-
- XmlQualifiedName q2 =
+
+ XmlQualifiedName q2 =
new XmlQualifiedName("books", "http://www.cpandl.com");
-
+
XmlQualifiedName[] names = {q1, q2};
return new XmlSerializerNamespaces(names);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTextAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTextAttribute Example/CS/source.cs
index 3879dab2a10..e5818b8872f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTextAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTextAttribute Example/CS/source.cs
@@ -4,10 +4,10 @@
using System.IO;
public class Group1{
- // The XmlTextAttribute with type set to string informs the
+ // The XmlTextAttribute with type set to string informs the
// XmlSerializer that strings should be serialized as XML text.
[XmlText(typeof(string))]
- [XmlElement(typeof(int))]
+ [XmlElement(typeof(int))]
[XmlElement(typeof(double))]
public object [] All= new object []{321, "One", 2, 3.0, "Two" };
}
@@ -62,6 +62,6 @@ private void SerializeDateTime(string filename){
ser.Serialize(writer, myGroup);
writer.Close();
- }
+ }
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTextAttribute.XmlTextAttribute Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTextAttribute.XmlTextAttribute Example/CS/source.cs
index ad7b767d4be..90c3fa3dfd6 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTextAttribute.XmlTextAttribute Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTextAttribute.XmlTextAttribute Example/CS/source.cs
@@ -15,17 +15,17 @@ public static void Main() {
Test t = new Test();
t.SerializerOrder("TextOverride.xml");
}
- /* Create an instance of the XmlSerializer class that overrides
+ /* Create an instance of the XmlSerializer class that overrides
the default way it serializes an object. */
public XmlSerializer CreateOverrider() {
- /* Create instances of the XmlAttributes and
+ /* Create instances of the XmlAttributes and
XmlAttributeOverrides classes. */
-
+
XmlAttributes attrs = new XmlAttributes();
XmlAttributeOverrides xOver = new XmlAttributeOverrides();
-
- /* Create an XmlTextAttribute to override the default
+
+ /* Create an XmlTextAttribute to override the default
serialization process. */
XmlTextAttribute xText = new XmlTextAttribute();
attrs.XmlText = xText;
@@ -45,10 +45,10 @@ public void SerializerOrder(string filename) {
// Create the object and serialize it.
Group myGroup = new Group();
myGroup.Comment = "This is a great product.";
-
+
TextWriter writer = new StreamWriter(filename);
xSer.Serialize(writer, myGroup);
}
}
-
+
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTypeAttribute.TypeName Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTypeAttribute.TypeName Example/CS/source.cs
index bb593fe2525..162b8568cbe 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTypeAttribute.TypeName Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Classic XmlTypeAttribute.TypeName Example/CS/source.cs
@@ -14,7 +14,7 @@ public class Person {
public Job Position;
}
-[XmlType(TypeName = "Occupation",
+[XmlType(TypeName = "Occupation",
Namespace = "http://www.cohowinery.com")]
public class Job {
public string JobName;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ClassicTcpClient.PublicMethodsAndPropertiesExample/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ClassicTcpClient.PublicMethodsAndPropertiesExample/CS/source.cs
index 41089536faa..a2b64fba6c0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ClassicTcpClient.PublicMethodsAndPropertiesExample/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ClassicTcpClient.PublicMethodsAndPropertiesExample/CS/source.cs
@@ -16,7 +16,7 @@ public static void MyTcpClientConstructor (string myConstructorType)
IPAddress ipAddress = Dns.GetHostEntry (Dns.GetHostName ()).AddressList[0];
IPEndPoint ipLocalEndPoint = new IPEndPoint(ipAddress, 0);
TcpClient tcpClientA = new TcpClient (ipLocalEndPoint);
- //
+ //
}
else if (myConstructorType == "HostNameExample")
{
@@ -30,7 +30,7 @@ public static void MyTcpClientConstructor (string myConstructorType)
//
//Creates a TCPClient using the default constructor.
TcpClient tcpClientC = new TcpClient ();
- //
+ //
}
else
{
@@ -176,7 +176,7 @@ public static void MyTcpClientCommunicator ()
// Reads NetworkStream into a byte buffer.
byte[] bytes = new byte[tcpClient.ReceiveBufferSize];
- // Read can return anything from 0 to numBytesToRead.
+ // Read can return anything from 0 to numBytesToRead.
// This method blocks until at least one byte is read.
netStream.Read (bytes, 0, (int)tcpClient.ReceiveBufferSize);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ClientSponsor_Register/CS/ClientSponsor_Server.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ClientSponsor_Register/CS/ClientSponsor_Server.cs
index b72d87347f7..01a1a009ae2 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ClientSponsor_Register/CS/ClientSponsor_Server.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ClientSponsor_Register/CS/ClientSponsor_Server.cs
@@ -10,7 +10,7 @@ class HelloServer
{
static void Main()
{
-
+
RemotingConfiguration.Configure("Server.config");
Console.WriteLine("Server started.");
Console.WriteLine("Hit enter to terminate...");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Client.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Client.cs
index 16e432ab3f6..158e0f06622 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Client.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Client.cs
@@ -16,8 +16,8 @@ public static void Main()
RemotingConfiguration.Configure("channels.config");
RemotingConfiguration.Configure("client.exe.config");
- Foo server = new Foo();
- // Call share method.
+ Foo server = new Foo();
+ // Call share method.
server.PrintString("String logged to console.");
Console.WriteLine("Connected to server ...");
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Server.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Server.cs
index 28efe69c279..82b24965ae1 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Server.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Server.cs
@@ -12,10 +12,10 @@ public class Server
public static void Main()
{
RemotingConfiguration.Configure("channels.config");
- RemotingConfiguration.Configure("server.exe.config");
+ RemotingConfiguration.Configure("server.exe.config");
Console.WriteLine("Listening...");
-
+
String keyState = "";
while (String.Compare(keyState,"0", true) != 0)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Share.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Share.cs
index 66d10faeb2f..31d0f0e7daa 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Share.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/CommonTransportKeys_Share.cs
@@ -1,5 +1,5 @@
/*
- Supporting file: Common
+ Supporting file: Common
*/
using System;
@@ -8,7 +8,7 @@ public class Foo : MarshalByRefObject
{
// Print the string value.
public void PrintString(String str)
- {
+ {
Console.WriteLine("\n" + str);
}
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/commontransportkeys.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/commontransportkeys.cs
index 75ae132ff9a..dd1378cb6b5 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/commontransportkeys.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CommonTransportKeys/CS/commontransportkeys.cs
@@ -3,7 +3,7 @@
// System.Runtime.Remoting.Channels.CommonTransportKeys.ConnectionId
// System.Runtime.Remoting.Channels.CommonTransportKeys.RequestUri
-/*
+/*
This program demonstrates 'CommonTransportKeys' class and the static members 'IPAddress', 'ConnectionId',
'RequestUri'. 'LoggingClientChannelSinkProvider' and 'LoggingServerChannelSinkProvider' classes are
created which inherits'IClientChannelSinkProvider' and 'IServerChannelSinkProvider' respectively.
@@ -21,12 +21,12 @@ config config files.
using System.Security.Permissions;
namespace Logging
-{
+{
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class LoggingClientChannelSinkProvider : IClientChannelSinkProvider
{
private IClientChannelSinkProvider next1 = null;
- public IClientChannelSink CreateSink(IChannelSender channel1, String url1,
+ public IClientChannelSink CreateSink(IChannelSender channel1, String url1,
Object remoteChannelData)
{
IClientChannelSink localNextSink = null;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference/CS/contractreference.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference/CS/contractreference.cs
index 185f3b12b30..b1e70253e32 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference/CS/contractreference.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference/CS/contractreference.cs
@@ -2,9 +2,9 @@
/*
The following example demonstrates the 'ContractReference' class .
A new instance of 'ContractReference' class is obtained. The
- Contract reference object is added to the list of references
- contained within the discovery document and a '.disco' file is
- generated for the Webservice where the reference tags of
+ Contract reference object is added to the list of references
+ contained within the discovery document and a '.disco' file is
+ generated for the Webservice where the reference tags of
ContractReference are reflected.
*/
//
@@ -35,9 +35,9 @@ static void Main()
myBinding.Binding = new XmlQualifiedName("q1:Service1Soap");
myBinding.Address = "http://localhost/service1.asmx";
- // Add myContractReference to the list of references contained
+ // Add myContractReference to the list of references contained
// in the discovery document.
- myDiscoveryDocument.References.Add(myContractReference);
+ myDiscoveryDocument.References.Add(myContractReference);
// Add Binding to the references collection.
myDiscoveryDocument.References.Add(myBinding);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_Contract/CS/contractreference_contract.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_Contract/CS/contractreference_contract.cs
index e5e589e3888..160081816c0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_Contract/CS/contractreference_contract.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_Contract/CS/contractreference_contract.cs
@@ -1,10 +1,10 @@
// System.Web.Services.Discovery.ContractReference.Contract
-/*
+/*
The following example demonstrates the 'Contract' property of the 'ContractReference'
class.
- It creates an instance of 'DiscoveryDocument' class by reading from a disco file
+ It creates an instance of 'DiscoveryDocument' class by reading from a disco file
and gets the first reference to a service description in a 'ContractReference' instance.
- Using the 'Contract' property of the 'ContractReference' instance it creates a wsdl
+ Using the 'Contract' property of the 'ContractReference' instance it creates a wsdl
file which works as a service description file.
*/
@@ -25,11 +25,11 @@ static void Main()
try
{
// Create the file stream.
- FileStream discoStream =
+ FileStream discoStream =
new FileStream("Service1_CS.disco",FileMode.Open);
// Create the discovery document.
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
DiscoveryDocument.Read(discoStream);
// Get the first ContractReference in the collection.
@@ -38,7 +38,7 @@ static void Main()
// Set the client protocol.
myContractReference.ClientProtocol = new DiscoveryClientProtocol();
- myContractReference.ClientProtocol.Credentials =
+ myContractReference.ClientProtocol.Credentials =
CredentialCache.DefaultCredentials;
// Get the service description.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_DefaultFileName/CS/contractreference_defaultfilename.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_DefaultFileName/CS/contractreference_defaultfilename.cs
index 8fa49cfd230..6b80b7cb4eb 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_DefaultFileName/CS/contractreference_defaultfilename.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_DefaultFileName/CS/contractreference_defaultfilename.cs
@@ -2,8 +2,8 @@
// System.Web.Services.Discovery.ContractReference.Url
/*
- The following example demonstrates the 'DefaultFilename' and 'Url' properties of
- 'ContractReference' class. It gets the 'DiscoveryDocument' object using the
+ The following example demonstrates the 'DefaultFilename' and 'Url' properties of
+ 'ContractReference' class. It gets the 'DiscoveryDocument' object using the
'Discover' method of 'DiscoveryClientProtocol' class. It gets the 'ContractReference'
object by using the 'References' property of 'DiscoveryDocument' object.Then it displays the
'DefaultFileName' and 'Url' properties of 'ContractReference'.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ReadDocument/CS/contractreference_readdocument.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ReadDocument/CS/contractreference_readdocument.cs
index f27ff716b2f..d0d4d514bf3 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ReadDocument/CS/contractreference_readdocument.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ReadDocument/CS/contractreference_readdocument.cs
@@ -1,9 +1,9 @@
// System.Web.Services.Discovery.ContractReference.ReadDocument
-/*
- * The following example demonstrates the 'ReadDocument' method of the
+/*
+ * The following example demonstrates the 'ReadDocument' method of the
* 'ContractReference' class.
- * It creates an instance of 'ContractReference' class and calls the
- * 'ReadDocument' method passing a service description stream and get a
+ * It creates an instance of 'ContractReference' class and calls the
+ * 'ReadDocument' method passing a service description stream and get a
* 'ServiceDescription' instance.
*/
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_Reference/CS/contractreference_ref.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_Reference/CS/contractreference_ref.cs
index bd5f3806748..6778c1e3cef 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_Reference/CS/contractreference_ref.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_Reference/CS/contractreference_ref.cs
@@ -5,7 +5,7 @@
System.Web.Services.Discovery.ContractReference.Namespace
The following example demonstrates the constructor, the
- properties 'Ref', 'DocRef' and 'Namespace'. A sample discovery
+ properties 'Ref', 'DocRef' and 'Namespace'. A sample discovery
document is read and 'Ref', 'DocRef' and 'Namespace' properties
are displayed.
*/
@@ -26,12 +26,12 @@ public static void Main()
ContractReference myContractReference = new ContractReference();
//
XmlDocument myXmlDocument = new XmlDocument();
-
+
// Read the discovery document for the 'contractRef' tag.
myXmlDocument.Load("http://localhost/Discoverydoc.disco");
-
+
XmlNode myXmlRoot = myXmlDocument.FirstChild;
- XmlNode myXmlNode = myXmlRoot["scl:contractRef"];
+ XmlNode myXmlNode = myXmlRoot["scl:contractRef"];
XmlAttributeCollection myAttributeCollection = myXmlNode.Attributes;
myContractReference.Ref = myAttributeCollection[0].Value;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_WriteDocument/CS/contractreference_writedocument.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_WriteDocument/CS/contractreference_writedocument.cs
index 76238ca7579..23f8c210c3f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_WriteDocument/CS/contractreference_writedocument.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_WriteDocument/CS/contractreference_writedocument.cs
@@ -1,8 +1,8 @@
// System.Web.Services.Discovery.ContractReference.WriteDocument
/*
-The following example demonstrates the 'WriteDocument' method of
-'ContractReference' class. It creates a 'ContactReference' and a 'FileStream' object.
+The following example demonstrates the 'WriteDocument' method of
+'ContractReference' class. It creates a 'ContactReference' and a 'FileStream' object.
Then it gets the 'ServiceDescription' object corresponding to the 'test.wsdl' file.
Using the 'WriteDocument' method, the 'ServiceDescription' object is written into the
file stream.
@@ -22,7 +22,7 @@ static void Main()
{
//
ContractReference myContractReference = new ContractReference();
- FileStream myFileStream = new FileStream( "TestOutput_cs.wsdl",
+ FileStream myFileStream = new FileStream( "TestOutput_cs.wsdl",
FileMode.OpenOrCreate, FileAccess.Write );
// Get the ServiceDescription for the test .wsdl file.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ctor1/CS/contractreference_ctor1.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ctor1/CS/contractreference_ctor1.cs
index 19971632469..1fcdff747e6 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ctor1/CS/contractreference_ctor1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ctor1/CS/contractreference_ctor1.cs
@@ -1,9 +1,9 @@
// System.Web.Services.Discovery.ContractReference.ContractReference(string)
/*
-The following example demonstrates the constructor 'ContractReference(string)'
-of 'ContractReference' class. A 'DiscoveryDocument' object is created .The
-constructor initializes a new instance of 'ContractReference' using the supplied
-reference to a Service Description.The Contract reference object is added to the list
+The following example demonstrates the constructor 'ContractReference(string)'
+of 'ContractReference' class. A 'DiscoveryDocument' object is created .The
+constructor initializes a new instance of 'ContractReference' using the supplied
+reference to a Service Description.The Contract reference object is added to the list
of references contained within the discovery document. A '.disco' file is generated
for the webservice, where the reference tags of ContractReference are reflected.
*/
@@ -31,9 +31,9 @@ static void Main()
myBinding.Binding = new XmlQualifiedName("q1:Service1Soap");
myBinding.Address = "http://localhost/service1.asmx";
- // Add myContractReference to the list of references contained
+ // Add myContractReference to the list of references contained
// in the discovery document.
- myDiscoveryDocument.References.Add(myContractReference);
+ myDiscoveryDocument.References.Add(myContractReference);
myDiscoveryDocument.References.Add(myBinding);
// Open or create a file for writing.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ctor2/CS/contractreference_ctor2.cs b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ctor2/CS/contractreference_ctor2.cs
index 8f864c05aec..5c985d8e690 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ctor2/CS/contractreference_ctor2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/ContractReference_ctor2/CS/contractreference_ctor2.cs
@@ -1,11 +1,11 @@
// System.Web.Services.Discovery.ContractReference.ContractReference(string,string)
/*
- The following example demonstrates the constructor 'ContractReference(string,string)'
+ The following example demonstrates the constructor 'ContractReference(string,string)'
of 'ContractReference' class. In this example the 'ContractReference' class constructor
initializes a new instance of the 'ContractReference' class using the supplied references
to a service description and a XML Web service implementing the service description.The
- Contract reference object is added to the list of references contained within the
- discovery document and a '.disco' file is generated for the webservice where the
+ Contract reference object is added to the list of references contained within the
+ discovery document and a '.disco' file is generated for the webservice where the
reference tags of ContractReference are reflected.
*/
using System;
@@ -22,7 +22,7 @@ static void Main()
// Get a DiscoveryDocument.
DiscoveryDocument myDiscoveryDocument = new DiscoveryDocument();
//
- // Create a ContractReference using a service description and
+ // Create a ContractReference using a service description and
// an XML Web service.
ContractReference myContractReference = new ContractReference
("http://localhost/Service1.asmx?wsdl",
@@ -32,7 +32,7 @@ static void Main()
myBinding.Binding = new XmlQualifiedName("q1:Service1Soap");
myBinding.Address = "http://localhost/service1.asmx";
- // Add myContractReference to the list of references contained
+ // Add myContractReference to the list of references contained
// in the discovery document.
myDiscoveryDocument.References.Add(myContractReference);
myDiscoveryDocument.References.Add(myBinding);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_1/CS/CookiesPage.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_1/CS/CookiesPage.cs
index 9772b171677..7cc08f29274 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_1/CS/CookiesPage.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_1/CS/CookiesPage.cs
@@ -1,10 +1,10 @@
/*
-** This program is used as the server for
-** the programs demonstrating the use of
-** cookies. If the initial request from the
+** This program is used as the server for
+** the programs demonstrating the use of
+** cookies. If the initial request from the
** client has cookies, the server uses these
** cookies to generate a page structured with
-** the information provided. Otherwise the
+** the information provided. Otherwise the
** server sends a page to the client requesting
** some information, this information is used
** to structure the subsequent page that is sent
@@ -85,9 +85,9 @@ private void GenerateCookies(Object Sender, EventArgs e) {
myHttpCookie.Expires = DateTime.Now.AddHours(-12);
myHttpCookie.Secure = false;
Response.Cookies.Add(myHttpCookie);
- Response.Write(Request.Form["UserName"] +
- " , was born on " +
- Request.Form["DateOfBirth"] +
+ Response.Write(Request.Form["UserName"] +
+ " , was born on " +
+ Request.Form["DateOfBirth"] +
" at " +
Request.Form["PlaceOfBirth"]);
}
@@ -100,10 +100,10 @@ private void GenerateCookies(Object Sender, EventArgs e) {
}
// Compose a page with the information in the cookies sent over.
else {
- Response.Write(Request.Cookies["UserName"].Value +
- " , was born on " +
- Request.Cookies["DateOfBirth"].Value +
- " at " +
+ Response.Write(Request.Cookies["UserName"].Value +
+ " , was born on " +
+ Request.Cookies["DateOfBirth"].Value +
+ " at " +
Request.Cookies["PlaceOfBirth"].Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_1/CS/cookiecollection_item_1.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_1/CS/cookiecollection_item_1.cs
index 9841a0351d3..b64f725a49a 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_1/CS/cookiecollection_item_1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_1/CS/cookiecollection_item_1.cs
@@ -4,12 +4,12 @@
This program uses an internal site called "CookiesServer.aspx". The program creates a 'HttpWebRequest'
object with the 'URL' taken from command line argument. When no cookies are initially sent to
the server, it responds with a specific page querying the client for information. The client queries
- this information from the user and sends it to the server in the second request. This information is
+ this information from the user and sends it to the server in the second request. This information is
used by the server to not only structure the page sent subsequently but also construct some cookies to be
- set by the client, for future requests. The response and the cookies that are sent from the server are
+ set by the client, for future requests. The response and the cookies that are sent from the server are
displayed to the console.
- Note: This program requires the "CookiesServer.aspx" server to be running before the execution of this
+ Note: This program requires the "CookiesServer.aspx" server to be running before the execution of this
program.Please refer the "ReadmeCookiesServer.txt" file for setting up the server.
*/
@@ -29,11 +29,11 @@ public static void Main(String[] args) {
}
GetPage(new Uri(args[0]));
}
- catch(UriFormatException e)
+ catch(UriFormatException e)
{
Console.WriteLine("UriFormatException raised.\nError : " + e.Message);
}
- catch(Exception e)
+ catch(Exception e)
{
Console.WriteLine("Exception raised.\nError : " + e.Message);
}
@@ -69,9 +69,9 @@ public static void GetPage(Uri requestUri) {
Console.Write("\nPlaceOfBirth : ");
placeBirth = Console.ReadLine();
Console.WriteLine("");
- output = asciiEncoding.GetBytes("UserName=" + usrName +
+ output = asciiEncoding.GetBytes("UserName=" + usrName +
"&DateOfBirth=" + convertDate +
- "&PlaceOfBirth=" + placeBirth +
+ "&PlaceOfBirth=" + placeBirth +
"&__EVENTTARGET=PlaceOfBirth&__EVENTARGUMENT=");
myHttpWebRequest.ContentLength = output.Length;
myStream = myHttpWebRequest.GetRequestStream();
@@ -109,9 +109,9 @@ public static void DisplayCookies(CookieCollection cookies) {
//
//
// Get the cookies in the 'CookieCollection' object using the 'Item' property.
- // The 'Item' property in C# is implemented through Indexers.
- // The class that implements indexers is usually a collection of other objects.
- // This class provides access to those objects with the '[i]' syntax.
+ // The 'Item' property in C# is implemented through Indexers.
+ // The class that implements indexers is usually a collection of other objects.
+ // This class provides access to those objects with the '[i]' syntax.
try {
if(cookies.Count == 0) {
Console.WriteLine("No cookies to display");
@@ -128,7 +128,7 @@ public static void DisplayCookies(CookieCollection cookies) {
//
//
}
- public static void printUsage()
+ public static void printUsage()
{
Console.WriteLine("Usage : ");
Console.WriteLine("CookieCollection_Item_1 ");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_2/CS/CookiesPage.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_2/CS/CookiesPage.cs
index 9772b171677..7cc08f29274 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_2/CS/CookiesPage.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_2/CS/CookiesPage.cs
@@ -1,10 +1,10 @@
/*
-** This program is used as the server for
-** the programs demonstrating the use of
-** cookies. If the initial request from the
+** This program is used as the server for
+** the programs demonstrating the use of
+** cookies. If the initial request from the
** client has cookies, the server uses these
** cookies to generate a page structured with
-** the information provided. Otherwise the
+** the information provided. Otherwise the
** server sends a page to the client requesting
** some information, this information is used
** to structure the subsequent page that is sent
@@ -85,9 +85,9 @@ private void GenerateCookies(Object Sender, EventArgs e) {
myHttpCookie.Expires = DateTime.Now.AddHours(-12);
myHttpCookie.Secure = false;
Response.Cookies.Add(myHttpCookie);
- Response.Write(Request.Form["UserName"] +
- " , was born on " +
- Request.Form["DateOfBirth"] +
+ Response.Write(Request.Form["UserName"] +
+ " , was born on " +
+ Request.Form["DateOfBirth"] +
" at " +
Request.Form["PlaceOfBirth"]);
}
@@ -100,10 +100,10 @@ private void GenerateCookies(Object Sender, EventArgs e) {
}
// Compose a page with the information in the cookies sent over.
else {
- Response.Write(Request.Cookies["UserName"].Value +
- " , was born on " +
- Request.Cookies["DateOfBirth"].Value +
- " at " +
+ Response.Write(Request.Cookies["UserName"].Value +
+ " , was born on " +
+ Request.Cookies["DateOfBirth"].Value +
+ " at " +
Request.Cookies["PlaceOfBirth"].Value);
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_2/CS/cookiecollection_item_2.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_2/CS/cookiecollection_item_2.cs
index 907d4e9da94..fe9d49535db 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_2/CS/cookiecollection_item_2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CookieCollection_Item_2/CS/cookiecollection_item_2.cs
@@ -4,12 +4,12 @@
This program uses an internal site called "CookiesServer.aspx". The program creates a 'HttpWebRequest'
object with the 'URL' taken from command line argument. When no cookies are initially sent to
the server, it responds with a specific page querying the client for information. The client queries
- this information from the user and sends it to the server in the second request. This information is
+ this information from the user and sends it to the server in the second request. This information is
used by the server to not only structure the page sent subsequently but also construct some cookies to be
- set by the client, for future requests. The response and the cookies that are sent from the server are
+ set by the client, for future requests. The response and the cookies that are sent from the server are
displayed to the console.
- Note: This program requires the "CookiesServer.aspx" server to be running before the execution of this
+ Note: This program requires the "CookiesServer.aspx" server to be running before the execution of this
program.Please refer the "ReadmeCookiesServer.txt" file for setting up the server.
*/
@@ -29,11 +29,11 @@ public static void Main(String[] args) {
}
GetPage(new Uri(args[0]));
}
- catch(UriFormatException e)
+ catch(UriFormatException e)
{
Console.WriteLine("UriFormatException raised.\nError : " + e.Message);
}
- catch(Exception e)
+ catch(Exception e)
{
Console.WriteLine("Exception raised.\nError : " + e.Message);
}
@@ -69,9 +69,9 @@ public static void GetPage(Uri requestUri) {
Console.Write("\nPlaceOfBirth : ");
placeBirth = Console.ReadLine();
Console.WriteLine("");
- output = asciiEncoding.GetBytes("UserName=" + usrName +
+ output = asciiEncoding.GetBytes("UserName=" + usrName +
"&DateOfBirth=" + convertDate +
- "&PlaceOfBirth=" + placeBirth +
+ "&PlaceOfBirth=" + placeBirth +
"&__EVENTTARGET=PlaceOfBirth&__EVENTARGUMENT=");
myHttpWebRequest.ContentLength = output.Length;
myStream = myHttpWebRequest.GetRequestStream();
@@ -108,9 +108,9 @@ public static void GetPage(Uri requestUri) {
public static void DisplayCookies(CookieCollection cookies) {
//
// Get the cookies in the 'CookieCollection' object using the 'Item' property.
- // The 'Item' property in C# is implemented through Indexers.
- // The class that implements indexers is usually a collection of other objects.
- // This class provides access to those objects with the '[i]' syntax.
+ // The 'Item' property in C# is implemented through Indexers.
+ // The class that implements indexers is usually a collection of other objects.
+ // This class provides access to those objects with the '[i]' syntax.
try {
if(cookies.Count == 0) {
Console.WriteLine("No cookies to display");
@@ -125,7 +125,7 @@ public static void DisplayCookies(CookieCollection cookies) {
}
//
}
- public static void printUsage()
+ public static void printUsage()
{
Console.WriteLine("Usage : ");
Console.WriteLine("CookieCollection_Item_2 ");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CreateObjRef/CS/example.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CreateObjRef/CS/example.cs
index 857bca9de85..4d2360b4170 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CreateObjRef/CS/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CreateObjRef/CS/example.cs
@@ -13,20 +13,20 @@ public static void Main() {
ChannelServices.RegisterChannel(new HttpChannel(8090));
- RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteObject),
- "RemoteObject",
+ RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteObject),
+ "RemoteObject",
WellKnownObjectMode.Singleton);
- RemoteObject RObj =
- (RemoteObject)Activator.GetObject(typeof(RemoteObject),
+ RemoteObject RObj =
+ (RemoteObject)Activator.GetObject(typeof(RemoteObject),
"http://localhost:8090/RemoteObject");
-
+
LocalObject LObj = new LocalObject();
-
+
RObj.Method1( LObj );
Console.WriteLine("Press Return to exit...");
-
+
Console.ReadLine();
}
}
@@ -44,7 +44,7 @@ public void Method1(LocalObject param) {
// a custom ObjRef class that outputs its status
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class MyObjRef : ObjRef {
-
+
// only instantiate via marshaling or deserialization
private MyObjRef() { }
@@ -74,7 +74,7 @@ public override Object GetRealObject(StreamingContext context) {
Console.WriteLine("Returning proxy to remote object.");
return RemotingServices.Unmarshal(this);
}
- }
+ }
public void ORDump() {
@@ -83,13 +83,13 @@ public void ORDump() {
Console.WriteLine("URI is {0}.", URI);
Console.WriteLine("\nWriting EnvoyInfo: ");
-
+
if ( EnvoyInfo != null) {
IMessageSink EISinks = EnvoyInfo.EnvoySinks;
while (EISinks != null) {
- Console.WriteLine("\tSink: " + EISinks.ToString());
+ Console.WriteLine("\tSink: " + EISinks.ToString());
EISinks = EISinks.NextSink;
}
}
@@ -101,7 +101,7 @@ public void ORDump() {
Console.WriteLine("\nWriting ChannelInfo: ");
for (int i = 0; i < ChannelInfo.ChannelData.Length; i++)
Console.WriteLine ("\tChannel: {0}", ChannelInfo.ChannelData[i]);
-
+
Console.WriteLine(" ----------------------------- ");
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CreateObjRef2/CS/example.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CreateObjRef2/CS/example.cs
index b2c598eac79..274fbcc5eff 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CreateObjRef2/CS/example.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CreateObjRef2/CS/example.cs
@@ -14,19 +14,19 @@ public static void Main() {
ChannelServices.RegisterChannel(new HttpChannel(8090));
- WellKnownServiceTypeEntry wkste =
- new WellKnownServiceTypeEntry(typeof(RemoteObject),
- "RemoteObject",
+ WellKnownServiceTypeEntry wkste =
+ new WellKnownServiceTypeEntry(typeof(RemoteObject),
+ "RemoteObject",
WellKnownObjectMode.Singleton);
-
+
RemotingConfiguration.RegisterWellKnownServiceType( wkste );
- RemoteObject RObj =
- (RemoteObject)Activator.GetObject(typeof(RemoteObject),
+ RemoteObject RObj =
+ (RemoteObject)Activator.GetObject(typeof(RemoteObject),
"http://localhost:8090/RemoteObject");
LocalObject LObj = new LocalObject();
-
+
RObj.Method1( LObj );
Console.WriteLine("Press Return to exit...");
@@ -34,7 +34,7 @@ public static void Main() {
}
}
-[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
+[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class RemoteObject : MarshalByRefObject {
public void Method1(LocalObject param) {
@@ -47,7 +47,7 @@ public void Method1(LocalObject param) {
// a custom ObjRef class that outputs its status
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class MyObjRef : ObjRef {
-
+
// only instantiate using marshaling or deserialization
private MyObjRef() { }
@@ -77,7 +77,7 @@ public override Object GetRealObject(StreamingContext context) {
Console.WriteLine("Returning proxy to remote object.");
return RemotingServices.Unmarshal(this);
}
- }
+ }
public void ORDump() {
@@ -87,10 +87,10 @@ public void ORDump() {
Console.WriteLine("\nWriting EnvoyInfo: ");
if ( EnvoyInfo != null) {
-
+
IMessageSink EISinks = EnvoyInfo.EnvoySinks;
while (EISinks != null) {
- Console.WriteLine("\tSink: " + EISinks.ToString());
+ Console.WriteLine("\tSink: " + EISinks.ToString());
EISinks = EISinks.NextSink;
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_Add_Remove/CS/credentialcache_add_remove.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_Add_Remove/CS/credentialcache_add_remove.cs
index 9eb65dc88e3..b99550ad117 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_Add_Remove/CS/credentialcache_add_remove.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_Add_Remove/CS/credentialcache_add_remove.cs
@@ -2,8 +2,8 @@
// System.Net.CredentialCache.Remove;System.Net.CredentialCache.
/*This program demontrates the 'Remove' method, 'Add' method and 'CredentialCache'
-constructor of the 'CredentialCache' class.It takes an URL creates a 'WebRequest' object for the Url.
-The program stores a known set of credentials in a credential cache and removes a credential when it
+constructor of the 'CredentialCache' class.It takes an URL creates a 'WebRequest' object for the Url.
+The program stores a known set of credentials in a credential cache and removes a credential when it
is no longer needed.
*/
@@ -11,8 +11,8 @@ is no longer needed.
using System.Net;
class CredentialCacheSnippet {
- public static void Main(string[] args)
- {
+ public static void Main(string[] args)
+ {
if (args.Length <4) {
Console.WriteLine("\n Usage:");
Console.WriteLine("\n CredentialCache_Add_Remove ");
@@ -22,31 +22,31 @@ public static void Main(string[] args)
else{
Console.WriteLine("\nInvalid arguments.");
return;
- }
+ }
Console.WriteLine(" Press any key to continue...");Console.ReadLine();
return;
}
public static void GetPage(string url,string userName,string password,string domainName)
{
- try
+ try
{
//
//
CredentialCache myCredentialCache = new CredentialCache();
// Used Dummy names as credentials. They are to be replaced by credentials applicable locally.
- myCredentialCache.Add(new Uri("http://www.microsoft.com/"),"Basic", new NetworkCredential("user1","passwd1","domain1"));
+ myCredentialCache.Add(new Uri("http://www.microsoft.com/"),"Basic", new NetworkCredential("user1","passwd1","domain1"));
myCredentialCache.Add(new Uri("http://www.msdn.com/"),"Basic", new NetworkCredential("user2","passwd2","domain2"));
- myCredentialCache.Add(new Uri(url),"Basic", new NetworkCredential(userName,password,domainName));
+ myCredentialCache.Add(new Uri(url),"Basic", new NetworkCredential(userName,password,domainName));
Console.WriteLine("\nAdded your credentials to the program's CredentialCache");
//
//
- // Create a webrequest with the specified url.
- WebRequest myWebRequest = WebRequest.Create(url);
+ // Create a webrequest with the specified url.
+ WebRequest myWebRequest = WebRequest.Create(url);
myWebRequest.Credentials = myCredentialCache;
Console.WriteLine("\nLinked CredentialCache to your request.");
// Send the request and wait for response.
- WebResponse myWebResponse = myWebRequest.GetResponse();
+ WebResponse myWebResponse = myWebRequest.GetResponse();
//
// Process response here.
@@ -55,19 +55,19 @@ public static void GetPage(string url,string userName,string password,string dom
// Call 'Remove' method to dispose credentials for current Uri as not required further.
myCredentialCache.Remove(myWebRequest.RequestUri,"Basic");
Console.WriteLine("\nYour credentials have now been removed from the program's CredentialCache");
- myWebResponse.Close();
+ myWebResponse.Close();
//
- }
- catch(WebException e)
+ }
+ catch(WebException e)
{
if (e.Response != null)
- Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",((HttpWebResponse)(e.Response)).StatusDescription);
+ Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",((HttpWebResponse)(e.Response)).StatusDescription);
else
- Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",e.Status);
+ Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",e.Status);
}
catch(Exception e)
{
Console.WriteLine("\nThe following exception was raised : {0}",e.Message);
}
- }
+ }
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_DefaultCredentials/CS/credentialcache_defaultcredentials.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_DefaultCredentials/CS/credentialcache_defaultcredentials.cs
index ab88ec173af..0a8016b1e87 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_DefaultCredentials/CS/credentialcache_defaultcredentials.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_DefaultCredentials/CS/credentialcache_defaultcredentials.cs
@@ -1,17 +1,17 @@
// System.Net.CredentialCache.DefaultCredentials.
-/* This program demonstrates the 'DefaultCredentials' property of the 'CredentialCache'
+/* This program demonstrates the 'DefaultCredentials' property of the 'CredentialCache'
class.
Creates an 'HttpWebRequest' object to access the local Uri "http://localhost"(IIS documentation start page)
Assigns the static property 'DefaultCredentials' of 'CredentialCache' as 'Credentials' for the 'HttpWebRequest'
- object. DefaultCredentials returns the system credentials for the current security context in which
- the application is running. For a client-side application, these are usually the Windows credentials
+ object. DefaultCredentials returns the system credentials for the current security context in which
+ the application is running. For a client-side application, these are usually the Windows credentials
(user name, password, and domain) of the user running the application.
These credentials are used internally to authenticate the request.
- The html contents of the start page are displayed to the console.
+ The html contents of the start page are displayed to the console.
Note: Make sure that "Windows Authentication" has been set as Directory Security settings
- for default web site in IIS
+ for default web site in IIS
*/
using System;
@@ -21,19 +21,19 @@ The html contents of the start page are displayed to the console.
class CredentialCache_DefaultCredentials
{
- public static void Main()
+ public static void Main()
{
- try
- {
-//
+ try
+ {
+//
// Ensure Directory Security settings for default web site in IIS is "Windows Authentication".
string url = "http://localhost";
- // Create a 'HttpWebRequest' object with the specified url.
- HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
+ // Create a 'HttpWebRequest' object with the specified url.
+ HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
// Assign the credentials of the logged in user or the user being impersonated.
myHttpWebRequest.Credentials = CredentialCache.DefaultCredentials;
- // Send the 'HttpWebRequest' and wait for response.
- HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
+ // Send the 'HttpWebRequest' and wait for response.
+ HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Console.WriteLine("Authentication successful");
Console.WriteLine("Response received successfully");
//
@@ -41,14 +41,14 @@ public static void Main()
// Get the stream associated with the response object.
Stream receiveStream = myHttpWebResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
- // Pipe the stream to a higher level stream reader with the required encoding format.
+ // Pipe the stream to a higher level stream reader with the required encoding format.
StreamReader readStream = new StreamReader( receiveStream, encode );
Console.WriteLine("\r\nResponse stream received");
Char[] read = new Char[256];
- // Read 256 characters at a time.
+ // Read 256 characters at a time.
int count = readStream.Read( read, 0, 256 );
Console.WriteLine("HTML...\r\n");
- while (count > 0)
+ while (count > 0)
{
// Dump the 256 characters on a string and display the string onto the console.
String output = new String(read, 0, count);
@@ -60,10 +60,10 @@ public static void Main()
myHttpWebResponse.Close();
// Release the resources of stream object.
readStream.Close();
- }
- catch(WebException e)
+ }
+ catch(WebException e)
{
- Console.WriteLine("\r\nException Raised. The following error occurred : {0}",e.Message);
+ Console.WriteLine("\r\nException Raised. The following error occurred : {0}",e.Message);
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_GetCredential/CS/credentialcache_getcredential.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_GetCredential/CS/credentialcache_getcredential.cs
index c55c17a997d..d3cec30d602 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_GetCredential/CS/credentialcache_getcredential.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_GetCredential/CS/credentialcache_getcredential.cs
@@ -1,6 +1,6 @@
// System.Net.CredentialCache.GetCredential
-/*This program demontrates the 'GetCredential' method of the CredentialCache class.It takes an URL
+/*This program demontrates the 'GetCredential' method of the CredentialCache class.It takes an URL
creates a 'WebRequest' object for the Url. The program stores a known set of credentials in a credential cache.
'GetCredential' will then retrieve the credentials for the requested Uri.*/
@@ -9,7 +9,7 @@
using System.Collections;
class CredentialCacheSnippet {
- public static void Main(string[] args)
+ public static void Main(string[] args)
{
if (args.Length <4) {
Console.WriteLine("\n Usage:");
@@ -20,7 +20,7 @@ public static void Main(string[] args)
else{
Console.WriteLine("\nInvalid arguments.");
return;
- }
+ }
Console.WriteLine("Press any key to continue...");Console.ReadLine();
return;
}
@@ -28,34 +28,34 @@ public static void Main(string[] args)
//
public static void GetPage(string url,string userName,string password,string domainName)
{
- try
+ try
{
CredentialCache myCredentialCache = new CredentialCache();
- // Dummy names used as credentials.
+ // Dummy names used as credentials.
myCredentialCache.Add(new Uri("http://microsoft.com/"),"Basic", new NetworkCredential("user1","passwd1","domain1"));
myCredentialCache.Add(new Uri("http://msdn.com/"),"Basic", new NetworkCredential("user2","passwd2","domain2"));
myCredentialCache.Add(new Uri(url),"Basic", new NetworkCredential(userName,password,domainName));
// Create a webrequest with the specified url.
- WebRequest myWebRequest = WebRequest.Create(url);
+ WebRequest myWebRequest = WebRequest.Create(url);
// Call 'GetCredential' to obtain the credentials specific to our Uri.
NetworkCredential myCredential = myCredentialCache.GetCredential(new Uri(url),"Basic");
Display(myCredential);
- // Associating only our credentials.
- myWebRequest.Credentials = myCredential;
+ // Associating only our credentials.
+ myWebRequest.Credentials = myCredential;
// Sends the request and waits for response.
- WebResponse myWebResponse = myWebRequest.GetResponse();
-
+ WebResponse myWebResponse = myWebRequest.GetResponse();
+
// Process response here.
-
+
Console.WriteLine("\nResponse Received.");
myWebResponse.Close();
- }
- catch(WebException e)
+ }
+ catch(WebException e)
{
if (e.Response != null)
- Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",((HttpWebResponse)(e.Response)).StatusDescription);
+ Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",((HttpWebResponse)(e.Response)).StatusDescription);
else
- Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",e.Status);
+ Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",e.Status);
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_GetEnumerator/CS/credentialcache_getenumerator.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_GetEnumerator/CS/credentialcache_getenumerator.cs
index b30d15c6fd5..13d303c4f70 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_GetEnumerator/CS/credentialcache_getenumerator.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CredentialCache_GetEnumerator/CS/credentialcache_getenumerator.cs
@@ -2,7 +2,7 @@
/*This program demontrates the 'GetEnumerator' method of the CredentialCache class.
It takes an URL, creates a 'WebRequest' object for the Url. The program stores a known set of credentials
-in a credential cache which is then bound to the request. If the url requested has it's credentials in the cache
+in a credential cache which is then bound to the request. If the url requested has it's credentials in the cache
the response will be OK . 'GetEnumerator' method is used to enlist all the credentials stored in the
'CredentialCache' object.
*/
@@ -12,8 +12,8 @@ the response will be OK . 'GetEnumerator' method is used to enlist all the crede
using System.Collections;
class CredentialCacheSnippet {
-
- public static void Main(string[] args)
+
+ public static void Main(string[] args)
{
if (args.Length <4) {
Console.WriteLine("\n Usage:");
@@ -24,7 +24,7 @@ public static void Main(string[] args)
else{
Console.WriteLine("\n Invalid arguments.");
return;
- }
+ }
Console.WriteLine("Press any key to continue...");Console.ReadLine();
return;
@@ -32,19 +32,19 @@ public static void Main(string[] args)
//
public static void GetPage(string url,string userName,string password,string domainName)
{
- try
+ try
{
CredentialCache myCredentialCache = new CredentialCache();
- // Dummy Credentials used here.
+ // Dummy Credentials used here.
myCredentialCache.Add(new Uri("http://microsoft.com/"),"Basic", new NetworkCredential("user1","passwd1","domain1"));
myCredentialCache.Add(new Uri("http://msdn.com/"),"Basic", new NetworkCredential("user2","passwd2","domain2"));
- myCredentialCache.Add(new Uri(url),"Basic", new NetworkCredential(userName,password,domainName));
- // Creates a webrequest with the specified url.
+ myCredentialCache.Add(new Uri(url),"Basic", new NetworkCredential(userName,password,domainName));
+ // Creates a webrequest with the specified url.
WebRequest myWebRequest = WebRequest.Create(url);
- myWebRequest.Credentials = myCredentialCache;
+ myWebRequest.Credentials = myCredentialCache;
IEnumerator listCredentials = myCredentialCache.GetEnumerator();
-
+
Console.WriteLine("\nDisplaying credentials stored in CredentialCache: ");
while(listCredentials.MoveNext())
{
@@ -55,19 +55,19 @@ public static void GetPage(string url,string userName,string password,string dom
foreach(NetworkCredential credential in myCredentialCache)
Display(credential);
// Send the request and waits for response.
- WebResponse myWebResponse = myWebRequest.GetResponse();
-
+ WebResponse myWebResponse = myWebRequest.GetResponse();
+
// Process response here.
-
+
Console.WriteLine("\nResponse Received.");
myWebResponse.Close();
- }
- catch(WebException e)
+ }
+ catch(WebException e)
{
if (e.Response != null)
- Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",((HttpWebResponse)(e.Response)).StatusDescription);
+ Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",((HttpWebResponse)(e.Response)).StatusDescription);
else
- Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",e.Status);
+ Console.WriteLine("\r\nFailed to obtain a response. The following error occurred : {0}",e.Status);
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/CustomProxy_Attribute_RealProxy/CS/customproxy_sample.cs b/samples/snippets/csharp/VS_Snippets_Remoting/CustomProxy_Attribute_RealProxy/CS/customproxy_sample.cs
index 94c3fbf2a10..857e5b2b328 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/CustomProxy_Attribute_RealProxy/CS/customproxy_sample.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/CustomProxy_Attribute_RealProxy/CS/customproxy_sample.cs
@@ -15,8 +15,8 @@
'CreateInstance' and 'CreateProxy' of System.Runtime.Remoting.Proxies.ProxyAttribute and methods
'SetStubData', 'Invoke', 'InitializeServerObject', 'CreateObjRef', 'GetStubData', 'GetObjectData',
'GetTransparentProxy', 'GetProxiedType' of System.Runtime.Remoting.Proxies.RealProxy.
-
- The following program has derived from'ProxyAttribute','RealProxy' classes. CustomProxy is implemented by deriving
+
+ The following program has derived from'ProxyAttribute','RealProxy' classes. CustomProxy is implemented by deriving
from 'RealProxy' and overriding 'Invoke' method. The new statement for 'CustomServer' class is intercepted to
derived 'CustomProxyAttribute' by setting 'ProxyAttribute' on the CustomServer class. Implementation of
'RealProxy' and 'ProxyAttribute' methods are shown.
@@ -31,7 +31,7 @@
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Proxies;
using System.Runtime.Remoting.Messaging;
-using System.Runtime.Remoting.Contexts;
+using System.Runtime.Remoting.Contexts;
using System.Security.Permissions;
namespace Samples
@@ -47,7 +47,7 @@ public MyProxyAttribute()
//
// Create an instance of ServicedComponentProxy
public override MarshalByRefObject CreateInstance(Type serverType)
- {
+ {
return base.CreateInstance(serverType);
}
//
@@ -126,11 +126,11 @@ public override IMessage Invoke(IMessage myMessage)
Console.WriteLine("IMethodReturnMessage");
}
if (myMessage is IConstructionCallMessage)
- {
+ {
// Initialize a new instance of remote object
- IConstructionReturnMessage myIConstructionReturnMessage =
+ IConstructionReturnMessage myIConstructionReturnMessage =
this.InitializeServerObject((IConstructionCallMessage)myMessage);
- ConstructionResponse constructionResponse = new
+ ConstructionResponse constructionResponse = new
ConstructionResponse(null,(IMethodCallMessage) myMessage);
return constructionResponse;
}
@@ -148,8 +148,8 @@ public override IMessage Invoke(IMessage myMessage)
//
//
public override ObjRef CreateObjRef(Type ServerType)
- {
- Console.WriteLine ("CreateObjRef Method Called ...");
+ {
+ Console.WriteLine ("CreateObjRef Method Called ...");
CustomObjRef myObjRef = new CustomObjRef(myMarshalByRefObject,ServerType);
myObjRef.URI = myUri ;
return myObjRef;
@@ -157,7 +157,7 @@ public override ObjRef CreateObjRef(Type ServerType)
//
//
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
- public override void GetObjectData( SerializationInfo info,
+ public override void GetObjectData( SerializationInfo info,
StreamingContext context)
{
// Add your custom data if any here.
@@ -167,9 +167,9 @@ public override void GetObjectData( SerializationInfo info,
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class CustomObjRef :ObjRef
{
- public CustomObjRef(MarshalByRefObject myMarshalByRefObject,Type serverType):
+ public CustomObjRef(MarshalByRefObject myMarshalByRefObject,Type serverType):
base(myMarshalByRefObject,serverType)
- {
+ {
Console.WriteLine("ObjRef 'Constructor' called");
}
// Override this method to store custom data.
@@ -180,13 +180,13 @@ public override void GetObjectData(SerializationInfo info,
base.GetObjectData(info,context);
}
}
- }
+ }
public class ProxySample
{
// Acts as a custom proxy user.
[PermissionSet(SecurityAction.LinkDemand)]
public static void Main()
- {
+ {
Console.WriteLine("");
Console.WriteLine("CustomProxy Sample");
Console.WriteLine("================");
@@ -200,10 +200,10 @@ public static void Main()
CustomServer myHelloServer = (CustomServer)myProxyInstance.GetTransparentProxy();
//
// Get stubdata.
- Console.WriteLine("GetStubData = " + RealProxy.GetStubData(myProxyInstance).ToString());
+ Console.WriteLine("GetStubData = " + RealProxy.GetStubData(myProxyInstance).ToString());
//
// Get ProxyType.
- Console.WriteLine("Type of object represented by RealProxy is :"
+ Console.WriteLine("Type of object represented by RealProxy is :"
+ myProxyInstance.GetProxiedType());
//
myHelloServer.HelloMethod("RealProxy Sample");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_Constructor/CS/DateServer_SocketPermission.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_Constructor/CS/DateServer_SocketPermission.cs
index bc73b87d7fa..cf846166189 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_Constructor/CS/DateServer_SocketPermission.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_Constructor/CS/DateServer_SocketPermission.cs
@@ -1,14 +1,14 @@
/*
This program demonstrates the 'AcceptList' property of 'SocketPermission' class.
- This program provides a class called 'DateServer' that functions as a server
+ This program provides a class called 'DateServer' that functions as a server
for a 'DateClient'. A 'DateServer' is a server that provides the current date on
- the server in response to a request from a client. The 'DateServer' class
+ the server in response to a request from a client. The 'DateServer' class
provides a method called 'Create' which waits for client connections and sends
the current date on that socket connection. Within the 'Create' method of
- 'DateServer' class an instance of 'SocketPermission' is created with the
+ 'DateServer' class an instance of 'SocketPermission' is created with the
'SocketPermission(NetworkAccess, TransportType, string, int)' constructor.
- If the calling method has the requisite permissions the 'Create' method waits
+ If the calling method has the requisite permissions the 'Create' method waits
for client connections and sends the current date on the socket connection.
*/
@@ -23,14 +23,14 @@ If the calling method has the requisite permissions the 'Create' method waits
public class DateServer {
// Client connecting to the date server.
- private Socket clientSocket;
+ private Socket clientSocket;
private Socket serverSocket;
private Encoding asciiEncoding;
public readonly int serverBacklog;
public static void Main(String[] args) {
- if(args.Length != 1)
+ if(args.Length != 1)
{
PrintUsage();
return;
@@ -60,13 +60,13 @@ public bool Create(String portString) {
// Create another 'SocketPermission' object with two ip addresses.
// First 'SocketPermission' ip-address is '192.168.144.238' for 'All' transport types and
// for 'All' ports for the ip-address.
- SocketPermission socketPermission =
+ SocketPermission socketPermission =
new SocketPermission(NetworkAccess.Accept,
TransportType.All,
"192.168.144.238",
SocketPermission.AllPorts);
- // Second 'SocketPermission' ip-address is '192.168.144.239' for 'All' transport types and
+ // Second 'SocketPermission' ip-address is '192.168.144.239' for 'All' transport types and
// for 'All' ports for the ip-address.
socketPermission.AddPermission(NetworkAccess.Accept,
TransportType.All,
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_Constructor/CS/dateclient_socketpermission_constructor.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_Constructor/CS/dateclient_socketpermission_constructor.cs
index 0b6aeb6644e..0496b85dac6 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_Constructor/CS/dateclient_socketpermission_constructor.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_Constructor/CS/dateclient_socketpermission_constructor.cs
@@ -1,17 +1,17 @@
/*
- This program demonstrates the 'SocketPermission(PermissionState)',
+ This program demonstrates the 'SocketPermission(PermissionState)',
'SocketPermission(NetworkAccess, TransportType, string, int) constructors,
'FromXml', 'Intersect', 'AddPermission' methods and 'AllPorts' field
of 'SocketPermission' class.
-
+
This program provides a class called 'DateClient' that functions as a client
for a 'DateServer'. A 'DateServer' is a server that provides the current date on
- the server in response to a request from a client. The 'DateClient' class
+ the server in response to a request from a client. The 'DateClient' class
provides a method called 'GetDate' which returns the current date on the server.
The 'GetDate' is the method that shows the use of 'SocketPermission' class. An
instance of 'SocketPermission' is obtained using the 'FromXml' method. Another
instance of 'SocketPermission' is created with the 'SocketPermission(NetworkAccess,
- TransportType, string, int)' constructor. A third 'SocketPermission' object is
+ TransportType, string, int)' constructor. A third 'SocketPermission' object is
formed from the intersection of the above two 'SocketPermission' objects with the
use of the 'Intersect' method of 'SocketPermission' class. This 'SocketPermission'
object is used by the 'GetDate' method to verify the permissions of the calling
@@ -19,7 +19,7 @@ method. If the calling method has the requisite permissions the 'GetDate' method
connects to the 'DateServer' and returns the current date that the 'DateServer'
sends. If any exception occurs the 'GetDate' method returns an empty string.
- Note: This program requires 'DateServer_SocketPermission' program executing.
+ Note: This program requires 'DateServer_SocketPermission' program executing.
*/
using System;
@@ -33,7 +33,7 @@ sends. If any exception occurs the 'GetDate' method returns an empty string.
public class DateClient {
private Socket serverSocket;
- private Encoding asciiEncoding;
+ private Encoding asciiEncoding;
private IPAddress serverAddress;
private int serverPort;
@@ -61,10 +61,10 @@ public String GetDate() {
// 'SocketPermission' object for 'Connect' permission
SecurityElement securityElement2 = new SecurityElement("ConnectAccess");
// Format to specify ip address are ##
- // First 'SocketPermission' ip-address is '192.168.144.238' for 'All' transport types and
+ // First 'SocketPermission' ip-address is '192.168.144.238' for 'All' transport types and
// for 'All'ports for the ip-address.
SecurityElement securityElement3 = new SecurityElement("URI", "192.168.144.238#-1#3");
- // Second 'SocketPermission' ip-address is '192.168.144.240' for 'All' transport types and
+ // Second 'SocketPermission' ip-address is '192.168.144.240' for 'All' transport types and
// for 'All' ports for the ip-address.
SecurityElement securityElement4 = new SecurityElement("URI", "192.168.144.240#-1#3");
securityElement2.AddChild(securityElement3);
@@ -79,7 +79,7 @@ public String GetDate() {
// Create another 'SocketPermission' object with two ip addresses.
// First 'SocketPermission' ip-address is '192.168.144.238' for 'All' transport types and for 'All' ports for the ip-address.
- SocketPermission socketPermission3 =
+ SocketPermission socketPermission3 =
new SocketPermission(NetworkAccess.Connect,
TransportType.All,
"192.168.144.238",
@@ -128,7 +128,7 @@ public String GetDate() {
public class UserDateClient {
public static void Main(String[] args) {
- if(args.Length != 2)
+ if(args.Length != 2)
{
PrintUsage();
return;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_ToXml/CS/DateServer_SocketPermission.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_ToXml/CS/DateServer_SocketPermission.cs
index bc73b87d7fa..cf846166189 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_ToXml/CS/DateServer_SocketPermission.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_ToXml/CS/DateServer_SocketPermission.cs
@@ -1,14 +1,14 @@
/*
This program demonstrates the 'AcceptList' property of 'SocketPermission' class.
- This program provides a class called 'DateServer' that functions as a server
+ This program provides a class called 'DateServer' that functions as a server
for a 'DateClient'. A 'DateServer' is a server that provides the current date on
- the server in response to a request from a client. The 'DateServer' class
+ the server in response to a request from a client. The 'DateServer' class
provides a method called 'Create' which waits for client connections and sends
the current date on that socket connection. Within the 'Create' method of
- 'DateServer' class an instance of 'SocketPermission' is created with the
+ 'DateServer' class an instance of 'SocketPermission' is created with the
'SocketPermission(NetworkAccess, TransportType, string, int)' constructor.
- If the calling method has the requisite permissions the 'Create' method waits
+ If the calling method has the requisite permissions the 'Create' method waits
for client connections and sends the current date on the socket connection.
*/
@@ -23,14 +23,14 @@ If the calling method has the requisite permissions the 'Create' method waits
public class DateServer {
// Client connecting to the date server.
- private Socket clientSocket;
+ private Socket clientSocket;
private Socket serverSocket;
private Encoding asciiEncoding;
public readonly int serverBacklog;
public static void Main(String[] args) {
- if(args.Length != 1)
+ if(args.Length != 1)
{
PrintUsage();
return;
@@ -60,13 +60,13 @@ public bool Create(String portString) {
// Create another 'SocketPermission' object with two ip addresses.
// First 'SocketPermission' ip-address is '192.168.144.238' for 'All' transport types and
// for 'All' ports for the ip-address.
- SocketPermission socketPermission =
+ SocketPermission socketPermission =
new SocketPermission(NetworkAccess.Accept,
TransportType.All,
"192.168.144.238",
SocketPermission.AllPorts);
- // Second 'SocketPermission' ip-address is '192.168.144.239' for 'All' transport types and
+ // Second 'SocketPermission' ip-address is '192.168.144.239' for 'All' transport types and
// for 'All' ports for the ip-address.
socketPermission.AddPermission(NetworkAccess.Accept,
TransportType.All,
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_ToXml/CS/dateclient_socketpermission_toxml.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_ToXml/CS/dateclient_socketpermission_toxml.cs
index c66f5b5615c..9df925f0001 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_ToXml/CS/dateclient_socketpermission_toxml.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DateClient_SocketPermission_ToXml/CS/dateclient_socketpermission_toxml.cs
@@ -1,18 +1,18 @@
/*
- This program demonstrates the 'ToXml' and 'IsUnrestricted' method and 'ConnectList' property of
+ This program demonstrates the 'ToXml' and 'IsUnrestricted' method and 'ConnectList' property of
'SocketPermission' class.
-
+
This program provides a class called 'DateClient' that functions as a client
for a 'DateServer'. A 'DateServer' is a server that provides the current date on
- the server in response to a request from a client. The 'DateClient' class
+ the server in response to a request from a client. The 'DateClient' class
provides a method called 'GetDate' which returns the current date on the server.
The 'GetDate' is the method that shows the use of 'SocketPermission' class. An
instance of 'SocketPermission' is obtained using the 'FromXml' method. Another
instance of 'SocketPermission' is created with the 'SocketPermission(NetworkAccess,
- TransportType, string, int)' constructor. A third 'SocketPermission' object is
+ TransportType, string, int)' constructor. A third 'SocketPermission' object is
formed from the union of the above two 'SocketPermission' objects with the use of the
'Union' method of 'SocketPermission' class . This 'SocketPermission' object is used by
- the 'GetDate' method to verify the permissions of the calling method. If the calling
+ the 'GetDate' method to verify the permissions of the calling method. If the calling
method has the requisite permissions the 'GetDate' method connects to the 'DateServer'
and returns the current date that the 'DateServer' sends. If any exception occurs
the 'GetDate' method returns an empty string.
@@ -34,7 +34,7 @@ and returns the current date that the 'DateServer' sends. If any exception occur
public class DateClient {
private Socket serverSocket;
- private Encoding asciiEncoding;
+ private Encoding asciiEncoding;
private IPAddress serverAddress;
private int serverPort;
@@ -59,20 +59,20 @@ private void PrintSecurityElement(SecurityElement securityElementObj, int depth)
if(securityElementObj.Attributes != null) {
IEnumerator attributeEnumerator = securityElementObj.Attributes.GetEnumerator();
while(attributeEnumerator.MoveNext())
- Console.WriteLine("Attribute - \"{0}\" , Value - \"{1}\"", ((IDictionaryEnumerator)attributeEnumerator).Key,
- ((IDictionaryEnumerator)attributeEnumerator).Value);
+ Console.WriteLine("Attribute - \"{0}\" , Value - \"{1}\"", ((IDictionaryEnumerator)attributeEnumerator).Key,
+ ((IDictionaryEnumerator)attributeEnumerator).Value);
}
Console.WriteLine("");
if(securityElementObj.Children != null) {
depth += 1;
- for(int i = 0; i < securityElementObj.Children.Count; i++)
+ for(int i = 0; i < securityElementObj.Children.Count; i++)
PrintSecurityElement((SecurityElement)(securityElementObj.Children[i]), depth);
}
}
- public String GetDate()
+ public String GetDate()
{
SocketPermission socketPermission1 = new SocketPermission(PermissionState.Unrestricted);
@@ -96,7 +96,7 @@ public String GetDate()
// Create another 'SocketPermission' object with two ip addresses.
// First 'SocketPermission' ip-address is '192.168.144.238' for 'All' transport types and for 'All' ports for the ip-address.
- SocketPermission socketPermission3 =
+ SocketPermission socketPermission3 =
new SocketPermission(NetworkAccess.Connect,
TransportType.All,
"192.168.144.238",
@@ -157,7 +157,7 @@ public String GetDate()
public class UserDateClient {
public static void Main(String[] args) {
- if(args.Length != 2)
+ if(args.Length != 2)
{
PrintUsage();
return;
@@ -166,7 +166,7 @@ public static void Main(String[] args) {
DateClient myDateClient = new DateClient(IPAddress.Parse(args[0]), Int32.Parse(args[1]));
String currentDate = myDateClient.GetDate();
Console.WriteLine("The current date and time is : ");
- Console.WriteLine("{0}", currentDate);
+ Console.WriteLine("{0}", currentDate);
}
// This exception is thrown by the called method in the context of improper permissions.
catch(SecurityException e) {
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CS/descriptionnamespacesample1.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CS/descriptionnamespacesample1.cs
index 1cdea665bad..52fc6d4f6a8 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CS/descriptionnamespacesample1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DescriptionNamespaceSample1/CS/descriptionnamespacesample1.cs
@@ -37,7 +37,7 @@ class MyClass1
public static void Main()
{
//
- ServiceDescription myServiceDescription =
+ ServiceDescription myServiceDescription =
ServiceDescription.Read("MathService_input_cs.wsdl");
// Create SOAP messages.
@@ -47,7 +47,7 @@ public static void Main()
//
MessagePart myMessagePart = new MessagePart();
myMessagePart.Name = "parameters";
- myMessagePart.Element = new
+ myMessagePart.Element = new
XmlQualifiedName("AddResponse",myServiceDescription.TargetNamespace);
myMessage.Parts.Add(myMessagePart);
//
@@ -102,7 +102,7 @@ public static void Main()
Binding myBinding = new Binding();
myBinding.Name = myServiceDescription.Services[0].Name + "Soap";
- // Pass the name of the existing PortType MathServiceSoap and the
+ // Pass the name of the existing PortType MathServiceSoap and the
// Xml TargetNamespace attribute of the Descriptions tag.
myBinding.Type = new XmlQualifiedName("MathServiceSoap",
myServiceDescription.TargetNamespace);
@@ -115,7 +115,7 @@ public static void Main()
// Add tag soap:binding as an extensibility element.
myBinding.Extensions.Add(mySoapBinding);
- // Create OperationBindings for each of the operations defined
+ // Create OperationBindings for each of the operations defined
// in the .asmx file.
OperationBinding addOperationBinding = CreateOperationBinding(
"Add",myServiceDescription.TargetNamespace);
@@ -130,8 +130,8 @@ public static void Main()
"Divide",myServiceDescription.TargetNamespace);
myBinding.Operations.Add(divideOperationBinding);
myServiceDescription.Bindings.Insert(0,myBinding);
- Console.WriteLine("\nTarget namespace of the service description to " +
- "which the binding was added is: " +
+ Console.WriteLine("\nTarget namespace of the service description to " +
+ "which the binding was added is: " +
myServiceDescription.Bindings[0].ServiceDescription.TargetNamespace);
// Create a Port.
@@ -145,7 +145,7 @@ public static void Main()
mySoapAddressBinding.Location = "http://localhost/MathService.cs.asmx";
soapPort.Extensions.Add(mySoapAddressBinding);
- // Add the port to the MathService, which is the first service in
+ // Add the port to the MathService, which is the first service in
// the service collection.
myServiceDescription.Services[0].Ports.Add(soapPort);
@@ -157,7 +157,7 @@ public static void Main()
"as input to generate the proxy");
}
//
- // Creates a Message with name = messageName having one MessagePart
+ // Creates a Message with name = messageName having one MessagePart
// with name = partName.
public static Message CreateMessage(string messageName,string partName,
string element,string targetNamespace)
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection2/CS/discoveryclientdocumentcollection.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection2/CS/discoveryclientdocumentcollection.cs
index 6e115347235..894566a51da 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection2/CS/discoveryclientdocumentcollection.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection2/CS/discoveryclientdocumentcollection.cs
@@ -2,7 +2,7 @@
System.Web.Services.Discovery.DiscoveryClientDocumentCollection
The following example demonstrates the class 'DiscoveryClientDocumentCollection'.
- A sample discovery document is read and the 'Keys' and 'Values' properties
+ A sample discovery document is read and the 'Keys' and 'Values' properties
are displayed.
*/
@@ -26,45 +26,45 @@ static void Run()
{
DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
-
+
myDiscoveryClientProtocol.Credentials = CredentialCache.DefaultCredentials;
// 'dataservice.disco' is a sample discovery document.
string myStringUrl = "http://localhost/dataservice.disco";
-
+
// 'Discover' method is called to populate the 'Documents' property.
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
myDiscoveryClientProtocol.Discover(myStringUrl);
// An instance of the 'DiscoveryClientDocumentCollection' class is created.
- DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection =
+ DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection =
myDiscoveryClientProtocol.Documents;
-
+
// 'Keys' in the collection are retrieved.
ICollection myCollection = myDiscoveryClientDocumentCollection.Keys;
- object[] myObjectCollection =
+ object[] myObjectCollection =
new object[myDiscoveryClientDocumentCollection.Count];
myCollection.CopyTo(myObjectCollection, 0);
-
+
Console.WriteLine("The discovery documents in the collection are :");
for (int iIndex=0; iIndex < myObjectCollection.Length; iIndex++)
{
Console.WriteLine(myObjectCollection[iIndex]);
}
-
+
Console.WriteLine("");
// 'Values' in the collection are retrieved.
ICollection myCollection1 = myDiscoveryClientDocumentCollection.Values;
- object[] myObjectCollection1 =
+ object[] myObjectCollection1 =
new object[myDiscoveryClientDocumentCollection.Count];
myCollection1.CopyTo(myObjectCollection1, 0);
-
+
Console.WriteLine("The objects in the collection are :");
for (int iIndex=0; iIndex < myObjectCollection1.Length; iIndex++)
{
Console.WriteLine(myObjectCollection1[iIndex]);
}
}
-}
+}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection_Keys/CS/discoveryclientdocumentcollection_keys.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection_Keys/CS/discoveryclientdocumentcollection_keys.cs
index 254a80a99b6..d66815a523b 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection_Keys/CS/discoveryclientdocumentcollection_keys.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection_Keys/CS/discoveryclientdocumentcollection_keys.cs
@@ -2,13 +2,13 @@
System.Web.Services.Discovery.DiscoveryClientDocumentCollection.Keys
System.Web.Services.Discovery.DiscoveryClientDocumentCollection.Values
System.Web.Services.Discovery.DiscoveryClientDocumentCollection.Contains(String)
-
+
The following example demonstrates the 'Keys', 'Values' properties
and the 'Contains' method. The 'Keys' property returns the names
- the discoverydocuments in the 'DiscoveryClientDocumentCollection' and
- the 'Values' property returns the type of objects in the
+ the discoverydocuments in the 'DiscoveryClientDocumentCollection' and
+ the 'Values' property returns the type of objects in the
'DiscoveryClientDocumentCollection'. A sample discovery document is read
- and the properties 'Keys' and 'Values' and the method 'Contains' are
+ and the properties 'Keys' and 'Values' and the method 'Contains' are
displayed.
*/
using System;
@@ -34,18 +34,18 @@ static void Run()
// 'dataservice.disco' is a sample discovery document.
string myStringUrl = "http://localhost/dataservice.disco";
-
+
// 'Discover' method is called to populate the 'Documents' property.
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
myDiscoveryClientProtocol.Discover(myStringUrl);
-
- DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection =
+
+ DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection =
myDiscoveryClientProtocol.Documents;
-
+
// 'Keys' in the collection are retrieved.
//
ICollection myCollection = myDiscoveryClientDocumentCollection.Keys;
- object[] myObjectCollection =
+ object[] myObjectCollection =
new object[myDiscoveryClientDocumentCollection.Count];
myCollection.CopyTo(myObjectCollection, 0);
Console.WriteLine("The discovery documents in the collection are :");
@@ -58,7 +58,7 @@ static void Run()
//
// 'Values' in the collection are retrieved.
ICollection myCollection1 = myDiscoveryClientDocumentCollection.Values;
- object[] myObjectCollection1 =
+ object[] myObjectCollection1 =
new object[myDiscoveryClientDocumentCollection.Count];
myCollection1.CopyTo(myObjectCollection1, 0);
Console.WriteLine("The objects in the collection are :");
@@ -69,7 +69,7 @@ static void Run()
//
bool myContains = myDiscoveryClientDocumentCollection.Contains(myStringUrl);
if (myContains)
- Console.WriteLine("The discovery document {0} is present in the"
+ Console.WriteLine("The discovery document {0} is present in the"
+ " Collection",myStringUrl);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection_ctor/CS/discoveryclientdocumentcollection_ctor.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection_ctor/CS/discoveryclientdocumentcollection_ctor.cs
index 4bdabacb1d3..0f385b5e985 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection_ctor/CS/discoveryclientdocumentcollection_ctor.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientDocumentCollection_ctor/CS/discoveryclientdocumentcollection_ctor.cs
@@ -3,14 +3,14 @@
System.Web.Services.Discovery.DiscoveryClientDocumentCollection.Add
System.Web.Services.Discovery.DiscoveryClientDocumentCollection.Remove
System.Web.Services.Discovery.DiscoveryClientDocumentCollection.Item
-
- The following example demonstrates the constructor, the 'Add' and
+
+ The following example demonstrates the constructor, the 'Add' and
'Remove' methods and the 'Item' property. The method 'Add', adds a
discovery document object to the DiscoveryClientDocumentCollection.
The method 'Remove', removes a discovery document object from the
- DiscoveryClientDocumentCollection. The Item property is used to
+ DiscoveryClientDocumentCollection. The Item property is used to
retrieve an object in the DiscoveryClientDocumentCollection. A sample
- discovery document is read and the methods 'Add', 'Remove' and the
+ discovery document is read and the methods 'Add', 'Remove' and the
property 'Item' are applied on the sample.
*/
using System;
@@ -26,13 +26,13 @@ public static void Main()
//
//
//
- DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection =
+ DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection =
new DiscoveryClientDocumentCollection();
//
DiscoveryDocument myDiscoveryDocument = new DiscoveryDocument();
string myStringUrl = "http://www.contoso.com/service.disco";
string myStringUrl1 = "http://www.contoso.com/service1.disco";
-
+
myDiscoveryClientDocumentCollection.Add(myStringUrl, myDiscoveryDocument);
myDiscoveryClientDocumentCollection.Add(myStringUrl1, myDiscoveryDocument);
//
@@ -46,7 +46,7 @@ public static void Main()
Console.WriteLine("");
// 'Keys' in the collection are retrieved.
ICollection myCollection = myDiscoveryClientDocumentCollection.Keys;
- object[] myObjectCollection =
+ object[] myObjectCollection =
new object[myDiscoveryClientDocumentCollection.Count];
myCollection.CopyTo(myObjectCollection, 0);
Console.WriteLine("The discovery documents in the collection are :");
@@ -57,7 +57,7 @@ public static void Main()
Console.WriteLine("");
// 'Values' in the collection are retrieved.
ICollection myCollection1 = myDiscoveryClientDocumentCollection.Values;
- object[] myObjectCollection1 =
+ object[] myObjectCollection1 =
new object[myDiscoveryClientDocumentCollection.Count];
myCollection1.CopyTo(myObjectCollection1, 0);
Console.WriteLine("The objects in the collection are :");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_AdditionalInformation/CS/discoveryclientprotocol_additionalinformation.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_AdditionalInformation/CS/discoveryclientprotocol_additionalinformation.cs
index cc56d0465a1..3e75a17eec8 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_AdditionalInformation/CS/discoveryclientprotocol_additionalinformation.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_AdditionalInformation/CS/discoveryclientprotocol_additionalinformation.cs
@@ -31,16 +31,16 @@ static void Run()
string myStringUrl = "http://localhost/dataservice.disco";
// Call the Discover method to populate the Documents property.
- DiscoveryClientProtocol myDiscoveryClientProtocol =
+ DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
- myDiscoveryClientProtocol.Credentials =
+ myDiscoveryClientProtocol.Credentials =
CredentialCache.DefaultCredentials;
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
myDiscoveryClientProtocol.Discover(myStringUrl);
SoapBinding mySoapBinding = new SoapBinding();
mySoapBinding.Address = "http://schemas.xmlsoap.org/disco/scl/";
- mySoapBinding.Binding = new XmlQualifiedName("string",
+ mySoapBinding.Binding = new XmlQualifiedName("string",
"http://www.w3.org/2001/XMLSchema");
myDiscoveryClientProtocol.AdditionalInformation.Add(mySoapBinding);
@@ -48,12 +48,12 @@ static void Run()
myDiscoveryClientProtocol.WriteAll("MyDirectory",
"results.discomap");
- System.Collections.IList myIList =
+ System.Collections.IList myIList =
myDiscoveryClientProtocol.AdditionalInformation;
mySoapBinding = null;
mySoapBinding = (SoapBinding)myIList[0];
- Console.WriteLine("The address of the SoapBinding associated "
- + "with AdditionalInformation is: "
+ Console.WriteLine("The address of the SoapBinding associated "
+ + "with AdditionalInformation is: "
+ mySoapBinding.Address);
}
catch (Exception e)
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Download/CS/discoveryclientprotocol_download.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Download/CS/discoveryclientprotocol_download.cs
index 5d0d4cfc1cd..4a97d4d4f6a 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Download/CS/discoveryclientprotocol_download.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Download/CS/discoveryclientprotocol_download.cs
@@ -1,7 +1,7 @@
/*
System.Web.Services.Discovery.DiscoveryClientProtocol.DiscoveryClientProtocol
System.Web.Services.Discovery.DiscoveryClientProtocol.Download(ref String)
-
+
The following example demonstrates the 'constructor' and the
method 'Download' of the 'DiscoveryClientProtocol' class. The
'Download' method downloads a discovery document into a stream.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Download2/CS/discoveryclientprotocol_download.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Download2/CS/discoveryclientprotocol_download.cs
index c157a45c513..1434b8a5861 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Download2/CS/discoveryclientprotocol_download.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Download2/CS/discoveryclientprotocol_download.cs
@@ -2,9 +2,9 @@
/*
The following example demonstrates the usage of the 'Download' method
of the class 'DiscoveryClientProtocol'. The input to the program is
-a discovery file 'MathService_cs.vsdisco'. It generates a 'Stream'
-instance of the discovery file 'MathService_cs.vsdisco' from the
-'Download' method of 'DiscoveryClientPrototocol' and prints out
+a discovery file 'MathService_cs.vsdisco'. It generates a 'Stream'
+instance of the discovery file 'MathService_cs.vsdisco' from the
+'Download' method of 'DiscoveryClientPrototocol' and prints out
the 'contentType' and length in bytes of the discoverydocument.
*/
@@ -20,7 +20,7 @@ public static void Main()
//
string myDiscoFile = "http://localhost/MathService_cs.vsdisco";
string myEncoding = "";
- DiscoveryClientProtocol myDiscoveryClientProtocol =
+ DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
Stream myStream = myDiscoveryClientProtocol.Download
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Errors/CS/discoveryclientprotocol_errors.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Errors/CS/discoveryclientprotocol_errors.cs
index 643e21b576e..817ea2d12d5 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Errors/CS/discoveryclientprotocol_errors.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientProtocol_Errors/CS/discoveryclientprotocol_errors.cs
@@ -2,12 +2,12 @@
/*
The following example demonstrates the usage of the 'Errors' property
of the class 'DiscoveryClientProtocol'. The input to the program is
- a discovery file 'MathService_cs.vsdisco', which holds reference
- related to 'MathService_cs.asmx' web service. The program is
- excecuted first time with existence of the file
+ a discovery file 'MathService_cs.vsdisco', which holds reference
+ related to 'MathService_cs.asmx' web service. The program is
+ excecuted first time with existence of the file
'MathService_cs.asmx' in the location as specified in the discovery
- file. The file 'MathService_cs.asmx' is removed from the referred
- location in a way to simulate a scenario wherein the file related
+ file. The file 'MathService_cs.asmx' is removed from the referred
+ location in a way to simulate a scenario wherein the file related
to web service is missing, and the program is excecuted the second time
to show the exception occuring.
*/
@@ -23,13 +23,13 @@ public static void Main()
//
string myDiscoFile = "http://localhost/MathService_cs.vsdisco";
string myUrlKey = "http://localhost/MathService_cs.asmx?wsdl";
- DiscoveryClientProtocol myDiscoveryClientProtocol =
+ DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
// Get the discovery document.
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
myDiscoveryClientProtocol.Discover(myDiscoFile);
- IEnumerator myEnumerator =
+ IEnumerator myEnumerator =
myDiscoveryDocument.References.GetEnumerator();
while ( myEnumerator.MoveNext() )
{
@@ -40,7 +40,7 @@ public static void Main()
myDiscoveryClientProtocol = myContractReference.ClientProtocol;
myDiscoveryClientProtocol.ResolveAll();
- DiscoveryExceptionDictionary myExceptionDictionary
+ DiscoveryExceptionDictionary myExceptionDictionary
= myDiscoveryClientProtocol.Errors;
if (myExceptionDictionary.Contains(myUrlKey))
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection/CS/discoveryclientreferencecollection.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection/CS/discoveryclientreferencecollection.cs
index 6de24dec81c..e96626d8550 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection/CS/discoveryclientreferencecollection.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection/CS/discoveryclientreferencecollection.cs
@@ -1,11 +1,11 @@
// System.Web.Services.Discovery.DiscoveryClientReferenceCollection
/*
- The following example demonstrates the class
- 'DiscoveryClientReferenceCollection'. A sample discovery document
- is read and the 'Keys' and 'Values' properties are displayed. A
- string containing the URL of a discovery document is passed as
- an argument to 'Contains' method of the instance of the class.
+ The following example demonstrates the class
+ 'DiscoveryClientReferenceCollection'. A sample discovery document
+ is read and the 'Keys' and 'Values' properties are displayed. A
+ string containing the URL of a discovery document is passed as
+ an argument to 'Contains' method of the instance of the class.
*/
//
@@ -27,29 +27,29 @@ static void Run()
{
DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
-
- myDiscoveryClientProtocol.Credentials =
+
+ myDiscoveryClientProtocol.Credentials =
CredentialCache.DefaultCredentials;
// 'dataservice.vsdisco' is a sample discovery document.
string myStringUrl = "http://localhost/dataservice.vsdisco";
-
+
// Call the Discover method to populate the References property.
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
myDiscoveryClientProtocol.Discover(myStringUrl);
// Resolve all references found in the discovery document.
myDiscoveryClientProtocol.ResolveAll();
-
- DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection =
+
+ DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection =
myDiscoveryClientProtocol.References;
-
+
// Retrieve the keys from the collection.
ICollection myCollection = myDiscoveryClientReferenceCollection.Keys;
- object[] myObjectCollection =
+ object[] myObjectCollection =
new object[myDiscoveryClientReferenceCollection.Count];
myCollection.CopyTo(myObjectCollection, 0);
-
+
Console.WriteLine("The discovery documents, service descriptions, " +
"and XML schema");
Console.WriteLine(" definitions in the collection are: ");
@@ -61,10 +61,10 @@ static void Run()
// Retrieve the values from the collection.
ICollection myCollection1 = myDiscoveryClientReferenceCollection.Values;
- object[] myObjectCollection1 =
+ object[] myObjectCollection1 =
new object[myDiscoveryClientReferenceCollection.Count];
myCollection1.CopyTo(myObjectCollection1, 0);
-
+
Console.WriteLine("The objects in the collection are: ");
for (int i=0; i< myObjectCollection1.Length; i++)
{
@@ -80,5 +80,5 @@ static void Run()
myStringUrl1);
}
}
-}
+}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection_Items/CS/discoveryclientreferencecollection_items.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection_Items/CS/discoveryclientreferencecollection_items.cs
index 89bf3ac4e46..532d0acc8e0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection_Items/CS/discoveryclientreferencecollection_items.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection_Items/CS/discoveryclientreferencecollection_items.cs
@@ -9,8 +9,8 @@ The following example demonstrates the 'constructor' and various members of
the class 'DiscoveryClientReferenceCollection'. The 'Add(DiscoveryReference)'
method adds a DocumentReference object to the DiscoveryClientDocumentCollection
collection. The Add(url, DiscoveryReference) method adds a DiscoveryReference
- with the specified Url. The 'Remove' method removes a DiscoveryReference with
- the specified Url from the 'DiscoveryClientReferenceCollection' collection.
+ with the specified Url. The 'Remove' method removes a DiscoveryReference with
+ the specified Url from the 'DiscoveryClientReferenceCollection' collection.
The 'Item' property gets or sets a DiscoveryReference object from the
'DiscoveryClientReferenceCollection' with the specified Url.
*/
@@ -26,9 +26,9 @@ public static void Main()
//
//
//
- DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection =
+ DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection =
new DiscoveryClientReferenceCollection();
-
+
ContractReference myContractReference = new ContractReference();
string myStringUrl1 = "http://www.contoso.com/service1.disco";
myContractReference.Ref = myStringUrl1;
@@ -46,7 +46,7 @@ public static void Main()
DiscoveryDocumentReference myDiscoveryDocumentReference =
new DiscoveryDocumentReference();
string myStringUrl = "http://www.contoso.com/service.disco";
- myDiscoveryClientReferenceCollection.Add(myStringUrl,
+ myDiscoveryClientReferenceCollection.Add(myStringUrl,
myDiscoveryDocumentReference);
//
myDiscoveryClientReferenceCollection.Remove(myStringUrl);
@@ -54,10 +54,10 @@ public static void Main()
// Retrieve the keys in the collection.
ICollection myCollection = myDiscoveryClientReferenceCollection.Keys;
- object[] myObjectCollection =
+ object[] myObjectCollection =
new object[myDiscoveryClientReferenceCollection.Count];
myCollection.CopyTo(myObjectCollection, 0);
-
+
Console.WriteLine("The discovery documents, service descriptions, and");
Console.WriteLine("XML schema definitions in the collection are:");
for (int iIndex=0; iIndex < myObjectCollection.Length; iIndex++)
@@ -69,14 +69,14 @@ public static void Main()
// Retrieve the values in the collection.
ICollection myCollection1 = myDiscoveryClientReferenceCollection.Values;
- object[] myObjectCollection1 =
+ object[] myObjectCollection1 =
new object[myDiscoveryClientReferenceCollection.Count];
myCollection1.CopyTo(myObjectCollection1, 0);
-
+
Console.WriteLine("The objects in the collection are:");
for (int iIndex=0; iIndex < myObjectCollection1.Length; iIndex++)
{
Console.WriteLine(myObjectCollection1[iIndex]);
}
}
-}
+}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection_Keys/CS/discoveryclientreferencecollection_keys.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection_Keys/CS/discoveryclientreferencecollection_keys.cs
index df86fe92012..6ff382aa687 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection_Keys/CS/discoveryclientreferencecollection_keys.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientReferenceCollection_Keys/CS/discoveryclientreferencecollection_keys.cs
@@ -3,9 +3,9 @@
System.Web.Services.Discovery.DiscoveryClientReferenceCollection.Values
System.Web.Services.Discovery.DiscoveryClientReferenceCollection.Contains
- The following example demonstrates the 'Keys', 'Values' properties and
- the method 'Contains' of the class 'DiscoveryClientReferenceCollection'. A sample
- discovery document is read and the 'Keys', 'Values' and 'Contains' properties
+ The following example demonstrates the 'Keys', 'Values' properties and
+ the method 'Contains' of the class 'DiscoveryClientReferenceCollection'. A sample
+ discovery document is read and the 'Keys', 'Values' and 'Contains' properties
are displayed.
*/
@@ -28,24 +28,24 @@ static void Run()
//
DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
- myDiscoveryClientProtocol.Credentials =
+ myDiscoveryClientProtocol.Credentials =
CredentialCache.DefaultCredentials;
// 'dataservice.disco' is a sample discovery document.
string myStringUrl = "http://localhost/dataservice.disco";
// Call the Discover method to populate the References property.
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
myDiscoveryClientProtocol.Discover(myStringUrl);
// Resolve all references found in the discovery document.
myDiscoveryClientProtocol.ResolveAll();
- DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection =
+ DiscoveryClientReferenceCollection myDiscoveryClientReferenceCollection =
myDiscoveryClientProtocol.References;
// Retrieve the keys in the collection.
ICollection myCollection = myDiscoveryClientReferenceCollection.Keys;
- object[] myObjectCollection =
+ object[] myObjectCollection =
new object[myDiscoveryClientReferenceCollection.Count];
myCollection.CopyTo(myObjectCollection, 0);
Console.WriteLine("The discovery documents, service descriptions, and XML schema");
@@ -59,10 +59,10 @@ static void Run()
//
// Retrieve the values in the collection.
ICollection myCollection1 = myDiscoveryClientReferenceCollection.Values;
- object[] myObjectCollection1 =
+ object[] myObjectCollection1 =
new object[myDiscoveryClientReferenceCollection.Count];
myCollection1.CopyTo(myObjectCollection1, 0);
-
+
Console.WriteLine("The objects in the collection are:");
for (int iIndex=0; iIndex < myObjectCollection1.Length; iIndex++)
{
@@ -79,4 +79,4 @@ static void Run()
}
//
}
-}
+}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResult/CS/discoveryclientresult.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResult/CS/discoveryclientresult.cs
index cee4c1b596d..860d6ba7df0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResult/CS/discoveryclientresult.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResult/CS/discoveryclientresult.cs
@@ -17,11 +17,11 @@ static void Main()
{
try
{
- DiscoveryClientProtocol myDiscoveryClientProtocol =
+ DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
// Get the collection holding DiscoveryClientResult objects.
- DiscoveryClientResultCollection myDiscoveryClientResultCollection =
+ DiscoveryClientResultCollection myDiscoveryClientResultCollection =
myDiscoveryClientProtocol.ReadAll("results.discomap");
Console.WriteLine("The number of DiscoveryClientResult objects: "
+ myDiscoveryClientResultCollection.Count);
@@ -29,13 +29,13 @@ static void Main()
// Iterate through the collection and display the properties
// of each DiscoveryClientResult in it.
- foreach(DiscoveryClientResult myDiscoveryClientResult in
+ foreach(DiscoveryClientResult myDiscoveryClientResult in
myDiscoveryClientResultCollection)
{
Console.WriteLine(
"Type of reference in the discovery document: "
+ myDiscoveryClientResult.ReferenceTypeName);
- Console.WriteLine("Url for the reference: "
+ Console.WriteLine("Url for the reference: "
+ myDiscoveryClientResult.Url);
Console.WriteLine("File for saving the reference: "
+ myDiscoveryClientResult.Filename);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResultCollection/CS/discoveryclientresultcollection.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResultCollection/CS/discoveryclientresultcollection.cs
index 7995722fad8..cca3db4d912 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResultCollection/CS/discoveryclientresultcollection.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResultCollection/CS/discoveryclientresultcollection.cs
@@ -2,8 +2,8 @@
/*
The following example demonstrates 'DiscoveryClientResultCollection' class.
A 'DiscoveryClientResultCollection' object is obtained by reading a '.discomap' file
-which contains the 'DiscoveryClientResult' objects, representing the details of
-discovery references. An element from the collection is removed and programmatically
+which contains the 'DiscoveryClientResult' objects, representing the details of
+discovery references. An element from the collection is removed and programmatically
added to 'DiscoveryClientResultCollection' class.
*/
//
@@ -20,7 +20,7 @@ static void Main()
{
try
{
- DiscoveryClientProtocol myDiscoveryClientProtocol =
+ DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
// Get the collection of DiscoveryClientResult objects.
@@ -34,16 +34,16 @@ static void Main()
myDiscoveryClientResultCollection[0]);
Console.WriteLine("Adding a DiscoveryClientResult" +
" to the collection...");
- DiscoveryClientResult myDiscoveryClientResult =
+ DiscoveryClientResult myDiscoveryClientResult =
new DiscoveryClientResult();
- // Set the DiscoveryDocumentReference class as the type of
+ // Set the DiscoveryDocumentReference class as the type of
// reference in the discovery document.
- myDiscoveryClientResult.ReferenceTypeName =
+ myDiscoveryClientResult.ReferenceTypeName =
"System.Web.Services.Discovery.DiscoveryDocumentReference";
// Set the URL for the reference.
- myDiscoveryClientResult.Url =
+ myDiscoveryClientResult.Url =
"http://localhost/Discovery/Service1_cs.asmx?disco";
// Set the name of the file in which the reference is saved.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResult_Filename/CS/discoveryclientresult_filename.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResult_Filename/CS/discoveryclientresult_filename.cs
index b05534ccd7c..2612d48ebee 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResult_Filename/CS/discoveryclientresult_filename.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryClientResult_Filename/CS/discoveryclientresult_filename.cs
@@ -7,13 +7,13 @@
// System.Web.Services.Discovery.DiscoveryClientResultCollection.Contains
// System.Web.Services.Discovery.DiscoveryClientResultCollection.Item
/*
-The following example demonstrates 'ReferenceTypeName' ,'Url','Filename' properties and the
-constructor of 'DiscoveryClientResult' class and 'Remove', 'Add' 'Contains' methods and
+The following example demonstrates 'ReferenceTypeName' ,'Url','Filename' properties and the
+constructor of 'DiscoveryClientResult' class and 'Remove', 'Add' 'Contains' methods and
'Item' property of 'DiscoveryClientResultCollection' class.
-A 'DiscoveryClientResultCollection' object is obtained by reading a '.discomap' file
+A 'DiscoveryClientResultCollection' object is obtained by reading a '.discomap' file
which contains the 'DiscoveryClientResult' objects, representing the details of
-discovery references. An element from the collection is removed and programmatically
-added to it to show the usage of methods of 'DiscoveryClientResultCollection' class .
+discovery references. An element from the collection is removed and programmatically
+added to it to show the usage of methods of 'DiscoveryClientResultCollection' class .
The contents of this collection are displayed..
*/
@@ -26,11 +26,11 @@ static void Main()
{
try
{
- DiscoveryClientProtocol myDiscoveryClientProtocol =
+ DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
// Get the collection of DiscoveryClientResult objects.
- DiscoveryClientResultCollection myDiscoveryClientResultCollection =
+ DiscoveryClientResultCollection myDiscoveryClientResultCollection =
myDiscoveryClientProtocol.ReadAll("results.discomap");
Console.WriteLine("The number of DiscoveryClientResult objects: "
@@ -54,13 +54,13 @@ static void Main()
DiscoveryClientResult myDiscoveryClientResult =
new DiscoveryClientResult();
- // Set the type of reference in the discovery document as
+ // Set the type of reference in the discovery document as
// DiscoveryDocumentReference.
- myDiscoveryClientResult.ReferenceTypeName =
+ myDiscoveryClientResult.ReferenceTypeName =
"System.Web.Services.Discovery.DiscoveryDocumentReference";
// Set the URL for the reference.
- myDiscoveryClientResult.Url =
+ myDiscoveryClientResult.Url =
"http://localhost/Discovery/Service1_cs.asmx?disco";
// Set the name of the file in which the reference is saved.
@@ -88,7 +88,7 @@ static void Main()
//
for(int i=0; i
// Initialize a new instance of the DiscoveryClientResult class.
- DiscoveryClientResult myDiscoveryClientResult =
+ DiscoveryClientResult myDiscoveryClientResult =
new DiscoveryClientResult(
typeof(System.Web.Services.Discovery.DiscoveryDocumentReference),
"http://localhost/Discovery/Service1_cs.asmx?disco",
@@ -52,7 +52,7 @@ static void Main()
Console.WriteLine("Displaying the items in the collection");
for(int i=0;i
//
// Get the DiscoveryClientProtocol.DiscoveryClientResultsFile.
DiscoveryClientProtocol.DiscoveryClientResultsFile myResultFile =
new DiscoveryClientProtocol.DiscoveryClientResultsFile();
- XmlSerializer mySerializer = new XmlSerializer(myResultFile.GetType());
+ XmlSerializer mySerializer = new XmlSerializer(myResultFile.GetType());
XmlReader reader = new XmlTextReader("http://localhost/MyDiscoMap.discomap");
myResultFile = (DiscoveryClientProtocol.DiscoveryClientResultsFile)
mySerializer.Deserialize(reader);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocument/CS/discoverydocument.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocument/CS/discoverydocument.cs
index 23be7829ea2..b813ec8382c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocument/CS/discoverydocument.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocument/CS/discoverydocument.cs
@@ -1,7 +1,7 @@
// System.Web.Services.Discovery.DiscoveryDocument
// System.Web.Services.Discovery.DiscoveryDocument.Write(TextWriter)
-/* The following example deomonstrates DiscoveryDocument class and the 'Write(Stream)' method
+/* The following example deomonstrates DiscoveryDocument class and the 'Write(Stream)' method
of the 'DiscoveryDocument' class.
A XmlTextReader object is created with a sample discovery file and this
is passed to the Read method to create a DiscoveryDocument. The contents
@@ -26,7 +26,7 @@ static void Main()
DiscoveryDocument myDiscoveryDocument = new DiscoveryDocument();
// Create an XmlTextReader with the sample file.
- XmlTextReader myXmlTextReader = new
+ XmlTextReader myXmlTextReader = new
XmlTextReader( "http://localhost/example_cs.disco" );
// Read the given XmlTextReader.
@@ -34,24 +34,24 @@ static void Main()
//
// Write the DiscoveryDocument into the 'TextWriter'.
- FileStream myFileStream = new
+ FileStream myFileStream = new
FileStream( "log.txt", FileMode.OpenOrCreate, FileAccess.Write );
StreamWriter myStreamWriter = new StreamWriter( myFileStream );
myDiscoveryDocument.Write( myStreamWriter );
- myStreamWriter.Flush();
- myStreamWriter.Close();
+ myStreamWriter.Flush();
+ myStreamWriter.Close();
//
// Display the contents of the DiscoveryDocument onto the console.
FileStream myFileStream1 = new
FileStream( "log.txt", FileMode.OpenOrCreate, FileAccess.Read );
- StreamReader myStreamReader = new StreamReader( myFileStream1 );
+ StreamReader myStreamReader = new StreamReader( myFileStream1 );
// Set the file pointer to the begin.
- myStreamReader.BaseStream.Seek(0, SeekOrigin.Begin);
+ myStreamReader.BaseStream.Seek(0, SeekOrigin.Begin);
Console.WriteLine( "The contents of the DiscoveryDocument are-" );
- while ( myStreamReader.Peek() > -1 )
+ while ( myStreamReader.Peek() > -1 )
{
Console.WriteLine( myStreamReader.ReadLine() );
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_Document_ResolveAll/CS/ddreference_document_resolveall.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_Document_ResolveAll/CS/ddreference_document_resolveall.cs
index 4fd75114362..a191dfbcd14 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_Document_ResolveAll/CS/ddreference_document_resolveall.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_Document_ResolveAll/CS/ddreference_document_resolveall.cs
@@ -2,7 +2,7 @@
// System.Web.Services.Discovery.DiscoveryDocumentReference.ResolveAll()
/*
- This program demonstrates the 'Document' property and 'ResolveAll()' method of
+ This program demonstrates the 'Document' property and 'ResolveAll()' method of
'DiscoveryDocumentReference' class. Set the 'ClientProtocol' of
'DiscoveryDocumentReference' class. The validity of the documents within the discovery
document is verified using the 'ResolveAll' method and the valid references to the
@@ -37,7 +37,7 @@ static void Run()
IEnumerator myEnumerator = myDiscoveryDocument.References.GetEnumerator();
while(myEnumerator.MoveNext())
{
- DiscoveryDocumentReference myNewReference =
+ DiscoveryDocumentReference myNewReference =
(DiscoveryDocumentReference)myEnumerator.Current;
// Set the ClientProtocol of myNewReference.
DiscoveryClientProtocol myNewProtocol = myNewReference.ClientProtocol;
@@ -45,10 +45,10 @@ static void Run()
myNewReference.ResolveAll();
// Get the document of myNewReference.
- DiscoveryDocument myNewDiscoveryDocument =
+ DiscoveryDocument myNewDiscoveryDocument =
myNewReference.Document;
- IEnumerator myNewEnumerator =
+ IEnumerator myNewEnumerator =
myNewDiscoveryDocument.References.GetEnumerator();
Console.WriteLine("The valid discovery document is : \n");
while(myNewEnumerator.MoveNext())
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ReadDocument/CS/discoverydocumentreference_readdocument.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ReadDocument/CS/discoverydocumentreference_readdocument.cs
index f7484fa33d6..11e3f85e25e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ReadDocument/CS/discoverydocumentreference_readdocument.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ReadDocument/CS/discoverydocumentreference_readdocument.cs
@@ -2,7 +2,7 @@
/*
This program demonstrates the 'ReadDocument(stream)' of 'DiscoveryDocumentReference'
- class. Read the contents of the discovery document from the stream and returns
+ class. Read the contents of the discovery document from the stream and returns
discovery document reference. The references of the 'DiscoveryDocumentReference'
are printed.
*/
@@ -13,7 +13,7 @@ are printed.
using System.Collections;
using System.Security.Permissions;
-class DiscoveryDocumentReference_ReadDocument
+class DiscoveryDocumentReference_ReadDocument
{
[PermissionSetAttribute(SecurityAction.Demand, Name="FullTrust")]
@@ -26,14 +26,14 @@ static void Run()
DiscoveryClientProtocol myProtocol = new DiscoveryClientProtocol();
DiscoveryDocumentReference myReference = new DiscoveryDocumentReference(myUrl);
Stream myFileStream = myProtocol.Download(ref myUrl);
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
(DiscoveryDocument)myReference.ReadDocument(myFileStream);
//
IEnumerator myEnumerator = myDiscoveryDocument.References.GetEnumerator();
Console.WriteLine("\nThe references to the discovery document are : \n");
while(myEnumerator.MoveNext())
{
- DiscoveryDocumentReference myNewReference =
+ DiscoveryDocumentReference myNewReference =
(DiscoveryDocumentReference)myEnumerator.Current;
// Print the discovery document references on the console.
Console.WriteLine(myNewReference.Url);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ctor_Properties/CS/discoverydocumentreference_ctor_properties.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ctor_Properties/CS/discoverydocumentreference_ctor_properties.cs
index 43658b827f7..6cf66c9de85 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ctor_Properties/CS/discoverydocumentreference_ctor_properties.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ctor_Properties/CS/discoverydocumentreference_ctor_properties.cs
@@ -21,7 +21,7 @@ public static void Main()
try
{
//
- DiscoveryDocumentReference myDiscoveryDocumentReference =
+ DiscoveryDocumentReference myDiscoveryDocumentReference =
new DiscoveryDocumentReference(
"http://localhost/Sample_cs.disco");
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ctor_WriteDocument/CS/discoverydocumentreference_ctor_writedocument.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ctor_WriteDocument/CS/discoverydocumentreference_ctor_writedocument.cs
index 5add4eb8d6a..da366ef86b4 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ctor_WriteDocument/CS/discoverydocumentreference_ctor_writedocument.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocumentReference_ctor_WriteDocument/CS/discoverydocumentreference_ctor_writedocument.cs
@@ -4,8 +4,8 @@
/*
This program demonstrates the 'DiscoveryDocumentReference' class, default constructor and
- 'WriteDocument(object, Stream)' method of the 'DiscoveryDocumentReference' class.
- Discovery file is read by using 'DiscoveryDocument' instance. Write this discovery
+ 'WriteDocument(object, Stream)' method of the 'DiscoveryDocumentReference' class.
+ Discovery file is read by using 'DiscoveryDocument' instance. Write this discovery
document into a file stream and print its contents on the console.
*/
@@ -23,24 +23,24 @@ public static void Main()
try
{
DiscoveryDocument myDiscoveryDocument;
- XmlTextReader myXmlTextReader =
+ XmlTextReader myXmlTextReader =
new XmlTextReader("http://localhost/Sample_cs.vsdisco");
myDiscoveryDocument = DiscoveryDocument.Read(myXmlTextReader);
//
// Create a new instance of DiscoveryDocumentReference.
- DiscoveryDocumentReference myDiscoveryDocumentReference =
+ DiscoveryDocumentReference myDiscoveryDocumentReference =
new DiscoveryDocumentReference();
//
//
- FileStream myFileStream = new FileStream("Temp.vsdisco",
+ FileStream myFileStream = new FileStream("Temp.vsdisco",
FileMode.OpenOrCreate, FileAccess.Write);
myDiscoveryDocumentReference.WriteDocument(
myDiscoveryDocument, myFileStream);
myFileStream.Close();
//
- FileStream myFileStream1 = new FileStream("Temp.vsdisco",
+ FileStream myFileStream1 = new FileStream("Temp.vsdisco",
FileMode.OpenOrCreate, FileAccess.Read);
StreamReader myStreamReader = new StreamReader(myFileStream1);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocument_DiscoveryDocument/CS/discoverydocument_discoverydocument.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocument_DiscoveryDocument/CS/discoverydocument_discoverydocument.cs
index d144a79b0a3..1f78e7ff6bc 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocument_DiscoveryDocument/CS/discoverydocument_discoverydocument.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryDocument_DiscoveryDocument/CS/discoverydocument_discoverydocument.cs
@@ -35,7 +35,7 @@ static void Main()
//
// Create an XmlTextReader with the sample file.
- XmlTextReader myXmlTextReader = new
+ XmlTextReader myXmlTextReader = new
XmlTextReader( "http://localhost/example.vsdisco" );
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryExceptionDictionary_Property_Method/CS/discoveryexceptiondictionary_property_method.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryExceptionDictionary_Property_Method/CS/discoveryexceptiondictionary_property_method.cs
index b86626ac6eb..2061fdf68aa 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryExceptionDictionary_Property_Method/CS/discoveryexceptiondictionary_property_method.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryExceptionDictionary_Property_Method/CS/discoveryexceptiondictionary_property_method.cs
@@ -8,7 +8,7 @@
// System.Web.Services.Discovery.DiscoveryExceptionDictionary.Values
/*
- The following example demonstrates the usage of the
+ The following example demonstrates the usage of the
'DiscoveryExceptionDictionary' class, the constructor
'DiscoveryExceptionDictionary()', the properties 'Item', 'Keys',
'Values' and the methods 'Contains', 'Add' and 'Remove' of the class.
@@ -35,21 +35,21 @@ static void Main()
{
string myDiscoFile = "http://localhost/MathService_cs.disco";
string myUrlKey = "http://localhost/MathService_cs.asmx?wsdl";
- DiscoveryClientProtocol myDiscoveryClientProtocol1 =
+ DiscoveryClientProtocol myDiscoveryClientProtocol1 =
new DiscoveryClientProtocol();
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
myDiscoveryClientProtocol1.Discover(myDiscoFile);
- IEnumerator myEnumerator =
+ IEnumerator myEnumerator =
myDiscoveryDocument.References.GetEnumerator();
while ( myEnumerator.MoveNext() )
{
ContractReference myContractReference =
(ContractReference)myEnumerator.Current;
- DiscoveryClientProtocol myDiscoveryClientProtocol2 =
+ DiscoveryClientProtocol myDiscoveryClientProtocol2 =
myContractReference.ClientProtocol;
myDiscoveryClientProtocol2.ResolveAll();
//
- DiscoveryExceptionDictionary myExceptionDictionary
+ DiscoveryExceptionDictionary myExceptionDictionary
= myDiscoveryClientProtocol2.Errors;
if ( myExceptionDictionary.Contains(myUrlKey) == true )
{
@@ -84,7 +84,7 @@ DiscoveryExceptionDictionary myExceptionDictionary
DiscoveryExceptionDictionary myNewExceptionDictionary =
new DiscoveryExceptionDictionary();
// Add an exception with the custom error message.
- Exception myNewException =
+ Exception myNewException =
new Exception("The requested service is not available.");
myNewExceptionDictionary.Add(myUrlKey, myNewException);
myExceptionDictionary = myNewExceptionDictionary;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReference/CS/discoveryreference.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReference/CS/discoveryreference.cs
index c5c4cac6db1..5fe1c7c4726 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReference/CS/discoveryreference.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReference/CS/discoveryreference.cs
@@ -24,9 +24,9 @@ class MyDiscoveryDocumentClass
static void Main()
{
DiscoveryDocument myDiscoveryDocument;
- StreamReader myStreamReader =
+ StreamReader myStreamReader =
new StreamReader("c:\\Inetpub\\wwwroot\\dataservice.disco");
- FileStream myStream =
+ FileStream myStream =
new FileStream("C:\\MyDiscovery.disco",FileMode.OpenOrCreate);
Console.WriteLine("Demonstrating Discovery Reference class.");
@@ -37,14 +37,14 @@ static void Main()
MyDiscoveryReferenceClass myDiscoveryReference;
myDiscoveryReference = new MyDiscoveryReferenceClass();
- DiscoveryClientProtocol myDiscoveryClientProtocol =
+ DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
- myDiscoveryClientProtocol.Credentials =
+ myDiscoveryClientProtocol.Credentials =
CredentialCache.DefaultCredentials;
// Set client protocol.
myDiscoveryReference.ClientProtocol = myDiscoveryClientProtocol;
-
+
// Read the default file name.
Console.WriteLine("Default file name is: " + myDiscoveryReference.DefaultFilename);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReference1/CS/discoveryreference.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReference1/CS/discoveryreference.cs
index 2b191a33823..aecbc79f532 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReference1/CS/discoveryreference.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReference1/CS/discoveryreference.cs
@@ -1,9 +1,9 @@
// System.Web.Services.Discovery.DiscoveryReference
-/*
- This program demonstrates 'DiscoveryReference' class.
+/*
+ This program demonstrates 'DiscoveryReference' class.
DiscoveryReference class is derived in 'MyDiscoveryReferenceClass'. A
- variable of type 'MyDiscoveryReferenceClass' class is taken to demonstrate
+ variable of type 'MyDiscoveryReferenceClass' class is taken to demonstrate
members of 'MyDiscoveryReferenceClass'.
Note : The dataservice.disco file should be copied to c:\Inetpub\wwwroot
*/
@@ -20,7 +20,7 @@ static void Main()
{
try {
DiscoveryDocument myDiscoveryDocument;
- StreamReader myStreamReader =
+ StreamReader myStreamReader =
new StreamReader("c:\\Inetpub\\wwwroot\\dataservice.disco");
FileStream myStream = new FileStream("c:\\MyDiscovery.disco",
FileMode.OpenOrCreate);
@@ -33,16 +33,16 @@ static void Main()
MyDiscoveryReferenceClass myDiscoveryReference;
myDiscoveryReference = new MyDiscoveryReferenceClass();
- DiscoveryClientProtocol myDiscoveryClientProtocol =
+ DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
- myDiscoveryClientProtocol.Credentials =
+ myDiscoveryClientProtocol.Credentials =
CredentialCache.DefaultCredentials;
// Set the client protocol.
myDiscoveryReference.ClientProtocol = myDiscoveryClientProtocol;
-
+
// Read the default file name.
- Console.WriteLine("Default file name is: "
+ Console.WriteLine("Default file name is: "
+ myDiscoveryReference.DefaultFilename);
// Write the document.
@@ -51,7 +51,7 @@ static void Main()
// Read the document.
myDiscoveryReference.ReadDocument(myStream);
- // Set the URL.
+ // Set the URL.
myDiscoveryReference.Url = "http://localhost/dataservice.disco";
Console.WriteLine("Url is: " + myDiscoveryReference.Url);
@@ -61,7 +61,7 @@ static void Main()
myStreamReader.Close();
myStream.Close();
}
- catch (Exception e)
+ catch (Exception e)
{
Console.WriteLine("Exception caught! - {0}", e.Message);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReferenceCollection/CS/discoveryreferencecollection.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReferenceCollection/CS/discoveryreferencecollection.cs
index 334adc36080..e4e56805417 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReferenceCollection/CS/discoveryreferencecollection.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DiscoveryReferenceCollection/CS/discoveryreferencecollection.cs
@@ -21,20 +21,20 @@ class MyDiscoveryDocumentClass
{
static void Main()
{
- DiscoveryDocumentReference myDiscoveryDocReference1 =
+ DiscoveryDocumentReference myDiscoveryDocReference1 =
new DiscoveryDocumentReference();
- DiscoveryDocumentReference myDiscoveryDocReference2 =
+ DiscoveryDocumentReference myDiscoveryDocReference2 =
new DiscoveryDocumentReference();
DiscoveryReference myDiscoveryReference;
Console.WriteLine("Demonstrating DiscoveryReferenceCollection class.");
-
+
// Create new DiscoveryReferenceCollection.
- DiscoveryReferenceCollection myDiscoveryReferenceCollection =
+ DiscoveryReferenceCollection myDiscoveryReferenceCollection =
new DiscoveryReferenceCollection();
// Access the Count method.
- Console.WriteLine("The number of elements in the collection is: "
+ Console.WriteLine("The number of elements in the collection is: "
+ myDiscoveryReferenceCollection.Count.ToString());
// Add elements to the collection.
@@ -42,18 +42,18 @@ static void Main()
myDiscoveryReferenceCollection.Add(myDiscoveryDocReference2);
Console.WriteLine("The number of elements in the collection "
- + "after adding two elements to the collection: "
+ + "after adding two elements to the collection: "
+ myDiscoveryReferenceCollection.Count.ToString());
// Call the Contains method.
- if (myDiscoveryReferenceCollection.Contains(myDiscoveryDocReference1)
+ if (myDiscoveryReferenceCollection.Contains(myDiscoveryDocReference1)
!= true)
{
throw new Exception("Element not found in collection.");
}
// Access the indexed member.
- myDiscoveryReference =
+ myDiscoveryReference =
(DiscoveryReference)myDiscoveryReferenceCollection[0];
if (myDiscoveryReference == null)
{
@@ -63,7 +63,7 @@ static void Main()
// Remove one element from collection.
myDiscoveryReferenceCollection.Remove(myDiscoveryDocReference1);
Console.WriteLine("The number of elements in the collection "
- + "after removing one element is: "
+ + "after removing one element is: "
+ myDiscoveryReferenceCollection.Count.ToString());
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Discovery_SoapBinding1/CS/discovery_soapbinding.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Discovery_SoapBinding1/CS/discovery_soapbinding.cs
index 7fe911882e8..fceec5c2aca 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Discovery_SoapBinding1/CS/discovery_soapbinding.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Discovery_SoapBinding1/CS/discovery_soapbinding.cs
@@ -4,7 +4,7 @@
// System.Web.Services.Discovery.SoapBinding.Namespace
// System.Web.Services.Discovery.SoapBinding
-/* The following example demonstrates 'Discovery.SoapBinding' class, its
+/* The following example demonstrates 'Discovery.SoapBinding' class, its
* constructor, 'Address', 'Binding' and 'Namespace' members. A variable
* of type 'SoapBinding' is created. The properties are set.
* Finally the created 'SoapBinding' is added to 'DiscoveryClientProtocol'.
@@ -35,33 +35,33 @@ static void Run()
string myStringUrl = "http://localhost/dataservice.disco";
// Call the Discover method to populate the Documents property.
- DiscoveryClientProtocol myDiscoveryClientProtocol =
+ DiscoveryClientProtocol myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
- myDiscoveryClientProtocol.Credentials =
+ myDiscoveryClientProtocol.Credentials =
CredentialCache.DefaultCredentials;
- DiscoveryDocument myDiscoveryDocument =
+ DiscoveryDocument myDiscoveryDocument =
myDiscoveryClientProtocol.Discover(myStringUrl);
-
+
Console.WriteLine("Demonstrating the Discovery.SoapBinding class.");
// Create a SOAP binding.
SoapBinding mySoapBinding = new SoapBinding();
-
+
// Assign an address to the created SOAP binding.
mySoapBinding.Address = "http://schemas.xmlsoap.org/disco/scl/";
-
+
// Bind the created SOAP binding with a new XmlQualifiedName.
mySoapBinding.Binding = new XmlQualifiedName("string",
"http://www.w3.org/2001/XMLSchema");
-
+
// Add the created SOAP binding to the DiscoveryClientProtocol.
myDiscoveryClientProtocol.AdditionalInformation.Add(mySoapBinding);
// Display the namespace associated with SOAP binding.
- Console.WriteLine("Namespace associated with the SOAP binding is: "
+ Console.WriteLine("Namespace associated with the SOAP binding is: "
+ SoapBinding.Namespace);
-
- // Write all the information of the DiscoveryClientProtocol.
+
+ // Write all the information of the DiscoveryClientProtocol.
myDiscoveryClientProtocol.WriteAll(".","results.discomap");
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_Constructor/CS/dnspermission_constructor.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_Constructor/CS/dnspermission_constructor.cs
index 24395e9ee7a..96c2f907d4b 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_Constructor/CS/dnspermission_constructor.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_Constructor/CS/dnspermission_constructor.cs
@@ -1,6 +1,6 @@
/*
This program demonstrates the 'Constructor' of 'DnsPermission' class.
- It creates an instance of 'DnsPermission' class and checks for permission.Then it
+ It creates an instance of 'DnsPermission' class and checks for permission.Then it
creates a 'SecurityElement' object and prints it's attributes which hold the XML
encoding of 'DnsPermission' instance .
*/
@@ -23,14 +23,14 @@ public static void Main() {
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
- catch(Exception e)
+ catch(Exception e)
{
Console.WriteLine("Exception caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
}
-//
+//
public void useDns() {
// Create a DnsPermission instance.
@@ -39,7 +39,7 @@ public void useDns() {
// Check for permission.
permission.Demand();
// Create a SecurityElement object to hold XML encoding of the DnsPermission instance.
- SecurityElement securityElementObj = permission.ToXml();
+ SecurityElement securityElementObj = permission.ToXml();
Console.WriteLine("Tag, Attributes and Values of 'DnsPermission' instance :");
Console.WriteLine("\n\tTag :" + securityElementObj.Tag);
// Print the attributes and values.
@@ -54,5 +54,5 @@ private void PrintKeysAndValues(Hashtable myList) {
Console.WriteLine("\t{0}:\t{1}", myEnumerator.Key, myEnumerator.Value);
Console.WriteLine();
}
-//
+//
};
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_Copy/CS/dnspermission_copy.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_Copy/CS/dnspermission_copy.cs
index 8431596cb12..70151d33605 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_Copy/CS/dnspermission_copy.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_Copy/CS/dnspermission_copy.cs
@@ -12,18 +12,18 @@ It creates an identical copy of 'DnsPermission' instance.
class DnsPermissionExample {
public static void Main() {
- try
+ try
{
DnsPermissionExample dnsPermissionExampleObj = new DnsPermissionExample();
dnsPermissionExampleObj.UseDns();
}
- catch(SecurityException e)
+ catch(SecurityException e)
{
Console.WriteLine("SecurityException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
- catch(Exception e)
+ catch(Exception e)
{
Console.WriteLine("Exception caught!!!");
Console.WriteLine("Source : " + e.Source);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_FromXml/CS/dnspermission_fromxml.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_FromXml/CS/dnspermission_fromxml.cs
index 5465efcfd60..6306d5f46f8 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_FromXml/CS/dnspermission_fromxml.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_FromXml/CS/dnspermission_fromxml.cs
@@ -1,8 +1,8 @@
/*
This program demonstrates the 'FromXml' method of 'DnsPermission' class.
- It creates an instance of 'DnsPermission' class and prints the XML encoding of that instance.Then it
+ It creates an instance of 'DnsPermission' class and prints the XML encoding of that instance.Then it
creates a 'SecurityElement' object and adds the attributes corresponding to the above 'DnsPermission'
- object. A new 'DnsPermission' instance is reconstructed from the 'SecurityElement' instance by calling
+ object. A new 'DnsPermission' instance is reconstructed from the 'SecurityElement' instance by calling
'FromXml' method and it's XML encoding is printed.
*/
@@ -14,17 +14,17 @@ creates a 'SecurityElement' object and adds the attributes corresponding to the
class DnsPermissionExample {
- public static void Main() {
+ public static void Main() {
DnsPermissionExample dnsPermissionExampleObj = new DnsPermissionExample();
dnsPermissionExampleObj.ConstructDnsPermission();
}
//
public void ConstructDnsPermission() {
- try
+ try
{
// Create a DnsPermission instance.
DnsPermission permission = new DnsPermission(PermissionState.None);
- // Create a SecurityElement instance by calling the ToXml method on the
+ // Create a SecurityElement instance by calling the ToXml method on the
// DnsPermission instance.
// Print its attributes, which hold the XML encoding of the DnsPermission
// instance.
@@ -34,11 +34,11 @@ public void ConstructDnsPermission() {
// Create a SecurityElement instance.
SecurityElement securityElementObj = new SecurityElement("IPermission");
// Add attributes and values of the SecurityElement instance corresponding to
- // the permission instance.
+ // the permission instance.
securityElementObj.AddAttribute("version", "1");
securityElementObj.AddAttribute("Unrestricted", "true");
securityElementObj.AddAttribute("class","System.Net.DnsPermission");
-
+
// Reconstruct a DnsPermission instance from an XML encoding.
DnsPermission permission1 = new DnsPermission(PermissionState.None);
permission1.FromXml(securityElementObj);
@@ -47,19 +47,19 @@ public void ConstructDnsPermission() {
Console.WriteLine("After reconstruction Attributes and Values of new DnsPermission instance :");
PrintKeysAndValues(permission1.ToXml().Attributes);
}
- catch(NullReferenceException e)
+ catch(NullReferenceException e)
{
Console.WriteLine("NullReferenceException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
- catch(SecurityException e)
+ catch(SecurityException e)
{
Console.WriteLine("SecurityException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
- catch(ArgumentNullException e)
+ catch(ArgumentNullException e)
{
Console.WriteLine("ArgumentNullException caught!!!");
Console.WriteLine("Source : " + e.Source);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_IsSubsetOf/CS/dnspermission_issubsetof.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_IsSubsetOf/CS/dnspermission_issubsetof.cs
index 1ceb8d975ef..bfe2d2a5278 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_IsSubsetOf/CS/dnspermission_issubsetof.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_IsSubsetOf/CS/dnspermission_issubsetof.cs
@@ -11,16 +11,16 @@ more access to DNS servers than does the specified 'DnsPermission' instance.
using System.Collections;
class DnsPermissionExample {
-
+
private DnsPermission permission;
public static void Main() {
- try
+ try
{
DnsPermissionExample dnsPermissionExampleObj = new DnsPermissionExample();
dnsPermissionExampleObj.useDns();
}
- catch(SecurityException e)
+ catch(SecurityException e)
{
Console.WriteLine("SecurityException caught!!!");
Console.WriteLine("Source : " + e.Source);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_IsUnrestricted/CS/dnspermission_isunrestricted.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_IsUnrestricted/CS/dnspermission_isunrestricted.cs
index 2fbf24c33c8..2610b76fdf5 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_IsUnrestricted/CS/dnspermission_isunrestricted.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DnsPermission_IsUnrestricted/CS/dnspermission_isunrestricted.cs
@@ -11,14 +11,14 @@ This program demonstrates the 'IsUnrestricted' method of 'DnsPermission' class.
using System.Collections;
class DnsPermissionExample {
-
+
public static void Main(String[] Args) {
- try
+ try
{
DnsPermissionExample dnsPermissionExampleObj = new DnsPermissionExample();
dnsPermissionExampleObj.useDns();
}
- catch(SecurityException e)
+ catch(SecurityException e)
{
Console.WriteLine("SecurityException caught!!!");
Console.WriteLine("Source : " + e.Source);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_Begin_EndResolve/CS/dns_begin_endresolve.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_Begin_EndResolve/CS/dns_begin_endresolve.cs
index 865a2b77471..bc93db044ea 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_Begin_EndResolve/CS/dns_begin_endresolve.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_Begin_EndResolve/CS/dns_begin_endresolve.cs
@@ -1,8 +1,8 @@
/*
This program demonstrates 'BeginResolve' and 'EndResolve' methods of Dns class.
- It obtains the 'IPHostEntry' object by calling 'BeginResolve' and 'EndResolve' method
+ It obtains the 'IPHostEntry' object by calling 'BeginResolve' and 'EndResolve' method
of 'Dns' class by passing a URL, a callback function and an instance of 'RequestState'
- class.Then prints host name, IP address list and aliases.
+ class.Then prints host name, IP address list and aliases.
*/
using System;
@@ -12,7 +12,7 @@ It obtains the 'IPHostEntry' object by calling 'BeginResolve' and 'EndResolve' m
//
//
class DnsBeginGetHostByName
-{
+{
public static System.Threading.ManualResetEvent allDone = null;
class RequestState
@@ -30,7 +30,7 @@ public static void Main()
// Create an instance of the RequestState class.
RequestState myRequestState = new RequestState();
- // Begin an asynchronous request for information like host name, IP addresses, or
+ // Begin an asynchronous request for information like host name, IP addresses, or
// aliases for specified the specified URI.
IAsyncResult asyncResult = Dns.BeginResolve("www.contoso.com", new AsyncCallback(RespCallback), myRequestState );
@@ -41,17 +41,17 @@ public static void Main()
for(int index=0; index < myRequestState.host.AddressList.Length; index++)
{
Console.WriteLine(myRequestState.host.AddressList[index]);
- }
+ }
Console.WriteLine("\nAliases : ");
for(int index=0; index < myRequestState.host.Aliases.Length; index++)
{
Console.WriteLine(myRequestState.host.Aliases[index]);
- }
+ }
}
-
+
private static void RespCallback(IAsyncResult ar)
{
- try
+ try
{
// Convert the IAsyncResult object to a RequestState object.
RequestState tempRequestState = (RequestState)ar.AsyncState;
@@ -59,12 +59,12 @@ private static void RespCallback(IAsyncResult ar)
tempRequestState.host = Dns.EndResolve(ar);
allDone.Set();
}
- catch(ArgumentNullException e)
+ catch(ArgumentNullException e)
{
Console.WriteLine("ArgumentNullException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
- }
+ }
catch(Exception e)
{
Console.WriteLine("Exception caught!!!");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostByAddress_IPAddress/CS/dns_gethostbyaddress_ipaddress.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostByAddress_IPAddress/CS/dns_gethostbyaddress_ipaddress.cs
index b447f24150d..10761343b5c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostByAddress_IPAddress/CS/dns_gethostbyaddress_ipaddress.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostByAddress_IPAddress/CS/dns_gethostbyaddress_ipaddress.cs
@@ -1,9 +1,9 @@
/*
This program demonstrates 'GetHostByAddress(IPAddress)' method of 'Dns' class.
- It takes an IP address string from commandline or uses default value and creates
- an instance of IPAddress for the specified IP address string. Obtains the IPHostEntry
+ It takes an IP address string from commandline or uses default value and creates
+ an instance of IPAddress for the specified IP address string. Obtains the IPHostEntry
object by calling 'GetHostByAddress' method of 'Dns' class and prints host name,
- IP address list and aliases.
+ IP address list and aliases.
*/
using System;
@@ -25,14 +25,14 @@ public static void Main()
}
public void DisplayHostAddress(String IpAddressString)
{
- // Call 'GetHostByAddress(IPAddress)' method giving an 'IPAddress' object as argument.
+ // Call 'GetHostByAddress(IPAddress)' method giving an 'IPAddress' object as argument.
// Obtain an 'IPHostEntry' instance, containing address information of the specified host.
-//
- try
+//
+ try
{
IPAddress hostIPAddress = IPAddress.Parse(IpAddressString);
IPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress);
- // Get the IP address list that resolves to the host names contained in
+ // Get the IP address list that resolves to the host names contained in
// the Alias property.
IPAddress[] address = hostInfo.AddressList;
// Get the alias names of the addresses in the IP address list.
@@ -42,13 +42,13 @@ public void DisplayHostAddress(String IpAddressString)
Console.WriteLine("\nAliases :");
for(int index=0; index < alias.Length; index++) {
Console.WriteLine(alias[index]);
- }
+ }
Console.WriteLine("\nIP address list : ");
for(int index=0; index < address.Length; index++) {
Console.WriteLine(address[index]);
}
}
- catch(SocketException e)
+ catch(SocketException e)
{
Console.WriteLine("SocketException caught!!!");
Console.WriteLine("Source : " + e.Source);
@@ -72,6 +72,6 @@ public void DisplayHostAddress(String IpAddressString)
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
-//
+//
}
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostByName/CS/dns_gethostbyname.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostByName/CS/dns_gethostbyname.cs
index cfbaac4a349..b27fdbc3303 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostByName/CS/dns_gethostbyname.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostByName/CS/dns_gethostbyname.cs
@@ -1,8 +1,8 @@
/*
This program demonstrates 'GetHostByName' method of 'Dns' class.
- It takes a URL string from commandline or uses default value, and obtains
- the 'IPHostEntry' object by calling 'GetHostByName' method of 'Dns' class.Then
- prints host name,IP address list and aliases.
+ It takes a URL string from commandline or uses default value, and obtains
+ the 'IPHostEntry' object by calling 'GetHostByName' method of 'Dns' class.Then
+ prints host name,IP address list and aliases.
*/
using System;
@@ -12,7 +12,7 @@ This program demonstrates 'GetHostByName' method of 'Dns' class.
class DnsHostByName
{
public static void Main()
-
+
{
String hostName = "";
DnsHostByName myDnsHostByName = new DnsHostByName();
@@ -26,14 +26,14 @@ public static void Main()
public void DisplayHostName(String hostName)
{
- // Call the GetHostByName method passing a DNS style host name(for example,
- // "www.contoso.com") as an argument.
+ // Call the GetHostByName method passing a DNS style host name(for example,
+ // "www.contoso.com") as an argument.
// Obtain the IPHostEntry instance, that contains information of the specified host.
-//
- try
+//
+ try
{
IPHostEntry hostInfo = Dns.GetHostByName(hostName);
- // Get the IP address list that resolves to the host names contained in the
+ // Get the IP address list that resolves to the host names contained in the
// Alias property.
IPAddress[] address = hostInfo.AddressList;
// Get the alias names of the addresses in the IP address list.
@@ -43,13 +43,13 @@ public void DisplayHostName(String hostName)
Console.WriteLine("\nAliases : ");
for(int index=0; index < alias.Length; index++) {
Console.WriteLine(alias[index]);
- }
+ }
Console.WriteLine("\nIP address list : ");
for(int index=0; index < address.Length; index++) {
Console.WriteLine(address[index]);
}
}
- catch(SocketException e)
+ catch(SocketException e)
{
Console.WriteLine("SocketException caught!!!");
Console.WriteLine("Source : " + e.Source);
@@ -67,6 +67,6 @@ public void DisplayHostName(String hostName)
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
-//
+//
}
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostName/CS/dns_gethostname.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostName/CS/dns_gethostname.cs
index a42bd834d5b..7432ab368e9 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostName/CS/dns_gethostname.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_GetHostName/CS/dns_gethostname.cs
@@ -1,6 +1,6 @@
/*
This program demonstrates the 'GetHostName' method of 'Dns' class.
- It creates a 'DnsHostName' instance and calls 'GetHostName' method to get the local host
+ It creates a 'DnsHostName' instance and calls 'GetHostName' method to get the local host
computer name. Then prints the computer name on the console.
*/
@@ -15,8 +15,8 @@ public static void Main()
DnsHostName dnsHostNameObj = new DnsHostName();
dnsHostNameObj.DisplayLocalHostName();
}
-
-//
+
+//
public void DisplayLocalHostName()
{
try {
@@ -36,5 +36,5 @@ public void DisplayLocalHostName()
Console.WriteLine("Message : " + e.Message);
}
}
-//
+//
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_Resolve/CS/dns_resolve.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_Resolve/CS/dns_resolve.cs
index 225fa30e284..fbac88ba001 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Dns_Resolve/CS/dns_resolve.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Dns_Resolve/CS/dns_resolve.cs
@@ -1,6 +1,6 @@
/*
This program demonstrates 'Resolve' method of 'Dns' class.
- It takes a URL or IP address string from commandline or uses default value and obtains the 'IPHostEntry'
+ It takes a URL or IP address string from commandline or uses default value and obtains the 'IPHostEntry'
object by calling 'Resolve' method of 'Dns' class. Then prints host name, IP address list and aliases.
*/
@@ -16,7 +16,7 @@ public static void Main()
DnsResolve myDnsResolve = new DnsResolve();
Console.Write("Type a URL or IP address (press Enter for default, default is '207.46.131.199') : ");
hostString = Console.ReadLine();
- if(hostString.Length > 0)
+ if(hostString.Length > 0)
myDnsResolve.DisplayHostAddress(hostString);
else
myDnsResolve.DisplayHostAddress("207.46.131.199");
@@ -24,13 +24,13 @@ public static void Main()
public void DisplayHostAddress(String hostString)
{
- // Call the Resolve method passing a DNS style host name or an IP address in dotted-quad notation
- // (for example, "www.contoso.com" or "207.46.131.199") to obtain an IPHostEntry instance that contains
+ // Call the Resolve method passing a DNS style host name or an IP address in dotted-quad notation
+ // (for example, "www.contoso.com" or "207.46.131.199") to obtain an IPHostEntry instance that contains
// address information for the specified host.
-//
+//
try {
IPHostEntry hostInfo = Dns.Resolve(hostString);
- // Get the IP address list that resolves to the host names contained in the
+ // Get the IP address list that resolves to the host names contained in the
// Alias property.
IPAddress[] address = hostInfo.AddressList;
// Get the alias names of the addresses in the IP address list.
@@ -40,13 +40,13 @@ public void DisplayHostAddress(String hostString)
Console.WriteLine("\nAliases : ");
for(int index=0; index < alias.Length; index++) {
Console.WriteLine(alias[index]);
- }
+ }
Console.WriteLine("\nIP Address list :");
for(int index=0; index < address.Length; index++) {
Console.WriteLine(address[index]);
}
}
- catch(SocketException e)
+ catch(SocketException e)
{
Console.WriteLine("SocketException caught!!!");
Console.WriteLine("Source : " + e.Source);
@@ -70,6 +70,6 @@ public void DisplayHostAddress(String hostString)
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
-//
+//
}
}
\ No newline at end of file
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/DocumentableItemsample/CS/documentableitemsample.cs b/samples/snippets/csharp/VS_Snippets_Remoting/DocumentableItemsample/CS/documentableitemsample.cs
index cbfb97295d6..4e7416d0814 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/DocumentableItemsample/CS/documentableitemsample.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/DocumentableItemsample/CS/documentableitemsample.cs
@@ -1,10 +1,10 @@
// System.Web.Services.Description.DocumentableItem.Documentation;
-/*
+/*
The following program demonstrates the property 'Documentation' of abstract class 'DocumentableItem'
The program reads a wsdl document "MathService.wsdl" and instantiates a ServiceDescription instance
from the WSDL document.
- This program demonstrates a generic utility function which can accept any of Types,PortType and Binding
+ This program demonstrates a generic utility function which can accept any of Types,PortType and Binding
classes as parameters.
*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices Registration/CS/deployservicedcomponent.cs b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices Registration/CS/deployservicedcomponent.cs
index 4e1cbf52aa2..6fadceda60f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices Registration/CS/deployservicedcomponent.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices Registration/CS/deployservicedcomponent.cs
@@ -1,5 +1,5 @@
using System;
-using System.EnterpriseServices;
+using System.EnterpriseServices;
namespace ESDeployment
{
///
@@ -20,14 +20,14 @@ static void Main(string[] args)
//
string applicationName = "Queued Component";
string typeLibraryName = null;
- RegistrationHelper helper = new RegistrationHelper();
- // Call the InstallAssembly method passing it the name of the assembly to
- // install as a COM+ application, the COM+ application name, and
+ RegistrationHelper helper = new RegistrationHelper();
+ // Call the InstallAssembly method passing it the name of the assembly to
+ // install as a COM+ application, the COM+ application name, and
// the name of the type library file.
// Setting the application name and the type library to NULL (nothing in Visual Basic .NET
- // allows you to use the COM+ application name that is given in the assembly and
- // the default type library name. The application name in the assembly metadata
- // takes precedence over the application name you provide to InstallAssembly.
+ // allows you to use the COM+ application name that is given in the assembly and
+ // the default type library name. The application name in the assembly metadata
+ // takes precedence over the application name you provide to InstallAssembly.
helper.InstallAssembly(@"C:..\..\QueuedComponent.dll", ref applicationName, ref typeLibraryName, InstallationFlags.CreateTargetApplication);
Console.WriteLine("Registration succeeded: Type library {0} created.", typeLibraryName);
Console.Read();
@@ -36,36 +36,36 @@ static void Main(string[] args)
//
// Create a RegistrationConfig object and set its attributes
// Create a RegistrationHelper object, and call the InstallAssemblyFromConfig
- // method by passing the RegistrationConfiguration object to it as a
+ // method by passing the RegistrationConfiguration object to it as a
// reference object
RegistrationConfig registrationConfiguration = new RegistrationConfig();
registrationConfiguration.AssemblyFile=@"C:..\..\QueuedComponent.dll";
registrationConfiguration.Application = "MyApp";
registrationConfiguration.InstallationFlags = InstallationFlags.CreateTargetApplication;
RegistrationHelper helperFromConfig = new RegistrationHelper();
- helperFromConfig.InstallAssemblyFromConfig(ref registrationConfiguration);
+ helperFromConfig.InstallAssemblyFromConfig(ref registrationConfiguration);
//
}
- //
-
+ //
+
catch(RegistrationException e)
{
- Console.WriteLine(e.Message);
+ Console.WriteLine(e.Message);
//
-
+
//
- // Check whether the ErrorInfo property of the RegistrationException object is null.
- // If there is no extended error information about
+ // Check whether the ErrorInfo property of the RegistrationException object is null.
+ // If there is no extended error information about
// methods related to multiple COM+ objects ErrorInfo will be null.
if(e.ErrorInfo != null)
{
// Gets an array of RegistrationErrorInfo objects describing registration errors
RegistrationErrorInfo[] registrationErrorInfos = e.ErrorInfo;
-
- // Iterate through the array of RegistrationErrorInfo objects and disply the
+
+ // Iterate through the array of RegistrationErrorInfo objects and disply the
// ErrorString for each object.
- foreach (RegistrationErrorInfo registrationErrorInfo in registrationErrorInfos)
+ foreach (RegistrationErrorInfo registrationErrorInfo in registrationErrorInfos)
{
Console.WriteLine(registrationErrorInfo.ErrorString);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServicesAutoCompleteAttribute/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServicesAutoCompleteAttribute/CS/class1.cs
index 7bf8a4fcf0d..372a8eb6f5e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServicesAutoCompleteAttribute/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServicesAutoCompleteAttribute/CS/class1.cs
@@ -27,7 +27,7 @@ public void AutoCompleteAttribute_Ctor_Bool()
public void AutoCompleteAttribute_Value()
{
// Get information on the member.
- System.Reflection.MemberInfo[] memberinfo =
+ System.Reflection.MemberInfo[] memberinfo =
this.GetType().GetMember(
"AutoCompleteAttribute_Value");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Activity/CS/EnterpriseServices_Activity.cs b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Activity/CS/EnterpriseServices_Activity.cs
index 3ba3d3b72ac..50f1b0d85f4 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Activity/CS/EnterpriseServices_Activity.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Activity/CS/EnterpriseServices_Activity.cs
@@ -3,16 +3,16 @@
namespace EnterpriseServices_ActivitySample
{
//
- class SvcClass: IServiceCall
+ class SvcClass: IServiceCall
{
static int callNumber = 0;
public void OnCall()
{
callNumber++;
System.Guid contextID = ContextUtil.ContextId;
- Console.WriteLine("This is call number "+ callNumber.ToString());
+ Console.WriteLine("This is call number "+ callNumber.ToString());
Console.WriteLine(contextID.ToString());
- System.TimeSpan sleepTime = new System.TimeSpan(0,0,0,10);
+ System.TimeSpan sleepTime = new System.TimeSpan(0,0,0,10);
System.Threading.Thread.Sleep(sleepTime);
}
}
@@ -26,10 +26,10 @@ static void Main(string[] args)
serviceConfig.ThreadPool = ThreadPoolOption.MTA;
SvcClass serviceCall = new SvcClass();
//
- Activity activity = new Activity(serviceConfig);
+ Activity activity = new Activity(serviceConfig);
//
//
- activity.AsynchronousCall(serviceCall);
+ activity.AsynchronousCall(serviceCall);
//
activity.AsynchronousCall(serviceCall);
Console.WriteLine("Waiting for asynchronous calls to terminate");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Crm/CS/crmserver.cs b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Crm/CS/crmserver.cs
index 822ee4acc61..ad0322ac721 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Crm/CS/crmserver.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Crm/CS/crmserver.cs
@@ -38,7 +38,7 @@ public static int ReadAccountBalance (string filename)
balance = Int32.Parse(line);
reader.Close();
}
- return(balance);
+ return(balance);
}
}
@@ -50,7 +50,7 @@ public class Account : ServicedComponent
// A data member for the account file name.
private string filename;
-
+
public string Filename
{
get
@@ -78,7 +78,7 @@ public bool AllowCommit
}
}
- // Debit the account,
+ // Debit the account,
public void DebitAccount (int ammount)
{
@@ -105,7 +105,7 @@ public void DebitAccount (int ammount)
AccountManager.WriteAccountBalance(filename, balance);
//
- // Commit or abort the transaction
+ // Commit or abort the transaction
if (commit)
{
ContextUtil.SetComplete();
@@ -145,7 +145,7 @@ public override bool PrepareRecord (LogRecord log)
// The record is valid.
receivedPrepareRecord = true;
- return(false);
+ return(false);
}
//
@@ -206,7 +206,7 @@ public override bool AbortRecord (LogRecord log)
// Extract old account data from the record.
string filename = (string) record[0];
int balance = (int) record[1];
-
+
// Restore the old state of the account.
AccountManager.WriteAccountBalance(filename, balance);
@@ -218,7 +218,7 @@ public override bool AbortRecord (LogRecord log)
public override void EndAbort ()
{
// nothing to do
- }
+ }
//
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Pooling/CS/inspector.cs b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Pooling/CS/inspector.cs
index ee5d4395c47..8309a3c32a4 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Pooling/CS/inspector.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_Pooling/CS/inspector.cs
@@ -19,9 +19,9 @@ public string IdentifyObject (Object obj)
// Return this object to the pool after use.
ContextUtil.DeactivateOnReturn = true;
- // Get the supplied object's type.
+ // Get the supplied object's type.
Type objType = obj.GetType();
-
+
// Return its name.
return(objType.FullName);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_SharedProperties/CS/receiptcounterclass.cs b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_SharedProperties/CS/receiptcounterclass.cs
index 0b9b032de3a..c22773aacab 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_SharedProperties/CS/receiptcounterclass.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/EnterpriseServices_SharedProperties/CS/receiptcounterclass.cs
@@ -3,14 +3,14 @@
using System.EnterpriseServices;
using System.Reflection;
-[assembly: ApplicationName("ReceiptNumberGenerator")]
-[assembly: ApplicationActivation(ActivationOption.Library)]
+[assembly: ApplicationName("ReceiptNumberGenerator")]
+[assembly: ApplicationActivation(ActivationOption.Library)]
public class ReceiptNumberGeneratorClass
{
// Generates a new receipt number based on the receipt number
// stored by the Shared Property Manager (SPM)
- public int GetNextReceiptNumber()
+ public int GetNextReceiptNumber()
{
bool groupExists,propertyExists;
int nextReceiptNumber = 0;
@@ -32,7 +32,7 @@ public int GetNextReceiptNumber()
ReceiptNumber = group.CreateProperty("ReceiptNumber",out propertyExists);
//
//
- // Retrieve the value from shared property, and increment the shared
+ // Retrieve the value from shared property, and increment the shared
// property value.
nextReceiptNumber = (int) ReceiptNumber.Value;
ReceiptNumber.Value = nextReceiptNumber + 1;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Add/CS/faultbindingcollection_add.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Add/CS/faultbindingcollection_add.cs
index b3502c58728..fe9eb717bf5 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Add/CS/faultbindingcollection_add.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Add/CS/faultbindingcollection_add.cs
@@ -1,12 +1,12 @@
/* The following example demonstrates the 'Add' method of the 'FaultBindingCollection' class
- * and constructor and 'Extensions' property of 'FaultBinding'class and 'Documentation'
+ * and constructor and 'Extensions' property of 'FaultBinding'class and 'Documentation'
* property of 'DocumentableItem' class.
- *
+ *
* This program generates a WSDL file for a service called StockQuote. The StockQuote service
- * provides one method called 'GetTradePrice'. The 'GetTradePrice' method takes two arguments,
- * a 'tickerSymbol' and 'time' strings. The 'tickerSymbol' is a unique representation of a
- * stock and 'time' is the time for which the trading price is to be returned for the stock
- * specified. The WSDL file generated for the service supports the SOAP protocol only.
+ * provides one method called 'GetTradePrice'. The 'GetTradePrice' method takes two arguments,
+ * a 'tickerSymbol' and 'time' strings. The 'tickerSymbol' is a unique representation of a
+ * stock and 'time' is the time for which the trading price is to be returned for the stock
+ * specified. The WSDL file generated for the service supports the SOAP protocol only.
*/
using System;
@@ -17,26 +17,26 @@
public class FaultBindingCollection_Add
{
-
+
public static void Main()
{
ServiceDescription myServiceDescription = new ServiceDescription();
myServiceDescription.Name = "StockQuote";
myServiceDescription.TargetNamespace = "http://www.contoso.com/stockquote.wsdl";
-
- // Generate the 'Types' element.
+
+ // Generate the 'Types' element.
XmlSchema myXmlSchema = new XmlSchema();
myXmlSchema.AttributeFormDefault = XmlSchemaForm.Qualified;
myXmlSchema.ElementFormDefault = XmlSchemaForm.Qualified;
myXmlSchema.TargetNamespace = "http://www.contoso.com/stockquote.wsdl";
-
+
//XmlSchemaElement myXmlSchemaElement;
XmlSchemaComplexType myXmlSchemaComplexType = new XmlSchemaComplexType();
myXmlSchemaComplexType.Name = "GetTradePriceInputType";
XmlSchemaSequence myXmlSchemaSequence = new XmlSchemaSequence();
myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1","1","tickerSymbol",true,new XmlQualifiedName("s:string")));
myXmlSchemaSequence.Items.Add(CreateComplexTypeXmlElement("1","1","time",true,new XmlQualifiedName("s:string")));
- myXmlSchemaComplexType.Particle = myXmlSchemaSequence;
+ myXmlSchemaComplexType.Particle = myXmlSchemaSequence;
myXmlSchema.Items.Add(myXmlSchemaComplexType);
myXmlSchemaComplexType = new XmlSchemaComplexType();
@@ -157,7 +157,7 @@ public static void Main()
myFaultBindingCollection.Add(myFaultBinding);
myOperationBindingCollection.Add(myOperationBinding);
myBindingCollection.Add(myBinding);
-
+
// Generate the 'Service' element.
ServiceCollection myServiceCollection = myServiceDescription.Services;
//
@@ -183,7 +183,7 @@ public static void Main()
public static XmlSchemaElement CreateComplexTypeXmlElement(string minoccurs,string maxoccurs,string name,bool isNillable,XmlQualifiedName schemaTypeName)
{
- XmlSchemaElement myXmlSchemaElement = new XmlSchemaElement();
+ XmlSchemaElement myXmlSchemaElement = new XmlSchemaElement();
myXmlSchemaElement.MinOccursString = minoccurs;
myXmlSchemaElement.MaxOccursString = maxoccurs;
myXmlSchemaElement.Name = name;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Item/CS/faultbindingcollection_item.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Item/CS/faultbindingcollection_item.cs
index bbf93c05e14..67477f1a1d3 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Item/CS/faultbindingcollection_item.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Item/CS/faultbindingcollection_item.cs
@@ -1,10 +1,10 @@
/*
* The following example demonstrates the 'Item[string]' property of
- FaultBindingCollection class
- * The program removes a fault binding with the name 'ErrorString'
- from the WSDL file. It also removes a operation fault with the name
+ FaultBindingCollection class
+ * The program removes a fault binding with the name 'ErrorString'
+ from the WSDL file. It also removes a operation fault with the name
'ErrorString' and displays the resultant WSDL file to the console.
- *
+ *
*/
using System;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Remove/CS/faultbindingcollection_remove.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Remove/CS/faultbindingcollection_remove.cs
index 3a280165809..b4202bc2ef4 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Remove/CS/faultbindingcollection_remove.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FaultBindingCollection_Remove/CS/faultbindingcollection_remove.cs
@@ -1,9 +1,9 @@
/*
- * The following example demonstrates the 'Remove', 'CopyTo', 'Insert',
- 'Contains', 'IndexOf' method and 'Item[int]' property of FaultBindingCollection
+ * The following example demonstrates the 'Remove', 'CopyTo', 'Insert',
+ 'Contains', 'IndexOf' method and 'Item[int]' property of FaultBindingCollection
class
- The program reverses the fault bindings that appear in the WSDL file.
- It also reverses the operation faults and displays the resultant WSDL file
+ The program reverses the fault bindings that appear in the WSDL file.
+ It also reverses the operation faults and displays the resultant WSDL file
to the console.
*/
@@ -35,7 +35,7 @@ public static void Main()
for(int i = 0, j = (myOperationFaultArray.Length - 1); i < myOperationFaultArray.Length; i++, j--)
myOperationFaultCollection.Insert(i, myOperationFaultArray[j]);
}
-
+
//
//
//
@@ -50,7 +50,7 @@ public static void Main()
FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults;
// Reverse the fault bindings order.
- if(myFaultBindingCollection.Count > 1)
+ if(myFaultBindingCollection.Count > 1)
{
FaultBinding myFaultBinding = myFaultBindingCollection[0];
@@ -66,7 +66,7 @@ public static void Main()
for(int i = 0, j = (myFaultBindingArray.Length - 1); i < myFaultBindingArray.Length; i++, j--)
myFaultBindingCollection.Insert(i, myFaultBindingArray[j]);
// Check if the first element in the collection before the reversal is now the last element.
- if(myFaultBindingCollection.Contains(myFaultBinding) &&
+ if(myFaultBindingCollection.Contains(myFaultBinding) &&
myFaultBindingCollection.IndexOf(myFaultBinding) == (myFaultBindingCollection.Count - 1))
// Display the WSDL generated to the console.
myServiceDescription.Write(Console.Out);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ContentLength/CS/filewebrequest_contentlength.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ContentLength/CS/filewebrequest_contentlength.cs
index a1dc3257bfd..7b579f01243 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ContentLength/CS/filewebrequest_contentlength.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ContentLength/CS/filewebrequest_contentlength.cs
@@ -1,6 +1,6 @@
// System.Net.FileWebRequest.ContentLength;System.Net.FileWebRequest.RequestUri;
-/*
+/*
This program demonstrates 'ContentLength'and 'RequestUri' property of 'FileWebRequest' class.
The path of a file where user would like to write something is obtained from command line argument.
Then a 'WebRequest' object is created. The 'ContentLength' property of 'FileWebRequest' is used to
@@ -16,18 +16,18 @@ class FileWebRequest_ContentLen
{
public static void Main(String[] args)
{
-
+
if (args.Length < 1)
{
Console.WriteLine("\nPlease enter the file name as command line parameter where you want to write:");
Console.WriteLine("Usage:FileWebRequest_ContentLen //\nExample:FileWebRequest_ContentLen shafeeque/shaf/hello.txt");
- }
+ }
else
{
try
{
- // Create an 'Uri' object.
+ // Create an 'Uri' object.
Uri myUrl=new Uri("file://"+args[0]);
String fileName = "file://"+args[0];
FileWebRequest myFileWebRequest =null;
@@ -35,7 +35,7 @@ public static void Main(String[] args)
//
myFileWebRequest = (FileWebRequest)WebRequest.Create(myUrl);
-
+
Console.WriteLine("Enter the string you want to write into the file:");
String userInput = Console.ReadLine();
ASCIIEncoding encoder = new ASCIIEncoding();
@@ -43,7 +43,7 @@ public static void Main(String[] args)
// Set the 'Method' property of 'FileWebRequest' object to 'POST' method.
myFileWebRequest.Method="POST";
-
+
// The 'ContentLength' property is used to set the content length of the file.
myFileWebRequest.ContentLength = byteArray.Length;
//
@@ -58,9 +58,9 @@ public static void Main(String[] args)
readStream.Close();
}
- Console.WriteLine("\nThe String you entered was successfully written into the file.");
- Console.WriteLine("The content length sent to the server is "+myFileWebRequest.ContentLength+".");
-
+ Console.WriteLine("\nThe String you entered was successfully written into the file.");
+ Console.WriteLine("The content length sent to the server is "+myFileWebRequest.ContentLength+".");
+
//
}
catch(ArgumentException e)
@@ -71,6 +71,6 @@ public static void Main(String[] args)
{
Console.WriteLine("The UriFormatException is :"+e.Message);
}
- }
+ }
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ReqBeginEnd/CS/filewebrequest_reqbeginend.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ReqBeginEnd/CS/filewebrequest_reqbeginend.cs
index 2ed62221aec..0e08039df0c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ReqBeginEnd/CS/filewebrequest_reqbeginend.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ReqBeginEnd/CS/filewebrequest_reqbeginend.cs
@@ -4,7 +4,7 @@
/*
This program demonstrates 'BeginGetRequestStream' and 'EndGetRequestStream' method of 'FileWebRequest' class
The path of the file from where content is to be read is obtained as a command line argument and a 'webRequest'
- object is created.Using the 'BeginGetRequestStream' method and 'EndGetRequestStream' of 'FileWebRequest' class
+ object is created.Using the 'BeginGetRequestStream' method and 'EndGetRequestStream' of 'FileWebRequest' class
a stream object is obtained which is used to write into the file.
*/
@@ -21,7 +21,7 @@ public class RequestDeclare
{
public FileWebRequest myFileWebRequest;
public String userinput;
-
+
public RequestDeclare()
{
myFileWebRequest = null;
@@ -38,7 +38,7 @@ static void Main(string[] args)
{
Console.WriteLine("\nPlease enter the file name as command line parameter:");
Console.WriteLine("Usage:FileWebRequest_reqbeginend //\nExample:FileWebRequest_reqbeginend shafeeque/shaf/hello.txt");
- }
+ }
else
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ResBeginEnd/CS/filewebrequest_resbeginend.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ResBeginEnd/CS/filewebrequest_resbeginend.cs
index 97954f3c9bd..8d52d48f0e9 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ResBeginEnd/CS/filewebrequest_resbeginend.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebRequest_ResBeginEnd/CS/filewebrequest_resbeginend.cs
@@ -1,9 +1,9 @@
// System.Net.FileWebRequest.BeginGetResponse;System.Net.FileWebRequest.EndGetResponse;
// Snippet1 and Snippet2 go together
-/*
+/*
This program demonstrates 'BeginGetResponse' and 'EndGetResponse' methods of 'FileWebRequest' class.
- The path of the file from where content is to be read is obtained as a command line argument and a
- 'WebRequest' object is created. Using the 'BeginGetResponse' method and 'EndGetResponse' of 'FileWebRequest'
+ The path of the file from where content is to be read is obtained as a command line argument and a
+ 'WebRequest' object is created. Using the 'BeginGetResponse' method and 'EndGetResponse' of 'FileWebRequest'
class a 'FileWebResponse' object is obtained which is used to print the content on the file.
*/
@@ -18,7 +18,7 @@ class a 'FileWebResponse' object is obtained which is used to print the content
public class RequestDeclare
{
public FileWebRequest myFileWebRequest;
-
+
public RequestDeclare()
{
myFileWebRequest = null;
@@ -37,7 +37,7 @@ static void Main(string[] args)
{
Console.WriteLine("\nPlease enter the file name as command line parameter:");
Console.WriteLine("Usage:FileWebRequest_resbeginend //\nExample:FileWebRequest_resbeginend shafeeque/shaf/hello.txt");
- }
+ }
else
{
try
@@ -85,7 +85,7 @@ private static void RespCallback(IAsyncResult ar)
Console.WriteLine("The contents of the file are :\n");
- while (count > 0)
+ while (count > 0)
{
String str = new String(readBuffer, 0, count);
Console.WriteLine(str);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_Close/CS/filewebresponse_close.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_Close/CS/filewebresponse_close.cs
index 5af0231b5d1..2060acd50a0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_Close/CS/filewebresponse_close.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_Close/CS/filewebresponse_close.cs
@@ -1,8 +1,8 @@
// System.Net.FileWebResponse.Close
-/*This program demontrates the 'Close' method of 'FileWebResponse' Class.
+/*This program demontrates the 'Close' method of 'FileWebResponse' Class.
It takes an Uri from console and creates a 'FileWebRequest' object for the Uri.It then gets back
-the response object from the Uri. The response object can be processed as desired.The program then
+the response object from the Uri. The response object can be processed as desired.The program then
closes the response object and releases resources associated with it.*/
using System;
@@ -10,16 +10,16 @@ closes the response object and releases resources associated with it.*/
using System.IO;
using System.Text;
-class FileWebResponseSnippet
+class FileWebResponseSnippet
{
- public static void Main(string[] args)
+ public static void Main(string[] args)
{
- if (args.Length < 1)
+ if (args.Length < 1)
{
Console.WriteLine("\nPlease enter the file name as command line parameter:");
Console.WriteLine("Usage:FileWebResponse_Close // \nExample:FileWebResponse_Close microsoft/shared/hello.txt");
- }
- else
+ }
+ else
{
GetPage(args[0]);
}
@@ -29,24 +29,24 @@ public static void Main(string[] args)
}
//
- public static void GetPage(String url)
+ public static void GetPage(String url)
{
- try
- {
+ try
+ {
Uri fileUrl = new Uri("file://"+url);
- // Create a FileWebrequest with the specified Uri.
- FileWebRequest myFileWebRequest = (FileWebRequest)WebRequest.Create(fileUrl);
+ // Create a FileWebrequest with the specified Uri.
+ FileWebRequest myFileWebRequest = (FileWebRequest)WebRequest.Create(fileUrl);
// Send the 'fileWebRequest' and wait for response.
- FileWebResponse myFileWebResponse = (FileWebResponse)myFileWebRequest.GetResponse();
+ FileWebResponse myFileWebResponse = (FileWebResponse)myFileWebRequest.GetResponse();
// Process the response here.
Console.WriteLine("\nResponse Received.Trying to Close the response stream..");
// Release resources of response object.
myFileWebResponse.Close();
- Console.WriteLine("\nResponse Stream successfully closed.");
- }
- catch(WebException e)
+ Console.WriteLine("\nResponse Stream successfully closed.");
+ }
+ catch(WebException e)
{
- Console.WriteLine("\r\nWebException thrown.The Reason for failure is : {0}",e.Status);
+ Console.WriteLine("\r\nWebException thrown.The Reason for failure is : {0}",e.Status);
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_ContentLength_ContentType/CS/filewebresponse_contentlength_contenttype.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_ContentLength_ContentType/CS/filewebresponse_contentlength_contenttype.cs
index 6f2a1afbf4a..6ba5897fb59 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_ContentLength_ContentType/CS/filewebresponse_contentlength_contenttype.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_ContentLength_ContentType/CS/filewebresponse_contentlength_contenttype.cs
@@ -7,18 +7,18 @@ and content type of the entity body in the response onto the console */
using System;
using System.Net;
-class FileWebResponseSnippet
+class FileWebResponseSnippet
{
- public static void Main(string[] args)
+ public static void Main(string[] args)
{
- if (args.Length < 1)
+ if (args.Length < 1)
{
Console.WriteLine("\nPlease enter the file name as command line parameter:");
Console.WriteLine("Usage:FileWebResponse_ContentLength_ContentType // \nExample:FileWebResponse_ContentLength_ContentType microsoft/shared/hello.txt");
- }
- else
- {
+ }
+ else
+ {
GetPage(args[0]);
}
Console.WriteLine("Press any key to continue...");Console.ReadLine();
@@ -26,23 +26,23 @@ public static void Main(string[] args)
}
//
//
- public static void GetPage(String url)
+ public static void GetPage(String url)
{
- try
- {
+ try
+ {
Uri fileUrl = new Uri("file://"+url);
// Create a 'FileWebrequest' object with the specified Uri.
- FileWebRequest myFileWebRequest = (FileWebRequest)WebRequest.Create(fileUrl);
- // Send the 'fileWebRequest' and wait for response.
- FileWebResponse myFileWebResponse = (FileWebResponse)myFileWebRequest.GetResponse();
+ FileWebRequest myFileWebRequest = (FileWebRequest)WebRequest.Create(fileUrl);
+ // Send the 'fileWebRequest' and wait for response.
+ FileWebResponse myFileWebResponse = (FileWebResponse)myFileWebRequest.GetResponse();
// Print the ContentLength and ContentType properties received as headers in the response object.
- Console.WriteLine("\nContent length :{0}, Content Type : {1}",myFileWebResponse.ContentLength,myFileWebResponse.ContentType);
+ Console.WriteLine("\nContent length :{0}, Content Type : {1}",myFileWebResponse.ContentLength,myFileWebResponse.ContentType);
// Release resources of response object.
myFileWebResponse.Close();
- }
- catch(WebException e)
+ }
+ catch(WebException e)
{
- Console.WriteLine("\r\nWebException thrown.The Reason for failure is : {0}",e.Status);
+ Console.WriteLine("\r\nWebException thrown.The Reason for failure is : {0}",e.Status);
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_GetResponseStream/CS/filewebresponse_getresponsestream.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_GetResponseStream/CS/filewebresponse_getresponsestream.cs
index dd78536ef46..56ae4d9fb60 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_GetResponseStream/CS/filewebresponse_getresponsestream.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_GetResponseStream/CS/filewebresponse_getresponsestream.cs
@@ -2,7 +2,7 @@
/* This program demonstrates the 'GetResponseStream' method of the 'FileWebResponse' class.
It creates a 'FileWebRequest' object and queries for a response.
- The response stream obtained is piped to a higher level stream reader. The reader reads
+ The response stream obtained is piped to a higher level stream reader. The reader reads
256 characters at a time , writes them into a string and then displays the string onto the console*/
using System;
@@ -10,16 +10,16 @@ The response stream obtained is piped to a higher level stream reader. The reade
using System.IO;
using System.Text;
-class FileWebResponseSnippet
+class FileWebResponseSnippet
{
- public static void Main(string[] args)
+ public static void Main(string[] args)
{
- if (args.Length < 1)
+ if (args.Length < 1)
{
Console.WriteLine("\nPlease enter the file name as command line parameter:");
Console.WriteLine("Usage:FileWebResponse_GetResponseStream // \nExample:FileWebResponse_GetResponseStream microsoft/shared/hello.txt");
- }
- else
+ }
+ else
{
GetPage(args[0]);
}
@@ -27,30 +27,30 @@ public static void Main(string[] args)
Console.ReadLine();
return;
}
- public static void GetPage(String url)
+ public static void GetPage(String url)
{
- try
- {
+ try
+ {
//
Uri fileUrl = new Uri("file://"+url);
- // Create a 'FileWebrequest' object with the specified Uri.
+ // Create a 'FileWebrequest' object with the specified Uri.
FileWebRequest myFileWebRequest = (FileWebRequest)WebRequest.Create(fileUrl);
- // Send the 'FileWebRequest' object and wait for response.
+ // Send the 'FileWebRequest' object and wait for response.
FileWebResponse myFileWebResponse = (FileWebResponse)myFileWebRequest.GetResponse();
-
+
// Get the stream object associated with the response object.
Stream receiveStream = myFileWebResponse.GetResponseStream();
-
+
Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
- // Pipe the stream to a higher level stream reader with the required encoding format.
+ // Pipe the stream to a higher level stream reader with the required encoding format.
StreamReader readStream = new StreamReader( receiveStream, encode );
Console.WriteLine("\r\nResponse stream received");
-
+
Char[] read = new Char[256];
- // Read 256 characters at a time.
+ // Read 256 characters at a time.
int count = readStream.Read( read, 0, 256 );
Console.WriteLine("File Data...\r\n");
- while (count > 0)
+ while (count > 0)
{
// Dump the 256 characters on a string and display the string onto the console.
String str = new String(read, 0, count);
@@ -62,11 +62,11 @@ public static void GetPage(String url)
readStream.Close();
// Release resources of response object.
myFileWebResponse.Close();
-//
- }
- catch(WebException e)
+//
+ }
+ catch(WebException e)
{
- Console.WriteLine("\r\nWebException thrown.The Reason for failure is : {0}",e.Status);
+ Console.WriteLine("\r\nWebException thrown.The Reason for failure is : {0}",e.Status);
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_Headers/CS/filewebresponse_headers.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_Headers/CS/filewebresponse_headers.cs
index a39a4e46bcb..644e8de4e26 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_Headers/CS/filewebresponse_headers.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FileWebResponse_Headers/CS/filewebresponse_headers.cs
@@ -7,16 +7,16 @@
using System;
using System.Net;
-class FileWebResponseSnippet
+class FileWebResponseSnippet
{
- public static void Main(string[] args)
+ public static void Main(string[] args)
{
- if (args.Length < 1)
+ if (args.Length < 1)
{
Console.WriteLine("\nPlease type the file name as command line parameter as:");
Console.WriteLine("Usage:FileWebResponse_Headers // \nExample:FileWebResponse_Headers microsoft/shared/hello.txt");
- }
- else
+ }
+ else
{
GetPage(args[0]);
}
@@ -25,26 +25,26 @@ public static void Main(string[] args)
return;
}
//
- public static void GetPage(String url)
+ public static void GetPage(String url)
{
- try
- {
+ try
+ {
Uri fileUrl = new Uri("file://"+url);
// Create a 'FileWebrequest' object with the specified Uri .
- FileWebRequest myFileWebRequest = (FileWebRequest)WebRequest.Create(fileUrl);
+ FileWebRequest myFileWebRequest = (FileWebRequest)WebRequest.Create(fileUrl);
// Send the 'fileWebRequest' and wait for response.
- FileWebResponse myFileWebResponse = (FileWebResponse)myFileWebRequest.GetResponse();
+ FileWebResponse myFileWebResponse = (FileWebResponse)myFileWebRequest.GetResponse();
// Display all Headers present in the response received from the Uri.
Console.WriteLine("\r\nThe following headers were received in the response:");
// Display each header and the key of the response object.
- for(int i=0; i < myFileWebResponse.Headers.Count; ++i)
+ for(int i=0; i < myFileWebResponse.Headers.Count; ++i)
Console.WriteLine("\nHeader Name:{0}, Header value :{1}",myFileWebResponse.Headers.Keys[i],
- myFileWebResponse.Headers[i]);
- myFileWebResponse.Close();
- }
- catch(WebException e)
+ myFileWebResponse.Headers[i]);
+ myFileWebResponse.Close();
+ }
+ catch(WebException e)
{
- Console.WriteLine("\r\nWebException thrown.The Reason for failure is : {0}",e.Status);
+ Console.WriteLine("\r\nWebException thrown.The Reason for failure is : {0}",e.Status);
}
catch(Exception e)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FormatterServices/CS/FormatterServices.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FormatterServices/CS/FormatterServices.cs
index df1a102b20b..01c26fb3361 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FormatterServices/CS/FormatterServices.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FormatterServices/CS/FormatterServices.cs
@@ -1,5 +1,5 @@
//Types:System.Runtime.Serialization.FormatterServices
-//Types:System.Runtime.Serialization.SerializationInfoEnumerator
+//Types:System.Runtime.Serialization.SerializationInfoEnumerator
//
using System;
using System.IO;
@@ -49,12 +49,12 @@ public class Manager : Employee, ISerializable
{
private String title;
- public Manager() : base("Employee")
+ public Manager() : base("Employee")
{
this.title = "Manager";
}
- //
+ //
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
@@ -74,7 +74,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
// Skip this field if it is marked NonSerialized.
if (Attribute.IsDefined(mi[i], typeof(NonSerializedAttribute))) continue;
-
+
// Get the value of this field and add it to the SerializationInfo object.
info.AddValue(mi[i].Name, ((FieldInfo) mi[i]).GetValue(this));
}
@@ -83,7 +83,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
DisplaySerializationInfo(info);
}
//
-
+
//
private void DisplaySerializationInfo(SerializationInfo info)
{
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/FormatterServices_PopulateObjects/cs/Populate.cs b/samples/snippets/csharp/VS_Snippets_Remoting/FormatterServices_PopulateObjects/cs/Populate.cs
index a481a9524ac..410fad699ed 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/FormatterServices_PopulateObjects/cs/Populate.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/FormatterServices_PopulateObjects/cs/Populate.cs
@@ -9,7 +9,7 @@
[assembly: SecurityPermission(SecurityAction.RequestMinimum)]
namespace Examples
{
- // The SerializableAttribute specifies that instances of the class
+ // The SerializableAttribute specifies that instances of the class
// can be serialized by the BinaryFormatter or SoapFormatter.
[Serializable]
class Book
@@ -47,19 +47,19 @@ public static void Main()
static void Run()
{
- // Create an instance of a Book class
+ // Create an instance of a Book class
// with a title and author.
Book Book1 = new Book("Book Title 1",
"Masato Kawai");
- // Store data about the serializable members in a
- // MemberInfo array. The MemberInfo type holds
+ // Store data about the serializable members in a
+ // MemberInfo array. The MemberInfo type holds
// only type data, not instance data.
MemberInfo[] members =
FormatterServices.GetSerializableMembers
(typeof(Book));
- // Copy the data from the first book into an
+ // Copy the data from the first book into an
// array of objects.
object[] data =
FormatterServices.GetObjectData(Book1, members);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs
index 954006e720d..07511e1c3d0 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs
@@ -143,7 +143,7 @@ void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
void ReadFileName(XmlReader reader)
{
string fileName = reader.ReadElementString("fileName", ns);
- this.filePath =
+ this.filePath =
Path.Combine(MusicPath, Path.ChangeExtension(fileName, ".mp3"));
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CS/httpbinding_ctor.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CS/httpbinding_ctor.cs
index 67c35bd4761..0441ff9995c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CS/httpbinding_ctor.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpBinding_HttpBinding/CS/httpbinding_ctor.cs
@@ -15,8 +15,8 @@ class MyHttpBindingClass
public static void Main()
{
ServiceDescription myDescription = ServiceDescription.Read("HttpBinding_ctor_Input_CS.wsdl");
-//
-//
+//
+//
// Create 'Binding' object.
Binding myBinding = new Binding();
myBinding.Name = "MyHttpBindingServiceHttpPost";
@@ -26,7 +26,7 @@ public static void Main()
HttpBinding myHttpBinding = new HttpBinding();
myHttpBinding.Verb = "POST";
Console.WriteLine("HttpBinding Namespace : "+HttpBinding.Namespace);
-//
+//
// Add 'HttpBinding' to 'Binding'.
myBinding.Extensions.Add(myHttpBinding);
//
@@ -50,7 +50,7 @@ public static void Main()
postMimeXmlbinding .Part = "Body";
myOutput.Extensions.Add(postMimeXmlbinding);
// Add 'OutPutBinding' to 'OperationBinding'.
- myOperationBinding.Output = myOutput;
+ myOperationBinding.Output = myOutput;
// Add 'OperationBinding' to 'Binding'.
myBinding.Operations.Add(myOperationBinding);
// Add 'Binding' to 'BindingCollection' of 'ServiceDescription'.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.AddHookChannelUri/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.AddHookChannelUri/CS/class1.cs
index 241bbcd3011..90a89c18e7a 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.AddHookChannelUri/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.AddHookChannelUri/CS/class1.cs
@@ -49,7 +49,7 @@ public static void Main(string[] args) {
CustomChannel channel = new CustomChannel(8085);
channel.AddHookChannelUri("TempConverter");
- /*System.Runtime.Remoting.Channels.Http.HttpChannel channel =
+ /*System.Runtime.Remoting.Channels.Http.HttpChannel channel =
new System.Runtime.Remoting.Channels.Http.HttpChannel(8085);*/
/*System.Runtime.Remoting.Channels.Tcp.TcpChannel channel =
@@ -152,7 +152,7 @@ public IMessageSink CreateMessageSink(string url,
object remoteChannelData,
out string objectURI) {
Parse(url, out objectURI);
-
+
return null;
}
@@ -195,7 +195,7 @@ public ServerProcessing ProcessMessage(
out IMessage msg,
out ITransportHeaders responseHeaders,
out Stream responseStream
- ) {
+ ) {
msg = null;
responseHeaders = null;
responseStream = null;
@@ -204,9 +204,9 @@ out Stream responseStream
public IDictionary Properties {
get {
- return null;
+ return null;
}
- }
+ }
}
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.ChannelSinkChain/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.ChannelSinkChain/CS/class1.cs
index 8b0288daf13..e2a232b7b7f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.ChannelSinkChain/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.ChannelSinkChain/CS/class1.cs
@@ -30,7 +30,7 @@ public static void Main() {
CustomChannel channel = new CustomChannel(8085);
channel.AddHookChannelUri("TempConverter");
- /*System.Runtime.Remoting.Channels.Http.HttpChannel channel =
+ /*System.Runtime.Remoting.Channels.Http.HttpChannel channel =
new System.Runtime.Remoting.Channels.Http.HttpChannel(8085);*/
/*System.Runtime.Remoting.Channels.Tcp.TcpChannel channel =
@@ -144,7 +144,7 @@ public IMessageSink CreateMessageSink(string url,
object remoteChannelData,
out string objectURI) {
Parse(url, out objectURI);
-
+
return null;
}
@@ -187,7 +187,7 @@ public ServerProcessing ProcessMessage(
out IMessage msg,
out ITransportHeaders responseHeaders,
out Stream responseStream
- ) {
+ ) {
msg = null;
responseHeaders = null;
@@ -197,8 +197,8 @@ out Stream responseStream
public IDictionary Properties {
get {
- return null;
+ return null;
}
- }
+ }
}
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.GetUrlsFromUri/CS/class1.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.GetUrlsFromUri/CS/class1.cs
index d58a7253b21..4e311d5950a 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.GetUrlsFromUri/CS/class1.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel.GetUrlsFromUri/CS/class1.cs
@@ -9,9 +9,9 @@ public static void Main() {
// Create a remotable object.
HttpChannel httpChannel = new HttpChannel(8085);
- WellKnownServiceTypeEntry WKSTE =
+ WellKnownServiceTypeEntry WKSTE =
new WellKnownServiceTypeEntry(typeof(HelloService),
- "Service",
+ "Service",
WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(WKSTE);
@@ -19,7 +19,7 @@ public static void Main() {
// Print out the urls for HelloServer.
string[] urls = httpChannel.GetUrlsForUri("HelloServer");
-
+
foreach (string url in urls)
System.Console.WriteLine("{0}", url);
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/client.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/client.cs
index f998536fa0c..4df607b4d86 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/client.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/client.cs
@@ -24,7 +24,7 @@ public SampleClient() {
ChannelServices.RegisterChannel(new HttpChannel(0));
- SampleService service = (SampleService)Activator.GetObject(typeof(SampleService),
+ SampleService service = (SampleService)Activator.GetObject(typeof(SampleService),
"http://localhost:9000/MySampleService/SampleService.soap");
// Subscribe to event so that the client can receive notification from ther server.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/client2.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/client2.cs
index b9d22636bdc..46bfe29f152 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/client2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/client2.cs
@@ -8,7 +8,7 @@
using SampleNamespace;
// The following sample uses an HttpChannel constructor
-// to create a new HttpChannel.
+// to create a new HttpChannel.
// NOTE: manually instantiating HttpChannel() and registering it does not seem
// necessary. This sample will work if the line of code is commented out.
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/server.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/server.cs
index f6e07962c24..ee865709fee 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/server.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/server.cs
@@ -18,9 +18,9 @@ public static void Main() {
HttpChannel channel = new HttpChannel(9000);
ChannelServices.RegisterChannel(channel);
- RemotingConfiguration.RegisterWellKnownServiceType( typeof(SampleService),
+ RemotingConfiguration.RegisterWellKnownServiceType( typeof(SampleService),
"MySampleService/SampleService.soap", WellKnownObjectMode.Singleton);
-
+
Console.WriteLine("** Press enter to end the server process. **");
Console.ReadLine();
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/server2.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/server2.cs
index 7b13cacce5d..335b089f577 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/server2.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/server2.cs
@@ -18,17 +18,17 @@ public static void Main() {
ListDictionary channelProperties = new ListDictionary();
channelProperties.Add("port", 9000);
-
+
HttpChannel channel = new HttpChannel(channelProperties,
new SoapClientFormatterSinkProvider(),
new SoapServerFormatterSinkProvider());
ChannelServices.RegisterChannel(channel);
- RemotingConfiguration.RegisterWellKnownServiceType(typeof(SampleService),
+ RemotingConfiguration.RegisterWellKnownServiceType(typeof(SampleService),
"MySampleService/SampleService.soap",
WellKnownObjectMode.Singleton);
-
+
Console.WriteLine("** Press enter to end the server process. **");
Console.ReadLine();
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/service.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/service.cs
index bbe49427a7f..c17d8bdd58e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/service.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpChannel/CS/service.cs
@@ -22,7 +22,7 @@ public string Message {
}
}
}
-
+
// Define the delegate for the event
public delegate void SomethingHappenedEventHandler (object sender, SampleServiceEventArgs e);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpGetClientProtocol_Constructor/CS/httpgetclientprotocol_constructor.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpGetClientProtocol_Constructor/CS/httpgetclientprotocol_constructor.cs
index 23c9638c53c..05230a6803e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpGetClientProtocol_Constructor/CS/httpgetclientprotocol_constructor.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpGetClientProtocol_Constructor/CS/httpgetclientprotocol_constructor.cs
@@ -6,43 +6,43 @@ client credentials and Url on the proxy class.
*/
/*
-// The following example is a proxy class generated by the Wsdl.exe
-// utility for the Math Web service. The proxy class derives from
-// HttpGetClientProtocol, which derives from the abstract
+// The following example is a proxy class generated by the Wsdl.exe
+// utility for the Math Web service. The proxy class derives from
+// HttpGetClientProtocol, which derives from the abstract
// HttpSimpleClientProtocol class.
-public class MyMath : System.Web.Services.Protocols.HttpGetClientProtocol
+public class MyMath : System.Web.Services.Protocols.HttpGetClientProtocol
{
[System.Diagnostics.DebuggerStepThroughAttribute()]
- public MyMath()
+ public MyMath()
{
this.Url = "http://localhost/MyMath.Cs.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.HttpMethodAttribute(
- typeof(System.Web.Services.Protocols.XmlReturnReader),
+ typeof(System.Web.Services.Protocols.XmlReturnReader),
typeof(System.Web.Services.Protocols.UrlParameterWriter))]
- [return: System.Xml.Serialization.XmlRootAttribute("int",
+ [return: System.Xml.Serialization.XmlRootAttribute("int",
Namespace="http://tempuri.org/", IsNullable=false)]
- public int Add(string num1, string num2)
+ public int Add(string num1, string num2)
{
return ((int)(this.Invoke("Add", (this.Url + "/Add"), new object[] {
num1,
num2})));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
- public System.IAsyncResult BeginAdd(string num1, string num2,
- System.AsyncCallback callback, object asyncState)
+ public System.IAsyncResult BeginAdd(string num1, string num2,
+ System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("Add", (this.Url + "/Add"), new object[] {
num1,
num2}, callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
- public int EndAdd(System.IAsyncResult asyncResult)
+ public int EndAdd(System.IAsyncResult asyncResult)
{
return ((int)(this.EndInvoke(asyncResult)));
}
@@ -70,7 +70,7 @@ public static void Main()
String SecurelyStoredPassword = String.Empty;
// Set the client-side credentials using the Credentials property.
- ICredentials credentials =
+ ICredentials credentials =
new NetworkCredential("Joe", "mydomain", SecurelyStoredPassword);
myHttpGetClientProtocol.Credentials = credentials;
Console.WriteLine("Auto redirect is: "
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpPostClientProtocol_Constructor/CS/httppostclientprotocol_constructor.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpPostClientProtocol_Constructor/CS/httppostclientprotocol_constructor.cs
index 439acdd80d1..8585c858a0b 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpPostClientProtocol_Constructor/CS/httppostclientprotocol_constructor.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpPostClientProtocol_Constructor/CS/httppostclientprotocol_constructor.cs
@@ -6,40 +6,40 @@ client credentials and Url on the proxy class.
*/
/*
// The following example is a proxy class generated by the Wsdl.exe utility
-// for the Math Web service. The proxy class derives from
+// for the Math Web service. The proxy class derives from
// HttpPostClientProtocol, which derives from the abstract
// HttpSimpleClientProtocol class.
-public class MyMath : System.Web.Services.Protocols.HttpPostClientProtocol
+public class MyMath : System.Web.Services.Protocols.HttpPostClientProtocol
{
[System.Diagnostics.DebuggerStepThroughAttribute()]
- public MyMath()
+ public MyMath()
{
this.Url = "http://localhost/Mymath.Cs.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.HttpMethodAttribute(
- typeof(System.Web.Services.Protocols.XmlReturnReader),
+ typeof(System.Web.Services.Protocols.XmlReturnReader),
typeof(System.Web.Services.Protocols.HtmlFormParameterWriter))]
[return: System.Xml.Serialization.XmlRootAttribute("int",
Namespace="http://tempuri.org/", IsNullable=false)]
- public int Add(string num1, string num2)
+ public int Add(string num1, string num2)
{
- return ((int)(this.Invoke("Add", (this.Url + "/Add"),
+ return ((int)(this.Invoke("Add", (this.Url + "/Add"),
new object[] {num1, num2})));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public System.IAsyncResult BeginAdd(string num1, string num2,
- System.AsyncCallback callback, object asyncState)
+ System.AsyncCallback callback, object asyncState)
{
- return this.BeginInvoke("Add", (this.Url + "/Add"),
+ return this.BeginInvoke("Add", (this.Url + "/Add"),
new object[] {num1, num2}, callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
- public int EndAdd(System.IAsyncResult asyncResult)
+ public int EndAdd(System.IAsyncResult asyncResult)
{
return ((int)(this.EndInvoke(asyncResult)));
}
@@ -71,7 +71,7 @@ public static void Main()
// Allow the server to redirect the request.
myHttpPostClientProtocol.AllowAutoRedirect = true;
- Console.WriteLine("Auto redirect is: " +
+ Console.WriteLine("Auto redirect is: " +
myHttpPostClientProtocol.AllowAutoRedirect);
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/HttpServerChannel_Clientl_14_Share.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/HttpServerChannel_Clientl_14_Share.cs
index c438e0e15f6..9e59c7da17f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/HttpServerChannel_Clientl_14_Share.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/HttpServerChannel_Clientl_14_Share.cs
@@ -5,14 +5,14 @@
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
-public class MyHelloServer : MarshalByRefObject
+public class MyHelloServer : MarshalByRefObject
{
- public MyHelloServer()
+ public MyHelloServer()
{
Console.WriteLine("HelloServer activated");
}
- public String myHelloMethod(String name)
+ public String myHelloMethod(String name)
{
Console.WriteLine("Hello.HelloMethod : {0}", name);
return "Hi there " + name;
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/httpclientchannel_6_client.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/httpclientchannel_6_client.cs
index d39d591f063..b15aff9a614 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/httpclientchannel_6_client.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/httpclientchannel_6_client.cs
@@ -4,9 +4,9 @@
/*
The following program demonstrates the 'HttpClientChannel' class and
'ChannelName','ChannelPriority' , 'Keys', properties, and 'Parse',
-CreateMessageSink methods of 'HttpClientChannel' class. This program
+CreateMessageSink methods of 'HttpClientChannel' class. This program
create and registers 'HttpClientChannel'. This will change the priority
-of the 'HttpClientChannel' channel and it displays the property values
+of the 'HttpClientChannel' channel and it displays the property values
of 'HttpClientChannel'.
*/
//
@@ -18,10 +18,10 @@ of the 'HttpClientChannel' channel and it displays the property values
using System.Runtime.Remoting.Messaging;
using System.Security.Permissions;
-public class MyHttpClientChannel
+public class MyHttpClientChannel
{
[PermissionSet(SecurityAction.LinkDemand)]
- public static void Main()
+ public static void Main()
{
try
{
@@ -31,7 +31,7 @@ public static void Main()
myDictionary["name"]="HttpClientChannel";
myDictionary["priority"]=2;
// Set the properties along with the constructor.
- HttpClientChannel myHttpClientChannel =
+ HttpClientChannel myHttpClientChannel =
new HttpClientChannel(myDictionary,new BinaryClientFormatterSinkProvider());
// Register the server channel.
ChannelServices.RegisterChannel(myHttpClientChannel);
@@ -49,13 +49,13 @@ public static void Main()
// Get the channel priority.
Console.WriteLine("ChannelPriority :"+myHttpClientChannel.ChannelPriority.ToString());
string myString,myObjectURI1;
- Console.WriteLine("Parse :" +
+ Console.WriteLine("Parse :" +
myHttpClientChannel.Parse("http://localhost:8085/SayHello",out myString)+myString);
// Get the key count.
System.Console.WriteLine("Keys.Count : " + myHttpClientChannel.Keys.Count);
// Get the channel message sink that delivers message to the specified url.
- IMessageSink myIMessageSink =
- myHttpClientChannel.CreateMessageSink("http://localhost:8085/NewEndPoint",
+ IMessageSink myIMessageSink =
+ myHttpClientChannel.CreateMessageSink("http://localhost:8085/NewEndPoint",
null,out myObjectURI1);
Console.WriteLine("The channel message sink that delivers the messages to the URL is : "
+myIMessageSink.ToString());
@@ -66,7 +66,7 @@ public static void Main()
catch(Exception ex)
{
Console.WriteLine("The following exception is raised on client side :"+ex.Message);
- }
+ }
}
}
//
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/httpserverchannel_9_server.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/httpserverchannel_9_server.cs
index 70940abb054..ce7b07f5880 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/httpserverchannel_9_server.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpServerChannel_Server_Client/CS/httpserverchannel_9_server.cs
@@ -4,8 +4,8 @@
/* The following program demonstrates the 'HttpServerChannel' class, 'ChannelName',
'ChannelPriority', 'ChannelScheme', 'WantsToListen' properties, 'GetChannelUri',
- 'StartListening', 'StopListening' and 'Parse' methods of 'HttpServerChannel' class.
- This program creates and registers 'HttpServerChannel'. This will change the priority
+ 'StartListening', 'StopListening' and 'Parse' methods of 'HttpServerChannel' class.
+ This program creates and registers 'HttpServerChannel'. This will change the priority
of the 'HttpServerChannel' channel and displays the property values of this class.
*/
@@ -35,8 +35,8 @@ static void Main( )
new BinaryServerFormatterSinkProvider());
// Register the server channel.
ChannelServices.RegisterChannel(myHttpServerChannel);
- RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyHelloServer),
- "SayHello", WellKnownObjectMode.SingleCall);
+ RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyHelloServer),
+ "SayHello", WellKnownObjectMode.SingleCall);
myHttpServerChannel.WantsToListen = true;
// Start listening on a specific port.
myHttpServerChannel.StartListening((object)myPort);
@@ -53,7 +53,7 @@ static void Main( )
//
//
// Extract the channel URI and the remote well known object URI from the specified URL.
- Console.WriteLine("Parsed : " +
+ Console.WriteLine("Parsed : " +
myHttpServerChannel.Parse(myHttpServerChannel.GetChannelUri()+
"/SayHello",out myString));
Console.WriteLine("Remote WellKnownObject : " + myString);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpSimpleClientProtocol.Invoke Example/CS/source.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpSimpleClientProtocol.Invoke Example/CS/source.cs
index ff1461f80b7..7b6ee156023 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpSimpleClientProtocol.Invoke Example/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpSimpleClientProtocol.Invoke Example/CS/source.cs
@@ -8,12 +8,12 @@ namespace MyMath {
[System.Web.Services.WebServiceBindingAttribute(Name="MathSoap", Namespace="http://tempuri.org/")]
public class Math : System.Web.Services.Protocols.SoapHttpClientProtocol {
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public Math() {
this.Url = "http://www.contoso.com/math.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Add", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int Add(int num1, int num2) {
@@ -21,13 +21,13 @@ public int Add(int num1, int num2) {
num2});
return ((int)(results[0]));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public System.IAsyncResult BeginAdd(int num1, int num2, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Add", new object[] {num1,
num2}, callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
public int EndAdd(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebClientProtocol_UserAgent/CS/httpwebclientprotocol_useragent.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebClientProtocol_UserAgent/CS/httpwebclientprotocol_useragent.cs
index e556dfb2f79..b0fdfb143fe 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebClientProtocol_UserAgent/CS/httpwebclientprotocol_useragent.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebClientProtocol_UserAgent/CS/httpwebclientprotocol_useragent.cs
@@ -1,7 +1,7 @@
// System.Web.Services.Protocols.HttpWebClientProtocol.UserAgent
-/* The following example demonstrates 'UserAgent' member of 'HttpWebClientProtocol'
- class. First the default user agent is displayed. Then the user agent is modified
+/* The following example demonstrates 'UserAgent' member of 'HttpWebClientProtocol'
+ class. First the default user agent is displayed. Then the user agent is modified
and displayed.
*/
@@ -10,39 +10,39 @@ The following example is a proxy class generated by the Wsdl.exe utility
for the Math Web service. The proxy class derives from SoapHttpClientProtocol,
which derives from the abstract HttpWebClientProtocol class.
-[System.Web.Services.WebServiceBindingAttribute(Name="MyMathSoap",
+[System.Web.Services.WebServiceBindingAttribute(Name="MyMathSoap",
Namespace="http://tempuri.org/")]
-public class MyMath : System.Web.Services.Protocols.SoapHttpClientProtocol
+public class MyMath : System.Web.Services.Protocols.SoapHttpClientProtocol
{
[System.Diagnostics.DebuggerStepThroughAttribute()]
- public MyMath()
+ public MyMath()
{
this.Url = "http://localhost/Mymath.Cs.asmx";
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute(
- "http://tempuri.org/Add",
+ "http://tempuri.org/Add",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public int Add(int num1, int num2)
+ public int Add(int num1, int num2)
{
- object[] results = this.Invoke("Add",
+ object[] results = this.Invoke("Add",
new object[] {num1, num2});
return ((int)(results[0]));
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
- public System.IAsyncResult BeginAdd(int num1, int num2,
- System.AsyncCallback callback, object asyncState)
+ public System.IAsyncResult BeginAdd(int num1, int num2,
+ System.AsyncCallback callback, object asyncState)
{
- return this.BeginInvoke("Add", new object[] {num1, num2},
+ return this.BeginInvoke("Add", new object[] {num1, num2},
callback, asyncState);
}
-
+
[System.Diagnostics.DebuggerStepThroughAttribute()]
- public int EndAdd(System.IAsyncResult asyncResult)
+ public int EndAdd(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((int)(results[0]));
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Accept/CS/httpwebrequest_accept.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Accept/CS/httpwebrequest_accept.cs
index a4ae92812ae..dd2a88c1940 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Accept/CS/httpwebrequest_accept.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Accept/CS/httpwebrequest_accept.cs
@@ -1,14 +1,14 @@
/* System.Net.HttpWebRequest.Accept
This program demonstrates 'Accept' property of the 'HttpWebRequest' class.
A new 'HttpWebRequest' object is created.The 'Accept' property of 'HttpWebRequest'
-class is set to 'image/*' that in turn sets the 'Accept' field of HTTP Request Headers to
+class is set to 'image/*' that in turn sets the 'Accept' field of HTTP Request Headers to
"image/*". HTTP Request and Response headers are displayed to the console.
The contents of the page of the requested URI are displayed to the console.
'Accept' property is set with an aim to receive the response in a specific format.
Note:This program requires http://localhost/CodeSnippetTest.html as Command line parameter.
If the requested page contains any content other than 'image/*' an error of 'status (406) Not Acceptable'
- is returned.The functionality of 'Accept' property is supported only by servers that use HTTP 1.1
+ is returned.The functionality of 'Accept' property is supported only by servers that use HTTP 1.1
protocol.Please refer to RFC 2616 for further information on HTTP Headers.
*/
@@ -20,8 +20,8 @@ class HttpWebRequest_Accept
{
static void Main(string[] args)
{
- try
- {
+ try
+ {
if(args.Length<1)
{
Console.WriteLine("\nPlease enter the Uri address as a command line parameter");
@@ -65,7 +65,7 @@ public static void GetPage(String myUri)
Char[] readBuffer = new Char[256];
int count = streamRead.Read( readBuffer, 0, 256 );
Console.WriteLine("\nThe contents of HTML page are.......");
- while (count > 0)
+ while (count > 0)
{
String outputData = new String(readBuffer, 0, count);
Console.Write(outputData);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowAutoRedirect/CS/httpwebrequest_allowautoredirect.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowAutoRedirect/CS/httpwebrequest_allowautoredirect.cs
index d3f35070f52..a0d2e6c8c8c 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowAutoRedirect/CS/httpwebrequest_allowautoredirect.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowAutoRedirect/CS/httpwebrequest_allowautoredirect.cs
@@ -1,7 +1,7 @@
/* System.Net.HttpWebRequest.AllowAutoRedirect System.Net.HttpWebRequest.Address
This program demonstrates 'AllowAutoRedirect' and 'Address' properties of 'HttpWebRequest' Class.
- A new 'HttpWebRequest' object is created. The 'AllowAutoredirect' property which redirects a page automatically
- to the new Uri is set to true.Using the 'Address' property, the address of the 'Responding Uri' is printed to
+ A new 'HttpWebRequest' object is created. The 'AllowAutoredirect' property which redirects a page automatically
+ to the new Uri is set to true.Using the 'Address' property, the address of the 'Responding Uri' is printed to
console.The contents of the redirected page are displayed to the console.
*/
@@ -29,7 +29,7 @@ static void Main()
Char[] readBuff = new Char[256];
int count = streamRead.Read( readBuff, 0, 256 );
Console.WriteLine("\nThe contents of Html Page are : ");
- while (count > 0)
+ while (count > 0)
{
String outputData = new String(readBuff, 0, count);
Console.Write(outputData);
@@ -51,7 +51,7 @@ static void Main()
Console.WriteLine("WebException raised!");
Console.WriteLine("\nMessage:{0}",e.Message);
Console.WriteLine("\nStatus:{0}",e.Status);
- }
+ }
catch(Exception e)
{
Console.WriteLine("Exception raised!");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowWriteStreamBuffering/CS/httpwebrequest_allowwritestreambuffering.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowWriteStreamBuffering/CS/httpwebrequest_allowwritestreambuffering.cs
index 51bd7ceafe5..ba63ab08736 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowWriteStreamBuffering/CS/httpwebrequest_allowwritestreambuffering.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowWriteStreamBuffering/CS/httpwebrequest_allowwritestreambuffering.cs
@@ -3,7 +3,7 @@ This program demonstrates 'AllowWriteStreamBuffering' property of 'HttpWebReques
A new 'HttpWebRequest' object is created.
The 'AllowWriteStreamBuffering' property value is set to false.
If the 'AllowWriteStreamBuffering' is set to false,
- then 'ContentLength' property should be set to the length of data to be posted before posting the data
+ then 'ContentLength' property should be set to the length of data to be posted before posting the data
else the Http Status(411) Length required is returned.
Data to be posted to the Uri is requested from the user.
The 'Method' property is set to POST to be able to post data to the Uri.
@@ -14,7 +14,7 @@ The HTML contents of the page are displayed to the console after the posted data
Note:This program posts data to the Uri : http://www20.brinkster.com/codesnippets/next.asp.
*/
-
+
using System;
using System.IO;
using System.Net;
@@ -30,7 +30,7 @@ public static void Main()
// Create a new 'HttpWebRequest' object to the mentioned Uri.
HttpWebRequest myHttpWebRequest=(HttpWebRequest)WebRequest.Create("http://www.contoso.com/codesnippets/next.asp");
- // Set AllowWriteStreamBuffering to 'false'.
+ // Set AllowWriteStreamBuffering to 'false'.
myHttpWebRequest.AllowWriteStreamBuffering=false;
Console.WriteLine("\nPlease Enter the data to be posted to the (http://www.contoso.com/codesnippets/next.asp) uri:");
string inputData =Console.ReadLine();
@@ -55,7 +55,7 @@ public static void Main()
Char[] readBuff = new Char[256];
int count = streamRead.Read( readBuff, 0, 256 );
Console.WriteLine("\nThe contents of the Html page are : ");
- while (count > 0)
+ while (count > 0)
{
String outputData = new String(readBuff, 0, count);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/CS/httpwebrequest_begingetrequeststream.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/CS/httpwebrequest_begingetrequeststream.cs
index bd77c6a0f68..dfb28a012f3 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/CS/httpwebrequest_begingetrequeststream.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/CS/httpwebrequest_begingetrequeststream.cs
@@ -27,14 +27,14 @@ public static void Main(string[] args)
// Keep the main thread from continuing while the asynchronous
// operation completes. A real world application
- // could do something useful such as updating its user interface.
+ // could do something useful such as updating its user interface.
allDone.WaitOne();
}
private static void GetRequestStreamCallback(IAsyncResult asynchronousResult)
{
HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState;
-
+
// End the operation
Stream postStream = request.EndGetRequestStream(asynchronousResult);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetResponse/CS/httpwebrequest_begingetresponse.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetResponse/CS/httpwebrequest_begingetresponse.cs
index 6049e5ca883..17f256a408f 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetResponse/CS/httpwebrequest_begingetresponse.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetResponse/CS/httpwebrequest_begingetresponse.cs
@@ -1,12 +1,12 @@
// System.Net.HttpWebRequest.BeginGetResponse System.Net.HttpWebRequest.EndGetResponse
-
- /**
+
+ /**
* Snippet1,Snippet2,Snippet3 go together.
- * This program shows how to use BeginGetResponse and EndGetResponse methods of the
+ * This program shows how to use BeginGetResponse and EndGetResponse methods of the
* HttpWebRequest class.
* It uses an asynchronous approach to get the response for the HTTP Web Request.
* The RequestState class is defined to chekc the state of the request.
- * After a HttpWebRequest object is created, its BeginGetResponse method is used to start
+ * After a HttpWebRequest object is created, its BeginGetResponse method is used to start
* the asynchronous response phase.
* Finally, the EndGetResponse method is used to end the asynchronous response phase .*/
using System;
@@ -39,18 +39,18 @@ class HttpWebRequest_BeginGetResponse
const int BUFFER_SIZE = 1024;
static void Main()
- {
+ {
//
//
try
- {
+ {
// Create a HttpWebrequest object to the desired URL.
HttpWebRequest myHttpWebRequest1= (HttpWebRequest)WebRequest.Create("http://www.contoso.com");
-
+
// Create an instance of the RequestState and assign the previous myHttpWebRequest1
- // object to it's request field.
- RequestState myRequestState = new RequestState();
+ // object to it's request field.
+ RequestState myRequestState = new RequestState();
myRequestState.request = myHttpWebRequest1;
// Start the asynchronous request.
@@ -58,7 +58,7 @@ static void Main()
(IAsyncResult) myHttpWebRequest1.BeginGetResponse(new AsyncCallback(RespCallback),myRequestState);
allDone.WaitOne();
-
+
// Release the HttpWebResponse resource.
myRequestState.response.Close();
}
@@ -79,18 +79,18 @@ static void Main()
}
}
private static void RespCallback(IAsyncResult asynchronousResult)
- {
+ {
try
{
// State of request is asynchronous.
RequestState myRequestState=(RequestState) asynchronousResult.AsyncState;
HttpWebRequest myHttpWebRequest2=myRequestState.request;
myRequestState.response = (HttpWebResponse) myHttpWebRequest2.EndGetResponse(asynchronousResult);
-
+
// Read the response into a Stream object.
Stream responseStream = myRequestState.response.GetResponseStream();
myRequestState.streamResponse=responseStream;
-
+
// Begin the Reading of the contents of the HTML page and print it to the console.
IAsyncResult asynchronousInputRead = responseStream.BeginRead(myRequestState.BufferRead, 0, BUFFER_SIZE, new AsyncCallback(ReadCallBack), myRequestState);
}
@@ -126,7 +126,7 @@ private static void ReadCallBack(IAsyncResult asyncResult)
}
Console.WriteLine("Press any key to continue..........");
Console.ReadLine();
-
+
responseStream.Close();
allDone.Set();
}
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Connection/CS/httpwebrequest_connection.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Connection/CS/httpwebrequest_connection.cs
index 1aa9646f145..1e3143ef3db 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Connection/CS/httpwebrequest_connection.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Connection/CS/httpwebrequest_connection.cs
@@ -1,15 +1,15 @@
// System.Net.HttpWebRequest.KeepAlive System.Net.HttpWebRequest.Connection
-
+
/**
- * This program demonstrates Connection and KeepAlive properties of the
+ * This program demonstrates Connection and KeepAlive properties of the
* HttpWebRequest Class.
- * Two new HttpWebRequest objects are created . The KeepAlive property of one of
- * the objects is set to false that in turn sets the value of Connection field of
+ * Two new HttpWebRequest objects are created . The KeepAlive property of one of
+ * the objects is set to false that in turn sets the value of Connection field of
* the HTTP request Headers to Close.
- * The Connection property of the other HttpWebRequest object is assigned the
- * value Close. This throws an ArgumentException which is caught.The HTTP request
+ * The Connection property of the other HttpWebRequest object is assigned the
+ * value Close. This throws an ArgumentException which is caught.The HTTP request
* Headers are displayed to the console.
- * The contents of the HTML page of the requested URI are displayed.
+ * The contents of the HTML page of the requested URI are displayed.
**/
using System;
using System.IO;
@@ -21,18 +21,18 @@
class HttpWebRequest_Connection
{
static void Main()
- {
- try
+ {
+ try
{
- // Create a new HttpWebRequest object.Make sure that
+ // Create a new HttpWebRequest object.Make sure that
// a default proxy is set if you are behind a firewall.
HttpWebRequest myHttpWebRequest1 =
(HttpWebRequest)WebRequest.Create("http://www.contoso.com");
-
+
myHttpWebRequest1.KeepAlive=false;
// Assign the response object of HttpWebRequest to a HttpWebResponse variable.
- HttpWebResponse myHttpWebResponse1 =
+ HttpWebResponse myHttpWebResponse1 =
(HttpWebResponse)myHttpWebRequest1.GetResponse();
Console.WriteLine("\nThe HTTP request Headers for the first request are: \n{0}",myHttpWebRequest1.Headers);
@@ -43,8 +43,8 @@ static void Main()
StreamReader streamRead = new StreamReader( streamResponse );
Char[] readBuff = new Char[256];
int count = streamRead.Read( readBuff, 0, 256 );
- Console.WriteLine("The contents of the Html page are.......\n");
- while (count > 0)
+ Console.WriteLine("The contents of the Html page are.......\n");
+ while (count > 0)
{
String outputData = new String(readBuff, 0, count);
Console.Write(outputData);
@@ -58,18 +58,18 @@ static void Main()
myHttpWebResponse1.Close();
//
// Create a new HttpWebRequest object for the specified Uri.
- HttpWebRequest myHttpWebRequest2 =
+ HttpWebRequest myHttpWebRequest2 =
(HttpWebRequest)WebRequest.Create("http://www.contoso.com");
myHttpWebRequest2.Connection="Close";
// Assign the response object of 'HttpWebRequest' to a 'HttpWebResponse' variable.
- HttpWebResponse myHttpWebResponse2 =
+ HttpWebResponse myHttpWebResponse2 =
(HttpWebResponse)myHttpWebRequest2.GetResponse();
// Release the resources held by response object.
myHttpWebResponse2.Close();
Console.WriteLine("\nThe Http RequestHeaders are \n{0}",myHttpWebRequest2.Headers);
//
Console.WriteLine("\nPress 'Enter' Key to Continue.........");
- Console.Read();
+ Console.Read();
}
catch(ArgumentException e)
{
@@ -81,7 +81,7 @@ static void Main()
Console.WriteLine("WebException raised!");
Console.WriteLine("\n{0}",e.Message);
Console.WriteLine("\n{0}",e.Status);
- }
+ }
catch(Exception e)
{
Console.WriteLine("Exception raised!");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CS/httpwebrequest_contentlength.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CS/httpwebrequest_contentlength.cs
index ad41754c961..b2a24712ea8 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CS/httpwebrequest_contentlength.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CS/httpwebrequest_contentlength.cs
@@ -1,16 +1,16 @@
-/*
+/*
System.Net.HttpWebRequest.Method,System.Net.HttpWebRequest.ContentLength,System.Net.HttpWebRequest.ContentType
System.Net.HttpWebRequest.GetRequestStream
This program demonstrates 'Method', 'ContentLength' and 'ContentType' properties and 'GetRequestStream'
method of HttpWebRequest Class.
It creates a 'HttpWebRequest' object.The 'Method' property of 'HttpWebRequestClass' is set to 'POST'.
- The 'ContentType' property is set to 'application/x-www-form-urlencoded'.The 'ContentLength' property
- is set to the length of the Byte stream to be posted.A new 'Stream' object is obtained from the
+ The 'ContentType' property is set to 'application/x-www-form-urlencoded'.The 'ContentLength' property
+ is set to the length of the Byte stream to be posted.A new 'Stream' object is obtained from the
'GetRequestStream' method of the 'HttpWebRequest' class. Data to be posted is requested from the user.
- Data is posted using the stream object.The HTML contents of the page are then displayed to the console
+ Data is posted using the stream object.The HTML contents of the page are then displayed to the console
after the Posted data is accepted by the URL.
- Note: This program POSTs data to the Uri: http://www20.Brinkster.com/codesnippets/next.asp
-
+ Note: This program POSTs data to the Uri: http://www20.Brinkster.com/codesnippets/next.asp
+
*/
using System;
using System.IO;
@@ -23,7 +23,7 @@ static void Main ()
{
try
{
- // Create a new WebRequest Object to the mentione Uri.
+ // Create a new WebRequest Object to the mentione Uri.
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create ("http://www.contoso.com/codesnippets/next.asp");
Console.WriteLine ("\nThe value of 'ContentLength' property before sending the data is {0}", myHttpWebRequest.ContentLength);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Headers/CS/httpwebrequest_headers.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Headers/CS/httpwebrequest_headers.cs
index 265c01486f5..affbad65616 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Headers/CS/httpwebrequest_headers.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Headers/CS/httpwebrequest_headers.cs
@@ -2,8 +2,8 @@
This program demonstrates the 'Headers' property of 'HttpWebRequest' Class.
A new 'HttpWebRequest' object is created.
The (name,value) collection of the Http Headers are displayed to the console.
- The contents of the HTML page of the requested URI are displayed to the console.
-
+ The contents of the HTML page of the requested URI are displayed to the console.
+
*/
using System;
@@ -23,13 +23,13 @@ public static void Main()
// Assign the response object of 'HttpWebRequest' to a 'HttpWebResponse' variable.
HttpWebResponse myHttpWebResponse=(HttpWebResponse)myHttpWebRequest.GetResponse();
Console.WriteLine("\nThe HttpHeaders are \n\n\tName\t\tValue\n{0}",myHttpWebRequest.Headers);
- // Print the HTML contents of the page to the console.
+ // Print the HTML contents of the page to the console.
Stream streamResponse=myHttpWebResponse.GetResponseStream();
StreamReader streamRead = new StreamReader( streamResponse );
Char[] readBuff = new Char[256];
int count = streamRead.Read( readBuff, 0, 256 );
Console.WriteLine("\nThe HTML contents of page the are : \n\n ");
- while (count > 0)
+ while (count > 0)
{
String outputData = new String(readBuff, 0, count);
Console.Write(outputData);
@@ -49,7 +49,7 @@ public static void Main()
Console.WriteLine("\nWebException Caught!");
Console.WriteLine("Message :{0}",e.Message);
Console.WriteLine("Status :{0}",e.Status);
- }
+ }
catch(Exception e)
{
Console.WriteLine("\nException Caught!");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_IfModifiedSince/CS/httpwebrequest_ifmodifiedsince.cs b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_IfModifiedSince/CS/httpwebrequest_ifmodifiedsince.cs
index 6c34b32bf5f..3b9144bcf7e 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_IfModifiedSince/CS/httpwebrequest_ifmodifiedsince.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_IfModifiedSince/CS/httpwebrequest_ifmodifiedsince.cs
@@ -4,8 +4,8 @@ This program demonstrates the 'IfModifiedSince' property of the 'HttpWebRequest'
A new 'HttpWebrequest' object is created.
A new 'DateTime' object is created with the value intialized to the present DateTime.
The 'IfModifiedSince' property of 'HttpWebRequest' object is compared with the 'DateTime' object.
-If the requested page has been modified since the time of the DateTime object
-then the output displays the page has been modified
+If the requested page has been modified since the time of the DateTime object
+then the output displays the page has been modified
else the response headers and the contents of the page of the requested Uri are printed to the Console.
*/
@@ -33,7 +33,7 @@ public static void Main()
targetDate.AddDays(-7.0);
myHttpWebRequest.IfModifiedSince = targetDate;
- try
+ try
{
// Assign the response object of 'HttpWebRequest' to a 'HttpWebResponse' variable.
HttpWebResponse myHttpWebResponse=(HttpWebResponse)myHttpWebRequest.GetResponse();
@@ -44,7 +44,7 @@ public static void Main()
int count = streamRead.Read( readBuff, 0, 256 );
Console.WriteLine("\nThe contents of Html Page are : \n");
- while (count > 0)
+ while (count > 0)
{
String outputData = new String(readBuff, 0, count);
Console.Write(outputData);
@@ -66,7 +66,7 @@ public static void Main()
if ( ((HttpWebResponse)e.Response).StatusCode == HttpStatusCode.NotModified)
Console.WriteLine("\nThe page has not been modified since "+targetDate);
else
- Console.WriteLine("\nUnexpected status code = " + ((HttpWebResponse)e.Response).StatusCode);
+ Console.WriteLine("\nUnexpected status code = " + ((HttpWebResponse)e.Response).StatusCode);
}
else
{
@@ -80,7 +80,7 @@ public static void Main()
Console.WriteLine("\nWebException Caught!");
Console.WriteLine("Source :{0}", e.Source);
Console.WriteLine("Message :{0}",e.Message);
- }
+ }
catch(Exception e)
{
Console.WriteLine("\nException raised!");
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/Httpwebrequest_HaveResponse/CS/httpwebrequest_haveresponse.cs b/samples/snippets/csharp/VS_Snippets_Remoting/Httpwebrequest_HaveResponse/CS/httpwebrequest_haveresponse.cs
index 9012e354ec5..3023f579a06 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/Httpwebrequest_HaveResponse/CS/httpwebrequest_haveresponse.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/Httpwebrequest_HaveResponse/CS/httpwebrequest_haveresponse.cs
@@ -1,13 +1,13 @@
/*System.Net.HttpWebRequest.HaveResponse
-
+
This program demonstrates 'HaveResponse' property of 'HttpWebRequest' Class.
A new 'HttpWebRequest' is created.
-The 'HaveResponse' property is a ReadOnly, boolean property that indicates
+The 'HaveResponse' property is a ReadOnly, boolean property that indicates
whether the Request object has received any response or not.
The default value of 'HaveResponse' property of the 'HttpWebRequest' is displayed to the console.
The HttpWebResponse variable is assigned the response object of 'HttpWebRequest'.
The HaveReponse property is tested for its value.
-If there is a response then the HTML contents of the page of the requested Uri are displayed to the console
+If there is a response then the HTML contents of the page of the requested Uri are displayed to the console
else a message 'The response is not received' is displayed to the console.
*/
@@ -39,7 +39,7 @@ public static void Main()
Char[] readBuff = new Char[256];
int count = streamRead.Read( readBuff, 0, 256 );
Console.WriteLine("\nThe contents of Html Page are : \n");
- while (count > 0)
+ while (count > 0)
{
String outputData = new String(readBuff, 0, count);
Console.Write(outputData);
diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/dnspermission_union_intersect/CS/dnspermission_union_intersect.cs b/samples/snippets/csharp/VS_Snippets_Remoting/dnspermission_union_intersect/CS/dnspermission_union_intersect.cs
index 68284585965..c06bfbc8aea 100644
--- a/samples/snippets/csharp/VS_Snippets_Remoting/dnspermission_union_intersect/CS/dnspermission_union_intersect.cs
+++ b/samples/snippets/csharp/VS_Snippets_Remoting/dnspermission_union_intersect/CS/dnspermission_union_intersect.cs
@@ -1,6 +1,6 @@
/*
This program demonstrates the 'Intersect' and 'Union' methods of 'DnsPermission' class.
- It creates a 'DnsPermission' instance that is the Union/Intersection of current permission
+ It creates a 'DnsPermission' instance that is the Union/Intersection of current permission
instance and specified permission instance.
*/
@@ -11,24 +11,24 @@ instance and specified permission instance.
using System.Collections;
class DnsPermissionExample {
-
+
private DnsPermission dnsPermission1;
- private DnsPermission dnsPermission2;
+ private DnsPermission dnsPermission2;
public static void Main() {
- try
+ try
{
DnsPermissionExample dnsPermissionExampleObj = new DnsPermissionExample();
dnsPermissionExampleObj.useDns();
}
- catch(SecurityException e)
+ catch(SecurityException e)
{
Console.WriteLine("SecurityException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(Exception e)
- {
+ {
Console.WriteLine("Exception caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
@@ -38,7 +38,7 @@ public static void Main() {
private void MyUnion()
{
// Create a DnsPermission instance that is the union of the current DnsPermission
- // instance and the specified DnsPermission instance.
+ // instance and the specified DnsPermission instance.
DnsPermission permission = (DnsPermission)dnsPermission1.Union(dnsPermission2);
// Print the attributes and the values of the union instance of DnsPermission.
PrintKeysAndValues(permission.ToXml().Attributes);
diff --git a/samples/snippets/csharp/VS_Snippets_VBCSharp/CsLINQCustomComparer/CS/CustomComparer.cs b/samples/snippets/csharp/VS_Snippets_VBCSharp/CsLINQCustomComparer/CS/CustomComparer.cs
index 259be5a2744..f232c84be09 100644
--- a/samples/snippets/csharp/VS_Snippets_VBCSharp/CsLINQCustomComparer/CS/CustomComparer.cs
+++ b/samples/snippets/csharp/VS_Snippets_VBCSharp/CsLINQCustomComparer/CS/CustomComparer.cs
@@ -15,7 +15,7 @@ class ProductComparer : IEqualityComparer
// Products are equal if their names and product numbers are equal.
public bool Equals(Product x, Product y)
{
-
+
//Check whether the compared objects reference the same data.
if (Object.ReferenceEquals(x, y)) return true;
@@ -27,7 +27,7 @@ public bool Equals(Product x, Product y)
return x.Code == y.Code && x.Name == y.Name;
}
- // If Equals() returns true for a pair of objects
+ // If Equals() returns true for a pair of objects
// then GetHashCode() must return the same value for these objects.
public int GetHashCode(Product product)
@@ -52,19 +52,19 @@ class Program
static void Main(string[] args)
{
//
- Product[] store1 = { new Product { Name = "apple", Code = 9 },
+ Product[] store1 = { new Product { Name = "apple", Code = 9 },
new Product { Name = "orange", Code = 4 } };
- Product[] store2 = { new Product { Name = "apple", Code = 9 },
+ Product[] store2 = { new Product { Name = "apple", Code = 9 },
new Product { Name = "lemon", Code = 12 } };
//
//INTERSECT
//
- // Get the products from the first array
+ // Get the products from the first array
// that have duplicates in the second array.
-
+
IEnumerable duplicates =
store1.Intersect(store2, new ProductComparer());
@@ -78,7 +78,7 @@ apple 9
//
//UNION
-
+
//
//Get the products from the both arrays
//excluding duplicates.
@@ -91,7 +91,7 @@ apple 9
/*
This code produces the following output:
-
+
apple 9
orange 4
lemon 12
@@ -101,13 +101,13 @@ lemon 12
//DISTINCT
//
- Product[] products = { new Product { Name = "apple", Code = 9 },
- new Product { Name = "orange", Code = 4 },
- new Product { Name = "apple", Code = 9 },
+ Product[] products = { new Product { Name = "apple", Code = 9 },
+ new Product { Name = "orange", Code = 4 },
+ new Product { Name = "apple", Code = 9 },
new Product { Name = "lemon", Code = 12 } };
//Exclude duplicates.
-
+
IEnumerable noduplicates =
products.Distinct(new ProductComparer());
@@ -116,7 +116,7 @@ lemon 12
/*
This code produces the following output:
- apple 9
+ apple 9
orange 4
lemon 12
*/
@@ -126,8 +126,8 @@ lemon 12
//
- Product[] fruits = { new Product { Name = "apple", Code = 9 },
- new Product { Name = "orange", Code = 4 },
+ Product[] fruits = { new Product { Name = "apple", Code = 9 },
+ new Product { Name = "orange", Code = 4 },
new Product { Name = "lemon", Code = 12 } };
Product apple = new Product { Name = "apple", Code = 9 };
@@ -143,17 +143,17 @@ lemon 12
/*
This code produces the following output:
-
+
Apple? True
Kiwi? False
- */
+ */
//
//EXCEPT
//
- Product[] fruits1 = { new Product { Name = "apple", Code = 9 },
+ Product[] fruits1 = { new Product { Name = "apple", Code = 9 },
new Product { Name = "orange", Code = 4 },
new Product { Name = "lemon", Code = 12 } };
@@ -170,7 +170,7 @@ lemon 12
/*
This code produces the following output:
-
+
orange 4
lemon 12
*/
@@ -181,10 +181,10 @@ lemon 12
//
- Product[] storeA = { new Product { Name = "apple", Code = 9 },
+ Product[] storeA = { new Product { Name = "apple", Code = 9 },
new Product { Name = "orange", Code = 4 } };
- Product[] storeB = { new Product { Name = "apple", Code = 9 },
+ Product[] storeB = { new Product { Name = "apple", Code = 9 },
new Product { Name = "orange", Code = 4 } };
bool equalAB = storeA.SequenceEqual(storeB, new ProductComparer());
@@ -193,7 +193,7 @@ lemon 12
/*
This code produces the following output:
-
+
Equal? True
*/
diff --git a/samples/snippets/csharp/VS_Snippets_VBCSharp/CsLINQEncapsulatedComparer/CS/EncapsulatedComparer.cs b/samples/snippets/csharp/VS_Snippets_VBCSharp/CsLINQEncapsulatedComparer/CS/EncapsulatedComparer.cs
index 4972a45fbf0..1633550c522 100644
--- a/samples/snippets/csharp/VS_Snippets_VBCSharp/CsLINQEncapsulatedComparer/CS/EncapsulatedComparer.cs
+++ b/samples/snippets/csharp/VS_Snippets_VBCSharp/CsLINQEncapsulatedComparer/CS/EncapsulatedComparer.cs
@@ -11,29 +11,29 @@ public class Product : IEquatable
public bool Equals(Product other)
{
- //Check whether the compared object is null.
+ //Check whether the compared object is null.
if (Object.ReferenceEquals(other, null)) return false;
- //Check whether the compared object references the same data.
+ //Check whether the compared object references the same data.
if (Object.ReferenceEquals(this, other)) return true;
- //Check whether the products' properties are equal.
+ //Check whether the products' properties are equal.
return Code.Equals(other.Code) && Name.Equals(other.Name);
}
- // If Equals() returns true for a pair of objects
- // then GetHashCode() must return the same value for these objects.
+ // If Equals() returns true for a pair of objects
+ // then GetHashCode() must return the same value for these objects.
public override int GetHashCode()
{
- //Get hash code for the Name field if it is not null.
+ //Get hash code for the Name field if it is not null.
int hashProductName = Name == null ? 0 : Name.GetHashCode();
- //Get hash code for the Code field.
+ //Get hash code for the Code field.
int hashProductCode = Code.GetHashCode();
- //Calculate the hash code for the product.
+ //Calculate the hash code for the product.
return hashProductName ^ hashProductCode;
}
}
@@ -47,27 +47,27 @@ static void Main(string[] args)
// Some samples here need to use ProductA in conjunction with
// ProductComparer, which implements IEqualityComparer (not IEquatable).
//
- ProductA[] store1 = { new ProductA { Name = "apple", Code = 9 },
+ ProductA[] store1 = { new ProductA { Name = "apple", Code = 9 },
new ProductA { Name = "orange", Code = 4 } };
- ProductA[] store2 = { new ProductA { Name = "apple", Code = 9 },
+ ProductA[] store2 = { new ProductA { Name = "apple", Code = 9 },
new ProductA { Name = "lemon", Code = 12 } };
//
//
- Product[] store1 = { new Product { Name = "apple", Code = 9 },
+ Product[] store1 = { new Product { Name = "apple", Code = 9 },
new Product { Name = "orange", Code = 4 } };
- Product[] store2 = { new Product { Name = "apple", Code = 9 },
+ Product[] store2 = { new Product { Name = "apple", Code = 9 },
new Product { Name = "lemon", Code = 12 } };
//
//INTERSECT
//
- // Get the products from the first array
+ // Get the products from the first array
// that have duplicates in the second array.
-
+
IEnumerable duplicates =
store1.Intersect(store2);
@@ -81,7 +81,7 @@ apple 9
//
//UNION
-
+
//
//Get the products from the both arrays
//excluding duplicates.
@@ -94,7 +94,7 @@ apple 9
/*
This code produces the following output:
-
+
apple 9
orange 4
lemon 12
@@ -104,13 +104,13 @@ lemon 12
//DISTINCT
//
- Product[] products = { new Product { Name = "apple", Code = 9 },
- new Product { Name = "orange", Code = 4 },
- new Product { Name = "apple", Code = 9 },
+ Product[] products = { new Product { Name = "apple", Code = 9 },
+ new Product { Name = "orange", Code = 4 },
+ new Product { Name = "apple", Code = 9 },
new Product { Name = "lemon", Code = 12 } };
//Exclude duplicates.
-
+
IEnumerable noduplicates =
products.Distinct();
@@ -119,7 +119,7 @@ lemon 12
/*
This code produces the following output:
- apple 9
+ apple 9
orange 4
lemon 12
*/
@@ -128,7 +128,7 @@ lemon 12
//EXCEPT
//
- ProductA[] fruits1 = { new ProductA { Name = "apple", Code = 9 },
+ ProductA[] fruits1 = { new ProductA { Name = "apple", Code = 9 },
new ProductA { Name = "orange", Code = 4 },
new ProductA { Name = "lemon", Code = 12 } };
@@ -145,7 +145,7 @@ lemon 12
/*
This code produces the following output:
-
+
orange 4
lemon 12
*/
@@ -155,10 +155,10 @@ lemon 12
//
- ProductA[] storeA = { new ProductA { Name = "apple", Code = 9 },
+ ProductA[] storeA = { new ProductA { Name = "apple", Code = 9 },
new ProductA { Name = "orange", Code = 4 } };
- ProductA[] storeB = { new ProductA { Name = "apple", Code = 9 },
+ ProductA[] storeB = { new ProductA { Name = "apple", Code = 9 },
new ProductA { Name = "orange", Code = 4 } };
bool equalAB = storeA.SequenceEqual(storeB);
@@ -167,7 +167,7 @@ lemon 12
/*
This code produces the following output:
-
+
Equal? True
*/
//
diff --git a/samples/snippets/csharp/VS_Snippets_VBCSharp/VbRaddataSQLObjects/CS/Aggregate1.cs b/samples/snippets/csharp/VS_Snippets_VBCSharp/VbRaddataSQLObjects/CS/Aggregate1.cs
index b3a3ddbf477..13b5b04d09f 100644
--- a/samples/snippets/csharp/VS_Snippets_VBCSharp/VbRaddataSQLObjects/CS/Aggregate1.cs
+++ b/samples/snippets/csharp/VS_Snippets_VBCSharp/VbRaddataSQLObjects/CS/Aggregate1.cs
@@ -20,7 +20,7 @@ public void Accumulate(SqlString value)
{
// list of vowels to look for
string vowels = "aeiou";
-
+
// for each character in the given parameter
for (int i=0; i < value.ToString().Length; i++)
{
diff --git a/samples/snippets/csharp/VS_Snippets_VBCSharp/VbRaddataSQLObjects/CS/Type1.cs b/samples/snippets/csharp/VS_Snippets_VBCSharp/VbRaddataSQLObjects/CS/Type1.cs
index d682e463840..c9f34f10eae 100644
--- a/samples/snippets/csharp/VS_Snippets_VBCSharp/VbRaddataSQLObjects/CS/Type1.cs
+++ b/samples/snippets/csharp/VS_Snippets_VBCSharp/VbRaddataSQLObjects/CS/Type1.cs
@@ -88,7 +88,7 @@ public SqlString Quadrant()
if (m_x == 0 && m_y == 0)
{
return "centered";
- }
+ }
SqlString stringReturn = "";
@@ -99,13 +99,13 @@ public SqlString Quadrant()
else if (m_x > 0)
{
stringReturn = "right";
- }
+ }
else if (m_x < 0)
{
stringReturn = "left";
}
- if (m_y == 0)
+ if (m_y == 0)
{
stringReturn = stringReturn + " center";
}
diff --git a/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideAttributes/CS/Attributes.cs b/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideAttributes/CS/Attributes.cs
index 6175dac7f62..e4cca1718b1 100644
--- a/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideAttributes/CS/Attributes.cs
+++ b/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideAttributes/CS/Attributes.cs
@@ -459,7 +459,7 @@ void TraceMethod()
{
// ...
}
- //
+ //
}
}
namespace WrapObsolete
diff --git a/samples/snippets/csharp/VS_Snippets_WebNet/AttributeCollection.Render_Sample1/CS/attributecollection_render.cs b/samples/snippets/csharp/VS_Snippets_WebNet/AttributeCollection.Render_Sample1/CS/attributecollection_render.cs
index 3c5a3796e89..6d7e7e2cbd7 100644
--- a/samples/snippets/csharp/VS_Snippets_WebNet/AttributeCollection.Render_Sample1/CS/attributecollection_render.cs
+++ b/samples/snippets/csharp/VS_Snippets_WebNet/AttributeCollection.Render_Sample1/CS/attributecollection_render.cs
@@ -1,10 +1,10 @@
//
-/* Create a custom WebControl class, named AttribRender, that overrides
+/* Create a custom WebControl class, named AttribRender, that overrides
the Render method to write two introductory strings. Then call the
AttributeCollection.Render method, which allows the control to write the
attribute values that are added to it when it is included in a page.
*/
-
+
using System;
using System.Web;
using System.Web.UI;
@@ -16,7 +16,7 @@ attribute values that are added to it when it is included in a page.
namespace AC_Render
{
// This is the custom WebControl class.
- [AspNetHostingPermission(SecurityAction.Demand,
+ [AspNetHostingPermission(SecurityAction.Demand,
Level=AspNetHostingPermissionLevel.Minimal)]
public class AttribRender : WebControl
{
diff --git a/samples/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs b/samples/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs
index a5aa9abe163..ca8167d0c5b 100644
--- a/samples/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs
+++ b/samples/snippets/csharp/VS_Snippets_WebNet/AutoGenerateFieldProperties/CS/SimpleCustomControl.cs
@@ -11,20 +11,20 @@
namespace Samples.AspNet.CS.Controls
{
-
+
[AspNetHostingPermission(SecurityAction.Demand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public class SimpleCustomControl : DetailsView
{
- protected override AutoGeneratedField CreateAutoGeneratedRow(AutoGeneratedFieldProperties fieldProperties)
+ protected override AutoGeneratedField CreateAutoGeneratedRow(AutoGeneratedFieldProperties fieldProperties)
{
// Create an AutoGeneratedField object.
AutoGeneratedField field = new AutoGeneratedField(fieldProperties.DataField);
// Set the properties of the AutoGeneratedField using
- // the values from the AutoGeneratedFieldProperties
+ // the values from the AutoGeneratedFieldProperties
// object contained in the fieldProperties parameter.
((IStateManager)field).TrackViewState();
field.HeaderText = fieldProperties.Name;
diff --git a/samples/snippets/csharp/VS_Snippets_WebNet/ButtonColumnButtonType/CS/source.cs b/samples/snippets/csharp/VS_Snippets_WebNet/ButtonColumnButtonType/CS/source.cs
index 36cfa76d7e8..2e9b37b34e6 100644
--- a/samples/snippets/csharp/VS_Snippets_WebNet/ButtonColumnButtonType/CS/source.cs
+++ b/samples/snippets/csharp/VS_Snippets_WebNet/ButtonColumnButtonType/CS/source.cs
@@ -7,12 +7,12 @@ public class Page1: Page
{
protected DataGrid ItemsGrid;
//
- private void Page_Init(Object sender, EventArgs e)
+ private void Page_Init(Object sender, EventArgs e)
{
// Create dynamic column to add to Columns collection.
ButtonColumn AddColumn = new ButtonColumn();
- AddColumn.HeaderText="Add Item";
+ AddColumn.HeaderText="Add Item";
AddColumn.Text="Add";
AddColumn.CommandName="Add";
AddColumn.ButtonType = ButtonColumnType.PushButton;
@@ -20,6 +20,6 @@ private void Page_Init(Object sender, EventArgs e)
// Add column to Columns collection.
ItemsGrid.Columns.AddAt(2, AddColumn);
}
-
+
//
}
diff --git a/samples/snippets/csharp/VS_Snippets_WebNet/cachingaspnetapplications/cs/default.aspx.cs b/samples/snippets/csharp/VS_Snippets_WebNet/cachingaspnetapplications/cs/default.aspx.cs
index 4c802eb76b9..78ab24dea67 100644
--- a/samples/snippets/csharp/VS_Snippets_WebNet/cachingaspnetapplications/cs/default.aspx.cs
+++ b/samples/snippets/csharp/VS_Snippets_WebNet/cachingaspnetapplications/cs/default.aspx.cs
@@ -15,7 +15,7 @@ protected void Button1_Click1(object sender, EventArgs e)
{
ObjectCache cache = MemoryCache.Default;
string fileContents = cache["filecontents"] as string;
-
+
if (fileContents == null)
{
CacheItemPolicy policy = new CacheItemPolicy();