MustHaveParameters Property

Yogesh.ExcelXml

A Sandcastle Documented Class Library MustHaveParameters Property
NamespacesYogesh.ExcelXmlFormulaMustHaveParameters
Check to force parameters in function
Declaration Syntax
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);
}
Remarks
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.
Examples
CopyC#
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

Assembly: Yogesh.ExcelXml (Module: Yogesh.ExcelXml) Version: 2.89.501.2158