Ejemplo n.º 1
0
        /// <summary>
        /// Gets source code mapping and metadata token based on type name and line number.
        /// </summary>
        /// <param name="codeMappings">Code mappings storage.</param>
        /// <param name="typeName">Member reference name.</param>
        /// <param name="lineNumber">Line number.</param>
        /// <param name="metadataToken">Metadata token.</param>
        /// <returns></returns>
        public static SourceCodeMapping GetInstructionByLineNumber(
            this MemberMapping codeMapping,
            int lineNumber,
            out int metadataToken)
        {
            if (codeMapping == null)
            {
                throw new ArgumentException("CodeMappings storage must be valid!");
            }

            var map = codeMapping.MemberCodeMappings.Find(m => m.StartLocation.Line == lineNumber);

            if (map != null)
            {
                metadataToken = codeMapping.MetadataToken;
                return(map);
            }

            metadataToken = 0;
            return(null);
        }
Ejemplo n.º 2
0
 void ITextOutput.AddDebuggerMemberMapping(MemberMapping memberMapping)
 {
 }