/// <summary> /// This adds the Elements to the form incrementally lower down /// </summary> /// <param name="element">The element to add</param> private void AddElement(DialogElement element) { _listOfDialogElements.Add(element); panelElementContainer.Controls.Add(element); element.Clicked += ElementClicked; element.Location = new Point(5, _elementHeight); _elementHeight = element.Height + _elementHeight; }
/// <summary> /// When one of the DialogElements is clicked this event fires to populate the help /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ElementClicked(object sender, EventArgs e) { DialogElement element = sender as DialogElement; if (element == null) { PopulateHelp(_tool.Name, _tool.Description, _tool.HelpImage); } else if (element.Param == null) { PopulateHelp(_tool.Name, _tool.Description, _tool.HelpImage); } else if (element.Param.HelpText == string.Empty) { PopulateHelp(_tool.Name, _tool.Description, _tool.HelpImage); } else { PopulateHelp(element.Param.Name, element.Param.HelpText, element.Param.HelpImage); } }