2005-04-11 Lluis Sanchez Gual <lluis@novell.com>
authorLluis Sanchez <lluis@novell.com>
Mon, 11 Apr 2005 09:37:04 +0000 (09:37 -0000)
committerLluis Sanchez <lluis@novell.com>
Mon, 11 Apr 2005 09:37:04 +0000 (09:37 -0000)
* ServiceDescriptionCollection.cs: Notify the parent importer
  when a service description is added.
* ServiceDescriptionImporter.cs: Register wsdl docs added to the
  collection.

svn path=/trunk/mcs/; revision=42778

mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionCollection.cs
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionImporter.cs

index 89dcb07234567f9ac39864f4fe00bf66b9361339..c4278e6ee1e0ad3fa5c9a938f267959e1e640d14 100644 (file)
@@ -1,3 +1,10 @@
+2005-04-11  Lluis Sanchez Gual <lluis@novell.com>
+
+       * ServiceDescriptionCollection.cs: Notify the parent importer
+         when a service description is added.
+       * ServiceDescriptionImporter.cs: Register wsdl docs added to the
+         collection.
+
 2005-02-07  Lluis Sanchez Gual <lluis@novell.com>
 
        * HttpSimpleProtocolImporter.cs: Fixed warning.
index bb440e18aa25d53a662f8b01163ac3a8afe54919..bae64506d7d8a2cc71bc80086359df94114eae31 100644 (file)
@@ -34,7 +34,9 @@ using System.Xml;
 \r
 namespace System.Web.Services.Description {\r
        public sealed class ServiceDescriptionCollection : ServiceDescriptionBaseCollection {\r
-\r
+
+               ServiceDescriptionImporter importer;
+               \r
                #region Constructors\r
        \r
                public ServiceDescriptionCollection () \r
@@ -64,14 +66,29 @@ namespace System.Web.Services.Description {
 \r
                #endregion // Properties\r
 \r
-               #region Methods\r
+               #region Methods
+               
+               internal void SetImporter (ServiceDescriptionImporter i)
+               {
+                       importer = i;
+               }\r
 \r
                public int Add (ServiceDescription serviceDescription) \r
-               {\r
-                       Insert (Count, serviceDescription);\r
+               {
+                       if (importer != null)\r
+                               importer.OnServiceDescriptionAdded (serviceDescription, null, null);
+                       Insert (Count, serviceDescription);
                        return (Count - 1);\r
                }\r
 \r
+               internal int Add (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)\r
+               {
+                       if (importer != null)\r
+                               importer.OnServiceDescriptionAdded (serviceDescription, appSettingUrlKey, appSettingBaseUrl);
+                       Insert (Count, serviceDescription);
+                       return (Count - 1);\r
+               }
+               \r
                public bool Contains (ServiceDescription serviceDescription)\r
                {\r
                        return List.Contains (serviceDescription);\r
index 19a106f91a6c3b14b25391a098491d423c06d34e..6224b198fd937856428cddd7a3eb4b134114c9a1 100644 (file)
@@ -69,7 +69,8 @@ namespace System.Web.Services.Description {
                {\r
                        protocolName = String.Empty;\r
                        schemas = new XmlSchemas ();\r
-                       serviceDescriptions = new ServiceDescriptionCollection ();\r
+                       serviceDescriptions = new ServiceDescriptionCollection ();
+                       serviceDescriptions.SetImporter (this);\r
                        style = ServiceDescriptionImportStyle.Client;\r
                }\r
                \r
@@ -123,10 +124,14 @@ namespace System.Web.Services.Description {
                {\r
                        if (appSettingUrlKey != null && appSettingUrlKey == string.Empty && style == ServiceDescriptionImportStyle.Server)\r
                                throw new InvalidOperationException ("Cannot set appSettingUrlKey if Style is Server");\r
+
+                       serviceDescriptions.Add (serviceDescription, appSettingUrlKey, appSettingBaseUrl);\r
+               }\r
 \r
+               internal void OnServiceDescriptionAdded (ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl)\r
+               {\r
                        ImportInfo info = new ImportInfo (serviceDescription, appSettingUrlKey, appSettingBaseUrl);\r
                        importInfo.Add (info);\r
-                       serviceDescriptions.Add (serviceDescription);\r
                        \r
                        if (serviceDescription.Types != null)\r
                                schemas.Add (serviceDescription.Types.Schemas);\r