예제 #1
0
        private void addLeaf(IVLControlProperties ctrl, int lvl, string parentName, Control c)
        {
            XmlLeaf_UC node = new XmlLeaf_UC(ctrl.text, ctrl.val.ToString(), parentName, lvl, ctrl.min, ctrl.max, ctrl);

            node.Left = hIndent + 5 * lvl;
            node.Top  = vIndent;
            c.Controls.Add(node);
            vIndent += 30;
        }
예제 #2
0
        private void addLeaf(KeyValuePair <String, Object> leaf, int lvl, String parentName, Control c)
        {
            XmlLeaf_UC node = new XmlLeaf_UC(leaf.Key, leaf.Value.ToString(), parentName, lvl, 0, 200000);

            node.Left = hIndent + 5 * lvl;
            node.Top  = vIndent;
            c.Controls.Add(node);
            vIndent += 30;
        }
예제 #3
0
        public void addBranchL(PropertyInfo[] branch, string parentName, int iLevel, Control c, object obj)
        {
            object     obj1 = obj;
            XmlLeaf_UC node = new XmlLeaf_UC(parentName, null, parentName, iLevel + 1, 0, 100000);

            node.Left = hIndent + 5 * (iLevel + 1);
            node.Top  = vIndent;
            c.Controls.Add(node);
            vIndent += 30;
            for (int i = 0; i < branch.Length; i++)
            {
                obj = branch[i].GetValue(obj1);
                IVLControlProperties controlProperties = obj as IVLControlProperties;
                addLeaf(controlProperties, iLevel, parentName, c);
            }
        }
예제 #4
0
        public void addBranchL(FieldInfo[] branch, string parentName, int iLevel, Control c, object obj)
        {
            XmlLeaf_UC tmp = new XmlLeaf_UC(parentName, null, parentName, iLevel, 0, 100000);

            tmp.Left = hIndent + (iLevel - 1) * 30;
            tmp.Top  = vIndent;
            c.Controls.Add(tmp);
            vIndent += 30;
            object obj1 = obj;

            for (int i = 0; i < branch.Length; i++)
            {
                if (!branch[i].FieldType.Name.Equals("IVLControlProperties"))
                {
                    temp = branch[i].FieldType.GetFields(System.Reflection.BindingFlags.Public | BindingFlags.Instance);
                    if (temp.Length == 0)
                    {
                        PropertyInfo[] pinf = branch[i].FieldType.GetProperties(System.Reflection.BindingFlags.Public | BindingFlags.Instance);
                        try
                        {
                            obj = branch[i].GetValue(obj1);
                        }
                        catch (Exception ex)
                        {
                            throw;
                        }

                        string[] strArr = branch[i].Name.Split('.');
                        addBranchL(pinf, strArr[0], iLevel, c, obj);
                    }
                    else if (temp.Length > 0)
                    {
                        addBranchL(temp, branch[i].Name, iLevel + 1, c, obj);
                    }
                }
                else
                {
                    obj = branch[i].GetValue(obj1);
                    IVLControlProperties controlProperties = obj as IVLControlProperties;
                    addLeaf(controlProperties, iLevel, parentName, c);
                }
            }
        }
예제 #5
0
        //private string password = "******";
        //private string password = DateTime.Now.Day.ToString() + DateTime.Now.Month.ToString();

        public void addBranchL(KeyValuePair <String, Object> branch, String parentName, int iLevel, Control c)
        {
            XmlLeaf_UC tmp = new XmlLeaf_UC(branch.Key, null, parentName, iLevel, 0, 100000);

            tmp.Left = hIndent + (iLevel - 1) * 30;
            tmp.Top  = vIndent;
            c.Controls.Add(tmp);
            vIndent += 30;
            foreach (KeyValuePair <String, Object> pair in branch.Value as Dictionary <string, object> )
            {
                if (!xmlRW.is_branch(pair))
                {
                    addLeaf(pair, iLevel, parentName == null ? branch.Key : parentName + "." + branch.Key, c);
                }
                else
                {
                    addBranchL(pair, parentName == null ? branch.Key : parentName + "." + branch.Key, iLevel + 1, c);
                }
            }
        }