Пример #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);
        }
Пример #2
0
        /*
         * Process Method
         */

        public override void Process(Appliance a, PhoneListViewCIO cio)
        {
            IEnumerator e = a.GetObjects().Values.GetEnumerator();

            while (e.MoveNext())
            {
                PhoneListViewItem item =
                    new PhoneListViewItem(a, (ApplianceObject)e.Current);

                cio.AddItem(item);
            }
        }
Пример #3
0
        /*
         * Process Method
         */

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

                if (((ListNode)node).Items.Count == 1)
                {
                    ConcreteInteractionObject statecio = ((CIOListItemNode)newPanel.Items[0]).CIO;
                    if (statecio is StateLinkedCIO)
                    {
                        StateLinkedCIO childCIO =
                            (StateLinkedCIO)statecio;
                        listItem = new SingleItemPanelListViewItemCIO(
                            list,
                            (ApplianceState)childCIO.GetApplObj());
                        panel = ((SingleItemPanelListViewItemCIO)listItem).Panel;
                    }
                    else
                    {
                        listItem = new PanelListViewItemCIO(list, newPanel.Labels);
                        panel    = ((PanelListViewItemCIO)listItem).Panel;
                    }
                }
                else
                {
                    listItem = new PanelListViewItemCIO(list, newPanel.Labels);
                    panel    = ((PanelListViewItemCIO)listItem).Panel;
                }

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

                return(panel);
            }

            return(cio);
        }
Пример #4
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);
        }
Пример #5
0
        /*
         * Process Method
         */

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

                IPhoneListViewItem listItem = (IPhoneListViewItem)item.CIO;

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

            return(cio);
        }