Skip to content

Instantly share code, notes, and snippets.

@manuelleduc
Created November 19, 2015 16:58
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 manuelleduc/171b10be82b5bb25de0f to your computer and use it in GitHub Desktop.
Save manuelleduc/171b10be82b5bb25de0f to your computer and use it in GitHub Desktop.
using System;
namespace test2
{
public delegate void CallSuccess();
public delegate void CallError(String e);
public class Service
{
public void success(CallSuccess ok, CallError error) {
ok();
}
public void error(CallSuccess ok, CallError error) {
error("Error message");
}
}
class MainClass
{
public static void Main (string[] args)
{
new Service ().success (() => { Console.WriteLine("ok");}, (e) => { Console.WriteLine("error : " + e); });
new Service ().error (() => { Console.WriteLine("ok");}, (e) => { Console.WriteLine("error : " + e); });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment