Exemplo n.º 1
0
        /// <summary>
        /// Gets the dependency value for a derived query asynchronously and with a cancellation token.
        /// </summary>
        public IDependencyValue GetDerived(object key, DerivedDependencyValue.ComputeValueAsyncCtDelegate recompute)
        {
            if (values.TryGetValue(key, out var value))
            {
                return((DerivedDependencyValue)value);
            }
            var newValue = new DerivedDependencyValue(recompute);

            values.Add(key, newValue);
            return(newValue);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets the dependency value for a derived query asynchronously and with a cancellation token.
 /// </summary>
 public IDependencyValue GetDerived <T>(object key, Func <DependencySystem, CancellationToken, Task <T> > recompute) =>
 GetDerived(key, DerivedDependencyValue.ToAsyncCtDelegate(recompute));
Exemplo n.º 3
0
 /// <summary>
 /// Gets the dependency value with a cancellation token.
 /// </summary>
 public IDependencyValue GetDerived(object key, DerivedDependencyValue.ComputeValueDelegate recompute) =>
 GetDerived(key, DerivedDependencyValue.ToAsyncCtDelegate(recompute));