diff -r 3145aadca3d2 -r 0c551e8818e0 External/Aga.Controls/Tree/NodeControls/InteractiveControl.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/External/Aga.Controls/Tree/NodeControls/InteractiveControl.cs Sun May 27 15:16:19 2012 +0000 @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; + +namespace Aga.Controls.Tree.NodeControls +{ + public abstract class InteractiveControl : BindableControl + { + private bool _editEnabled = false; + [DefaultValue(false)] + public bool EditEnabled + { + get { return _editEnabled; } + set { _editEnabled = value; } + } + + protected bool IsEditEnabled(TreeNodeAdv node) + { + if (EditEnabled) + { + NodeControlValueEventArgs args = new NodeControlValueEventArgs(node); + args.Value = true; + OnIsEditEnabledValueNeeded(args); + return Convert.ToBoolean(args.Value); + } + else + return false; + } + + public event EventHandler IsEditEnabledValueNeeded; + private void OnIsEditEnabledValueNeeded(NodeControlValueEventArgs args) + { + if (IsEditEnabledValueNeeded != null) + IsEditEnabledValueNeeded(this, args); + } + } +}