public void AddSequencePoint(string sourceFile, Guid docLanguage, Guid langVendor, Guid docType, uint offset, uint line, uint col, uint endLine, uint endCol)
{
Document sourceDoc = null;
// Make sure we are in a method
if (currentMethod == null)
throw new Exception("You can not add sequence points before opening a method.");
// Check if a reference for this source document already exists
foreach (Document doc in _docWriters)
if (sourceFile == doc._file && docLanguage == doc._docLanguage && langVendor == doc._langVendor && docType == doc._docType) {
sourceDoc = doc;
break;
}
// If no existing document, create a new one
if (sourceDoc == null) {
sourceDoc = new Document();
sourceDoc._file = sourceFile;
sourceDoc._docLanguage = docLanguage;
sourceDoc._langVendor = langVendor;
sourceDoc._docType = docType;
_docWriters.Add(sourceDoc);
}
SequencePointList spList = (SequencePointList)currentMethod.SequencePointList[sourceDoc];
if (spList == null)
currentMethod.SequencePointList.Add(sourceDoc, spList = new SequencePointList());
spList.offsets.Add(offset);
spList.lines.Add(line);
spList.cols.Add(col);
spList.endLines.Add(endLine);
spList.endCols.Add(endCol);
}