コード例 #1
0
        private void GetNativeMessagingStatus()
        {
            var statuses = _host.GetBrowserStatuses();
            var lst      = new List <string>();

            foreach (var b in statuses.Keys)
            {
                lst.Add($"{b.GetDescription()}: {statuses[b].GetDescription()}");
            }

            var latestVersion        = _host.GetLatestProxyVersion();
            var proxyVersion         = _host.GetProxyVersion();
            var proxyDisplay         = proxyVersion == null ? "Not Installed" : proxyVersion.ToString();
            var latestVersionDisplay = string.Empty;

            if (proxyVersion != null && latestVersion != null)
            {
                if (latestVersion > proxyVersion)
                {
                    latestVersionDisplay = $" New Version Available: {latestVersion}";
                }
                else
                {
                    latestVersionDisplay = " (Up To Date)";
                }
            }

            lst.Add($"Proxy: {proxyDisplay}{latestVersionDisplay}");

            lblProxyVersion.Text = string.Join(Environment.NewLine, lst);
        }
コード例 #2
0
        private void GetNativeMessagingStatus()
        {
            var statuses = _host.GetBrowserStatuses();
            var lst      = new List <string>();

            foreach (var b in statuses.Keys)
            {
                lst.Add(string.Format("{0}: {1}", b.GetDescription(), statuses[b].GetDescription()));
            }

            var latestVersion        = _host.GetLatestProxyVersion();
            var proxyVersion         = _host.GetProxyVersion();
            var proxyDisplay         = proxyVersion == null ? "Not Installed" : proxyVersion.ToString();
            var latestVersionDisplay = string.Empty;

            if (proxyVersion != null && latestVersion != null)
            {
                if (latestVersion > proxyVersion)
                {
                    latestVersionDisplay = " New Version Available: " + latestVersion;
                }
                else
                {
                    latestVersionDisplay = " (Up To Date)";
                }
            }

            lst.Add(string.Format("Proxy: {0}{1}", proxyDisplay, latestVersionDisplay));

            SetProxyVersionText(string.Join(Environment.NewLine, lst));
        }