public MapControlAction(MapControl control, DisplayToolId id, ToolStripItem[] items) { m_Control = control; m_ToolId = id; m_Elements = new UserActionSupport(items); m_Elements.SetHandler(Do); }
/// <summary> /// Creates a new <c>UserAction</c> /// </summary> /// <param name="items">The associated UI elements (at least one of them)</param> /// <param name="isActionEnabled">Delegate that can be used to determine if the action should be enabled (null means the /// action will always be enabled)</param> /// <param name="doAction">Delegate that should be called to perform the action (not null)</param> /// <exception cref="ArgumentNullException">If <paramref name="doAction"/> is null, or the associated /// UI elements are empty or null</exception> public UserAction(ToolStripItem[] items, IsActionEnabled isActionEnabled, DoAction doAction) { if (doAction == null) { throw new ArgumentNullException(); } m_Elements = new UserActionSupport(items); m_IsActionEnabled = isActionEnabled; m_DoAction = doAction; // Wire the supplied UI elements to a suitable handler m_Elements.SetHandler(Do); }
/// <summary> /// Creates a new <c>UserAction</c> /// </summary> /// <param name="items">The associated UI elements (at least one of them)</param> /// <param name="isActionEnabled">Delegate that can be used to determine if the action should be enabled (null means the /// action will always be enabled)</param> /// <param name="doAction">Delegate that should be called to perform the action (not null)</param> /// <exception cref="ArgumentNullException">If <paramref name="doAction"/> is null, or the associated /// UI elements are empty or null</exception> public UserAction(ToolStripItem[] items, IsActionEnabled isActionEnabled, DoAction doAction) { if (doAction==null) throw new ArgumentNullException(); m_Elements = new UserActionSupport(items); m_IsActionEnabled = isActionEnabled; m_DoAction = doAction; // Wire the supplied UI elements to a suitable handler m_Elements.SetHandler(Do); }