예제 #1
0
        public static VersionsInfo Create()
        {
            var asm            = typeof(RuntimeInfo).Assembly.GetName();
            var currentVersion = asm.Version;


            var release = ReleaseInfo.LatestRelease();

            VersionStatus status;

            int vcmp = currentVersion.CompareTo(release.Version);

            if (vcmp < 0)
            {
                status = VersionStatus.Available;
            }
            else if (vcmp == 0)
            {
                status = VersionStatus.UpToDate;
            }
            else
            {
                status = VersionStatus.Preview;
            }

            return(new VersionsInfo(currentVersion, release, status));
        }
예제 #2
0
            internal static void Show()
            {
                Console.Clear();

                CliOutput.WriteInfo("Search engines: {0}", RuntimeInfo.Config.Engines);
                CliOutput.WriteInfo("Priority engines: {0}", RuntimeInfo.Config.PriorityEngines);

                var sn     = RuntimeInfo.Config.SauceNaoAuth;
                var snNull = String.IsNullOrWhiteSpace(sn);

                CliOutput.WriteInfo("SauceNao authentication: {0} ({1})", snNull ? CliOutput.MUL_SIGN.ToString() : sn,
                                    snNull ? "Basic" : "Advanced");

                var  imgur     = RuntimeInfo.Config.ImgurAuth;
                bool imgurNull = String.IsNullOrWhiteSpace(imgur);

                CliOutput.WriteInfo("Imgur authentication: {0}", imgurNull ? CliOutput.MUL_SIGN.ToString() : imgur);

                CliOutput.WriteInfo("Image upload service: {0}", imgurNull ? "ImgOps" : "Imgur");

                CliOutput.WriteInfo("Application folder: {0}", RuntimeInfo.AppFolder);
                CliOutput.WriteInfo("Executable location: {0}", RuntimeInfo.ExeLocation);
                CliOutput.WriteInfo("Config location: {0}", RuntimeInfo.ConfigLocation);
                CliOutput.WriteInfo("Context menu integrated: {0}", RuntimeInfo.IsContextMenuAdded);
                CliOutput.WriteInfo("In path: {0}\n", RuntimeInfo.IsAppFolderInPath);
                CliOutput.WriteInfo(".NET bundle extract folder: {0}", RuntimeInfo.BundleExtractFolder);


                //

                // CliOutput.WriteInfo("Supported search engines: {0}\n", SearchEngines.All);

                //

                var asm            = typeof(RuntimeInfo).Assembly.GetName();
                var currentVersion = asm.Version;

                CliOutput.WriteInfo("Current version: {0}", currentVersion);

                var release = ReleaseInfo.LatestRelease();

                CliOutput.WriteInfo("Latest version: {0} (tag {1}) ({2})", release.Version, release.TagName,
                                    release.PublishedAt);

                int vcmp = currentVersion.CompareTo(release.Version);

                if (vcmp < 0)
                {
                    CliOutput.WriteInfo("Update available");
                }
                else if (vcmp == 0)
                {
                    CliOutput.WriteInfo("Up to date");
                }
                else
                {
                    CliOutput.WriteInfo("(preview)");
                }

                CliOutput.WriteInfo("Readme: {0}", RuntimeInfo.Readme);
                CliOutput.WriteInfo("Author: {0}", RuntimeInfo.Author);
            }