Camarades,
I have a WindowForm application and that contains multiple forms, each with a specific name. Well, I wanted to develop a class that manages the creation of these windows, where, through the parameter type of screen (her name), the system create one for me...
I'm thinking in the property "AcessibleName" in the MenuItem, put the name of the class that I want. Then to click on each item, the system performs the following verification
private void mnMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
try
{
if (!String.IsNullOrEmpty(((MenuStrip)sender).AccessibleName))
{
string[] _Parametros = ((MenuStrip)sender).AccessibleName.Split(uConstantes.CtSeparadorMenu);
uMenu.CreateWindow(((MenuStrip)sender).AccessibleName, _Parametros);
}
}
catch (uException __Excp)
{
throw __Excp;
}
}
uMenu.CreateWindow and within the class, I would receive the parameters and instantiate a new object, and display it. Does anyone have any idea? Reflection solves this problem? (Unfortunately I do not know much about reflection)
Thanks