public CalculationItem AddCalculationItem(string name = null, string expression = null) { var item = CalculationItem.CreateNew(CalculationGroup, string.IsNullOrEmpty(name) ? "New Calculation" : name); if (expression != null) { item.Expression = expression; } return(item); }
public CalculationItem AddCalculationItem(string name = null, string expression = null) { var item = CalculationItem.CreateNew(CalculationGroup, string.IsNullOrEmpty(name) ? "New Calculation" : name); if (expression != null) { item.Expression = expression; } if (CalculationItems.Any(i => i.Ordinal != -1)) { item.Ordinal = CalculationItems.Max(i => i.Ordinal) + 1; } return(item); }