using System.Collections.Generic; using System.ComponentModel; using System.Linq; namespace InABox.WPF { // public class StringCalculator : AbstractCalculator // { // // public string Separator { get; set; } // protected override string Combine(string current, string next) // { // return Function switch // { // StringCombinerFunction.Append => string.Join(Separator, new [] { current, next } ), // _ => current // }; // } // } public class StringCalculatorFunction : AbstractCalculatorFunction { public string Separator { get; set; } protected override string Calculate(string current, string next, StringCalculatorType type) { var result = type switch { StringCalculatorType.Append => string.Join(Separator, new [] { current, next } ), _ => current }; return result; } } public class StringCalculator : AbstractCalculator { public string Separator { get => Function.Separator; set => Function.Separator = value; } } }