using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UserControls { [Serializable] public class AdvisorItemLinkLabel : AdvisorItem { // Variables protected List> _actions; protected List _senders; protected List _eventArgs; // Properties //public List> Actions { get { return _actions; } set { _actions = value; } } // Constructors public AdvisorItemLinkLabel() { _actions = new List>(); _senders = new List(); _eventArgs = new List(); } // Methods public void AddAction(Action action) { AddAction(action, null, null); } public void AddAction(Action action, object sender, EventArgs e) { _actions.Add(action); _senders.Add(sender); _eventArgs.Add(e); } public void Activate() { for (int i = 0; i < _actions.Count; i++) _actions[i](_senders[i], _eventArgs[i]); } } }