Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        public static List <ICatalogCollection> GetComponentCollection()
        {
            List <ICatalogCollection> comAdminCatalogCollectionClass = new List <ICatalogCollection>();

            objCollection = GetApplicationCollection();
            objCollection.Populate();

            foreach (COMAdmin.COMAdminCatalogObject objAppNames in objCollection)
            {
                COMAdmin.ICatalogCollection objComponents = (COMAdmin.ICatalogCollection)objCollection.GetCollection("Components", objAppNames.Key);
                objComponents.Populate();
                comAdminCatalogCollectionClass.Add(objComponents);
            }

            return(comAdminCatalogCollectionClass);
        }
Пример #4
0
        public static NameValueCollection GetCOMComponents()
        {
            collection    = new NameValueCollection();
            objCollection = GetApplicationCollection();
            objCollection.Populate();

            foreach (COMAdmin.COMAdminCatalogObject objAppNames in objCollection)
            {
                COMAdmin.ICatalogCollection objComponents = (COMAdmin.ICatalogCollection)objCollection.GetCollection("Components", objAppNames.Key);
                objComponents.Populate();
                foreach (COMAdmin.COMAdminCatalogObject Components in objComponents)
                {
                    collection.Add(Components.Name.ToString(), objAppNames.Name.ToString());
                }
            }

            return(collection);
        }