예제 #1
0
        private async Task QueryServerAsync(bool forceCheck)
        {
            _options.SurveyNewsLastCheck = DateTime.Now;

            string url = null;

            try {
                var feed = await _feedClient.GetFeedAsync(_options.FeedUrl);

                if (feed?.NotVotedUrls?.Length > 0)
                {
                    url = feed.NotVotedUrls[0];
                }
                else if (forceCheck)
                {
                    url = _options.IndexUrl;
                }
            } catch (Exception ex) when(!ex.IsCriticalException())
            {
                GeneralLog.Write(ex);
                if (forceCheck)
                {
                    url = _options.CannotConnectUrl;
                }
            }

            try {
                if (!string.IsNullOrEmpty(url))
                {
                    _browserServices.OpenBrowser(WebBrowserRole.News, url, onIdle: !forceCheck);
                }
            } catch (Exception ex) when(!ex.IsCriticalException())
            {
                GeneralLog.Write(ex);
            }
        }
예제 #2
0
        private async Task QueryServerAsync(bool forceCheck)
        {
            _options.SurveyNewsLastCheck = DateTime.Now;

            string url = null;

            try {
                var feed = await _feedClient.GetFeedAsync(_options.FeedUrl);

                if (feed?.NotVotedUrls?.Length > 0)
                {
                    url = feed.NotVotedUrls[0];
                }
                else if (forceCheck)
                {
                    url = _options.IndexUrl;
                }
            } catch (Exception ex) when(!ex.IsCriticalException())
            {
                _coreShell.Log().Write(LogVerbosity.Normal, MessageCategory.Error, "SurveyNews exception: " + ex.Message);
                if (forceCheck)
                {
                    url = _options.CannotConnectUrl;
                }
            }

            try {
                if (!string.IsNullOrEmpty(url))
                {
                    _browserServices.OpenBrowser(WebBrowserRole.News, url, onIdle: !forceCheck);
                }
            } catch (Exception ex) when(!ex.IsCriticalException())
            {
                _coreShell.Log().Write(LogVerbosity.Normal, MessageCategory.Error, "SurveyNews exception: " + ex.Message);
            }
        }
예제 #3
0
 protected override void LaunchViewer(string fileName)
 {
     _wbs.OpenBrowser(WebBrowserRole.Markdown, Invariant($"file://{fileName}"));
 }