Has any way to mark generated code with [Serializable]? [ANTLR4][C#]

26 views
Skip to first unread message

André de Mattos Ferraz

unread,
May 26, 2015, 3:20:45 PM5/26/15
to antlr-di...@googlegroups.com
I create a grammar and in the code generated listeners I want to mark then with [Serializable], its possible?

André de Mattos Ferraz

unread,
May 27, 2015, 10:44:44 AM5/27/15
to antlr-di...@googlegroups.com
I resolve as follow:

[NonSerialized]
private MyListener _listener;

[OnDeserialized]
private void HandleOnDeserialized(StreamingContext context)
{
    _listener = new MyListener();
}
Reply all
Reply to author
Forward
0 new messages