public static void AddStepper(string eventName, MethodStep method, IList collection, int passes = 1) { var stepper = new EventStepper(method, null, collection, passes); stepper.onComplete = () => Event.Remove(eventName, stepper.Step); Event.Add(eventName, stepper.Step).SetPermanent(); }
public static void AddStepper(string eventName, MethodStep method, IList collection, int passes = 1, bool inline = false) { var stepper = new Stepper(method, null, collection, passes, inline); stepper.onEnd = () => Events.Remove(eventName, stepper.Step); Events.Add(eventName, stepper.Step).SetPermanent(); }
public EventStepper(MethodStep method, Method onComplete, IList collection, int passCount = 1) { this.method = method; this.collection = collection; this.passes = passCount; this.onComplete = onComplete ?? this.onComplete; EventStepper.instances.AddNew(this); }
public static IEnumerable <Type> ThreadedWhere <Type>(this IEnumerable <Type> source, Func <Type, bool> method) { MethodStep <Type, Type> Where = (response, value) => { response.skip = !method(value); return(value); }; return(Worker.Create(source.ToList(), Where).Build().result.SelectMany(x => x)); }
public Stepper(MethodStep onStep, Method onEnd, IList collection, int passCount = 1, bool inline = false) { this.onStep = onStep; this.collection = collection; this.passes = passCount; this.onEnd = onEnd ?? this.onEnd; this.inline = inline; Stepper.instances.AddNew(this); }
public static Worker <Value, Output> Create <Output, Value>(List <Value> collection, MethodStep <Value, Output> onStep) { return(new Worker <Value, Output>(collection).OnStep(onStep)); }
public static WorkerDictionary <Key, Value> OnStep <Key, Value>(this WorkerDictionary <Key, Value> current, MethodStep <Key> method) { current.onStepKey = method; return(current); }
public static Worker <Value, Output> OnStep <Value, Output>(this Worker <Value, Output> current, MethodStep <Value, Output> method) { current.onStep = method; return(current); }
public static IEnumerable <Output> ThreadedSelect <Type, Output>(this IEnumerable <Type> source, Func <Type, Output> method) { MethodStep <Type, Output> Select = (response, value) => method(value); return(Worker.Create(source.ToList(), Select).Build().result.SelectMany(x => x)); }