Exemplo n.º 1
0
        /// <summary>
        /// Convert the given resource filename into a full path (in the given folder) valid for a resource.
        /// All alternate qualifiers are removed and the name is converted to lower case.
        /// The extension is preserved.
        /// </summary>
        public static string GetNormalizedResourcePath(string folder, string resourceFile, ResourceType resourceType)
        {
            var configQualifiers           = ConfigurationQualifiers.Parse(resourceFile);
            var outputFolder               = Path.Combine(folder, resourceType.GetRelativeFolder() + configQualifiers);
            var normalizedResourceFileName = GetNormalizedResourceFileName(resourceFile);

            return(Path.Combine(outputFolder, normalizedResourceFileName));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Convert the given resource filename into a full path (in the given folder) valid for a resource.
        /// All alternate qualifiers are removed and the name is converted to lower case.
        /// The extension is preserved.
        /// </summary>
        public static string GetNormalizedResourcePath(string folder, string resourceFile, ResourceType resourceType)
        {
            // try the directory name first.
            string directoryName    = Path.GetDirectoryName(resourceFile);
            var    configQualifiers = ConfigurationQualifiers.Parse(directoryName);

            if (string.IsNullOrEmpty(configQualifiers.ToString()))
            {
                configQualifiers = ConfigurationQualifiers.Parse(resourceFile);
            }

            var outputFolder = Path.Combine(folder, resourceType.GetRelativeFolder() + configQualifiers);
            var normalizedResourceFileName = GetNormalizedResourceFileName(resourceFile);

            return(Path.Combine(outputFolder, normalizedResourceFileName));
        }