Example #1
0
        /// <summary>
        /// Handles the AfterSelect event of the treeConfig control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.TreeViewEventArgs"/> instance containing the event data.</param>
        private void treeConfig_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode selectedNode = treeConfig.SelectedNode;
            object   obj          = selectedNode.Tag;

            if (obj != null && obj.GetType() == typeof(TreeMenu))
            {
                TreeMenu menu = (TreeMenu)obj;
                if (ActionTrigger != null && !string.IsNullOrEmpty(menu.ActionClass))
                {
                    ActionTriggerEventHandlerArgs arg = new ActionTriggerEventHandlerArgs(menu);
                    this.ActionTrigger.BeginInvoke(this, arg, new AsyncCallback(this.AsyncCallback), null);
                }
            }
        }
 /// <summary>
 /// Handles the AfterSelect event of the treeConfig control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Windows.Forms.TreeViewEventArgs"/> instance containing the event data.</param>
 private void treeConfig_AfterSelect(object sender, TreeViewEventArgs e)
 {
     TreeNode selectedNode = treeConfig.SelectedNode;
     object obj = selectedNode.Tag;
     if (obj != null && obj.GetType() == typeof(TreeMenu))
     {
         TreeMenu menu = (TreeMenu)obj;
         if (ActionTrigger != null && !string.IsNullOrEmpty(menu.ActionClass))
         {
             ActionTriggerEventHandlerArgs arg = new ActionTriggerEventHandlerArgs(menu);
             this.ActionTrigger.BeginInvoke(this, arg, new AsyncCallback(this.AsyncCallback), null);
         }               
     }
 }