diff --git a/snippets/csharp/VS_Snippets_VBCSharp/csasyncexceptions/cs/class1.cs b/snippets/csharp/VS_Snippets_VBCSharp/csasyncexceptions/cs/class1.cs index 6c4ac82ea58..9b5fb690fd7 100644 --- a/snippets/csharp/VS_Snippets_VBCSharp/csasyncexceptions/cs/class1.cs +++ b/snippets/csharp/VS_Snippets_VBCSharp/csasyncexceptions/cs/class1.cs @@ -70,7 +70,6 @@ private async Task DelayAsync() // Exception Message: canceled // Task IsCanceled: True // Task IsFaulted: False - // @@ -116,4 +115,4 @@ private async Task ExcAsync(string info) // } -} +} \ No newline at end of file diff --git a/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsAccess/CS/csrefKeywordsAccess.cs b/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsAccess/CS/csrefKeywordsAccess.cs index 17eae4007cd..3eb73210724 100644 --- a/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsAccess/CS/csrefKeywordsAccess.cs +++ b/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsAccess/CS/csrefKeywordsAccess.cs @@ -92,6 +92,25 @@ in BaseClass(int i) */ // + namespace Example1 //for redefinition of Employee + { + // + public class Employee + { + private string alias; + private string name; + + public Employee(string name, string alias) + { + // Use this to qualify the members of the class + // instead of the constructor parameters. + this.name = name; + this.alias = alias; + } + } + // + } + namespace Example2 //for redefinition of Employee { // @@ -102,14 +121,13 @@ class Employee private decimal salary = 3000.00m; // Constructor: - // public Employee(string name, string alias) { // Use this to qualify the fields, name and alias: this.name = name; this.alias = alias; } - // + // Printing method: public void printEmployee() { diff --git a/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsExceptions/CS/csrefKeywordsExceptions.cs b/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsExceptions/CS/csrefKeywordsExceptions.cs index 0f11f63ea15..a905b889893 100644 --- a/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsExceptions/CS/csrefKeywordsExceptions.cs +++ b/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsExceptions/CS/csrefKeywordsExceptions.cs @@ -39,36 +39,34 @@ void ReadFile(int index) // class TryFinallyTest -{ - static void ProcessString(string s) { - if (s == null) + static void ProcessString(string s) { - throw new ArgumentNullException(); + if (s == null) + { + throw new ArgumentNullException(); + } } - } - static void Main() - { - string s = null; // For demonstration purposes. - - try - { - ProcessString(s); - } - - catch (Exception e) + static void Main() { - Console.WriteLine("{0} Exception caught.", e); + string s = null; // For demonstration purposes. + + try + { + ProcessString(s); + } + catch (Exception e) + { + Console.WriteLine("{0} Exception caught.", e); + } } } -} /* Output: System.ArgumentNullException: Value cannot be null. at TryFinallyTest.Main() Exception caught. * */ - // //