Пример #1
0
        /// <summary>
        /// The OnSaveRecordButton_Clicked
        /// </summary>
        /// <param name="sender">The sender<see cref="object"/>The source of the event.</param>
        /// <param name="e">The e<see cref="EventArgs"/>Instance containing the event data.</param>
        private void OnSaveRecordButton_Clicked(object sender, EventArgs e)
        {
            // TODO: need to put multiple autors to gether before creating author names.
            // TODO: need to check file does not exist then after creating file does exist.

            var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();

            var fileName = this.CreateAuthorsFileName();

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }
            if (!Directory.Exists(dirAuthors))
            {
                return;
            }

            var filePath = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(dirAuthors, fileName);

            if (!File.Exists(filePath))
            {
                File.Create(filePath).Dispose();
            }
        }
Пример #2
0
        /// <summary>
        /// The OnSaveRecordButton_Clicked
        /// </summary>
        /// <param name="sender">The sender<see cref="object"/>The source of the event.</param>
        /// <param name="e">The e<see cref="EventArgs"/>Instance containing the event data.</param>
        private void OnSaveRecordButton_Clicked(object sender, EventArgs e)
        {
            var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();

            var authorOp = new AuthorsTextOperations();
            var fileName = string.Empty;

            if (this.rbtnOneAuthor.Checked)
            {
                fileName = authorOp.BookAuthorName(this.txtFirstAuthor.Text);
            }
            else if (this.rbtnTwoAuthors.Checked)
            {
                fileName = authorOp.BookAuthorName(this.txtFirstAuthor.Text, this.txtSecondAuthor.Text);
            }
            else if (this.rbtnThreeAuthors.Checked)
            {
                fileName = authorOp.BookAuthorName(this.txtFirstAuthor.Text, this.txtSecondAuthor.Text, this
                                                   .txtThirdAuthor.Text);
            }

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }
            if (!Directory.Exists(dirAuthors))
            {
                return;
            }

            var filePath = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(dirAuthors, fileName);

            DirectoryFileOperationsClass.CreateNewFile(filePath);
        }
        private void OnTitleSearchButtonClicked(object sender, EventArgs e)
        {
            var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();

            var filePath = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(dirAuthors,
                                                                                         BookListPropertiesClass.CurrentWorkingFileName);
        }
Пример #4
0
        private void SearchBookTitlesAllAuthors()
        {

            AuthorsDirectoryFilesClass.GetAllAuthorFilePathsContainedInAuthorDirectory();

            for (v
        }
        /// <summary>
        /// The OnSaveRecordButton_Clicked
        /// </summary>
        /// <param name="sender">The sender<see cref="object"/>The source of the event.</param>
        /// <param name="e">The e<see cref="EventArgs"/>Instance containing the event data.</param>
        private void OnSaveRecordButton_Clicked(object sender, EventArgs e)
        {
            var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();

            var fileName = CreateAuthorsFileName();

            if fileName.
        }
Пример #6
0
        private void OnSearchAuthorsButton_Clicked(object sender, EventArgs e)
        {
            AuthorsDirectoryFilesClass.UpdateAuthorsNamesWithFileNames();
            FileOutputClass.WriteArthurFileNamesToListFile(BookListPropertiesClass.PathToAuthorsNamesListFile);

            using (var win = new SearchOfBookAuthors())
            {
                win.ShowDialog();
            }
        }
Пример #7
0
        private void SearchBookTitlesAllAuthors()
        {
            AuthorsDirectoryFilesClass.GetAllAuthorFilePathsContainedInAuthorDirectory();

            for (var i = 0; i < AuthorsFileNamesCollection.ItemsCount(); i++)
            {
                var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();
                var filePath   =
            }
        }
        /// <summary>
        /// The OnSaveRecordButton_Clicked
        /// </summary>
        /// <param name="sender">The sender<see cref="object"/>The source of the event.</param>
        /// <param name="e">The e<see cref="EventArgs"/>Instance containing the event data.</param>
        private void OnSaveRecordButton_Clicked(object sender, EventArgs e)
        {
            var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();

            var fileName = this.CreateAuthorsFileName();

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }

            var filePath = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(dirAuthors, fileName);
        }
Пример #9
0
        private void SearchBookTitlesAllAuthors()
        {
            AuthorsDirectoryFilesClass.GetAllAuthorFilePathsContainedInAuthorDirectory();

            for (var i = 0; i < AuthorsFileNamesCollection.ItemsCount(); i++)
            {
                var fileName   = AuthorsFileNamesCollection.GetItemAt(i);
                var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();
                var filePath   = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(dirAuthors,
                                                                                               fileName);
                this.txtAuthorName.Text = fileName;
            }
        }
        private void SearchBookTitlesBySingleAuthor()
        {
            var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();

            var filePath = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(dirAuthors,
                                                                                         BookListPropertiesClass.CurrentWorkingFileName);

            TitleNamesCollection.ClearCollection();

            FileInputClass.ReadTitlesFromFile(filePath);

            this.FindTitlesInString();

            if (this.lstTiltes.Items.Count < 1)
            {
                this.lstTiltes.Items.Add("No titles with this search criteria were found.");
            }
        }
        private void OnTitleSearchButtonClicked(object sender, EventArgs e)
        {
            var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();

            var filePath = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(dirAuthors,
                BookListPropertiesClass.CurrentWorkingFileName);

            TitleNamesCollection.ClearCollection();

            FileInputClass.ReadTitlesFromFile(filePath);

            this.FindTitlesInString();

            if (this.lstTiltes.Items.Count < 1)
            {
                this.lstTiltes.Items.Add( "No titles wit
            }
        }
        private void SearchBookTitlesAllAuthors()
        {
            AuthorsDirectoryFilesClass.GetAllAuthorFilePathsContainedInAuthorDirectory();

            TitleNamesCollection.ClearCollection();
            this.lstTiltes.

            for (var i = 0; i < AuthorsFileNamesCollection.ItemsCount(); i++)
            {
                var fileName   = AuthorsFileNamesCollection.GetItemAt(i);
                var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();
                var filePath   = DirectoryFileOperationsClass.CombineDirectoryPathWithFileName(dirAuthors,
                                                                                               fileName);
                this.txtAuthorName.Text = fileName;

                FileInputClass.ReadTitlesFromFile(filePath);
                this.FindTitlesInString();
            }
        }
 public BookListWindow()
 {
     InitializeComponent();
     AuthorsDirectoryFilesClass.UpdateAuthorsNamesWithFileNames();
 }
        private void OnTitleSearchButtonClicked(object sender, EventArgs e)
        {
            var dirAuthors = AuthorsDirectoryFilesClass.GetPathToAuthorsDirectory();

    }