/// <summary> /// Ask for a color effect change to be executed on the proper thread. /// </summary> /// <param name="colorEffect"></param> private void InvokeColorEffect(ScreenColorEffect colorEffect) { lock (invokeColorEffectLock) { invokeColorEffect = colorEffect; SynchronizeMenuItemCheckboxesWithEffect(colorEffect); shouldInvokeColorEffect = true; } }
private void SynchronizeMenuItemCheckboxesWithEffect(ScreenColorEffect effect) { ToolStripMenuItem currentItem = null; foreach (ToolStripMenuItem effectItem in this.changeModeToolStripMenuItem.DropDownItems) { effectItem.Checked = false; // reset all the check boxes var castItem = (ScreenColorEffect)effectItem.Tag; if (castItem.Matrix == effect.Matrix) { currentItem = effectItem; // TODO: should implement equality comparison... } } if (currentItem != null) { currentItem.Checked = true; } }