Beispiel #1
0
        public static bool PathEquals(this string firstPath, string secondPath)
        {
            if (OsInfo.IsLinux)
            {
                return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath());
            }

            return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), StringComparison.InvariantCultureIgnoreCase);
        }
Beispiel #2
0
        public static bool PathEquals(this string firstPath, string secondPath)
        {
            if (OsInfo.IsMono)
            {
                if (firstPath.Equals(secondPath)) return true;
                return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath());
            }

            if (firstPath.Equals(secondPath, StringComparison.OrdinalIgnoreCase)) return true;
            return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), StringComparison.OrdinalIgnoreCase);
        }
Beispiel #3
0
        public static bool PathEquals(this string firstPath, string secondPath, StringComparison? comparison = null)
        {
            if (!comparison.HasValue)
            {
                comparison = OsInfo.PathStringComparison;
            }

            if (firstPath.Equals(secondPath, comparison.Value)) return true;
            return string.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), comparison.Value);
        }
Beispiel #4
0
 public static bool PathEquals(this string firstPath, string secondPath)
 {
     if (firstPath.Equals(secondPath, OsInfo.PathStringComparison)) return true;
     return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), OsInfo.PathStringComparison);
 }