Click here to Skip to main content
15,885,309 members
Articles / Programming Languages / C#

ADB - Documentation Compiler for Managed Class Libraries

Rate me:
Please Sign up or sign in to vote.
4.60/5 (4 votes)
8 Mar 2009CPOL1 min read 30.7K   834   29  
ADB produces MSDN style documentation by reflecting and integrating XML Documentation Comments.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace ADB
{
    public partial class AutoSelectTreeView : TreeView
    {
        public AutoSelectTreeView()
        {
            InitializeComponent();
            this.AfterCheck+=new TreeViewEventHandler(AutoSelectTreeView_AfterCheck);
        }

        bool _handle_tvObjects_AfterCheck = true;

        private void AutoSelectTreeView_AfterCheck(object sender, TreeViewEventArgs e)
        {
            if (_handle_tvObjects_AfterCheck)
            {
                _handle_tvObjects_AfterCheck = false;
                try
                {
                    if (e.Node.Checked)
                    {
                        TreeNode parent = e.Node.Parent;
                        while (parent != null)
                        {
                            parent.Checked = true;
                            parent = parent.Parent;
                        }
                    }
                    SelectAllSubNodes(e.Node, e.Node.Checked);
                }
                catch (Exception)
                {
                }
                _handle_tvObjects_AfterCheck = true;
            }
        }

        void SelectAllSubNodes(TreeNode node, bool selected)
        {
            foreach (TreeNode subNode in node.Nodes)
            {
                subNode.Checked = selected;
                SelectAllSubNodes(subNode, selected);
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions