Exemple #1
0
        /// <summary>
        /// Load all types in the executing assembly
        /// </summary>
        /// <returns></returns>
        public static List <Type> GetRegisteredTypesInAssemblyFromLocation(string assemblyLocation, bool isRelativePath = false)
        {
            if (isRelativePath)
            {
                assemblyLocation = IoHelper.CombinePaths(AppDomain.CurrentDomain.BaseDirectory, assemblyLocation);
            }

            var types = Assembly.LoadFrom(assemblyLocation).LoadAllTypesFromAssembly();

            return(types);
        }
Exemple #2
0
        /// <summary>
        /// Gets localization sources paths from configuration
        /// </summary>
        /// <returns></returns>
        private Dictionary <string, string> GetLocalizationSourcesPaths()
        {
            var result = new Dictionary <string, string>();

            foreach (var source in Configuration.LocalizationSources)
            {
                result[source.Name] = string.IsNullOrEmpty(Configuration.DirectoryPath)
                    ? IoHelper.CombinePaths(ReflectionHelper.GetCurrentAssemblyRunPath(), source.SourcePath ?? string.Empty)
                    : IoHelper.CombinePaths(Configuration.DirectoryPath, source.SourcePath);
            }

            return(result);
        }