System.Diagnostics.SymbolStore.SymReader.GetDocument C# (CSharp) Method

GetDocument() public method

public GetDocument ( string url, System.Guid language, System.Guid languageVendor, System.Guid documentType ) : ISymbolDocument
url string
language System.Guid
languageVendor System.Guid
documentType System.Guid
return ISymbolDocument
        public ISymbolDocument GetDocument(
            string url,
            Guid language,
            Guid languageVendor,
            Guid documentType)
        {
            COMException Exception;
            int hr;
            IntPtr DocumentPointer;
            hr = SymReader_GetDocument(m_Reader, url, language, languageVendor, documentType, out DocumentPointer);
            if (hr < 0)
            {
                Exception = new COMException("Call to GetDocument failed.", hr);
                throw Exception;
            }        
            return new SymDocument(DocumentPointer);
        }

Usage Example

Esempio n. 1
0
        // Load the sequence point information.
        private void LoadSequencePoints()
        {
            SymInfoEnumerator e;
            String            filename;
            ISymbolDocument   document;
            int line, column, offset;

            // Bail out if we have already loaded the sequence points.
            if (sequencePoints != null)
            {
                return;
            }

            // Create the sequence point list.
            sequencePoints = new ArrayList();

            // Load the sequence point information.
            e = new SymInfoEnumerator(reader, token);
            while (e.MoveNext())
            {
                if (e.Type == SymReader.DataType_LineColumn)
                {
                    // Block contains line and column values only.
                    filename = reader.ReadString(e.GetNextInt());
                    document = reader.GetDocument(filename);
                    while ((line = e.GetNextInt()) != -1)
                    {
                        column = e.GetNextInt();
                        sequencePoints.Add
                            (new SequencePoint(0, document, line, column));
                    }
                }
                else if (e.Type == SymReader.DataType_LineOffsets)
                {
                    // Block contains line and offset values only.
                    filename = reader.ReadString(e.GetNextInt());
                    document = reader.GetDocument(filename);
                    while ((line = e.GetNextInt()) != -1)
                    {
                        offset = e.GetNextInt();
                        sequencePoints.Add
                            (new SequencePoint(offset, document, line, 0));
                    }
                }
                else if (e.Type == SymReader.DataType_LineColumnOffsets)
                {
                    // Block contains line, column, and offset values.
                    filename = reader.ReadString(e.GetNextInt());
                    document = reader.GetDocument(filename);
                    while ((line = e.GetNextInt()) != -1)
                    {
                        column = e.GetNextInt();
                        offset = e.GetNextInt();
                        sequencePoints.Add
                            (new SequencePoint
                                (offset, document, line, column));
                    }
                }
            }

            // Sort the sequence points on ascending offset.
            sequencePoints.Sort(new SequencePointComparer());
        }