![]() ![]() There are some noticeable differences in the two. One main thing here is that this control uses the new, relatively speaking. Of course, I'm sure there are many more pros and cons that you can come up with, but these were just a few that I came up with off the top of my head. Supporting the application becomes a bit more difficult as Support no longer has the ability to say for certain where to go in the menu structure as their "File" could be easily renamed to "Option1" (just an example).This could become confusing if someone renames the "File > Exit" MenuItem to "File > Open." Customers, End Users, Developers, etc., have the ability to rename their MenuItem elements at any time.A decent way to get new developers started on the learning curve for the application.can rename MenuItem in the XML configuration file to better suit their needs or to give a MenuItem more "meaning" in their environment. Customers, end-users, developers, etc.Adding and removing ToolStripMenuItem does not require an application rebuild.This is where I originally got the idea for the XML-driven Menu Strip. Having to make a separate build for each of the customers just because we want to rename one of their menu items was not a feasible solution. ![]() This typically controls how dynamic an application should be as well as how customizable an application should be. As many developers know, customers tend to want different things out of the application. Each customer puts more focus on different areas of the application than the other customers, which is perfectly understandable. The company that I work for has multiple clients that run our application. NET 3.0 will pretty much make this control out-dated with WPF and XAML, but in the meantime, why shouldn't I be able to supply a path to an XML configuration file to setup my MenuStrip control and have it generated at run time as opposed to hard coding all the ToolStripMenuItem values at design time. The only thing I can come up with to really answer this is … "why not?" I mean. Honestly, I've battled with the concept of an XML driven menu, and while I'm still not fully convinced that it would be 100% useful in all situations … I can see how it would be useful in some applications. This is a generalized re-usable control written in such a way that it can be easily plugged in to any application based on the application's requirements. Things like: Caption, Name, Text, and the corresponding Event it has to trigger when a user clicks a MenuItem. The MenuStrip will be based on XML data which contains all the details about the generated menu. In this article, I'll be showing how you can generate a dynamic MenuStrip (.NET 2.0's replacement of the MainMenu control) via an XML Configuration file, using recursion in C#. ![]()
0 Comments
Leave a Reply. |