public override void DecidePolicyForNavigation (WebView webView, NSDictionary actionInformation, NSUrlRequest request, WebFrame frame, NSObject decisionToken)
			{
				switch ((WebNavigationType)((NSNumber)actionInformation [WebPolicyDelegate.WebActionNavigationTypeKey]).Int32Value) {
				case WebNavigationType.BackForward:
				case WebNavigationType.FormResubmitted:
				case WebNavigationType.FormSubmitted:
					WebPolicyDelegate.DecideIgnore (decisionToken);
					break;
				case WebNavigationType.LinkClicked:
					NSWorkspace.SharedWorkspace.OpenUrl (actionInformation[WebPolicyDelegate.WebActionOriginalUrlKey] as NSUrl);
					WebPolicyDelegate.DecideIgnore (decisionToken);
					break;
				case WebNavigationType.Other:
				case WebNavigationType.Reload:
					WebPolicyDelegate.DecideUse (decisionToken);
					break;
				}
			}
 public override void DecidePolicyForNavigation(WebView web_view, NSDictionary action_info,
     NSUrlRequest request, WebFrame frame, NSObject decision_token)
 {
     if (LinkClicked != null)
         LinkClicked (request.Url.ToString ());
 }
Exemple #3
0
 public override void DecidePolicyForMimeType(WebView webView, string mimeType, NSUrlRequest request, WebFrame frame, NSObject decisionToken);
Exemple #4
0
 public override void ClearedWindowObject(WebView webView, WebScriptObject windowObject, WebFrame forFrame);
Exemple #5
0
 public override void CanceledClientRedirect(WebView sender, WebFrame forFrame);
Exemple #6
0
 public override void ChangedLocationWithinPage(WebView sender, WebFrame forFrame);
Exemple #7
0
 public override void FinishedLoad(WebView sender, WebFrame forFrame);
Exemple #8
0
 public override void ReceivedTitle(WebView sender, string title, WebFrame forFrame);
Exemple #9
0
            public override string UIRunJavaScriptTextInputPanelWithFrame(wk.WebView sender, string prompt, string defaultText, wk.WebFrame initiatedByFrame)
            {
                var dialog = new PromptDialog(Handler.Widget.Generator)
                {
                    Prompt = prompt,
                    Value  = defaultText,
                    Title  = Handler.DocumentTitle
                };
                var result = dialog.ShowDialog(Handler.Widget);

                return((result == DialogResult.Ok) ? dialog.Value : string.Empty);
            }
Exemple #10
0
 public override bool UIRunJavaScriptConfirmationPanel(wk.WebView sender, string withMessage, wk.WebFrame initiatedByFrame)
 {
     return(MessageBox.Show(Handler.Widget, withMessage, MessageBoxButtons.YesNo) == DialogResult.Yes);
 }
Exemple #11
0
 public override void UIRunJavaScriptAlertPanelMessage(wk.WebView sender, string withMessage, wk.WebFrame initiatedByFrame)
 {
     MessageBox.Show(Handler.Widget, withMessage);
 }
Exemple #12
0
        public override void DecidePolicyForNavigation(WebView web_view, NSDictionary action_info,
                                                        NSUrlRequest request, WebFrame frame, NSObject decision_token)
        {
            string file_path = request.Url.ToString ();
            file_path = file_path.Replace ("%20", " ");

            NSWorkspace.SharedWorkspace.OpenFile (file_path);
        }
 public override void DecidePolicyForNavigation(WebView web_view, NSDictionary action_info,
     NSUrlRequest request, WebFrame frame, NSObject decision_token)
 {
     SparkleEventLogController.LinkClicked (request.Url.ToString ());
 }
			public override void FinishedLoad (WebView sender, WebFrame forFrame)
			{
				document.ReloadDocument ();
			}
Exemple #15
0
            public void DecidePolicyForNavigation(wk.WebView webView, NSDictionary action, NSUrlRequest request, wk.WebFrame frame, NSObject listener)
            {
                var url  = action.ObjectForKey(new NSString("WebActionOriginalURLKey")) as NSUrl;
                var args = new WebViewNewWindowEventArgs(new Uri(url.AbsoluteString), frame.Name);

                Handler.Widget.OnOpenNewWindow(args);
                if (!args.Cancel)
                {
                    NSWorkspace.SharedWorkspace.OpenUrl(url);
                }
                listener.PerformSelector(selIgnore, null, 0);
            }
Exemple #16
0
 public override void CommitedLoad(WebView sender, WebFrame forFrame);
Exemple #17
0
 public override void UIRunJavaScriptAlertPanelMessage(WebView sender, string withMessage, WebFrame initiatedByFrame);
Exemple #18
0
 public override void ReceivedIcon(WebView sender, NSImage image, WebFrame forFrame);
Exemple #19
0
 public override bool UIRunJavaScriptConfirmationPanel(WebView sender, string withMessage, WebFrame initiatedByFrame);
Exemple #20
0
 public override void FailedLoadWithError(WebView sender, NSError error, WebFrame forFrame);
Exemple #21
0
 public override string UIRunJavaScriptTextInputPanelWithFrame(WebView sender, string prompt, string defaultText, WebFrame initiatedByFrame);
Exemple #22
0
 public override void WillPerformClientRedirect(WebView sender, NSUrl toUrl, double secondsDelay, NSDate fireDate, WebFrame forFrame);
Exemple #23
0
 public override bool UIRunBeforeUnload(WebView sender, string message, WebFrame initiatedByFrame);
Exemple #24
0
 public override void WillCloseFrame(WebView sender, WebFrame forFrame);
Exemple #25
0
 public override void StartedProvisionalLoad(WebView sender, WebFrame forFrame);
Exemple #26
0
 public override void DecidePolicyForNavigation(WebView webView, NSDictionary actionInformation, NSUrlRequest request, WebFrame frame, NSObject decisionToken);
Exemple #27
0
 public override void ReceivedServerRedirectForProvisionalLoad(WebView sender, WebFrame forFrame);
Exemple #28
0
 public override void UnableToImplementPolicy(WebView webView, NSError error, WebFrame frame);
Exemple #29
0
 public override void FailedProvisionalLoad(WebView sender, NSError error, WebFrame forFrame);
        public override void DecidePolicyForNavigation(WebView web_view, NSDictionary action_info,
            NSUrlRequest request, WebFrame frame, NSObject decision_token)
        {
            string url = request.Url.ToString ();

            if (url.StartsWith (Path.VolumeSeparatorChar.ToString ())) {
                string file_path = request.Url.ToString ();
                file_path = file_path.Replace ("%20", " ");

                NSWorkspace.SharedWorkspace.OpenFile (file_path);

            } else {
                Regex regex = new Regex (@"(.+)~(.+)~(.+)");
                Match match = regex.Match (url);

                if (match.Success) {
                    string folder_name = match.Groups [1].Value;
                    string revision    = match.Groups [2].Value;
                    string note        = match.Groups [3].Value;

                    Thread thread = new Thread (new ThreadStart (delegate {
                        SparkleShare.Controller.AddNoteToFolder (folder_name, revision, note);
                    }));

                    thread.Start ();
                }
            }
        }
Exemple #31
0
 public void FinishedLoad(WebView sender, WebFrame forFrame)
 {
     FinishedLoading();
 }