public Calculation(ICalculator calculator, IRestCalculationClient client) { _calculator = calculator; _cancellationSource = new CancellationTokenSource(); _client = client; _id = -1; _completed = 0; Task.Factory.StartNew(async() => await Initialize()); }
public CalculationManager(ICalculator calculator, IRestCalculationClient calculationClient) { _calculations = new ObservableCollection <Calculation>(); _readOnlyCalculations = new ReadOnlyObservableCollection <Calculation>(_calculations); _lock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); _calculator = calculator; _calculationClient = calculationClient; Status = CalculatorStatus.NotStarted; }