Listing 2 The JVsaSite class from class1.cs in the C# project
class JVsaSite : Microsoft.Vsa.BaseVsaSite { UISReport callback; // The object that the script will call public JVsaSite () { callback = new UISReport(); } // Implements Microsoft.Vsa.IVsaSite.OnCompilerError public override bool OnCompilerError(Microsoft.Vsa.IVsaError error) { // Build a message containing the compiler error message SyntaxErrors.Append (new StringBuilder (error.Description + " on line " + error.Line + " Text: " + error.LineText)); return true; // Continue reporting more errors } // Implements Microsoft.Vsa.IVsaSite.GetGlobalInstance public override object GetGlobalInstance(string name) { // We just have one global instance - the UISReport object return callback; } StringBuilder SyntaxErrors = new StringBuilder(); public void ShowErrors() { MessageBox.Show (SyntaxErrors.ToString()); SyntaxErrors = null; // Clear them } }