Пример #1
0
        public void Execute(IList <string> parameters)
        {
            if (parameters.Count > 0)
            {
                Information         selectedInformation;
                IList <Information> infos = Informations.GetInformations(parameters[0]).ToList();
                if (infos.Count > 0)
                {
                    if (infos.Count == 1)
                    {
                        selectedInformation = infos[0];
                    }
                    else
                    {
                        selectedInformation = InformationsUtils.SelectInformation(infos);
                    }

                    if (selectedInformation != null)
                    {
                        Console.WriteLine(string.Format("Running \"{0}\" uninstaller...", selectedInformation.DisplayName));
                        selectedInformation.Uninstall();
                    }
                }
                else
                {
                    Console.WriteLine("Not found");
                }
            }
        }
Пример #2
0
 public void Execute(IList <string> parameters)
 {
     foreach (Information info in Informations.GetInformations())
     {
         Console.WriteLine(info.DisplayName);
     }
 }
Пример #3
0
        public void Execute(IList <string> parameters)
        {
            if (parameters.Count > 0)
            {
                Information         selectedInformation;
                IList <Information> infos = Informations.GetInformations(parameters[0]).ToList();
                if (infos.Count > 0)
                {
                    bool sureToRemove;
                    if (infos.Count == 1)
                    {
                        selectedInformation = infos[0];
                        sureToRemove        = false;
                    }
                    else
                    {
                        selectedInformation = InformationsUtils.SelectInformation(infos);
                        sureToRemove        = true;
                    }

                    if (selectedInformation != null)
                    {
                        if (!sureToRemove)
                        {
                            Console.WriteLine("Are you sure to remove the installer of \"{0}\"\r\nfrom the uninstall list, without removing \"{0}\" ? (y/n)", selectedInformation.DisplayName);
                            var answer = Console.ReadKey(true).KeyChar;
                            sureToRemove = answer == 'y';
                        }

                        if (sureToRemove)
                        {
                            Console.WriteLine(string.Format("\"{0}\" removed from uninstall list.", selectedInformation.DisplayName));
                            selectedInformation.RemoveFromRegistry();
                        }
                    }
                }
                else
                {
                    Console.WriteLine("Not found");
                }
            }
        }
Пример #4
0
 public void Execute(IList <string> parameters)
 {
     if (parameters.Count > 0)
     {
         var infos = Informations.GetInformations(parameters[0]).ToList();
         if (infos.Count > 0)
         {
             foreach (var info in infos)
             {
                 Console.WriteLine(info.DisplayName);
             }
         }
         else
         {
             Console.WriteLine("No results");
         }
     }
     else
     {
         Console.WriteLine("Unable to search nothing, if you want to list all programs use the \"list\" action.");
     }
 }
Пример #5
0
 public InformationModel()
 {
     _InformationList = _Informations.GetInformations();
 }