当前位置: 首页>>代码示例>>C#>>正文


C# ILibraryManager.GetLibraries方法代码示例

本文整理汇总了C#中ILibraryManager.GetLibraries方法的典型用法代码示例。如果您正苦于以下问题:C# ILibraryManager.GetLibraries方法的具体用法?C# ILibraryManager.GetLibraries怎么用?C# ILibraryManager.GetLibraries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILibraryManager的用法示例。


在下文中一共展示了ILibraryManager.GetLibraries方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Program

 public Program(ILibraryManager libraryManager)
 {
     foreach (var lib in libraryManager.GetLibraries())
     {
         Console.WriteLine(lib.Name);
     }
 }
开发者ID:OutCust,项目名称:aspnet5samples,代码行数:7,代码来源:Program.cs

示例2: Program

 public Program(ILibraryManager libraryManager, IServiceProvider serviceProvider)
 {
     foreach(var library in libraryManager.GetLibraries())
     {
         Console.WriteLine(library.Name);
     }
 }
开发者ID:rprouse,项目名称:DnxConsoleApplication,代码行数:7,代码来源:Program.cs

示例3: RegisterAll

        public void RegisterAll(ContainerBuilder builder,ILibraryManager libraryManager)
        {
            var libraries = libraryManager.GetLibraries();
            _assemblies = GetAssemblies(libraries);
            RegisterTypes(builder,typeof(ISingletonDependency)).SingleInstance();
            RegisterTypes(builder,typeof(ITransientDependency)).InstancePerLifetimeScope();

            foreach(var assembly in _assemblies)
            {
                var types = assembly.GetTypes();
                Mapper.MapperBootstrapper.ConfigureMapper(types);
            }
        }
开发者ID:alienblog,项目名称:Rc,代码行数:13,代码来源:TypesRegister.cs

示例4: Program

        public Program(IApplicationEnvironment app,
                       IRuntimeEnvironment runtime,
                       IRuntimeOptions options,
                       ILibraryManager libraryManager,
                       IAssemblyLoaderContainer container,
                       IAssemblyLoadContextAccessor accessor)
        {
            Console.WriteLine("ApplicationName: {0} {1}", app.ApplicationName, app.Version);
            Console.WriteLine("ApplicationBasePath: {0}", app.ApplicationBasePath);
            Console.WriteLine("Framework: {0}", app.RuntimeFramework.FullName);
            Console.WriteLine("Runtime: {0} {1} {2}", runtime.RuntimeType, runtime.RuntimeArchitecture, runtime.RuntimeVersion);
            Console.WriteLine("System: {0} {1}", runtime.OperatingSystem, runtime.OperatingSystemVersion);

            var names = libraryManager
                .GetLibraries()
                .SelectMany(p => p.LoadableAssemblies)
                .Select(p => p.FullName).ToArray();

            var first = names.First();
        }
开发者ID:huoxudong125,项目名称:CacheManager,代码行数:20,代码来源:Program.cs

示例5: GetAssemblies

    public static IEnumerable<Assembly> GetAssemblies(string path, IAssemblyLoaderContainer assemblyLoaderContainer, IAssemblyLoadContextAccessor assemblyLoadContextAccessor, ILibraryManager libraryManager)
    {
      List<Assembly> assemblies = new List<Assembly>();

      IAssemblyLoadContext assemblyLoadContext = assemblyLoadContextAccessor.Default;

      using (assemblyLoaderContainer.AddLoader(new DirectoryAssemblyLoader(path, assemblyLoadContext)))
      {
        foreach (string extensionPath in Directory.EnumerateFiles(path, "*.dll"))
        {
          string extensionFilename = Path.GetFileNameWithoutExtension(extensionPath);

          assemblies.Add(assemblyLoadContext.Load(extensionFilename));
        }
      }

      // We must not load all of the assemblies
      foreach (Library library in libraryManager.GetLibraries())
        if (AssemblyManager.IsCandidateLibrary(libraryManager, library))
          assemblies.AddRange(library.Assemblies.Select(an => assemblyLoadContext.Load(an)));

      return assemblies;
    }
开发者ID:leo9223,项目名称:ExtCore,代码行数:23,代码来源:AssemblyManager.cs

示例6: GetLibraries

 private static IEnumerable<Library> GetLibraries(ILibraryManager libraryManager)
 {
     return libraryManager.GetLibraries()
         .Where(lbl => !lbl.Name.StartsWith("Microsoft"))
         .Where(lbl => !lbl.Name.StartsWith("System"));
 }
开发者ID:andrew-bn,项目名称:Microservices,代码行数:6,代码来源:MicroserviceDiscoverer.cs


注:本文中的ILibraryManager.GetLibraries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。