+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.
\r
namespace System.Web.Services.Description {\r
public sealed class ServiceDescriptionCollection : ServiceDescriptionBaseCollection {\r
-\r
+
+ ServiceDescriptionImporter importer;
+ \r
#region Constructors\r
\r
public ServiceDescriptionCollection () \r
\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
{\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
{\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