using System;
public class Program
{
public static event Action EventTrue;
public static event Action EventFalse;
static bool foo;
public static void Main()
var b = false;
Subscribe(()=>Invert(ref b));
EventTrue.Invoke();
Console.WriteLine(b);
EventFalse.Invoke();
}
public static void Subscribe(Action a)
EventTrue += () => a();
EventFalse += () => a();
public static void Invert(ref bool b)
b = !b;