[MonoDevelop] Using conditionals in the addin XML files

Todd Berman tberman@off.net
Tue, 23 Nov 2004 11:41:26 -0800

On Wed, 2004-11-24 at 00:10 +1030, Rubens Ramos wrote:
> Hi List,
>  Here is my problem: I want to add a sub menu to the context menu
> in the project file browser, but this menu would only appear
> when a certain option is chosen in the project options dialog.
> (ie when you select that option, you can right-click on a file
> and you will see a new sub-menu, otherwise you will only see 
> the standard options)

A bit of me thinks this is for version control, is it?

>  I have been looking at the existing XML files but I am not sure
> if there is any attribute to "Conditional" that I can use to
> remove/add my menu depending on the project configuration.
>  #D documentation says that it is possible to use:
>  <Conditional string="${property:...} equals="...">
>  but I haven't seen any real usage of it in MD, so don't know
>  if it works or if it should be used.

I do believeit works. We use it to hide various menus and the Debugger
gui. However, I am not sure if that ${property:...} stuff works.

This is actually a bit of MD that I believe could use to be refactored
and reworked. The current method for dealing with optionally
showing/enabling menu items is very difficult to understand and use.

For your specific example, for now I would just always show the menu and
disable it if the property is not set via code.