private void OnSaveAllChangesButton_Clicked(object sender, EventArgs e) { if (this.dataCopy.Count > 1) return; FileOutputClass.WriteAuthorsTitlesToFile(this.filePath, this.dataCopy); this.dataCopy.Clear(); }
private void OnSearchAuthorsButton_Clicked(object sender, EventArgs e) { FileOutputClass.WriteArthurFileNamesToListFile(BookListPropertiesClass.PathToAuthorsNamesListFile); using (var win = new SearchOfBookAuthors()) { win.ShowDialog(); } }
private void OnSaveAllChangesButton_Clicked(object sender, EventArgs e) { if (this.DataCopy.Count > 1) { return; } FileOutputClass.WriteAuthorsTitlesToFile(); }
private void OnSaveAllChangesButton_Clicked(object sender, EventArgs e) { //TODO: Make button not enabled untill user has used the format button. if (this.dataCopy.Count > 1) { return; } FileOutputClass.WriteAuthorsTitlesToFile(this.filePath, this.dataCopy); this.dataCopy.Clear(); }
public FileOutputWPFPresentation(FileOutputClass exp) { InitializeComponent(); this.exp = exp; SizeChanged += sizeChanged; hexBox = new HexBox.HexBox(); hexBox.InReadOnlyMode = true; hexBox.OnFileChanged += fileChanged; this.hexBox.ErrorOccured += new HexBox.HexBox.GUIErrorEventHandler(hexBox_ErrorOccured); MainMain.Children.Add(hexBox); hexBox.collapseControl(false); }
public void WriteOutput_WriteSuccess_ReturnTrue() { FileOutputClass output = new FileOutputClass(); List <string> list = new List <string>() { "test", "case1" }; output.WriteOutputFile(list, "text1.txt"); var path = Directory.GetCurrentDirectory(); List <string> result = File.ReadAllLines(path + "\\" + "text1.txt").ToList(); CollectionAssert.AreEqual(result, list); }
/// <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); }
/// <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); }