コード例 #1
0
ファイル: Config_UC.cs プロジェクト: SriramSigtuple/Intusoft
        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);
                }
            }
        }
コード例 #2
0
ファイル: Config_UC.cs プロジェクト: SriramSigtuple/Intusoft
        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);
        }