/// <summary> /// Make file name from authors name. /// </summary> /// <param name="author"> /// The Author <see cref="System.String" /> . /// </param> /// <returns> /// Return the authors name with dashes installed. /// </returns> public string CreateAuthorFileName(string author) { this._msgBox.NameOfMethod = MethodBase.GetCurrentMethod().Name; if (!this._valid.ValidateStringIsNotNull(author)) { return(string.Empty); } if (!this._valid.ValidateStringHasLength(author)) { return(string.Empty); } var cls1 = this.AddDash(author.Trim()); var cls2 = new FileClass(); var fileName = cls2.AddFileExtension(cls1); if (cls2.CheckFileNameHasExtension(fileName)) { return(fileName); } this._msgBox.Msg = "Unable to create the authors file name."; this._msgBox.ShowErrorMessageBox(); return(string.Empty); }
/// <summary> /// Add dash between authors first middle and last name. This allows the /// program to tell where each name begins and ends. /// </summary> /// <param name="author">The Author<see cref="string" />.</param> /// <returns>Return the authors name with dashes installed.</returns> public string AddDashBetweenAuthorsFirstMiddleLastName(string author) { this._msgBox.NameOfMethod = MethodBase.GetCurrentMethod().Name; if (!this._valid.ValidateStringIsNotNull(author)) { return(string.Empty); } if (!this._valid.ValidateStringHasLength(author)) { return(string.Empty); } var authorName = this.AddDashToAuthorName(author.Trim()); var clsFile = new FileClass(); return(clsFile.AddFileExtension(authorName)); }