コード例 #1
0
        public static void WebControlLinkClicked(object sender, OpenExternalLinkEventArgs e)
        {
            // Although all links have "target='_blank'" added (see ParsedDocument.ToHtml()), they go through this first
            // unless the url is local (a bug in Awesomium) in which case this event isn't triggered, and the "target='_blank'"
            // takes over to avoid crashing the preview. Local resource requests where the resource doesn't exist are thrown
            // away. See WebControl_ResourceRequest().

            var file = e.Url;

            if (e.Url.StartsWith(LocalRequestUrlBase))
            {
                file = GetResourceFileName(e.Url.Replace(LocalRequestUrlBase, "")) ?? "";
                if (!File.Exists(file))
                {
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(file))
            {
                return;
            }

            Process.Start(file);
        }
コード例 #2
0
 private void webControl_OpenExternalLink(object sender, OpenExternalLinkEventArgs e)
 {
     if (DockPanel != null)
     {
         WebDocument doc = new WebDocument(e.Url);
         doc.Show(DockPanel);
     }
 }
コード例 #3
0
ファイル: TabView.cs プロジェクト: torksrevol/AwesomiumSharp
 private void OnOpenExternalLink(object sender, OpenExternalLinkEventArgs e)
 {
     // Inform the window that the web control is asking for a new window or tab.
     // Currently, the event does not provide information of whether this request
     // is the result of a user clicking on a link with target="_blank" or javascript
     // calling window.open() etc. We assume target="_blank" and open a new tab.
     // When we get this info, we will be able to support floating windows.
     ParentWindow.OpenURL(e.Url);
 }
コード例 #4
0
    private void OnWebViewOpenExternalLink(object sender, OpenExternalLinkEventArgs e)
    {
        if (!CheckWebView())
        {
            return;
        }

        // For this sample, we load the URL
        // in the same WebView.
        webView.LoadURL(e.Url);
    }
コード例 #5
0
        private void Renderer_OpenExternalLink(object sender, OpenExternalLinkEventArgs e)
        {
            if (e.Url.StartsWith("local://base_request.html/"))
            {
                string str = e.Url.Replace("local://base_request.html/", "");
                EditorRenderer._logger.Trace("Found local resource request: " + str);
                this.Editor.StatusMessage = LocalizationProvider.GetLocalizedString("InternalNavigationDisabledInLivePreview", false, "MarkdownPadStrings");
                return;
            }
            string url = e.Url;

            url.TryStartDefaultProcess();
        }
コード例 #6
0
        public static void WebControlLinkClicked(object sender, OpenExternalLinkEventArgs e)
        {
            // Although all links have "target='_blank'" added (see ParsedDocument.ToHtml()), they go through this first
            // unless the url is local (a bug in Awesomium) in which case this event isn't triggered, and the "target='_blank'"
            // takes over to avoid crashing the preview. Local resource requests where the resource doesn't exist are thrown
            // away. See WebControl_ResourceRequest().

            var file = e.Url;
            if (e.Url.StartsWith(LocalRequestUrlBase))
            {
                file = GetResourceFileName(e.Url.Replace(LocalRequestUrlBase, "")) ?? "";
                if (!File.Exists(file)) return;
            }

            if (string.IsNullOrWhiteSpace(file)) return;

            Process.Start(file);
        }
コード例 #7
0
 private void OnOpenExternalLink(object sender, OpenExternalLinkEventArgs e)
 {
     Debug.Log( String.Format( "Navigating to: {0}" , e.Url ) );
     // For this sample, we simply load the page to the same view.
     webTexture.LoadURL( e.Url );
 }
コード例 #8
0
    private void OnWebViewOpenExternalLink( object sender, OpenExternalLinkEventArgs e )
    {
        if ( !CheckWebView() )
            return;

        // For this sample, we load the URL
        // in the same WebView.
        webView.LoadURL( e.Url );
    }
コード例 #9
0
ファイル: WebControl.cs プロジェクト: UIKit0/AwesomiumSharp
        private void internalOpenExternalLinkCallback( IntPtr caller, IntPtr url, IntPtr source )
        {
            OpenExternalLinkEventArgs e = new OpenExternalLinkEventArgs(
                StringHelper.ConvertAweString( url ),
                StringHelper.ConvertAweString( source ) );

            this.OnOpenExternalLink( this, e );

            CommandManager.InvalidateRequerySuggested();
        }
コード例 #10
0
ファイル: WebControl.cs プロジェクト: UIKit0/AwesomiumSharp
 /// <summary>
 /// Raises the <see cref="OpenExternalLink"/> event.
 /// </summary>
 protected virtual void OnOpenExternalLink( object sender, OpenExternalLinkEventArgs e )
 {
     if ( OpenExternalLink != null )
         OpenExternalLink( sender, e );
 }
コード例 #11
0
ファイル: ChatLogView.xaml.cs プロジェクト: dustyburwell/jell
        private void Browser_OpenExternalLink(object sender, OpenExternalLinkEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(e.Url))
            return;

             Process.Start(e.Url);
        }
コード例 #12
0
 private void OnOpenExternalLink(object sender, OpenExternalLinkEventArgs e)
 {
     Debug.Log(String.Format("Navigating to: {0}", e.Url));
     // For this sample, we simply load the page to the same view.
     webTexture.LoadURL(e.Url);
 }
コード例 #13
0
ファイル: WebControl.cs プロジェクト: Perikles/AwesomiumSharp
        private void internalOpenExternalLinkCallback( IntPtr caller, IntPtr url, IntPtr source )
        {
            OpenExternalLinkEventArgs e = new OpenExternalLinkEventArgs(
                StringHelper.ConvertAweString( url ),
                StringHelper.ConvertAweString( source ) );

            this.OnOpenExternalLink( this, e );
        }
コード例 #14
0
 void WebControl_LinkClicked(object sender, OpenExternalLinkEventArgs e)
 {
     Process.Start(e.Url);
 }