Exemple #1
0
        public void Helper(bool withParams)
        {
            Console.WriteLine("\n--------------------------------------------------------");
            Console.WriteLine(Culture.GetTranslation(TranslationString.Description,
                                                     Variables.ProgramName, Variables.CurrentVersion, Variables.By));
            Console.WriteLine(Culture.GetTranslation(TranslationString.GitHubProject,
                                                     Variables.GithubIoUri),
                              Config.Warning);
            Console.WriteLine(Culture.GetTranslation(TranslationString.SnipeWebsite,
                                                     Variables.SnipeWebsite),
                              Config.Warning);
            Console.WriteLine(Culture.GetTranslation(TranslationString.SnipeWebsite,
                                                     "http://mypogosnipers.com/"),
                              Config.Warning);
            Console.Write(Culture.GetTranslation(TranslationString.CurrentVersion,
                                                 Assembly.GetEntryAssembly().GetName().Version.ToString()),
                          Config.Highlight);
            if (Protocol.IsRegistered() == false && withParams == false)
            {
                Console.WriteLine(" ");
                Console.WriteLine(Culture.GetTranslation(TranslationString.ProtocolNotFound,
                                                         "registerProtocol.bat"),
                                  Config.Error);
                Shutdown();
            }

            if (VersionCheck.IsLatest())
            {
                Console.WriteLine($"\t* {Culture.GetTranslation(TranslationString.LatestVersion)} *", Config.Highlight);
            }
            else
            {
                Console.WriteLine(string.Format($"* {Culture.GetTranslation(TranslationString.NewVersion)}: {{0}} *", VersionCheck.RemoteVersion), Config.Success);

                var downloadlink = Variables.GithubProjectUri + "/releases/latest";
                Console.WriteLine(string.Format($"* {Culture.GetTranslation(TranslationString.DownloadLink)}:  {{0}} *", downloadlink), Config.Warning);
                if (Config.DownloadNewVersion && withParams == false)
                {
                    Console.WriteLine(Culture.GetTranslation(TranslationString.AutoDownloadMsg), Config.Notification);
                    Console.Write($"{Culture.GetTranslation(TranslationString.Warning)}:", Config.Error);
                    Console.WriteLine(Culture.GetTranslation(TranslationString.WarningShutdownProcess), Config.Highlight);
                    var c = Console.ReadKey();
                    if (c == 'd' || c == 'D')
                    {
                        Downloader.DownloadNewVersion();
                    }
                    Shutdown();
                }
            }
            Console.WriteLine(Culture.GetTranslation(TranslationString.IntegrateMsg,
                                                     Variables.ProgramName, Variables.MinRequireVersion), Config.Notification);
            Console.WriteLine("--------------------------------------------------------");
        }