public void LoadFromString(string s) { Properties.Clear(); var ss = new StringReader(s); var count = ss.ReadInt(); for (int i = 0; i < count; i++ ) { string name = ss.ReadName(); string value = ss.ReadName(); Properties[name] = value; } }