Exemplo n.º 1
0
        public bool OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect)
        {
            if (request.Url is null)
            {
                return(false);
            }

            string url = request.Url;

            if (string.Compare(url, "about:blank", StringComparison.Ordinal) == 0)
            {
                return(false); // don't intercept about:blank
            }

            if (url == UI.QuickStartGuide())
            {
                return(false); // let the quick-start guide be shown
            }

            if (url.Contains("://www.youtube.com/embed/"))
            {
                return(false); // let embedded youtube URL be show
            }

            if (url.StartsWith(UI.EXPLORE_PROXY, StringComparison.InvariantCultureIgnoreCase))
            {
                string openlocation = HttpUtility.UrlDecode(url.Substring(UI.EXPLORE_PROXY.Length));
                if (Helpers.OpenFolder(openlocation))
                {
                    return(true);
                }
                Helpers.OpenFolderSelectFile(openlocation);
                return(true);
            }

            if (url.StartsWith(UI.WATCH_PROXY, StringComparison.InvariantCultureIgnoreCase))
            {
                string fileName = HttpUtility.UrlDecode(url.Substring(UI.WATCH_PROXY.Length)).Replace('/', '\\');
                Helpers.OpenFile(fileName);
                return(true);
            }

            if (url.IsHttpLink() || url.IsFileLink())
            {
                Helpers.OpenUrl(url);
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
 private void lnkOpenRightFolder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     Helpers.OpenFolderSelectFile(rightFile.FullName);
 }