Merge pull request #3300 from esdrubal/mono-sym-fixes
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Configuration / CustomBindingCollectionElement.cs
index 6316d2f32cec8c7d82d2523644533b8085110fe2..d2c20a5c7e228d27f445c3c210bce475d50789d6 100644 (file)
@@ -52,6 +52,8 @@ using System.Runtime.Serialization;
 using System.Text;
 using System.Xml;
 
+using SysConfig = System.Configuration.Configuration;
+
 namespace System.ServiceModel.Configuration
 {
        public sealed class CustomBindingCollectionElement
@@ -86,16 +88,26 @@ namespace System.ServiceModel.Configuration
                }
 
 
-               public override bool ContainsKey (string name) {
-                       throw new NotImplementedException ();
+               public override bool ContainsKey (string name)
+               {
+                       return Bindings.ContainsKey (name);
                }
 
-               protected internal override Binding GetDefault () {
-                       throw new NotImplementedException ();
+               protected internal override Binding GetDefault ()
+               {
+                       return new CustomBinding ();
                }
 
-               protected internal override bool TryAdd (string name, Binding binding, System.Configuration.Configuration config) {
-                       throw new NotImplementedException ();
+               protected internal override bool TryAdd (string name, Binding binding, SysConfig config)
+               {
+                       if (!binding.GetType ().Equals (typeof (CustomBinding)))
+                               return false;
+                       
+                       var element = new CustomBindingElement ();
+                       element.Name = name;
+                       element.InitializeFrom (binding);
+                       Bindings.Add (element);
+                       return true;
                }
        }