/// <summary> /// Initializes a new instance of the <see cref="BizTalkCatalogExplorer"/> class. /// </summary> /// <param name="btsCatalogExplorer">The <c>BizTalk</c> catalog explorer.</param> /// <param name="managementDatabaseConnectionString">The connection string.</param> public BizTalkCatalogExplorer(IBtsCatalogExplorer2 btsCatalogExplorer, string managementDatabaseConnectionString) { if (btsCatalogExplorer == null) { throw new ArgumentNullException("btsCatalogExplorer"); } if (string.IsNullOrEmpty(managementDatabaseConnectionString)) { throw new ArgumentException("The 'managementDatabaseConnectionString' must not be null or empty."); } this.managementDatabaseConnectionString = managementDatabaseConnectionString; string[] connStringComponents = this.managementDatabaseConnectionString.Split(';'); foreach (string component in connStringComponents) { if (component.StartsWith("server", StringComparison.OrdinalIgnoreCase)) { this.managementDatabaseServerName = component.Split('=')[1]; } else if (component.StartsWith("database", StringComparison.OrdinalIgnoreCase)) { this.managementDatabaseName = component.Split('=')[1]; } } this.btsCatalogExplorer = btsCatalogExplorer; this.btsCatalogExplorer.ConnectionString = this.managementDatabaseConnectionString; }
private void GetReferencingList(IBtsCatalogExplorer2 explorer, string name, Queue<string> list) { this.Log.LogMessage("Examining {0}...", name); foreach (IBizTalkApplication application in explorer.Applications) { if (!application.IsSystem) { foreach (IBizTalkApplication reference in application.References) { if (!reference.IsSystem) { if (reference.Name == name) { GetReferencingList(explorer, application.Name, list); if (!list.Contains(application.Name)) { list.Enqueue(application.Name); this.Log.LogMessage("Adding {0}", application.Name); } } } } } } }