public static bool LoadWikiDataHosted(string uri) { if (uri.StartsWith("//")) { uri = MorebitsDotNet.GetProtocol() + ":" + uri; } WebClient loader = new WebClient(); loader.Headers.Add("User-Agent", MorebitsDotNet.UserAgent); loader.Encoding = Encoding.UTF8; string result; try { result = loader.DownloadString(new Uri(uri)); } catch (Exception) { MorebitsDotNet.DefaultErrorHandler(Localization.GetString("FailedToLoadHostedLocalWikiData", uri)); return(false); } LocalWikiData.LoadWikiData(result); return(true); }
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { Process.Start(MorebitsDotNet.GetProtocol() + "://en.wikipedia.org/wiki/User_talk:This,_that_and_the_other"); } catch (Exception) { MessageBox.Show(this, Localization.GetString("LinkVisitFailed"), Application.ProductName); } }
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { Process.Start(MorebitsDotNet.GetProtocol() + "://en.wikipedia.org/w/index.php?title=User_talk:This,_that_and_the_other/For_the_Common_Good&action=watch"); } catch (Exception) { MessageBox.Show(this, Localization.GetString("LinkVisitFailed"), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Stop); } }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { Process.Start(MorebitsDotNet.GetProtocol() + "://en.wikipedia.org/wiki/WP:FTCG"); } catch (Exception) { MessageBox.Show(Localization.GetString("LinkVisitFailed")); } }
private void lnkCatLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { Process.Start(MorebitsDotNet.GetProtocol() + "://" + Settings.CommonsDomain + ".org/wiki/Category:" + lnkCatLink.Text); } catch (Exception) { //ErrorHandler(Localization.GetString("LinkVisitFailed")); } }