Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }