private void SaveSourceForDebugging(){
if (!this.GenerateDebugInfo || this.debugDirectory == null || !this.isEngineDirty)
return;
foreach (VsaItem item in this.vsaItems){
if (item is VsaStaticCode){
string fileName = this.debugDirectory + item.Name + ".js";
try{
using (FileStream file = new FileStream(fileName, FileMode.Create, FileAccess.Write)) {
using (StreamWriter sw = new StreamWriter(file))
sw.Write(((VsaStaticCode)item).SourceText);
item.SetOption("codebase", fileName);
}
}catch{
// swallow any file creation exceptions
}
}
}
}