public void GetObjectData(SerializationInfo info, StreamingContext context) { Contract.RequiresNotNull(info, "info"); info.AddValue("symbolName", SymbolTable.IdToString(this)); }
/// <summary> /// Override of ToString. /// DO NOT USE THIS METHOD TO RETRIEVE STRING THAT THE SYMBOL REPRESENTS /// Use SymbolTable.IdToString(SymbolId) instead. /// </summary> public override string ToString() { return(SymbolTable.IdToString(this)); }
// When leaving a context we serialize out our ID as a name // rather than a raw ID. When we enter a new context we // consult it's FieldTable to get the ID of the symbol name in // the new context. private SymbolId(SerializationInfo info, StreamingContext context) { Contract.RequiresNotNull(info, "info"); _id = SymbolTable.StringToId(info.GetString("symbolName"))._id; }