private List <SymAttribute> ReadSymAttributes(ISymbolReader reader, ISymbolMethod method, bool haveCSharpCDI)
        {
            List <SymAttribute> attrs = new List <SymAttribute>();

            foreach (string name in AttributeNamesToSearch())
            {
                // If this attirubte represents C# CDI data, and we were able to expand it, then indicate that
                // the attribute here is redundant (as a raw view) and shouldn't be included again.
                if (name == k_cSharpCDIAttrName && haveCSharpCDI)
                {
                    continue;
                }

                // Note that despite being defined on ISymbolReader instead of ISymbolMethod, custom
                // attributes are permitted only on method metadata tokens.
                byte[] attrVal = reader.GetSymAttribute(method.Token, name);
                if (attrVal != null)
                {
                    SymAttribute attr = new SymAttribute();
                    attr.name  = name;
                    attr.value = Util.ToHexString(attrVal);
                    attrs.Add(attr);
                }
            }
            return(attrs);
        }
Example #2
0
        private List<SymAttribute> ReadSymAttributes(ISymbolReader reader, ISymbolMethod method, bool haveCSharpCDI)
        {
            List<SymAttribute> attrs = new List<SymAttribute>();
            foreach (string name in AttributeNamesToSearch())
            {
                // If this attirubte represents C# CDI data, and we were able to expand it, then indicate that
                // the attribute here is redundant (as a raw view) and shouldn't be included again.
                if (name == k_cSharpCDIAttrName && haveCSharpCDI)
                    continue;

                // Note that despite being defined on ISymbolReader instead of ISymbolMethod, custom
                // attributes are permitted only on method metadata tokens.
                byte[] attrVal = reader.GetSymAttribute(method.Token, name);
                if (attrVal != null)
                {
                    SymAttribute attr = new SymAttribute();
                    attr.name = name;
                    attr.value = Util.ToHexString(attrVal);
                    attrs.Add(attr);
                }
            }
            return attrs;
        }