示例#1
0
        /*
         * Process Method
         */

        public override ListNode Process(GroupNode group, ListNode list)
        {
            if (group.Decorations[MutualExclusionDecision.DECISION_KEY] != null)
            {
                MutualExclusionDecision d =
                    (MutualExclusionDecision)group.Decorations[MutualExclusionDecision.DECISION_KEY];

                if (d.Handled)
                {
                    return(list);
                }
            }

            if (group.Decorations[ListNodeDecision.DECISION_KEY] != null)
            {
                return(list);
            }

            if (group.Labels != null)
            {
                LabeledListNode item = new LabeledListNode(group.Labels);
                item.Group = group;

                list.Add(item);

                group.Decorations.Add(ListNodeDecision.DECISION_KEY,
                                      new ListNodeDecision(item));

                return(item);
            }

            return(list);
        }
示例#2
0
        /*
         * Process Method
         */

        public override ConcreteInteractionObject Process(ListItemNode node,
                                                          ConcreteInteractionObject cio,
                                                          UIGenerator ui)
        {
            if (node.Decorations[ItemDecision.DECISION_KEY] == null &&
                node is LabeledListNode &&
                cio is PhoneListViewCIO)
            {
                // the item node represents an appliance object and it will be
                // contained within a list
                LabeledListNode  newList = (LabeledListNode)node;
                PhoneListViewCIO list    = (PhoneListViewCIO)cio;

                PhoneListViewCIO subList = new PhoneListViewCIO();

                IPhoneListViewItem listItem =
                    new SubListViewItemCIO(list, subList, newList.Labels);

                list.AddItem(listItem);
                newList.Decorations[ItemDecision.DECISION_KEY] =
                    new ListItemDecision(listItem);

                return(subList);
            }

            return(cio);
        }