Below we have a synchronous method that counts to 5.
static void Main(string[] args)
{
Console.WriteLine("START");
Count();
Console.WriteLine("END");
Console.ReadKey();
Some times we want to do something when a specific event occurs, for that we can use a callback as I will show next. For me this implementation was realy important to solve a problem, I had a Library so the code will be closed (can't be changed), but I wanted to provide a way to allow extra operations when some event occurs, that was the solution that I had found.
Lets imagine that the next code from SmartHouse.cs
and ISmartHouseOperations.cs
is closed.
SmartHouse.cs
git init
git add .
git commit -m "First commit"
git remote add origin [YOUR_REPO_URL]