Esempio n. 1
0
 public MapControlAction(MapControl control, DisplayToolId id, ToolStripItem[] items)
 {
     m_Control  = control;
     m_ToolId   = id;
     m_Elements = new UserActionSupport(items);
     m_Elements.SetHandler(Do);
 }
 public MapControlAction(MapControl control, DisplayToolId id, ToolStripItem[] items)
 {
     m_Control = control;
     m_ToolId = id;
     m_Elements = new UserActionSupport(items);
     m_Elements.SetHandler(Do);
 }
Esempio n. 3
0
        /// <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);
        }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 5
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="action">The action to copy</param>
 protected UserAction(UserAction action)
 {
     m_Elements        = action.m_Elements;
     m_IsActionEnabled = action.m_IsActionEnabled;
     m_DoAction        = action.m_DoAction;
 }
Esempio n. 6
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="action">The action to copy</param>
 protected UserAction(UserAction action)
 {
     m_Elements = action.m_Elements;
     m_IsActionEnabled = action.m_IsActionEnabled;
     m_DoAction = action.m_DoAction;
 }