Example #1
0
 /// <summary>
 /// Called when debug toggle state is changed in the feed
 /// </summary>
 public void DebugToggleChanged(string name, bool state)
 {
     foreach (Control control in userCommandButtonFlowLayout.Controls)
     {
         UserCommand userCommand = control.Tag as UserCommand;
         if (userCommand != null && userCommand.Command == name)
         {
             // Found the control representing the debug toggle
             CheckBox cb = control as CheckBox;
             if (cb != null)
             {
                 this.BeginInvoke((MethodInvoker) delegate
                 {
                     // Change checkbox state
                     cb.Checked = state;
                     cb.Text    = cb.Checked ? "+ " + userCommand.Name : "- " + userCommand.Name;
                 });
             }
         }
     }
 }