}//end tsmSave_Click private void OfficeDocumentProgressForm(SaveDocument doc, string extension) { try { var secondScreener = (tabScreeners.SelectedTab == tabScreener2 ? true : false); frmOfficeDocumentProgress frm; if (extension == "xlsx") { frm = new frmOfficeDocumentProgress(doc, (secondScreener ? CreateTempDictionary(stocksAdditionalInfo.Values.Select(s => s["source"]).Distinct()) : stocks), secondScreener); } else { int rows = (secondScreener ? stocksAdditionalInfo.Values.Select(s => s["source"]).Distinct().Count() : stocks.Keys.Count()) + 1; if (secondScreener) { rows += stocksAdditionalInfo.Keys.Count; } else { foreach (var kvp in stocks.Values) { rows += kvp.Values.Count(); } } frm = new frmOfficeDocumentProgress(doc, (secondScreener ? CreateTempDictionary(stocksAdditionalInfo.Values.Select(s => s["source"]).Distinct()) : stocks), rows, secondScreener); }//end if-else frm.ShowDialog(); } catch (Exception ex) { ErrorMessage(ex); } }//end OfficeDocumentProgressForm
}//end tsmSave_Click private void OfficeDocumentProgressForm(SaveDocument doc, string extension) { try { frmOfficeDocumentProgress frm; if (extension == "xlsx") { frm = new frmOfficeDocumentProgress(doc, stocks); } else { int rows = stocks.Keys.Count() + 1; foreach (var kvp in stocks.Values) { rows += kvp.Values.Count(); } frm = new frmOfficeDocumentProgress(doc, stocks, rows); }//end if-else frm.ShowDialog(); } catch (Exception ex) { ErrorMessage(ex); } }//end OfficeDocumentProgressForm