title: Ignore items of a specific type in a foreach loop
body: <p>I am trying to uncheck a menu's all checkable ToolStripMenuItem items with</p>
  
  <pre><code>foreach (ToolStripMenuItem item in filtersMenu.DropDownItems)
  {
     item.Checked = false;
  }
  </code></pre>
  
  <p>ToolStripMenuItem's are all checkable but the problem is compiler gives an InvalidCastException, the loop is trying to operate on ToolStripSeparator items too, how can i fix this, any help would be appreciated, thanks.</p>