diff --git a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/eventsoverview.csproj b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/eventsoverview.csproj new file mode 100644 index 0000000000000..0be2a52725e5e --- /dev/null +++ b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/eventsoverview.csproj @@ -0,0 +1,11 @@ + + + + net6.0 + disable + true + Exe + ConsoleApplication2.ProgramTwo + + + \ No newline at end of file diff --git a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programnodata.cs b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programnodata.cs index 654c0db5078de..ea92dd0b743c6 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programnodata.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programnodata.cs @@ -3,7 +3,7 @@ namespace ConsoleApplication1 { - class Program + class ProgramOne { static void Main(string[] args) { diff --git a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programtruncated.cs b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programtruncated.cs index ac747b434e5b2..3507c52fb8a80 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programtruncated.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programtruncated.cs @@ -1,9 +1,9 @@ using System; -namespace ConsoleApplication1 +namespace ConsoleApplication2 { // - class Program + class ProgramTwo { static void Main() { @@ -27,8 +27,7 @@ class Counter protected virtual void OnThresholdReached(EventArgs e) { - EventHandler handler = ThresholdReached; - handler?.Invoke(this, e); + ThresholdReached?.Invoke(this, e); } // provide remaining implementation for the class diff --git a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programwithdata.cs b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programwithdata.cs index 3a49caa9e1bac..5700f9b2bdb6d 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programwithdata.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programwithdata.cs @@ -1,9 +1,9 @@ // using System; -namespace ConsoleApplication1 +namespace ConsoleApplication3 { - class Program + class ProgramThree { static void Main(string[] args) { diff --git a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programwithdelegate.cs b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programwithdelegate.cs index b063190ff9467..7ef1d2fd7ba5e 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programwithdelegate.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR/eventsoverview/cs/programwithdelegate.cs @@ -1,9 +1,9 @@ // using System; -namespace ConsoleApplication1 +namespace ConsoleApplication4 { - class Program + class ProgramFour { static void Main(string[] args) {