private void okButton_Click(object sender, MouseButtonEventArgs e) { if (MessageBox.Show("Click \"OK\" to Output.\r\n" + "Please check the Information again.", "Output", MessageBoxButton.OKCancel, MessageBoxImage.Information) == MessageBoxResult.OK) { ((sender as Label).Parent as Border).Opacity = 0.5; outputSheetInfo opsInfo = new outputSheetInfo(); opsInfo.IsColumn = (bool)columnRadio.IsChecked; opsInfo.LineIndex = Convert.ToInt32(lineIndexTextbox.Text) - 1; opsInfo.StartFrom = Convert.ToInt32(startFromTextbox.Text) - 1; opsInfo.SheetName = sheetsCombo.SelectedItem.ToString(); fillerInfo fInfo = new fillerInfo(blockIndex, itemIndex); (this.Owner as MainWindow).Output(opsInfo, fInfo); this.Close(); } }
//Invoked by "OutputWindow". public void Output(outputSheetInfo opsInfo, fillerInfo fInfo) { progressBar.Visibility = Visibility.Visible; progressBar.Value = 0; PBSetValue(10); XmlDocument smryXml = GetRightSummaryXml(); PBSetValue(30); wbOperator.Collect_Text_IntoWorkbook(ref smryXml, opsInfo, fInfo); PBSetValue(70); wbOperator.SaveWorkbook(); PBSetValue(100); progressBar.Visibility = Visibility.Hidden; }