public static Menu CollectNumbers(string operationName, Action <double[]> callback)
        {
            var utility = new NumberCollectionUtility(callback);

            return(new Menu(null, new[] { new MenuItem()
                                          {
                                              Text = $"How manu numbers would you like to {operationName ?? "use"}?", Execute = utility.SelectNumberCount
                                          } }));
        }
Exemplo n.º 2
0
 private Menu ChooseNumbers(string operationName, Func <double[], double> method)
 {
     return(NumberCollectionUtility.CollectNumbers(operationName, (numbers) => {
         Write($"Result: { method(numbers) }");
     }));
 }