Exemplo n.º 1
0
        // Keep in sync with InteropRewriter::ShimFullName in InteropRewriter.
        public static string ShimFullName(string delegateFullName)
        {
            var regex  = new Regex("^(.*)(`[0-9]+)$");
            var match  = regex.Match(delegateFullName);
            var prefix = default(string);
            var suffix = default(string);

            if (match.Success)
            {
                prefix = match.Groups[1].Value;
                suffix = match.Groups[2].Value;
            }
            else
            {
                prefix = delegateFullName;
                suffix = "";
            }

            return(prefix + "_Shim_" + Lexemes.HashToIdentifier(delegateFullName) + suffix);
        }