示例#1
0
        public void CreateAttributes(Tuple <XModule, XModuleAttribute, bool> modulePack, IHTMLElement node)
        {
            switch (node.tagName)
            {
            case "INPUT":
                string type = node.getAttribute("type", 0);
                switch (type)
                {
                case "text":
                case "password":
                    var textfield = new Textfield();
                    textfield.SetupAttributes(modulePack, node);
                    break;

                case "checkbox":
                    var checkbox = new Checkbox();
                    checkbox.SetupAttributes(modulePack, node);
                    break;

                case "hidden":
                    var hidden = new HiddenInput();
                    hidden.SetupAttributes(modulePack, node);
                    break;

                case "submit":
                case "reset":
                case "button":
                    var newButton = new InternalObjects.Button();
                    newButton.SetupAttributes(modulePack, node);
                    break;
                }
                break;

            case "select":
                var combobox = new Combobox();
                combobox.SetupAttributes(modulePack, node);
                break;

            case "A":
                var newLink = new Link();
                newLink.SetupAttributes(modulePack, node);
                break;

            case "table":
                var newTable = new Table();
                newTable.SetupAttributes(modulePack, node);

                /*var subAttributeRow = mainModule.CreateModuleAttribute();
                 * newTable.SetupRowAttributes(subAttributeRow, node);
                 *
                 * var subAttributeCellforRow = subAttributeRow.CreateModuleAttribute();
                 * newTable.SetupCellAttributes(subAttributeCellforRow, node);
                 *
                 * var subAttributeCol = mainModule.CreateModuleAttribute();
                 * newTable.SetupColAttributes(subAttributeCol, node);
                 *
                 * var subAttributeCellforCol = subAttributeCol.CreateModuleAttribute();
                 * newTable.SetupCellAttributes(subAttributeCellforCol, node);*/
                break;
            }
        }