void LoadRefsMenu ToolStripMenuItem subMenuRefs for int editors Count

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
void LoadRefsMenu(ToolStripMenuItem subMenuRefs)
{
for (int i = 0; i < editors.Count; i++)
{
ToolStripMenuItem menuItem = new ToolStripMenuItem(editors[i].EditorName());
IRefEditor tmpEditor = editors[i];
ChooseConcreteRefEditor SelectRefFunc = delegate(object sender, EventArgs e)
{
if (tmpEditor != null)
{
tmpEditor.LoadEditor(mDBSettings, this);
}
};
menuItem.Click += new System.EventHandler(SelectRefFunc);
subMenuRefs.DropDownItems.Add(menuItem);
}
}