private void SetConstructor() { if (!this.CheckApplicationExists()) { return; } this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "SetConstructor on Component: {0}", this.ComponentName)); COMAdminCatalogCollection appCollection = GetApplications(); foreach (COMAdmin.COMAdminCatalogObject app in appCollection) { if (app.Name.ToString() == this.ApplicationName) { COMAdmin.ICatalogCollection componentCollection = (COMAdmin.ICatalogCollection)appCollection.GetCollection("Components", app.Key); componentCollection.Populate(); foreach (COMAdmin.COMAdminCatalogObject component in componentCollection) { if (component.Name.ToString() == this.ComponentName) { component.set_Value("ConstructorString", this.ConstructorString ?? string.Empty); component.set_Value("ConstructionEnabled", !string.IsNullOrEmpty(this.ConstructorString)); componentCollection.SaveChanges(); break; } } break; } } appCollection.SaveChanges(); }
private void SetAccessIisIntrinsicProperties() { if (!this.CheckApplicationExists()) { return; } this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "SetAccessIisIntrinsicProperties on Component: {0}", this.ComponentName)); COMAdminCatalogCollection appCollection = GetApplications(); foreach (COMAdmin.COMAdminCatalogObject app in appCollection) { if (app.Name.ToString() == this.ApplicationName) { COMAdmin.ICatalogCollection componentCollection = (COMAdmin.ICatalogCollection)appCollection.GetCollection("Components", app.Key); componentCollection.Populate(); foreach (COMAdmin.COMAdminCatalogObject component in componentCollection) { if (component.Name.ToString() == this.ComponentName) { component.set_Value("IISIntrinsics", this.AllowIntrinsicIisProperties); componentCollection.SaveChanges(); break; } } break; } } appCollection.SaveChanges(); }