private void WebViewNavigationRequested(object o, WebKit.NavigationRequestedArgs args) { Controller.LinkClicked(args.Request.Uri); // Don't follow HREFs (as this would cause a page refresh) if (!args.Request.Uri.Equals("file:")) { args.RetVal = 1; } }
void HandleM_viewNavigationRequested(object o, WebKit.NavigationRequestedArgs args) { if (contentLoaded) { m_view.StopLoading(); if (args.Request.Uri.StartsWith("ocm://")) { string[] request = args.Request.Uri.Substring(6).Split('/'); if (request[0].Equals("deleteLog")) { MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, Mono.Unix.Catalog.GetString("Are you sure you wish to delete this log?")); if (((int)ResponseType.Yes) == dlg.Run()) { dlg.Hide(); m_App.CacheStore.PurgeLogsByKey(new String[] { request[1] }); m_App.RefreshAll(); } dlg.Hide(); } else if (request[0].Equals("editLog")) { OfflineLogDialog dlg = new OfflineLogDialog(); dlg.MainWin = m_Win; dlg.useFullLog = true; ocmengine.CacheLog log = m_App.CacheStore.GetCacheLogByKey(request[1]); dlg.Log = log; if ((int)ResponseType.Ok == dlg.Run()) { log = dlg.Log; m_App.CacheStore.AddLog(log.CacheCode, log); dlg.Hide(); m_App.RefreshAll(); } dlg.Hide(); } } else { // System.Diagnostics.Process.Start(args.Request.Uri); Helper.ProcessStartURL(args.Request.Uri); } } }