Example #1
0
        public static string GetResourceFileMetadataName(Project project, string resourceFileSource, string resourceFileTarget)
        {
            string resourceName  = null;
            string rootNamespace = null;

            string root         = PathUtility.EnsureTrailingSlash(project.ProjectDirectory);
            string resourcePath = resourceFileSource;

            if (string.IsNullOrEmpty(resourceFileTarget))
            {
                resourceName  = ResourceUtility.GetResourceName(root, resourcePath);
                rootNamespace = project.Name;
            }
            else
            {
                resourceName  = ResourceManifestName.EnsureResourceExtension(resourceFileTarget, resourcePath);
                rootNamespace = null;
            }

            return(ResourceManifestName.CreateManifestName(resourceName, rootNamespace));
        }
Example #2
0
        public static string GetResourceFileMetadataName(Project project, KeyValuePair <string, string> resourceFile)
        {
            string resourceName  = null;
            string rootNamespace = null;

            string root         = PathUtility.EnsureTrailingSlash(project.ProjectDirectory);
            string resourcePath = resourceFile.Key;

            if (string.IsNullOrEmpty(resourceFile.Value))
            {
                //  No logical name, so use the file name
                resourceName  = ResourceUtility.GetResourceName(root, resourcePath);
                rootNamespace = project.Name;
            }
            else
            {
                resourceName  = ResourceManifestName.EnsureResourceExtension(resourceFile.Value, resourcePath);
                rootNamespace = null;
            }

            var name = ResourceManifestName.CreateManifestName(resourceName, rootNamespace);

            return(name);
        }