using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
public static void Main()
var z = new ArgumentDictionary(){{"2", "5"}};
Stream stream = new MemoryStream();
BinaryFormatter bformatter = new BinaryFormatter();
bformatter.Serialize(stream, z);
ArgumentDictionary d = (ArgumentDictionary)bformatter.Deserialize(stream);
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
Console.WriteLine(reader.ReadToEnd());
Console.WriteLine(z["2"]);
Console.WriteLine(d["2"]);
Console.WriteLine("Hello instantiated");
public class Hi : Hello {
Console.WriteLine("Hi instantiated");
public class ArgumentDictionary : Dictionary<string, string>
protected ArgumentDictionary(SerializationInfo info, StreamingContext context) : base(info, context) { }
public ArgumentDictionary() { }