public T CalculateExpression(string expression) { var tree = _treeBuilder.BuildTree(expression); var compiledTree = tree.Compile(); return(compiledTree.Invoke()); }
public void RegisterWork(ITreeBuilder treeBuilder) { treeBuilder.IsRegisteredForCallbacks = true; CoreDispatcher.Main.RunAsync(CoreDispatcherPriority.High, () => { if (treeBuilder.IsBuildTreeSuspended) { RegisterWork(treeBuilder); return; } treeBuilder.IsRegisteredForCallbacks = false; var workerHasWorkLeft = treeBuilder.BuildTree(); if (workerHasWorkLeft) { var workerReRegistered = treeBuilder.IsRegisteredForCallbacks; if (!workerReRegistered) { RegisterWork(treeBuilder); } } }); }