13 internal static class ArgsHelper
30 public static void ThrowIfStringIsNullOrWhiteSpace(
string arg,
string name)
34 throw new ArgumentNullException(name);
36 else if (
string.IsNullOrWhiteSpace(arg))
38 throw new ArgumentException(
"Value cannot be empty.", name);
54 public static void ThrowIfObjectIsNull(
object arg,
string name)
58 throw new ArgumentNullException(name);
77 public static void ThrowIfWinGetObjectIsNullOrEmpty(
IWinGetObject arg,
string name)
81 throw new ArgumentNullException(name);
85 throw new ArgumentException(
"Object cannot be empty.", name);
107 public static void ThrowIfPathIsInvalid(
string arg)
110 string root = Directory.GetDirectoryRoot(arg);
113 if (!Directory.Exists(root))
115 throw new DirectoryNotFoundException($
"The path root '{root}' does not exist.");