Пример #1
0
        private void addChildNode(XmlNode node, string textAttribute, string keyAttribute, squishyWARE.WebComponents.squishyTREE.TreeNode tNode, string checkAttribute, string checkDefaultsAttribute)
        {
            squishyWARE.WebComponents.squishyTREE.TreeNode node2;
            string key          = "";
            bool   showCheckbox = false;
            bool   isChecked    = false;
            string text         = node.Attributes[textAttribute].Value;

            if (node.Attributes[keyAttribute] != null)
            {
                key = node.Attributes[keyAttribute].Value;
            }
            if (node.Attributes[checkAttribute] != null)
            {
                showCheckbox = Convert.ToBoolean(node.Attributes[checkAttribute].Value);
            }
            if (node.Attributes[checkDefaultsAttribute] != null)
            {
                isChecked = Convert.ToBoolean(node.Attributes[checkDefaultsAttribute].Value);
            }
            if (tNode == null)
            {
                node2 = this.AddNode(text, key, showCheckbox);
            }
            else
            {
                node2 = tNode.AddNode(text, key, showCheckbox);
            }
            XmlNodeList list = node.SelectNodes("taggedValue");
            int         num  = 0;

            foreach (XmlNode node3 in list)
            {
                num++;
                string tagName = node3.Attributes["tagName"].Value;
                string text4   = node3.Attributes["tagValue"].Value;
                node2.AddTaggedValue(tagName, text4);
            }
            if ((node.ChildNodes.Count - num) > 0)
            {
                foreach (XmlNode node4 in node.ChildNodes)
                {
                    if (node4.Name != "taggedValue")
                    {
                        this.addChildNode(node4, textAttribute, keyAttribute, node2, checkAttribute, checkDefaultsAttribute);
                    }
                }
            }
            if ((((checkDefaultsAttribute != "") && (node.Attributes[checkDefaultsAttribute] != null)) && (node.Attributes[checkDefaultsAttribute].Value.Trim() != "")) && !this.Page.IsPostBack)
            {
                node2.Check(isChecked);
            }
        }
Пример #2
0
        private void AddChildNode(DataRow row, string textColumn, string keyColumn, string checkColumn, string checkDefaultsColumn, squishyWARE.WebComponents.squishyTREE.TreeNode node)
        {
            squishyWARE.WebComponents.squishyTREE.TreeNode node2;
            bool   showCheckbox = false;
            bool   isChecked    = false;
            string text         = row[textColumn].ToString();
            string key          = row[keyColumn].ToString();

            if (checkColumn != "")
            {
                if (row[checkColumn] != DBNull.Value)
                {
                    showCheckbox = Convert.ToBoolean(row[checkColumn]);
                }
                if (row[checkDefaultsColumn] != DBNull.Value)
                {
                    isChecked = Convert.ToBoolean(row[checkDefaultsColumn]);
                }
            }
            if (node == null)
            {
                node2 = this.AddNode(text, key, showCheckbox);
            }
            else
            {
                node2 = node.AddNode(text, key, showCheckbox);
            }
            if (this.headers.Count != 0)
            {
                foreach (object[] objArray in this.headers)
                {
                    if (row.Table.Columns.Contains(objArray[0].ToString()))
                    {
                        node2.AddTaggedValue(objArray[0].ToString(), row[objArray[0].ToString()].ToString());
                    }
                }
            }
            if (row.Table.ChildRelations.Count > 0)
            {
                foreach (DataRelation relation in row.Table.ChildRelations)
                {
                    DataRow[] childRows = row.GetChildRows(relation);
                    foreach (DataRow row2 in childRows)
                    {
                        this.AddChildNode(row2, textColumn, keyColumn, checkColumn, checkDefaultsColumn, node2);
                    }
                }
            }
            if (showCheckbox && !this.Page.IsPostBack)
            {
                node2.Check(isChecked);
            }
        }