/// <summary> /// Adds a button with a specified name /// </summary> /// <param name="name">Button name</param> public Button CreateButton(string name) { if (string.IsNullOrEmpty(name)) throw new ArgumentNullException("name"); if (_buttonsMap.ContainsKey(name)) throw new Exception(string.Format("A button named {0} already exists in this virtual input", name)); Button btn = new Button(); _buttons.Add(btn); _buttonsMap.Add(name, _buttons.Count - 1); btn.Owner = this; return btn; }
/// <summary> /// Constructor of ButtonCommand class /// </summary> /// <param name="btn">Button instance</param> /// <param name="btnEvent">Type of event</param> internal ButtonCommand(Button btn, ButtonEventType btnEvent) { _button = btn; _buttonEvent = btnEvent; AssignCheckMethod(); }