Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

C# Event Demo

  • this demo console app shows simple event sample
  • using Action/Func as well as EventHandler and EventArgs

Key Points

  • Delegate is a kind of pointer to callback function
  • Event is improved version of Delegate for better control

Setup

cd ConsoleEventDemo
dotnet new sln -n ConsoleEventDemo
dotnet new console -n EventDemoApp
dotnet sln ConsoleEventDemo.sln add **/*.csproj

cd EventDemoApp
dotnet add package Microsoft.CodeAnalysis.FxCopAnalyzers

Run

cd EventDemoApp
dotnet restore
dotnet build
dotnet run

Reference