Ejemplo n.º 1
0
        /// <summary>
        /// Invokes an action that returns T on the app thread."/>
        /// </summary>
        /// <typeparam name="T">The return type</typeparam>
        /// <param name="act">the action that returns the type</param>
        /// <returns>value from the invoke.</returns>
        public T InvokeReturn <T>(ActionWithReturn <T> act)
        {
            var item = default(T);

            Invoke(new MethodInvoker(() => { item = act(); }));
            return(item);
        }
Ejemplo n.º 2
0
 internal CombinatorialEnumerator(IEnumerator e, ActionWithReturn p)
 {
     this.e = e;
     this.p = p;
 }
Ejemplo n.º 3
0
 public static void RunAsync(ActionWithReturn action, ActionWithArgs onDone)
 {
     RunAsync(new ActionWithReturn[] { action }, onDone);
 }
Ejemplo n.º 4
0
 internal CombinatorialEnumerable(IEnumerable e, ActionWithReturn p)
 {
     this.e = e;
     this.p = p;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Returns a wrapper around an IEnumerable to return the combined results of the elements and the supplied delegate.
 /// </summary>
 /// <param name="e">The IEnumerable object over which you want to Select.</param>
 /// <param name="a">The delegate to be applied to each element.</param>
 /// <returns>An IEnunumerable which will return objects after the delegate is applied.</returns>
 public static IEnumerable Select(this IEnumerable e, ActionWithReturn a)
 {
     return(new CombinatorialEnumerable(e, a));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Returns a wrapper around an IEnumerable to return the combined results of the elements and the supplied delegate.
 /// </summary>
 /// <param name="e">The IEnumerable object over which you want to Select.</param>
 /// <param name="a">The delegate to be applied to each element.</param>
 /// <returns>An IEnunumerable which will return objects after the delegate is applied.</returns>
 public static IEnumerable Select(this IEnumerable e, ActionWithReturn a)
 {
     return new CombinatorialEnumerable(e, a);
 }