本文整理汇总了C#中SS.AbstractSpreadsheet.SetContentsOfCell方法的典型用法代码示例。如果您正苦于以下问题:C# AbstractSpreadsheet.SetContentsOfCell方法的具体用法?C# AbstractSpreadsheet.SetContentsOfCell怎么用?C# AbstractSpreadsheet.SetContentsOfCell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SS.AbstractSpreadsheet
的用法示例。
在下文中一共展示了AbstractSpreadsheet.SetContentsOfCell方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Set
// For setting a spreadsheet cell.
public IEnumerable<string> Set(AbstractSpreadsheet sheet, string name, string contents)
{
List<string> result = new List<string>(sheet.SetContentsOfCell(name, contents));
return result;
}
示例2: SYNCEvent
private void SYNCEvent(String command)
{
//you need to create a spreadsheet here.
ss = new Spreadsheet();
String[] temp = CommandParser(command);
ss.Version = temp[1];
for (int i = 2; i < temp.Length && (i + 1) < temp.Length; i+=2)
{
String cell_name = temp[i];
String cell_content = temp[i+1];
ISet<string> CellToRecalculate = ss.SetContentsOfCell(cell_name, cell_content);
//update the all the relative cell value on the spreadsheet panel
//get the value of the namede cells, and convert to string
object value = ss.GetCellValue(cell_name);
string v;
if (value is double)
v = (double)value + "";
else if (value is string)
v = (string)value;
else
v = "FormulaError";
//set the value to the panel
int col = cell_name.First() - 'A';
int row = row = Int32.Parse(cell_name.Substring(1, cell_name.Length - 1)) - 1;
spreadsheetPanel1.SetValue(col, row, v);
//value of each dependent cell in the spreadsheet will be updated
foreach (string s in CellToRecalculate)
{
value = ss.GetCellValue(s);
col = s.First() - 'A';
row = Int32.Parse(s.Substring(1, s.Length - 1)) - 1;
spreadsheetPanel1.SetValue(col, row, "" + value);
}
}
}