Example #1
0
        /// <summary>
        /// </summary>
        public void HandleDelayedEvent(object sender, INuGenDEHEventArgs e)
        {
            if (e is NuGenSelectedTaskChangedEventArgs)
            {
                NuGenSelectedTaskChangedEventArgs eventArgs = (NuGenSelectedTaskChangedEventArgs)e;
                string treeNodeText = eventArgs.TaskText != null ? eventArgs.TaskText : "";

                if (this.IsHandleCreated)
                {
                    this.BeginInvoke(
                        new MethodInvoker(
                            delegate
                    {
                        if (
                            this.SelectedNode != null
                            /* Otherwise, not appropriate nodes change its text when multiselected. */
                            && this.SelectedNodes.Count < 2
                            )
                        {
                            if (this.SelectedNode is NuGenTaskTreeNodeBase)
                            {
                                ((NuGenTaskTreeNodeBase)this.SelectedNode).Text = treeNodeText;
                            }
                            else
                            {
                                this.SelectedNode.Text = treeNodeText;
                            }
                        }
                    }
                            )
                        );
                }
            }
        }
Example #2
0
 private void SelectedTaskChanged(NuGenSelectedTaskChangedEventArgs e)
 {
     if (this.IsHandleCreated)
     {
         this.BeginInvoke(
             new MethodInvoker(
                 delegate
         {
             this.Enabled = !e.IsTaskTextReadonly;
             this.Text    = e.TaskText != null ? e.TaskText : "";
         }
                 )
             );
     }
 }