Пример #1
0
        public override string VisualizeSymbol(uint token, OperandType operandType)
        {
            if (operandType == OperandType.InlineTok)
            {
                // Check for an encoding of the maximum method token index value.
                if ((token & 0xff000000) == 0x40000000)
                {
                    return("Max Method Token Index");
                }

                // Check for an encoding of a source document index.
                if ((token & 0xff000000) == 0x20000000)
                {
                    return("Source Document " + (token & 0x00ffffff).ToString());
                }

                // Check for a raw token value, encoded with a 1 high-order bit.
                if ((token & 0x80000000) != 0 && token != 0xffffffff)
                {
                    token &= 0x7fffffff;
                }
            }

            Cci.IReference reference = _tokenDeferral.GetReferenceFromToken(token);
            ISymbol        symbol    = (reference as ISymbolInternal)?.GetISymbol();

            return(string.Format("\"{0}\"", symbol == null ? (object)reference : symbol.ToDisplayString(SymbolDisplayFormat.ILVisualizationFormat)));
        }
Пример #2
0
        public override string VisualizeSymbol(uint token)
        {
            Cci.IReference reference = _tokenDeferral.GetReferenceFromToken(token);
            ISymbol        symbol    = reference as ISymbol;

            return(string.Format("\"{0}\"", symbol == null ? (object)reference : symbol.ToDisplayString(SymbolDisplayFormat.ILVisualizationFormat)));
        }