moel@345: using System; moel@345: using System.Collections.Generic; moel@345: using System.Text; moel@345: using System.ComponentModel; moel@345: moel@345: namespace Aga.Controls.Tree.NodeControls moel@345: { moel@345: public abstract class InteractiveControl : BindableControl moel@345: { moel@345: private bool _editEnabled = false; moel@345: [DefaultValue(false)] moel@345: public bool EditEnabled moel@345: { moel@345: get { return _editEnabled; } moel@345: set { _editEnabled = value; } moel@345: } moel@345: moel@345: protected bool IsEditEnabled(TreeNodeAdv node) moel@345: { moel@345: if (EditEnabled) moel@345: { moel@345: NodeControlValueEventArgs args = new NodeControlValueEventArgs(node); moel@345: args.Value = true; moel@345: OnIsEditEnabledValueNeeded(args); moel@345: return Convert.ToBoolean(args.Value); moel@345: } moel@345: else moel@345: return false; moel@345: } moel@345: moel@345: public event EventHandler IsEditEnabledValueNeeded; moel@345: private void OnIsEditEnabledValueNeeded(NodeControlValueEventArgs args) moel@345: { moel@345: if (IsEditEnabledValueNeeded != null) moel@345: IsEditEnabledValueNeeded(this, args); moel@345: } moel@345: } moel@345: }