/// <summary> /// Add new users name to theAr2mSpell User List file. /// </summary> /// <created>art2m,5/17/2019</created> /// <changed>art2m,5/17/2019</changed> private static void AddNewUserToUserNameFile() { MyMessages.NameOfMethod = MethodBase.GetCurrentMethod().Name; var unc = new UsersNameCollection(); if (unc.ContainsItem(SpellingPropertiesClass.UserName)) { MyMessages.InformationMessage = "This user all ready exists."; MyMessages.ShowInformationMessageBox(); } unc.AddItem(SpellingPropertiesClass.UserName); SpellingReadWriteClass.WriteUserNameFile(); var dirPath = DirectoryFileOperations.CheckDirectoryPathExistsCreate(); var retVal = DirectoryFileOperations.CreateUserSpellingListDirectory(dirPath); if (retVal) { return; } MyMessages.ErrorMessage = "Unable to create user directory."; MyMessages.ShowErrorMessageBox(); }
/// <summary> /// Read users names list from file. /// </summary> /// <created>art2m,5/20/2019</created> /// <changed>art2m,5/20/2019</changed> private void ReadUserFileFillListBox() { var dirPath = DirectoryFileOperations.CheckDirectoryPathExistsCreate(); if (string.IsNullOrEmpty(dirPath)) { if (!SpellingReadWriteClass.ReadUserNameFile()) { return; } } this.FillListBoxWithUserNames(); }
/// <summary> /// Add new users name to theAr2mSpell User List file. /// </summary> /// <created>art2m,5/17/2019</created> /// <changed>art2m,5/17/2019</changed> private static void AddNewUserToUserNameFile() { // TODO: Make method for editing and deleting users from user file. // TODO: Make method for adding existing spelling lists to current user. var unc = new UsersNameCollection(); if (unc.ContainsItem(SpellingPropertiesClass.UserName)) { MyMessages.InformationMessage = "This user all ready exists."; MyMessages.ShowInformationMessageBox(); } unc.AddItem(SpellingPropertiesClass.UserName); SpellingReadWriteClass.WriteUserNameFile(); var dirPath = DirectoryFileOperations.CheckDirectoryPathExistsCreate(); }
/// <summary> /// Display all of the users spelling list in the list box. /// </summary> /// <created>art2m,5/22/2019</created> /// <changed>art2m,5/22/2019</changed> private void DisplayUsersSpellingList() { var dirPath = DirectoryFileOperations.CheckDirectoryPathExistsCreate(); var filePath = DirectoryFileOperations.CreateUserSpellingListDirectory(dirPath); }