A Sandcastle Documented Class Library
MustHaveParameters Property
Namespaces ► Yogesh.ExcelXml ► Formula ► MustHaveParameters
Check to force parameters in function

C# | Visual Basic | Visual C++ |
public bool MustHaveParameters { get; set; }
Public Property MustHaveParameters As Boolean
public: property bool MustHaveParameters { bool get (); void set (bool value); }

In case if this flag is set and formula does not contain one or more parameters
then when the formula is assigned to a cell, the cell is left empty.


sheet[0, 0].Value = 2; sheet[1, 0].Value = 12; sheet[2, 0].Value = 9; sheet[3, 0].Value = 7; Formula formula1 = new Formula("Sum", new Range(sheet[0, 0], sheet[3, 0]), delegate (Cell cell) { return cell.GetValue() > 10; }); formula1.MustHaveParameters = false; // default value sheet[4, 0].Value = formula; // cell value will be '=SUM()') Formula formula2 = new Formula("Sum", new Range(sheet[0, 0], sheet[3, 0]), delegate (Cell cell) { return cell.GetValue() > 10; }); formula2.MustHaveParameters = true; sheet[5, 0].Value = formula; // cell will be empty