PERWAPI.PDBWriter.AddSequencePoint C# (CSharp) Method

AddSequencePoint() public method

Add a new sequnce point.
public AddSequencePoint ( string sourceFile, System.Guid docLanguage, System.Guid langVendor, System.Guid docType, uint offset, uint line, uint col, uint endLine, uint endCol ) : void
sourceFile string The source file the sequence point is in.
docLanguage System.Guid The language of the source file.
langVendor System.Guid The language vendor of the source file.
docType System.Guid The document type.
offset uint The offset of the sequence point.
line uint The starting line for the sequence point.
col uint The starting column for the sequence point.
endLine uint The ending line for the sequence point.
endCol uint The ending column for the sequence point.
return void
        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);
        }