mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve code quality
This commit is contained in:
parent
4055e30538
commit
a693773013
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue