Example #1
0
        private static string GetProbingFilePath(ProbedPath.PathSource pathSource, string assemblyName, bool isExe, string culture, string baseAssemblyDirectory)
        {
            string baseDirectory = baseAssemblyDirectory ?? Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            if (!string.IsNullOrEmpty(culture))
            {
                baseDirectory = Path.Combine(baseDirectory, culture);
            }

            string extension = isExe ? "exe" : "dll";

            switch (pathSource)
            {
            case ProbedPath.PathSource.AppPaths:
            case ProbedPath.PathSource.SatelliteSubdirectory:
                return(Path.Combine(baseDirectory, $"{assemblyName}.{extension}"));

            default:
                throw new ArgumentOutOfRangeException(nameof(pathSource));
            }
        }
Example #2
0
 public static string GetProbingFilePath(ProbedPath.PathSource pathSource, string assemblyName, bool isExe)
 {
     return(GetProbingFilePath(pathSource, assemblyName, isExe, null, null));
 }
Example #3
0
 public static string GetProbingFilePath(ProbedPath.PathSource pathSource, string assemblyName, string culture, string baseAssemblyDirectory = null)
 {
     return(GetProbingFilePath(pathSource, assemblyName, false, culture, baseAssemblyDirectory));
 }