Exemple #1
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            var extantDataField = new MutableField <T> {
                AbsoluteKey = PerElementAbsoluteKey.GetFirstValue(payload.Data)
            };

            bool valueAssigned = false;

            foreach (var entries in BoundsList.GetEntries(payload.Data))
            {
                var boundsList = BoundsList.GetValue(entries);

                foreach (var bound in boundsList)
                {
                    var useExtantValue = extantDataField.ValidateKey(bound.Data);

                    if (useExtantValue)
                    {
                        DefaultableField.SetValue(
                            extantDataField.GetLastKeyValue(bound.Data), payload.Data);
                        valueAssigned = true;
                    }
                    if (valueAssigned)
                    {
                        break;
                    }
                }
                if (valueAssigned)
                {
                    break;
                }
            }

            if (!valueAssigned)
            {
                DefaultableField.SetValue(DefaultValue.GetFirstValue(payload.Data), payload.Data);
            }

            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
Exemple #2
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            PayloadData = payload.Data;
            CacheSchema(); var extantDataField = new MutableField <T> {
                AbsoluteKey = PerElementAbsoluteKey.GetFirstValue(payload.Data)
            };

            bool valueAssigned = false;

            var boundsList = Expression.ResolveExpression(ChainView.Instance.Chain.RootBoundingBoxes);

            foreach (var bound in boundsList)
            {
                var useExtantValue = extantDataField.ValidateKey(bound.Data);

                if (useExtantValue)
                {
                    DefaultableField.SetValue(
                        extantDataField.GetLastKeyValue(bound.Data), payload.Data);
                    valueAssigned = true;
                }
                if (valueAssigned)
                {
                    break;
                }
            }

            if (!valueAssigned)
            {
                DefaultableField.SetValue(GetDefaultValue(payload.Data), payload.Data);
            }

            UnCacheSchema();

            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }