void IActiveTaskDialog.SetButtonEnabledState(int buttonId, bool enabled) { if (NormalButtons.Any(b => b.ID == buttonId)) { NormalButtons.First(b => b.ID == buttonId).IsEnabled = enabled; } else if (CommandLinks.Any(cl => cl.ID == buttonId)) { CommandLinks.First(b => b.ID == buttonId).IsEnabled = enabled; } else if (RadioButtons.Any(rb => rb.ID == buttonId)) { RadioButtons.First(b => b.ID == buttonId).IsEnabled = enabled; } }
bool IActiveTaskDialog.ClickButton(int buttonId) { if (NormalButtons.Any(b => b.ID == buttonId)) { NormalButtonCommand.Execute(buttonId); return(true); } else if (CommandLinks.Any(cl => cl.ID == buttonId)) { CommandLinkCommand.Execute(buttonId); return(true); } else if (RadioButtons.Any(rb => rb.ID == buttonId)) { RadioButtonCommand.Execute(buttonId); return(true); } return(false); }
/// <summary> /// Checks that all buttons in the set are invisible. /// Not equivelent to !AllVisible() /// </summary> /// <returns></returns> public bool AllInvisible() { return(!RadioButtons.Any(rb => rb.Displayed == true)); }
/// <summary> /// Checks that all buttons in the set are visible. /// Not equivelent to !AllInvisible() /// </summary> /// <returns></returns> public bool AllVisible() { return(!RadioButtons.Any(rb => rb.Displayed == false)); }