static bool NameIsValid(string name) { return !string.IsNullOrEmpty(name) && (name.IndexOfAny(Path.GetInvalidPathChars()) < 0); }