public FileName(string newvalue) { value = null; if (string.IsNullOrEmpty(newvalue)) return; if (!IsValidFileName(newvalue)) { throw new FormatException("value is not a valid filename"); } value = newvalue; }