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));
        }
        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());
        }
        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);
        }