本文整理汇总了C#中SS.AbstractSpreadsheet.GetNamesOfAllNonemptyCells方法的典型用法代码示例。如果您正苦于以下问题:C# AbstractSpreadsheet.GetNamesOfAllNonemptyCells方法的具体用法?C# AbstractSpreadsheet.GetNamesOfAllNonemptyCells怎么用?C# AbstractSpreadsheet.GetNamesOfAllNonemptyCells使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SS.AbstractSpreadsheet
的用法示例。
在下文中一共展示了AbstractSpreadsheet.GetNamesOfAllNonemptyCells方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: openToolStripMenuItem_Click
/// <summary>
/// deals with open a new file
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
//check if orignal file has been changed if so ask if they want to save.
String message = "Would you like to save before closing?";
var result1 = MessageBox.Show(message, "Closing", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result1 == DialogResult.Yes)
saveFile();
//With help from www.dotnetperls.com
//show dialog
DialogResult result = openFileDialog1.ShowDialog();
//check result
if (result == DialogResult.OK)
{
string fileName = openFileDialog1.FileName;
try
{
//make new spreadsheet
SSModel = new Spreadsheet(fileName, s => Regex.IsMatch(s, @"^[a-zA-Z][1-9][0-9]?$"), s => s.ToUpper(), "ps6");
//fill in the cells in the GUI
foreach (String cellName in SSModel.GetNamesOfAllNonemptyCells())
{
setRowAndCol(cellName);
spreadsheetPanel1.SetValue(col, row, SSModel.GetCellValue(cellName).ToString());
}
//set up the spreadsheet
spreadsheetPanel1.SetSelection(0, 0);
displayCurrentCell(0, 0);
}catch(Exception ex )
{
MessageBox.Show("An error occured:\n "+ ex.Message);
}
}
}