Наследование: System.EventArgs
Пример #1
0
        private void OnNavigated(object sender, PageLoadedEventArgs e) {
            CommandManager.InvalidateRequerySuggested();
            UrlTextBox.Text = e.Url;
            PageLoaded?.Invoke(this, new PageLoadedEventArgs(_something.GetUrl()));

            if (SaveKey != null && e.Url.StartsWith(@"http", StringComparison.OrdinalIgnoreCase)) {
                ValuesStorage.Set(SaveKey, e.Url);
            }
        }
Пример #2
0
        private void OnNavigated(object sender, PageLoadedEventArgs e)
        {
            CommandManager.InvalidateRequerySuggested();
            UrlTextBox.Text = e.Url;
            PageLoaded?.Invoke(this, new PageLoadedEventArgs(_something.GetUrl()));

            if (SaveKey != null && e.Url.StartsWith(@"http", StringComparison.OrdinalIgnoreCase))
            {
                ValuesStorage.Set(SaveKey, e.Url);
            }
        }
Пример #3
0
        private void WebBrowser_OnPageLoaded(object sender, PageLoadedEventArgs e) {
            var uri = e.Url;

            SrsCommon();

            var query = Regex.Match(uri, @"/(\w+?)\d*\.php", RegexOptions.IgnoreCase);
            var page = query.Success ? query.Groups[1].Value.ToLowerInvariant() : null;
            Logging.Debug(page);

            switch (page) {
                case "select":
                    SrsSelectCar();
                    break;

                case "unregsrs":
                    SrsUnregister();
                    break;

                case "race":
                    SrsMain();
                    break;
            }
        }
Пример #4
0
        private void OnPageLoaded(object sender, PageLoadedEventArgs e) {
            WebBrowser.Execute(@"
document.addEventListener('mouseup', function(){
    window.external.Update(window.getSelection().toString());
}, false);

document.addEventListener('mousedown', function(e){
    if (e.target.getAttribute('target') == '_blank'){
        e.target.setAttribute('target', '_parent');
    }
}, false);");
        }
Пример #5
0
        private void WebBrowser_OnPageLoaded(object sender, PageLoadedEventArgs e) {
            var uri = e.Url;
            var match = Regex.Match(uri, @"\beventId=(\d+)");
            if (match.Success) {
                Model.EventId = match.Groups[1].Value;
            } else {
                var trackId = Regex.Match(uri, @"\btrack(?:Id)?=(\d+)");
                var carId = Regex.Match(uri, @"\bcar(?:Id)?=(\d+)");
                if (trackId.Success && carId.Success) {
                    Model.EventId = trackId.Groups[1].Value + @"/" + carId.Groups[1].Value;
                } else {
                    Model.EventId = null;
                }
            }

            if (uri.Contains(@"page=setups")) {
                WebBrowser.Execute(@"
window.addEventListener('load', function(){
    var ths = document.getElementsByTagName('th');
    for (var i=0; i<ths.length; i++) if (ths[i].innerHTML == 'Download') ths[i].innerHTML = 'Install';
    var hs = document.getElementsByTagName('a');
    for (var i=0, m; i<hs.length; i++) if (m = hs[i].href.match(/=download_setup&id=(\d+)/)) hs[i].href = 'acmanager://rsr/setup?id=' + m[1];
}, false);");
            }
        }