コード例 #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
ファイル: MakePanelItemRule.cs プロジェクト: jwnichls/puc
        /*
         * 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
         */

        /// <summary>
        /// Input to this rule phase is an appliance object, but the input to
        /// the rules of this phase are GroupNode objects.  This phase iterates
        /// down the group tree depth first, feeding each rule the GroupNodes as
        /// it goes.
        /// </summary>
        /// <param name="o">an appliance object</param>
        /// <param name="ui">a UIGenerator object that contains global variables for this process</param>
        /// <returns></returns>
        public override object Process(object o, UIGenerator ui)
        {
            ListNode root = (ListNode)o;

            // setup the initial list CIO
            PhoneListViewCIO list = new PhoneListViewCIO();

            list.GetControl().Size     = ui.Size;
            list.GetControl().Location = new System.Drawing.Point(0, 0);

            ui.Panel.AddCIO(list);

            processHelper(root, list, ui);

            return(list);
        }
コード例 #5
0
ファイル: MakeValueSubListRule.cs プロジェクト: jwnichls/puc
        /*
         * 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);
        }
コード例 #6
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);
        }