我需要在我的代码中添加raws。 但我只能添加列。 如何添加原料?
LIMIT
答案 0 :(得分:2)
private enum Op {
case Operand(Double)
case UnaryOperation(String, Double -> Double)
case BinaryOperation(String, (Double, Double) -> Double)
}
private var operandStack = [Op]()
private var knownOps = [String: Op]()
override init() { // initialise the known operations
knownOps["×"] = Op.BinaryOperation("×", *)
knownOps["÷"] = Op.BinaryOperation("÷") {$1 / $0}
knownOps["+"] = Op.BinaryOperation("+", +)
knownOps["−"] = Op.BinaryOperation("−") {$1 - $0}
knownOps["√"] = Op.UnaryOperation("√", sqrt)
knownOps["x²"] = Op.UnaryOperation("x²" pow(2, pow) //squared key
来源: http://csharp.net-informations.com/datagridview/csharp-datagridview-add-column.htm