public static void Main() { foo("normal", test); FOO f = new FOO(foo); f("delegate", test); }
public static void Main(string[] args) { var foo = new FOO(); var x = new XmlSerializer(typeof(FOO)); using (var memoryStream = new MemoryStream()) { using (var writer = new StreamWriter(memoryStream)) { x.Serialize(writer, foo); } } }