Skip to content

Instantly share code, notes, and snippets.

@torokati44
Created May 31, 2014 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torokati44/0d1fb6387e47afcfe43c to your computer and use it in GitHub Desktop.
Save torokati44/0d1fb6387e47afcfe43c to your computer and use it in GitHub Desktop.
using System;
namespace dlgt
{
delegate void LoggerDelegate(int a, int b, int p);
class DataHandler
{
public void DoOperation (int a, int b, LoggerDelegate d)
{
d(a, b, a*b);
}
}
class MainClass
{
static void LogToStdOut (int a, int b, int p)
{
System.Console.WriteLine("{0} * {1} = {2}", a, b, p);
}
public static void Main (string[] args)
{
DataHandler dh = new DataHandler();
dh.DoOperation(2, 3, LogToStdOut);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment