Beispiel #1
0
        private static void AddDefaultApplicationParts(IApplicationPartManager applicationPartsManager)
        {
            var hasApplicationParts = applicationPartsManager.ApplicationParts.OfType <AssemblyPart>()
                                      .Any(part => !part.IsFrameworkAssembly);

            if (!hasApplicationParts)
            {
                applicationPartsManager.AddFromAppDomain();
                applicationPartsManager.AddFromApplicationBaseDirectory();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Adds default application parts if no non-framework parts have been added.
        /// </summary>
        /// <param name="applicationPartManager">The application part manager.</param>
        /// <returns>The application part manager.</returns>
        public static IApplicationPartManager ConfigureDefaults(this IApplicationPartManager applicationPartsManager)
        {
            var hasApplicationParts = applicationPartsManager.ApplicationParts.OfType <AssemblyPart>()
                                      .Any(part => !part.IsFrameworkAssembly);

            if (!hasApplicationParts)
            {
                applicationPartsManager.AddFromDependencyContext();
                applicationPartsManager.AddFromAppDomain();
                applicationPartsManager.AddFromApplicationBaseDirectory();
            }

            return(applicationPartsManager);
        }
Beispiel #3
0
 private static void ConfigureApplicationParts(IApplicationPartManager parts)
 {
     //foreach (var assembly in _assemblies)
     //    parts.AddApplicationPart(assembly);
     parts.AddFromApplicationBaseDirectory().WithReferences();
 }
Beispiel #4
0
 public static IEnumerable <Type> GetAllAssemblyTypes(this IApplicationPartManager appMgr)
 => appMgr
 .AddFromApplicationBaseDirectory()
 .Assemblies
 .SelectMany(t => t.GetTypes());
Beispiel #5
0
 private static void ConfigureApplicationParts(IApplicationPartManager parts)
 {
     parts.AddFromApplicationBaseDirectory().WithReferences();
 }