public BuildSetting(string name) { Name = name; var validCharacterName = InvalidCharacterPairs.Replace(name); var validKeyword = InvalidNames.Replace(validCharacterName); CSharpName = validKeyword; }
public BuildSetting(string path) { Path = System.IO.Path.ChangeExtension(path.Replace("Assets/", ""), null); var validCharacterName = InvalidCharacterPairs.Replace(Path); var validKeyword = InvalidNames.Replace(validCharacterName); CSharpName = validKeyword; }
private void Save_Click(object sender, RoutedEventArgs e) { SelectedName = ProfileName.Text; var isInvalidName = InvalidNames.Any(x => x.Equals(SelectedName, System.StringComparison.InvariantCultureIgnoreCase)); if (isInvalidName) { MessageBox.Show("Profile name already in use.", "Unable to create profile", MessageBoxButton.OK); } else { _saved = true; Close(); } }
private bool ValidateNameInput() { var text = _nameField.Text.Trim(); if (string.IsNullOrEmpty(text) && !AllowEmpty) { MessageBox.Show("You must provide a nonempty name."); return(false); } if (text != _originalName && InvalidNames.Contains(text)) { MessageBox.Show("Duplicate name provided."); return(false); } TagName = _nameField.Text.Trim(); return(true); }
private bool checkLoginCredentials(Dictionary <string, string> data, out string errorMsg) { errorMsg = ""; if (containsNeededInfo(data) == false) { errorMsg = "Something went wrong in login"; return(false); } string username = data [AlbotDictKeys.username].Trim(); string version = data[AlbotDictKeys.clientVersion].Trim(); //Check Client version vs Server version if (validClientVersion(version) == false) { errorMsg = "Invalid Client version, please make sure you have the latest version downloaded."; return(false); } //Name validation check if (InvalidNames.isValidName(username) == false) { errorMsg = "Username is invalid"; return(false); } //Check if the current username is aldready in use UserLoginInformation user = new UserLoginInformation(); AlbotDBManager.getLoginInfo(username, out user); if (user != null && user.isLoggedIn) { errorMsg = "Current acount is already loged in!"; return(false); } return(true); }
private bool ValidateNameInput() { if (!HasName) { return(true); } var text = _nameField.Text.Trim(); if (string.IsNullOrEmpty(text)) { MessageBox.Show("You must provide a nonempty name."); return(false); } if (InvalidNames.Contains(text)) { MessageBox.Show("Duplicate name provided."); return(false); } TagName = _nameField.Text.Trim(); return(true); }