GetAssemblyNames(IEnumerable<string> filenames, Predicate<Assembly> filter)
        {
#if PCL
            throw new NotImplementedException();
#else
#if !WINRT
            var assemblyCheckerType = typeof(AssemblyChecker);
            var temporaryDomain = CreateTemporaryAppDomain();
            try
            {
                var checker = (AssemblyChecker)temporaryDomain.CreateInstanceAndUnwrap(
                    assemblyCheckerType.Assembly.FullName,
                    assemblyCheckerType.FullName ?? string.Empty);

                return checker.GetAssemblyNames(filenames.ToArray(), filter);
#else
                var checker = new AssemblyCheckerWinRT();
                return checker.GetAssemblyListAsync(filenames.ToArray(), filter);
#endif

#if !WINRT
            }
            finally
            {
                AppDomain.Unload(temporaryDomain);
            }
#endif
#endif
        }
        GetAssemblyNames(IEnumerable <string> filenames, Predicate <Assembly> filter)
        {
#if PCL
            throw new NotImplementedException();
#else
#if !NETSTANDARD1_3
            var assemblyCheckerType = typeof(AssemblyChecker);
            var temporaryDomain     = CreateTemporaryAppDomain();
            try
            {
                var checker = (AssemblyChecker)temporaryDomain.CreateInstanceAndUnwrap(
                    assemblyCheckerType.Assembly.FullName,
                    assemblyCheckerType.FullName ?? string.Empty);

                return(checker.GetAssemblyNames(filenames.ToArray(), filter));
#else
            var checker = new AssemblyCheckerWinRT();
            return(checker.GetAssemblyListAsync(filenames.ToArray(), filter));
#endif

#if !NETSTANDARD1_3
            }
            finally
            {
                AppDomain.Unload(temporaryDomain);
            }
#endif
#endif
        }
Exemple #3
0
        /// <summary>
        /// Gets all assembly names of the assemblies in the given files that match the filter.
        /// </summary>
        /// <param name="filenames">The filenames.</param>
        /// <param name="filter">The filter.</param>
        /// <returns>All assembly names of the assemblies in the given files that match the filter.</returns>
        public IEnumerable <AssemblyName> GetAssemblyNames(IEnumerable <string> filenames, Predicate <Assembly> filter)
        {
#if !WINRT
            var assemblyCheckerType = typeof(AssemblyChecker);
            var temporaryDomain     = CreateTemporaryAppDomain();
            try
            {
                var checker = (AssemblyChecker)temporaryDomain.CreateInstanceAndUnwrap(
                    assemblyCheckerType.Assembly.FullName,
                    assemblyCheckerType.FullName ?? string.Empty);
#else
            var checker = new AssemblyCheckerWinRT();
#endif
                return(checker.GetAssemblyNames(filenames.ToArray(), filter));

#if !WINRT
            }
            finally
            {
                AppDomain.Unload(temporaryDomain);
            }
#endif
            }