Inheritance: ISymbolDocument
Example #1
0
        // Get a document block for a particular filename.
        internal ISymbolDocument GetDocument(String filename)
        {
            ISymbolDocument document;

            // Convert the filename into a full URL.
            filename = FilenameToURL(filename);
            if (filename == null)
            {
                return(null);
            }

            // See if we already have a document for this file.
            if (documentCache == null)
            {
                documentCache = new Hashtable();
            }
            else if ((document = (ISymbolDocument)documentCache[filename])
                     != null)
            {
                return(document);
            }

            // Create a new document object and add it to the cache.
            document = new SymDocument(this, null, filename);
            documentCache[filename] = document;
            return(document);
        }
Example #2
0
        public ISymbolDocument[] GetDocuments()
        {
            COMException Exception;
            int hr;
            uint i;
            int cDocs;
            IntPtr[] DocumentPointers;
            SymDocument[] Documents;
            hr = SymReader_GetDocuments(m_Reader, 0, out cDocs, null);
            if (hr < 0)
            {
                Exception = new COMException("Call to GetDocuments failed.", hr);
                throw Exception;
            }        
            DocumentPointers = new IntPtr[cDocs];
            Documents = new SymDocument[cDocs];
            hr = SymReader_GetDocuments(m_Reader, cDocs, out cDocs, DocumentPointers);
            if (hr < 0)
            {
                Exception = new COMException("Call to GetDocuments failed.", hr);
                throw Exception;
            }        

            for (i = 0; i < cDocs; i++)
            {
                Documents[i] = new SymDocument(DocumentPointers[i]);
            }

            return Documents;
        }
Example #3
0
        public bool GetSourceStartEnd(
            ISymbolDocument[] docs  ,
            int[] lines ,
            int[] columns )
        {
            int hr;
            uint i;
            bool pRetVal;
            int spCount = 0;
            if (docs != null)
                spCount = docs.Length;
            else if (lines != null)
                spCount = lines.Length;
            else if (columns != null)
                spCount = columns.Length;

            // If we don't have at least 2 entries then return an error
            if (spCount < 2)
                throw new ArgumentException();

            // Make sure all arrays are the same length.
            if ((docs != null) && (spCount != docs.Length))
                throw new ArgumentException();

            if ((lines != null) && (spCount != lines.Length))
                throw new ArgumentException();

            if ((columns != null) && (spCount != columns.Length))
                throw new ArgumentException();

            COMException Exception;
            IntPtr[] Documents = new IntPtr[docs.Length];
            hr = SymMethod_GetSourceStartEnd(m_Method, Documents, lines, columns, out pRetVal);
            if (hr < 0)
            {
                Exception = new COMException("Call to GetSourceStartEnd failed.", hr);
                throw Exception;
            }
            if (pRetVal)
            {
                for (i = 0; i < docs.Length;i++)
                {
                    docs[i] = new SymDocument(Documents[i]);
                }
            }
            return pRetVal;

        }
Example #4
0
        public void GetSequencePoints(int[] offsets,
            ISymbolDocument[] documents,
            int[] lines,
            int[] columns,
            int[] endLines,
            int[] endColumns)
        {
            int hr;
            int spCount = 0;
            if (offsets != null)
                spCount = offsets.Length;
            else if (documents != null)
                spCount = documents.Length;
            else if (lines != null)
                spCount = lines.Length;
            else if (columns != null)
                spCount = columns.Length;
            else if (endLines != null)
                spCount = endLines.Length;
            else if (endColumns != null)
                spCount = endColumns.Length;

            // Don't do anything if they're not really asking for anything.
            if (spCount == 0)
                return;

            // Make sure all arrays are the same length.
            if ((offsets != null) && (spCount != offsets.Length))
                throw new ArgumentException();

            if ((lines != null) && (spCount != lines.Length))
                throw new ArgumentException();

            if ((columns != null) && (spCount != columns.Length))
                throw new ArgumentException();

            if ((endLines != null) && (spCount != endLines.Length))
                throw new ArgumentException();

            if ((endColumns != null) && (spCount != endColumns.Length))
                throw new ArgumentException();

            COMException Exception;
            IntPtr[] IDocuments = new IntPtr[documents.Length];
            int cPoints;
            uint i;
            hr = SymMethod_GetSequencePoints(m_Method, documents.Length, out cPoints,
                IDocuments, offsets,
                lines, columns,
                endLines, endColumns);

            if (hr < 0)
            {
                Exception = new COMException("Call to GetSequencePoints failed.", hr);
                throw Exception;
            }

            // Create the SymDocument form the IntPtr's
            for (i = 0; i < documents.Length; i++)
            {
                documents[i] = new SymDocument(IDocuments[i]);
            }

            return;
        }
	// Get a document block for a particular filename.
	internal ISymbolDocument GetDocument(String filename)
			{
				ISymbolDocument document;

				// Convert the filename into a full URL.
				filename = FilenameToURL(filename);
				if(filename == null)
				{
					return null;
				}

				// See if we already have a document for this file.
				if(documentCache == null)
				{
					documentCache = new Hashtable();
				}
				else if((document = (ISymbolDocument)documentCache[filename])
							!= null)
				{
					return document;
				}

				// Create a new document object and add it to the cache.
				document = new SymDocument(this, null, filename);
				documentCache[filename] = document;
				return document;
			}