private void Init(string name) { adapter = new BaseInputAdapter(); LambdaBlock <object> b = Express2.BlockFactory.CreateLambdaBlock <object>(x => true, name); ExprTree.CreateComponent(this, b); adapter.Attach(this); }
public static INewCEPExpression <object> Input(this INewCEPExpression <object> expr, Func <object, object> action, INewCEPExpression exprToAttachTo) { //Do block logic here BaseInputAdapter adapter = new BaseInputAdapter(); var perfExpress = Yolo.Express().Perform(x => adapter.Send(action(x))); adapter.Attach(exprToAttachTo as INewComponent); adapter.Send(action(new object())); return(perfExpress); }
public YoloEnumerator(AbstractBlock output, BaseInputAdapter inputer) { CollectionOp <T> enumOp = new CollectionOp <T>(); enumOp.OpType = CollectionOpTypes.Enumerate; parentOutput = output; outputBlock = BlockFactory.CreateLambdaBlock <CollectionOp <T> >(x => { if (x.OpID == enumOp.OpID) { EnumOp = x; output.RemoveChild(outputBlock); } return(true); }, "YoloEnumerableOutput"); output.AddChild(outputBlock, new Filter <CollectionOp <T> >(null)); inputer.Send(enumOp); }