Beispiel #1
0
        public Launcher()
        {
            IISModel model = IISModel.LoadFromFile(DefaultFeaturesFile);

            Commands  = Configurator.CreateCommands(model);
            AutoClose = YesNo.No;
        }
Beispiel #2
0
        public IISModel GetIISInformation()
        {
            IISModel model = new IISModel();

            model.ApplicationPoolsList = GetApplicationPools();
            model.SiteList             = GetSites();
            model.SyncTime             = DateTime.Now;
        }
Beispiel #3
0
        // Configures IIS features from XML configuration file
        public static void ExecuteFromXmlFile()
        {
            Console.WriteLine();
            Console.WriteLine($@"> Configures IIS features from XML configuration file");

            IISModel model = IISModel.LoadFromFile("~\\resources\\IIS-Features.xml");
            FeatureCommandsCollection commands = Configurator.CreateCommands(model, CommandOptions.SilentModeDeactivated);

            commands.NotifyFeatureCommandCollectionExecuting += NotifyFeatureCommandCollectionExecuting;
            commands.NotifyFeatureCommandCollectionExecuted  += NotifyFeatureCommandCollectionExecuted;
            commands.NotifyFeatureCommandsCollectionStart    += NotifyFeatureCommandsCollectionStart;
            commands.NotifyFeatureCommandsCollectionFinish   += NotifyFeatureCommandsCollectionFinish;
            commands.Process();
        }
Beispiel #4
0
        /// <summary>
        /// Returns a new <see cref="FeatureCommandsCollection"/> reference from <b>Internet Information Services (IIS)</b> <see cref="IISModel"/> (<b>XML</b> model).
        /// </summary>
        /// <param name="model">Features array</param>
        /// <param name="commandOptions">Command options</param>
        /// <returns>
        /// A <see cref="FeatureCommandsCollection"/> reference.
        /// </returns>
        public static FeatureCommandsCollection CreateCommands(IISModel model, CommandOptions commandOptions = null)
        {
            if (model == null)
            {
                return(new FeatureCommandsCollection());
            }

            var features = new Collection <IISFeature>();

            foreach (var feature in model.Configuration.Features)
            {
                features.Add(feature.Name);
            }

            return(CreateCommandsImpl(features, commandOptions ?? CommandOptions.SilentModeActivated));
        }
Beispiel #5
0
 private void Monitor()
 {
     IISModel iisModel = MonitorAction.Instance().GetIISInformation();
 }