예제 #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);
        }