示例#1
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            SelectGroups(payload.Data);

            VisualPayload selectedPayload;

            if (NewPayloadOnly.GetFirstValue(payload.Data))
            {
                var newMutable = new MutableObject();
                newMutable[EntryFieldName] = SelectedList;
                selectedPayload            = new VisualPayload(
                    newMutable,
                    payload.VisualData);
            }
            else
            {
                selectedPayload = payload;
                SelectedListTarget.SetValue(SelectedList, payload.Data);
            }

            var iterator = SelectedSet.Transmit(selectedPayload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
示例#2
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            foreach (var entry in Scope.GetEntries(payload.Data))
            {
                SelectGroups(entry);

                //var firstEntry = EntryField.GetEntries(payload.Data).First().Last();
                //
                //if (firstEntry != null)
                //    firstEntry = firstEntry.CloneKeys();
                //else
                //    firstEntry = new MutableObject();
                //
                //if (!firstEntry.ContainsKey(ImplicitSchemaIndicator.KeyName))
                //    firstEntry.Add(ImplicitSchemaIndicator.KeyName, new ImplicitSchemaIndicator(this));
                //
                //
                //DenoteEmptySelectedList(payload.Data, firstEntry);
                //DenoteEmptyUnSelectedList(payload.Data, firstEntry);

                if (NewPayloadOnly.GetFirstValue(payload.Data))
                {
                    if (AllowEmptyLists.GetFirstValue(payload.Data) || SelectedList.Any())
                    {
                        var iterator = SelectedSet.Transmit(
                            new VisualPayload(new MutableObject
                        {
                            { SelectedListTarget.LastKey, SelectedList }
                        }, payload.VisualData));
                        while (iterator.MoveNext())
                        {
                            yield return(null);
                        }
                    }

                    if (AllowEmptyLists.GetFirstValue(payload.Data) || UnSelectedList.Any())
                    {
                        var iterator = UnSelectedSet.Transmit(
                            new VisualPayload(new MutableObject
                        {
                            { UnSelectedListTarget.LastKey, UnSelectedList }
                        }, payload.VisualData));
                        while (iterator.MoveNext())
                        {
                            yield return(null);
                        }
                    }
                }
                else
                {
                    SelectedListTarget.SetValue(SelectedList, entry);
                    UnSelectedListTarget.SetValue(UnSelectedList, entry);
                }
            }

            if (!NewPayloadOnly.GetFirstValue(payload.Data))
            {
                if (AllowEmptyLists.GetFirstValue(payload.Data) || SelectedList.Any())
                {
                    var iterator = SelectedSet.Transmit(payload);
                    while (iterator.MoveNext())
                    {
                        yield return(null);
                    }
                }

                if (AllowEmptyLists.GetFirstValue(payload.Data) || UnSelectedList.Any())
                {
                    var iterator = UnSelectedSet.Transmit(payload);
                    while (iterator.MoveNext())
                    {
                        yield return(null);
                    }
                }
            }
        }