コード例 #1
0
        public static string GetAssemblyQualifiedName(this TypeReference type, TypeDefinitionCache cache)
        {
            TypeDefinition def = cache != null?cache.Resolve(type) : type.Resolve();

            return(string.Format("{0}, {1}",
                                 // Cecil likes to use '/' as the nested type separator, while
                                 // Reflection uses '+' as the nested type separator. Use Reflection.
                                 type.FullName.Replace('/', '+'),
                                 (def ?? type).Module.Assembly.Name.FullName));
        }
コード例 #2
0
        public static TypeDefinition GetBaseType(this TypeDefinition type, TypeDefinitionCache cache)
        {
            var bt = type.BaseType;

            if (bt == null)
            {
                return(null);
            }
            if (cache != null)
            {
                return(cache.Resolve(bt));
            }
            return(bt.Resolve());
        }
コード例 #3
0
        public static string GetPartialAssemblyName(this TypeReference type, TypeDefinitionCache cache)
        {
            TypeDefinition def = cache != null?cache.Resolve(type) : type.Resolve();

            return((def ?? type).Module.Assembly.Name.Name);
        }