Problem with SyntaxEdit

I'm using SyntaxEdit. When I upload the codes to the editor the first time, everything works ok.
CSharpEditor editor = new CSharpEditor();
editor.scriptEditor.Source.Text = code;
editor.csParser.Repository.AddDocument("global.cs", globalCode);
editor.LoadReferences(references);

if (editor.ShowDialog() == DialogResult.OK)
{
references.Clear();
references.AddRange(editor.GetReferences());
return editor.scriptEditor.Text;
}
When I do this the second time, the syntax appears with errors, saying that my class already exists.
Hello Rogerio,
Could you please send me a cut-down version of your project so I can investigate the problem? My e-mail is andrew.medvedev@alternetsoft.com
regards,
Andrew
Hi Rogerio,
the problem might the the "csParser" variable. Which constructor do you use to create it? If you use the parameterless constructor, a static "RoslnySolution" will be used - thus the "global.cs" document will be added twice in your sample.
Better use the "new CsParser (new CsSolution())" constructor - this one creates a new solution each time.

Hope this helps

Wolfgang
Hello Wolfgang,
Your solution worked. Thank you!