Esempio n. 1
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);
        }
Esempio n. 2
0
        /*
         * Process Method
         */

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

                PhoneListViewCIO subList = new PhoneListViewCIO();

                LabelDictionary labels = null;

                if (newList.State.Type.ValueLabels != null)
                {
                    labels =
                        (LabelDictionary)newList.State.Type.ValueLabels[newList.Value];
                }

                if (labels == null)
                {
                    labels = new LabelDictionary();
                    labels.AddLabel(new StringValue(newList.Value.ToString()));
                }

                IPhoneListViewItem listItem =
                    new SubListViewItemCIO(list, subList, labels);

                ItemActivationListener l = new ItemActivationListener(newList.State,
                                                                      newList.Value);

                listItem.ItemActivated += new EventHandler(l.itemActivated);

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

                return(subList);
            }

            return(cio);
        }