Пример #1
0
        public bool GetSourceStartEnd(ISymbolDocument[] docs, int[] lines, int[] columns)
        {
            uint i;
            bool retVal;
            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();
            }

            ISymUnmanagedDocument[] unmanagedDocuments = new ISymUnmanagedDocument[docs.Length];
            unmanagedMethod.GetSourceStartEnd(unmanagedDocuments, lines, columns, out retVal);
            if (retVal)
            {
                for (i = 0; i < docs.Length; i++)
                {
                    docs[i] = new SymbolDocument(unmanagedDocuments[i]);
                }
            }
            return(retVal);
        }
Пример #2
0
        public ISymbolDocument[] GetDocuments()
        {
            int cDocs;
            unmanagedReader.GetDocuments(0, out cDocs, null);
            ISymUnmanagedDocument[] unmanagedDocuments = new ISymUnmanagedDocument[cDocs];
            unmanagedReader.GetDocuments(cDocs, out cDocs, unmanagedDocuments);

            ISymbolDocument[] documents = new SymbolDocument[cDocs];
            uint i;
            for (i = 0; i < cDocs; i++)
            {
                documents[i] = new SymbolDocument(unmanagedDocuments[i]);
            }
            return documents;
        }
Пример #3
0
        public ISymbolDocument[] GetDocuments()
        {
            int cDocs;

            unmanagedReader.GetDocuments(0, out cDocs, null);
            ISymUnmanagedDocument[] unmanagedDocuments = new ISymUnmanagedDocument[cDocs];
            unmanagedReader.GetDocuments(cDocs, out cDocs, unmanagedDocuments);

            ISymbolDocument[] documents = new SymbolDocument[cDocs];
            uint i;

            for (i = 0; i < cDocs; i++)
            {
                documents[i] = new SymbolDocument(unmanagedDocuments[i]);
            }
            return(documents);
        }
Пример #4
0
        public bool GetSourceStartEnd(ISymbolDocument[] docs, int[] lines, int[] columns)
        {
            uint i;
            bool retVal;
            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();

            ISymUnmanagedDocument[] unmanagedDocuments = new ISymUnmanagedDocument[docs.Length];
            unmanagedMethod.GetSourceStartEnd(unmanagedDocuments, lines, columns, out retVal);
            if (retVal)
            {
                for (i = 0; i < docs.Length; i++)
                {
                    docs[i] = new SymbolDocument(unmanagedDocuments[i]);
                }
            }
            return retVal;
        }
Пример #5
0
        public void GetSequencePoints(
            int[] offsets,
            ISymbolDocument[] documents,
            int[] lines,
            int[] columns,
            int[] endLines,
            int[] endColumns)
        {
            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();

            ISymUnmanagedDocument[] unmanagedDocuments = new ISymUnmanagedDocument[documents.Length];
            int cPoints;
            uint i;
            unmanagedMethod.GetSequencePoints(
                documents.Length, out cPoints,
                offsets, unmanagedDocuments,
                lines, columns,
                endLines, endColumns);

            // Create the SymbolDocument form the IntPtr's
            for (i = 0; i < documents.Length; i++)
            {
                documents[i] = new SymbolDocument(unmanagedDocuments[i]);
            }
            return;
        }
Пример #6
0
        public void GetSequencePoints(
            int[] offsets,
            ISymbolDocument[] documents,
            int[] lines,
            int[] columns,
            int[] endLines,
            int[] endColumns)
        {
            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();
            }

            ISymUnmanagedDocument[] unmanagedDocuments = new ISymUnmanagedDocument[documents.Length];
            int  cPoints;
            uint i;

            unmanagedMethod.GetSequencePoints(
                documents.Length, out cPoints,
                offsets, unmanagedDocuments,
                lines, columns,
                endLines, endColumns);

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