Ejemplo n.º 1
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            foreach (var entry in ArrayTarget.GetEntries(payload.Data))
            {
                var numberOfInts = NumberOfInts.GetValue(entry);

                var outMutable = new List <MutableObject>();

                for (int i = 0; i < numberOfInts; i++)
                {
                    outMutable.Add(new MutableObject()
                    {
                        { "Index", i }
                    });
                }

                ArrayTarget.SetValue(outMutable, entry);
            }

            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
Ejemplo n.º 2
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            foreach (var entry in ArrayTarget.GetEntries(newSchema))
            {
                var numberOfInts = 1;

                var outMutable = new List <MutableObject>();

                for (int i = 0; i < numberOfInts; i++)
                {
                    outMutable.Add(new MutableObject()
                    {
                        { "Index", i }
                    });
                }

                ArrayTarget.SetValue(outMutable, entry);
            }

            base.OnProcessOutputSchema(newSchema);
        }