コード例 #1
0
ファイル: MemberMapping.cs プロジェクト: Black-Beard-Sdk/Logs
        /// <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);
        }
コード例 #2
0
 void ITextOutput.AddDebuggerMemberMapping(MemberMapping memberMapping)
 {
 }