コード例 #1
0
        /// <summary>
        /// The OnSaveBookRecordButton_Clicked
        ///     If not series save book title.
        ///     If series save book title, book series name, book volume number.
        /// </summary>
        /// <param name="sender">The sender<see cref="object" />The source of the event.</param>
        /// <param name="e">The e<see cref="System.EventArgs" />Instance containing the event data.</param>
        private void OnSaveBookRecordButton_Clicked(object sender, EventArgs e)
        {
            var filePath = BookListPropertiesClass.PathOfCurrentWorkingFile;

            if (!this.chkSeries.Checked)
            {
                FileOutputClass.WriteBookTitleSeriesVolumeNamesToAuthorsFile(filePath, this.txtAuthor.Text);
                return;
            }

            var volume = "Book Series Number " + this.txtVolume.Text.Trim();
            var sb     = new StringBuilder(this.txtTitle.Text.Trim());

            sb.Append("(");
            sb.Append(this.txtSeries.Text.Trim());
            sb.Append(")");
            sb.Append(volume);
            var bookInfo = sb.ToString();

            FileOutputClass.WriteBookTitleSeriesVolumeNamesToAuthorsFile(filePath, bookInfo);
        }
コード例 #2
0
        /// <summary>
        ///     The OnSaveBookRecordButton_Clicked
        /// If not series save book title.
        /// If series save book title, book series name, book volume number.
        /// </summary>
        /// <param name="sender">The sender<see cref="object" />The source of the event.</param>
        /// <param name="e">The e<see cref="System.EventArgs" />Instance containing the event data.</param>
        private void OnSaveBookRecordButton_Clicked(object sender, EventArgs e)
        {
            // TODO: Need to format book info data with and with out series volume info.
            // TODO: Check that volume only allows numbers and then add "book volume" to number.
            var filePath = BookListPropertiesClass.PathOfCurrentWorkingFile;

            if (!this.chkSeries.Checked)
            {
                FileOutputClass.WriteBookTitleSeriesVolumeNamesToAuthorsFile(filePath, this.txtAuthor.Text);
                return;
            }

            var sb = new StringBuilder(this.txtTitle.Text.Trim());

            sb.Append("(");
            sb.Append(this.txtSeries.Text.Trim());
            sb.Append(")");
            sb.Append(this.txtVolume.Text.Trim());
            var bookInfo = sb.ToString();

            FileOutputClass.WriteBookTitleSeriesVolumeNamesToAuthorsFile(filePath, bookInfo);
        }