Exemplo n.º 1
0
        public void addBranchL(KeyValuePair <object, Object> branch, String parentName, int iLevel, Control c)
        {
            EEPROM_Props branchKeyEEPROM = branch.Key as EEPROM_Props;
            XmlLeaf_UC   tmp             = new XmlLeaf_UC(branchKeyEEPROM.text, branchKeyEEPROM.eepromDataType.dataType, branchKeyEEPROM.value, parentName, iLevel);

            tmp.Left = hIndent + (iLevel - 1) * 30;
            tmp.Top  = vIndent;
            c.Controls.Add(tmp);
            vIndent += 30;
            foreach (KeyValuePair <object, Object> pair in branch.Value as Dictionary <Object, object> )
            {
                EEPROM_Props pairKeyEEPROM = null;
                if (pair.Key is EEPROM_Props)
                {
                    pairKeyEEPROM = pair.Key as EEPROM_Props;
                }
                else
                {
                    pairKeyEEPROM = pair.Value as EEPROM_Props;
                }

                if (pairKeyEEPROM.eepromDataType.dataType != DataTypes.Tree)
                {
                    addLeaf(pairKeyEEPROM, iLevel, parentName + "." + branchKeyEEPROM.name, c);
                }
                else
                {
                    addBranchL(pair, parentName + "." + branchKeyEEPROM.name, iLevel + 1, c);
                }
            }
        }
Exemplo n.º 2
0
        private void addLeaf(EEPROM_Props ctrl, int lvl, string parentName, Control c)
        {
            XmlLeaf_UC node = new XmlLeaf_UC(ctrl.text, ctrl.eepromDataType.dataType, ctrl, parentName, lvl);

            node.Left = hIndent + 5 * lvl;
            node.Top  = vIndent;
            vIndent  += 30;
            c.Controls.Add(node);
        }