private static AppDomainResolutionPaths AppDomainResolutionPathsFor(AppDomainPaths paths) { List <string> filePaths = new List <string>(); List <string> directoryPaths = new List <string>(); if ((paths & AppDomainPaths.Core) == AppDomainPaths.Core) { directoryPaths.Add(Assembly.GetExecutingAssembly().LocalDirectoryPath()); } if ((paths & AppDomainPaths.Plugins) == AppDomainPaths.Plugins) { // Plugins can be found in: // - The plugins directory in the main app directory (i.e. <INSTALL_DIRECTORY>\plugins) // - In the machine location for plugins (i.e. <COMMON_APPLICATION_DATA>\<COMPANY>\plugins) // - In the user location for plugins (i.e. <LOCAL_APPLICATION_DATA>\<COMPANY>\plugins) directoryPaths.Add(Path.Combine(Assembly.GetExecutingAssembly().LocalDirectoryPath(), PluginsDirectoryName)); directoryPaths.Add(Path.Combine(FileConstants.CompanyCommonPath(), PluginsDirectoryName)); directoryPaths.Add(Path.Combine(FileConstants.CompanyUserPath(), PluginsDirectoryName)); } return(AppDomainResolutionPaths.WithFilesAndDirectories( Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), filePaths, directoryPaths)); }
private static AppDomainResolutionPaths AppDomainResolutionPathsFor(AppDomainPaths paths) { var filePaths = new List<string>(); var directoryPaths = new List<string>(); if ((paths & AppDomainPaths.Core) == AppDomainPaths.Core) { directoryPaths.Add(Assembly.GetExecutingAssembly().LocalDirectoryPath()); } if ((paths & AppDomainPaths.Plugins) == AppDomainPaths.Plugins) { // Plugins can be found in: // - The plugins directory in the main app directory (i.e. <INSTALL_DIRECTORY>\plugins) // - In the machine location for plugins (i.e. <COMMON_APPLICATION_DATA>\<COMPANY>\plugins) // - In the user location for plugins (i.e. <LOCAL_APPLICATION_DATA>\<COMPANY>\plugins) directoryPaths.Add(Path.Combine(Assembly.GetExecutingAssembly().LocalDirectoryPath(), PluginsDirectoryName)); directoryPaths.Add(Path.Combine(FileConstants.CompanyCommonPath(), PluginsDirectoryName)); directoryPaths.Add(Path.Combine(FileConstants.CompanyUserPath(), PluginsDirectoryName)); } return AppDomainResolutionPaths.WithFilesAndDirectories( Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), filePaths, directoryPaths); }