Example #1
0
        private Type GetTypeFromAssemblyByFullName(string assemblyQualifiedFullName)
        {
            var fullnameComponents = assemblyQualifiedFullName.Split(new[] { ',' });
            var assemblyName       = fullnameComponents.Last().Trim();
            var qualifiedClassName = fullnameComponents.First().Trim();

            var assembly    = Assembly.Load(assemblyName);
            var controllers = _typeFinder.FindDerivedTypes(assembly, SitecoreControllerType).ToArray();

            return(controllers.FirstOrDefault(x => x.FullName == qualifiedClassName));
        }
        public IEnumerable <Type> FindDerivedTypes(Assembly assembly, Type baseType)
        {
            const string field = "DerivedTypes";

            if (_cacheValues[field] == null)
            {
                lock (SyncLock)
                {
                    _cacheValues[field] = _typeFinder.FindDerivedTypes(assembly, baseType);
                }
            }
            return(_cacheValues[field]);
        }