Improve code quality

This commit is contained in:
Jack251970 2025-07-06 20:55:27 +08:00
parent 4055e30538
commit a693773013

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -365,6 +364,7 @@ namespace Flow.Launcher.Plugin.SharedCommands
} }
} }
} }
/// <summary> /// <summary>
/// Return true is the given name is a valid file name /// Return true is the given name is a valid file name
/// </summary> /// </summary>
@ -377,13 +377,14 @@ namespace Flow.Launcher.Plugin.SharedCommands
} }
return true; return true;
} }
/// <summary> /// <summary>
/// Returns true is the given name is a valid name for a directory, not a path /// Returns true is the given name is a valid name for a directory, not a path
/// </summary> /// </summary>
public static bool IsValidDirectoryName(string name) public static bool IsValidDirectoryName(string name)
{ {
if (IsReservedName(name)) return false; if (IsReservedName(name)) return false;
char[] invalidChars = Path.GetInvalidPathChars().Append('/').ToArray().Append('\\').ToArray(); var invalidChars = Path.GetInvalidPathChars().Append('/').ToArray().Append('\\').ToArray();
if (name.IndexOfAny(invalidChars) >= 0) if (name.IndexOfAny(invalidChars) >= 0)
{ {
return false; return false;