With respect to the xml elements that make up the configuration file sections for a WCF connection, how do you know that an <add> or say a <clear> tag is supported by a type that models a configuration file element
For instance, a System.ServiceModel.Configuration.BindingElementExtensionElement supports an <add> element, but I don't see which Property or method would process the data of the <add> element.
Can anyone at MSFT shed some light on this

Governing <add> and <clear> elements in a ConfigurationElement subtype
Kanaan
Does anyone know of such a post
Donal
DevB
This is actually an interesing question that unfortunately does not have a straight foward answer. Let me try to answer the question at least briefly here, and then I can go further in depth in a follow up blog entry.
First, understand that the behavior I describe below comes from System.Configuration and holds true for all .NET v2.0 configuration element collections.
The short answer to your question involves looking at the containing configuration element collection type. The <add>, <remove>, and <clear> element tags describe collection behaviors. In .NET v2.0 there are four predefined configuration element collection types: BasicMap, BasicMapAlternate, AddRemoveClearMap, and AddRemoveClearMapAlternate. For this discussion, consider BasicMap and BasicMapAlternate identical as well as AddRemoveClearMap and AddRemoveClearMap. (For those curious, I will describe the differences between these collections in my yet unwritten blog entry.)
BasicMap collections do not support <remove> and <clear> tags, thus they can only include <add> tags. AddRemoveClearMap collections support all three tags. This begs the question, "How do I tell the difference " Unforunately, you cannot from the configuration XML; however, you can from the configuration object model in code.
There are two different ways of getting a configuration element collection's collection type: The ConfigurationElementCollection.CollectionType property and the ConfigurationCollectionAttribute.CollectionType property. The first requires you have an instance of the specific ConfigurationElementCollection you wish to explore, while the second requires that you get the custom attributes off of the Type associated with the ConfigurationElementCollection. The second also requires that the developer that created the ConfigurationElementCollection you wish to inspect properly decorated their collection with the ConfigurationCollectionAttribute and kept the two in sync.
To add a bit more confusion into the mix, a configuration element collection can change the XML element names for any or all of the <add>, <remove>, and <clear> tags. You can see this in the WCF configuration when you look at bindings. In the following configuration snippet, the <binding> element really describes an <add> element where configuration element collection has changed the <add> element name to <binding>:
<configuration >
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name= "binding1" />
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
Like the collection type, there are two different ways of getting a configuration element collection's XML element names. However, unlike the collection type, one is much (MUCH) easier. The ConfigurationElementCollection object contains three properties: AddElementName, RemoveElementName, and ClearElementName. However, all three of these properties are "protected internal", which means that using these properties requires utilizing Reflection. On the other hand, the ConfigurationCollectionAttribute has three public properties: AddItemName, RemoveItemName, and ClearItemsName. Again, the ConfigurationCollectionAttribute method requires that the developer that created the ConfigurationElementCollection you wish to inspect properly decorated their collection with the ConfigurationCollectionAttribute and properly set these values.
Again, this is, hopefully, a brief synopsis of your question. I will attempt to craft a blog entry with more details soon (including a reference of what WCF collections follow which behavior).
Mark Gabarra
http://blogs.msdn.com/markgabarra
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
Bourne Again
Usually the <add> element is followed by relevant attributes, such as <add name="a"/>.
Try looking at this blog:
http://blogs.msdn.com/markgabarra/archive/2006/05/26/608328.aspx