|
@@ -74,14 +74,21 @@ namespace OTSSysMgrTools
|
|
|
for (int i = 0; i < fieldInfo.Length; i++)
|
|
|
{
|
|
|
|
|
|
- if (fieldInfo[i].FieldType.Name == "ContextMenuStrip")
|
|
|
+ //if (fieldInfo[i].FieldType.Name == "ContextMenuStrip")
|
|
|
+ //{
|
|
|
+ // ContextMenuStrip contextMenuStrip = (ContextMenuStrip)fieldInfo[i].GetValue(form);
|
|
|
+ // for (int j = 0; j < contextMenuStrip.Items.Count; j++)
|
|
|
+ // {
|
|
|
+ // if (table.Contains(contextMenuStrip.Items[j].Name.ToLower()))
|
|
|
+ // contextMenuStrip.Items[j].Text = (string)table[contextMenuStrip.Items[j].Name.ToLower()];
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
+ if(fieldInfo[i].FieldType.Name == "ToolStripMenuItem")
|
|
|
{
|
|
|
- ContextMenuStrip contextMenuStrip = (ContextMenuStrip)fieldInfo[i].GetValue(form);
|
|
|
- for (int j = 0; j < contextMenuStrip.Items.Count; j++)
|
|
|
- {
|
|
|
- if (table.Contains(contextMenuStrip.Items[j].Name.ToLower()))
|
|
|
- contextMenuStrip.Items[j].Text = (string)table[contextMenuStrip.Items[j].Name.ToLower()];
|
|
|
- }
|
|
|
+ ToolStripMenuItem toolStripMenuItem=(ToolStripMenuItem)fieldInfo[i].GetValue(form);
|
|
|
+ if (table.Contains(fieldInfo[i].Name.ToLower()))
|
|
|
+ toolStripMenuItem.Text = (string)table[fieldInfo[i].Name.ToLower()];
|
|
|
}
|
|
|
|
|
|
}
|