示例#1
0
        /// <summary>
        /// Makes a tree node from this object.
        /// </summary>
        /// <returns></returns>
        public override TreeNode toTreeNode()
        {
            TreeNode Node = new TreeNode();

            Node.Text = "Tables";
            Node.Tag  = this;

            if (Filter.Text != String.Empty)
            {
                Node.Text += " (Filtered)";
            }

            Base.SetNodeImageFromQualifier(Node, Qualifier, IsGhost);

            foreach (Table CurrentTable in Tables)
            {
                if
                (
                    (CurrentTable.Qualifier == Modification.None && Filter.HideUnmodified == false) ||
                    (CurrentTable.Qualifier == Modification.Modified && Filter.HideModified == false) ||
                    (CurrentTable.Qualifier == Modification.Created && Filter.HideCreated == false) ||
                    (CurrentTable.Qualifier == Modification.Deleted && Filter.HideDropped == false)
                )
                {
                    if (Filter.Text != String.Empty)
                    {
                        if (CurrentTable.Name.ToLower().Contains(Filter.Text.ToLower()))
                        {
                            Node.Nodes.Add(CurrentTable.toTreeNode());
                        }
                    }
                    else
                    {
                        Node.Nodes.Add(CurrentTable.toTreeNode());
                    }
                }
            }

            return(Node);
        }