Ejemplo n.º 1
0
 /// <summary>
 /// Bind a custom input subscription.
 /// </summary>
 /// <param name="input">The custom input subscription.</param>
 public void Bind(IInputSubscription input)
 {
     input.Subscribe();
     _subscriptions.Add(new SubscriptionPair
     {
         Input = input
     });
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Bind the results of a function to an action, and a custom input subscription.
 /// </summary>
 /// <param name="function">The function that computes a value to output.</param>
 /// <param name="action">The action to perform when new output is computed.</param>
 /// <param name="input">The custom input subscription.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public void Bind <T>(Func <T> function, Action <T> action, IInputSubscription input)
 {
     input.Subscribe();
     _subscriptions.Add(new SubscriptionPair
     {
         Output = new Computed <T> (function).Subscribe(action),
         Input  = input
     });
 }