External/Aga.Controls/Tree/NodeControls/InteractiveControl.cs
author moel.mich
Sun, 27 May 2012 15:16:19 +0000
changeset 345 0c551e8818e0
permissions -rw-r--r--
Added the source code of Aga.Controls (TreeViewAdv for .Net) version 1.7.0.0.
     1 using System;
     2 using System.Collections.Generic;
     3 using System.Text;
     4 using System.ComponentModel;
     5 
     6 namespace Aga.Controls.Tree.NodeControls
     7 {
     8 	public abstract class InteractiveControl : BindableControl
     9 	{
    10 		private bool _editEnabled = false;
    11 		[DefaultValue(false)]
    12 		public bool EditEnabled
    13 		{
    14 			get { return _editEnabled; }
    15 			set { _editEnabled = value; }
    16 		}
    17 
    18 		protected bool IsEditEnabled(TreeNodeAdv node)
    19 		{
    20 			if (EditEnabled)
    21 			{
    22 				NodeControlValueEventArgs args = new NodeControlValueEventArgs(node);
    23 				args.Value = true;
    24 				OnIsEditEnabledValueNeeded(args);
    25 				return Convert.ToBoolean(args.Value);
    26 			}
    27 			else
    28 				return false;
    29 		}
    30 
    31 		public event EventHandler<NodeControlValueEventArgs> IsEditEnabledValueNeeded;
    32 		private void OnIsEditEnabledValueNeeded(NodeControlValueEventArgs args)
    33 		{
    34 			if (IsEditEnabledValueNeeded != null)
    35 				IsEditEnabledValueNeeded(this, args);
    36 		}
    37 	}
    38 }