System.Diagnostics.SymbolStore.SymMethod.GetSourceStartEnd C# (CSharp) Méthode

GetSourceStartEnd() public méthode

public GetSourceStartEnd ( ISymbolDocument docs, int lines, int columns ) : bool
docs ISymbolDocument
lines int
columns int
Résultat bool
        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;

        }
    }