Ejemplo n.º 1
0
        /// <summary>
        /// Determines whether an assembly reference is considered an assembly file path or an assembly name.
        /// used, for example, on values of /r and #r.
        /// </summary>
        public static bool IsFilePath(string assemblyDisplayNameOrPath)
        {
            Debug.Assert(assemblyDisplayNameOrPath != null);

            string extension = FileNameUtilities.GetExtension(assemblyDisplayNameOrPath);

            return(string.Equals(extension, ".dll", StringComparison.OrdinalIgnoreCase) ||
                   string.Equals(extension, ".exe", StringComparison.OrdinalIgnoreCase) ||
                   assemblyDisplayNameOrPath.IndexOf(DirectorySeparatorChar) != -1 ||
                   assemblyDisplayNameOrPath.IndexOf(AltDirectorySeparatorChar) != -1);
        }
Ejemplo n.º 2
0
 public static string ChangeExtension(string path, string extension)
 {
     return(FileNameUtilities.ChangeExtension(path, extension));
 }
Ejemplo n.º 3
0
 public static string GetExtension(string path)
 {
     return(FileNameUtilities.GetExtension(path));
 }
Ejemplo n.º 4
0
 public static string GetFileName(string path, bool includeExtension = true)
 {
     return(FileNameUtilities.GetFileName(path, includeExtension));
 }
Ejemplo n.º 5
0
 public static string RemoveExtension(string path)
 {
     return(FileNameUtilities.ChangeExtension(path, extension: null));
 }