public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { //If menu item is not checked, then return if (!PluginEnabled || Settings.Images.Count == 0) { eventargs.Skip = false; return eventargs.ArticleText; } eventargs.EditSummary = ""; string text = eventargs.ArticleText; foreach (KeyValuePair<string, string> p in Settings.Images) { bool noChange; if (p.Value.Length == 0) { text = Parsers.RemoveImage(p.Key, text, Settings.Comment, "", out noChange); if (!noChange) eventargs.EditSummary += ", removed " + Variables.Namespaces[6] + p.Key; } else { text = Parsers.ReplaceImage(p.Key, p.Value, text, out noChange); if (!noChange) eventargs.EditSummary += ", replaced: " + Variables.Namespaces[6] + p.Key + FindandReplace.Arrow + Variables.Namespaces[6] + p.Value; } if (!noChange) text = Regex.Replace(text, "<includeonly>[\\s\\r\\n]*\\</includeonly>", ""); } eventargs.Skip = (text == eventargs.ArticleText) && Settings.Skip; return text; }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { // If menu item is not checked, then return if (!PluginEnabled) { eventargs.Skip = false; return(eventargs.ArticleText); } // Warn if plugin is running, but no fronds have been enabled. A common newbie situation. if (Settings.EnabledFilenames.Count == 0) { DialogResult result = MessageBox.Show( "It looks like you forget to select some fronds to use. You might like to choose some (\"Okay\"), or disable the plugin for now (\"Cancel\").", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); if (result == DialogResult.OK) { ConfigMenuItem.PerformClick(); } else { EnabledMenuItem.Checked = Settings.Enabled = PluginEnabled = false; } return(eventargs.ArticleText); } string text = eventargs.ArticleText; foreach (Frond f in Replacements) { text = f.Preform(text); } return(text); }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { //If menu item is not checked, then return if (!PluginEnabled) { eventargs.Skip = false; return eventargs.ArticleText; } // Warn if plugin is running, but no fronds have been enabled. A common newbie situation. if (Settings.EnabledFilenames.Count == 0) { DialogResult result = MessageBox.Show( "It looks like you forget to select some fronds to use. You might like to choose some (\"Okay\"), or disable the plugin for now (\"Cancel\").", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); if (result == DialogResult.OK) { ConfigMenuItem.PerformClick(); } else { EnabledMenuItem.Checked = Settings.Enabled = PluginEnabled = false; } return eventargs.ArticleText; } string text = eventargs.ArticleText; foreach (Frond f in Replacements) { text = f.Preform(text); } return text; }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { if (!Enabled || string.IsNullOrEmpty(Link)) { return(eventargs.ArticleText); } string articleText = eventargs.ArticleText; RefNames.Clear(); articleText = r4.Replace(articleText, R4Evaluator); articleText = r1.Replace(articleText, ""); articleText = r2.Replace(articleText, ""); articleText = r3.Replace(articleText, ""); if (RefNames.Count > 0) { foreach (string name in RefNames) { articleText = Regex.Replace(articleText, @"< ?ref\b[^>]*?name ?= ?""?" + name + "[\" ]? ?/ ?>", ""); } } if (articleText == eventargs.ArticleText) { eventargs.Skip = Skip; } else { if (RemoveEmptiedSections && (Variables.LangCode.Equals("en") || Variables.LangCode.Equals("de") || Variables.LangCode.Equals("ru"))) { articleText = RemoveSection(articleText); } } return(articleText); }
/// <summary> /// /// </summary> /// <param name="module"></param> public void SendPageToCustomModule(IModule module) { IProcessArticleEventArgs processArticleEventArgs = this; string strEditSummary; bool skipArticle; string strTemp = module.ProcessArticle(processArticleEventArgs.ArticleText, processArticleEventArgs.ArticleTitle, NameSpaceKey, out strEditSummary, out skipArticle); if (!skipArticle) { processArticleEventArgs.EditSummary = strEditSummary; processArticleEventArgs.Skip = false; AWBChangeArticleText("Custom module", strTemp, true); AppendPluginEditSummary(); } else { Trace.AWBSkipped("Skipped by custom module"); } }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { if (!Enabled) { return(eventargs.ArticleText); } string ArticleText = eventargs.ArticleText; RefNames.Clear(); ArticleText = r4.Replace(ArticleText, R4Evaluator); ArticleText = r1.Replace(ArticleText, ""); ArticleText = r2.Replace(ArticleText, ""); ArticleText = r3.Replace(ArticleText, ""); if (RefNames.Count > 0) { foreach (string name in RefNames) { ArticleText = Regex.Replace(ArticleText, @"< ?ref\b[^>]*?name ?= ?""?" + name + "[\" ]? ?/ ?>", ""); } } if (ArticleText == eventargs.ArticleText) { eventargs.Skip = Skip; } else { if (RemoveEmptiedSections && (Variables.LangCode == LangCodeEnum.en || Variables.LangCode == LangCodeEnum.de || Variables.LangCode == LangCodeEnum.ru)) { ArticleText = RemoveSection(ArticleText); } } return(ArticleText); }
string IAWBPlugin.ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { return(eventargs.ArticleText); }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { //If menu item is not checked, then return if (!PluginEnabled || Settings.Images.Count == 0) { eventargs.Skip = false; return eventargs.ArticleText; } string text = eventargs.ArticleText; string removed = "", replaced = ""; foreach (KeyValuePair<string, string> p in Settings.Images) { bool noChange; if (p.Value.Length == 0) { text = Parsers.RemoveImage(p.Key, text, Settings.Comment, "", out noChange); if (!noChange) { if (!string.IsNullOrEmpty(removed)) { removed += ", "; } removed += Variables.Namespaces[Namespace.File] + p.Key; } } else { text = Parsers.ReplaceImage(p.Key, p.Value, text, out noChange); if (!noChange) { if (!string.IsNullOrEmpty(replaced)) { replaced += ", "; } replaced += Variables.Namespaces[Namespace.File] + p.Key + FindandReplace.Arrow + Variables.Namespaces[Namespace.File] + p.Value; } } if (!noChange) { text = Regex.Replace(text, "<includeonly>[\\s\\r\\n]*\\</includeonly>", ""); } } string editSummary = ""; if (Settings.AppendToEditSummary) { if (!string.IsNullOrEmpty(replaced)) editSummary = "replaced: " + replaced.Trim(); if (!string.IsNullOrEmpty(removed)) { if (!string.IsNullOrEmpty(editSummary)) editSummary += ", "; editSummary += "removed: " + removed.Trim(); } } eventargs.EditSummary = editSummary; eventargs.Skip = (text == eventargs.ArticleText) && Settings.Skip; return text; }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { return(eventargs.ArticleText); }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { if (!Enabled) return eventargs.ArticleText; if (username == "" || password == "") { MessageBox.Show("Source wiki username and/or password not set. Turning off the plugin.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); disablePlugin(); return eventargs.ArticleText; } String linkTitle; String linkBody; String sourceText = eventargs.ArticleText; String url = String.Format("http://{0}.wikipedia.org/w/", SourceLanguage); ApiEdit sourceWiki = new ApiEdit(url); try { sourceWiki.Login(username, password); } catch (LoginException e) { MessageBox.Show("Source wiki username and/or password incorrect. Turning off the plugin.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); disablePlugin(); return eventargs.ArticleText; } #if DEBUG_OUTPUT_DIALOG DebugOutput dlg = new DebugOutput(); dlg.Show(sender.Form); #endif String langCode = Variables.LangCode.ToString(); Regex r = new Regex(String.Format(@"\[\[{0}:([^\]]+)\]\]", langCode)); Match m; String replaceReg; String replaceTo; string[] arr = { eventargs.ArticleTitle }; LinksOnPageListProvider linksProvider = new LinksOnPageListProvider(); List<Article> links = linksProvider.MakeList(arr); // Message AWBForm.StartProgressBar(); AWBForm.StatusLabelText = String.Format("Translating {0} links...", links.Count); #if DEBUG_OUTPUT_DIALOG dlg.StartSection(string.Format("Article {0}", eventargs.ArticleTitle)); #endif foreach (Article link in links) { #if DEBUG_OUTPUT_DIALOG dlg.StartSection(string.Format("Link: {0}", link.Name)); #endif linkTitle = link.Name; linkBody = sourceWiki.Open(linkTitle); m = r.Match(linkBody); if (m.Success) { #if DEBUG_OUTPUT_DIALOG dlg.AddSection("From: ", linkTitle); dlg.AddSection("To: ", m.Groups[1].ToString()); #endif replaceReg = String.Format(@"\[\[{0}\]\]", linkTitle); replaceTo = String.Format("[[{0}|{1}]]", m.Groups[1], linkTitle); sourceText = Regex.Replace(sourceText, replaceReg, replaceTo, RegexOptions.IgnoreCase); replaceReg = String.Format(@"\[\[{0}\|([^\]]+)\]\]", linkTitle); replaceTo = String.Format("[[{0}|$1]]", m.Groups[1], linkTitle); sourceText = Regex.Replace(sourceText, replaceReg, replaceTo, RegexOptions.IgnoreCase); } #if DEBUG_OUTPUT_DIALOG else { dlg.AddSection("No match", ""); } #endif #if DEBUG_OUTPUT_DIALOG dlg.EndSection(); #endif Application.DoEvents(); } #if DEBUG_OUTPUT_DIALOG dlg.EndSection(); #endif AWBForm.StopProgressBar(); AWBForm.StatusLabelText = ""; eventargs.EditSummary = "Automatic translation"; return sourceText; }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { //If menu item is not checked, then return if (!PluginEnabled || Settings.Images.Count == 0) { eventargs.Skip = false; return(eventargs.ArticleText); } string text = eventargs.ArticleText; string removed = "", replaced = ""; foreach (KeyValuePair <string, string> p in Settings.Images) { bool noChange; if (p.Value.Length == 0) { text = Parsers.RemoveImage(p.Key, text, Settings.Comment, "", out noChange); if (!noChange) { if (!string.IsNullOrEmpty(removed)) { removed += ", "; } removed += Variables.Namespaces[Namespace.File] + p.Key; } } else { text = Parsers.ReplaceImage(p.Key, p.Value, text, out noChange); if (!noChange) { if (!string.IsNullOrEmpty(replaced)) { replaced += ", "; } replaced += Variables.Namespaces[Namespace.File] + p.Key + FindandReplace.Arrow + Variables.Namespaces[Namespace.File] + p.Value; } } if (!noChange) { text = Regex.Replace(text, "<includeonly>[\\s\\r\\n]*\\</includeonly>", ""); } } string editSummary = ""; if (Settings.AppendToEditSummary) { if (!string.IsNullOrEmpty(replaced)) { editSummary = "replaced: " + replaced.Trim(); } if (!string.IsNullOrEmpty(removed)) { if (!string.IsNullOrEmpty(editSummary)) { editSummary += ", "; } editSummary += "removed: " + removed.Trim(); } } eventargs.EditSummary = editSummary; eventargs.Skip = (text == eventargs.ArticleText) && Settings.Skip; return(text); }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { if (!Enabled || string.IsNullOrEmpty(Link)) return eventargs.ArticleText; string articleText = eventargs.ArticleText; RefNames.Clear(); articleText = r4.Replace(articleText, R4Evaluator); articleText = r1.Replace(articleText, ""); articleText = r2.Replace(articleText, ""); articleText = r3.Replace(articleText, ""); if (RefNames.Count > 0) { foreach (string name in RefNames) { articleText = Regex.Replace(articleText, @"< ?ref\b[^>]*?name ?= ?""?" + name + "[\" ]? ?/ ?>", ""); } } if (articleText == eventargs.ArticleText) { eventargs.Skip = Skip; } else { if (RemoveEmptiedSections && (Variables.LangCode == "en" || Variables.LangCode == "de" || Variables.LangCode == "ru")) articleText = RemoveSection(articleText); } return articleText; }
string IAWBPlugin.ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { return eventargs.ArticleText; }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { string res; if (ActivePlugins.Count == 0) return eventargs.ArticleText; Article TheArticle; int Namesp = eventargs.NameSpaceKey; StatusText.Text = "Processing " + eventargs.ArticleTitle; AWBForm.TraceManager.ProcessingArticle(eventargs.ArticleTitle, Namesp); foreach (PluginBase p in ActivePlugins) { try { if (!p.IAmReady && p.IAmGeneric) { MessageBox.Show("The generic template plugin \"" + p.PluginShortName + "\"isn't properly configured.", "Can't start", MessageBoxButtons.OK, MessageBoxIcon.Error); StopAWB(); goto SkipOrStop; } } catch { StopAWB(); goto SkipOrStop; } } switch (Namesp) { case Namespace.Article: if (PluginSettings.ManuallyAssess) { if (eventargs.Exists == Exists.Yes) { StatusText.Text += ": Click Preview to read the article; " + "click Save or Ignore to load the assessments form"; AssessmentsObject.ProcessMainSpaceArticle(eventargs.ArticleTitle); eventargs.EditSummary = "Clean up"; goto SkipOrStop; } //FIXME var eaArticleES = eventargs.EditSummary; var eaArticleSkip = eventargs.Skip; res = Skipping(ref eaArticleES, "", SkipReason.ProcessingMainArticleDoesntExist, eventargs.ArticleText, ref eaArticleSkip); eventargs.EditSummary = eaArticleES; eventargs.Skip = eaArticleSkip; goto ExitMe; } goto SkipBadNamespace; //break; case Namespace.Talk: AsyncApiEdit editor = AWBForm.TheSession.Editor.Clone(); editor.Open(Tools.ConvertFromTalk(eventargs.ArticleTitle), false); editor.Wait(); if (!editor.Page.Exists) { // FIXME var eaNotExistsES = eventargs.EditSummary; var eaNotExistsSkip = eventargs.Skip; res = Skipping(ref eaNotExistsES, "", SkipReason.ProcessingTalkPageArticleDoesntExist, eventargs.ArticleText, ref eaNotExistsSkip, eventargs.ArticleTitle); eventargs.EditSummary = eaNotExistsES; eventargs.Skip = eaNotExistsSkip; } else { TheArticle = new Article(eventargs.ArticleText, eventargs.ArticleTitle, Namesp); bool ReqPhoto = ReqPhotoParamNeeded(TheArticle); if (PluginSettings.ManuallyAssess) { // reqphoto byref if (!AssessmentsObject.ProcessTalkPage(TheArticle, PluginSettings, ref ReqPhoto)) { eventargs.Skip = true; goto SkipOrStop; } } else { ReqPhoto = ProcessTalkPageAndCheckWeAddedReqPhotoParam(TheArticle, ReqPhoto); // We successfully added a reqphoto param } // FIXME var eaTalkSkip = eventargs.Skip; var eaTalkES = eventargs.EditSummary; res = FinaliseArticleProcessing(TheArticle, ref eaTalkSkip, ref eaTalkES, eventargs.ArticleText, ReqPhoto); eventargs.Skip = eaTalkSkip; eventargs.EditSummary = eaTalkES; } break; case Namespace.CategoryTalk: case 101: //101 is Portal Talk case Namespace.ProjectTalk: case Namespace.TemplateTalk: case Namespace.FileTalk: if (PluginSettings.ManuallyAssess) { MessageBox.Show("The plugin has received a non-standard namespace talk page in " + "manual assessment mode. Please remove this item from the list and start again.", "Manual Assessments", MessageBoxButtons.OK, MessageBoxIcon.Error); StopAWB(); goto SkipOrStop; } TheArticle = new Article(eventargs.ArticleText, eventargs.ArticleTitle, Namesp); foreach (PluginBase p in ActivePlugins) { p.ProcessTalkPage(TheArticle, Classification.Code, Importance.NA, false, false, false, ProcessTalkPageMode.NonStandardTalk, false); if (TheArticle.PluginManagerGetSkipResults == SkipResults.SkipBadTag) break; // TODO: might not be correct. Was : Exit For } // FIXME var eaMiscSkip = eventargs.Skip; var eaMiscES = eventargs.EditSummary; res = FinaliseArticleProcessing(TheArticle, ref eaMiscSkip, ref eaMiscES, eventargs.ArticleText, false); eventargs.Skip = eaMiscSkip; eventargs.EditSummary = eaMiscES; break; default: goto SkipBadNamespace; } if (!eventargs.Skip) { //TempHackInsteadOfDefaultSettings: if (AWBForm.EditSummaryComboBox.Text == "clean up") AWBForm.EditSummaryComboBox.Text = "Tagging"; } ExitMe: if (!PluginSettings.ManuallyAssess) DefaultStatusText(); AWBForm.TraceManager.Flush(); return res; SkipBadNamespace: //FIXME var eaES = eventargs.EditSummary; var eaSkip = eventargs.Skip; res = Skipping(ref eaES, "", SkipReason.BadNamespace, eventargs.ArticleText, ref eaSkip); eventargs.EditSummary = eaES; eventargs.Skip = eaSkip; goto ExitMe; SkipOrStop: res = eventargs.ArticleText; goto ExitMe; }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { if (!Enabled) return eventargs.ArticleText; string ArticleText = eventargs.ArticleText; RefNames.Clear(); ArticleText = r4.Replace(ArticleText, R4Evaluator); ArticleText = r1.Replace(ArticleText, ""); ArticleText = r2.Replace(ArticleText, ""); ArticleText = r3.Replace(ArticleText, ""); if (RefNames.Count > 0) foreach (string name in RefNames) { ArticleText = Regex.Replace(ArticleText, @"< ?ref\b[^>]*?name ?= ?""?" + name + "[\" ]? ?/ ?>", ""); } if (ArticleText == eventargs.ArticleText) { eventargs.Skip = Skip; } else { if (RemoveEmptiedSections && (Variables.LangCode == LangCodeEnum.en || Variables.LangCode == LangCodeEnum.de || Variables.LangCode == LangCodeEnum.ru)) ArticleText = RemoveSection(ArticleText); } return ArticleText; }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { //MessageBox.Show("Procsssing Article"); //If menu item is not checked, then return if (!PluginEnabled) { eventargs.Skip = false; return(eventargs.ArticleText); } string text = eventargs.ArticleText; string removed = "", replaced = ""; pr = new PostProcessor(RuleFileName, VerbListFileName, NounListFileName, AdjectiveListFileName, PronounListFileName, UsersCustomFileName); pr.LoadTextToTranslate(text); // translatorThread = new Thread(new ThreadStart(pr.TranslateVoid)); text = pr.Translate(); //translatorThread.Name = "TranslatorThread"; //Name of the thread //translatorThread.Start(); //starting translation. //pr.OnTranslationComplete += new PostProcessor.TranslationCompleteDelegate(C_TranslationComplete); //MessageBox.Show("Translation Complete"); #region abcd // //foreach (KeyValuePair<string, string> p in Settings.Categories) //{ // bool noChange; // if (p.Value.Length == 0) // { // text = Parsers.RemoveCategory(p.Key, text, out noChange); // if (!noChange) // { // if (!string.IsNullOrEmpty(removed)) // { // removed += ", "; // } // removed += Variables.Namespaces[Namespace.Category] + p.Key; // } // } // else // { // text = Parsers.ReCategoriser(p.Key, p.Value, text, out noChange); // if (!noChange) // { // if (!string.IsNullOrEmpty(replaced)) // { // replaced += ", "; // } // replaced += Variables.Namespaces[Namespace.Category] // + p.Key + FindandReplace.Arrow + Variables.Namespaces[Namespace.Category] + p.Value; // } // } // if (!noChange) // { // text = Regex.Replace(text, "<includeonly>[\\s\\r\\n]*\\</includeonly>", ""); // } //} //string editSummary = ""; //if (Settings.AppendToEditSummary) //{ // if (!string.IsNullOrEmpty(replaced)) // editSummary = "replaced: " + replaced.Trim(); // if (!string.IsNullOrEmpty(removed)) // { // if (!string.IsNullOrEmpty(editSummary)) // editSummary += ", "; // editSummary += "removed: " + removed.Trim(); // } //} //eventargs.EditSummary = editSummary; //eventargs.Skip = (text == eventargs.ArticleText) && Settings.Skip; #endregion return(text); }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { string res; if (ActivePlugins.Count == 0) { return(eventargs.ArticleText); } Article theArticle; StatusText.Text = "Processing " + eventargs.ArticleTitle; AWBForm.TraceManager.ProcessingArticle(eventargs.ArticleTitle, eventargs.NameSpaceKey); foreach (PluginBase p in ActivePlugins) { try { if (!p.AmReady && p.AmGeneric) { MessageBox.Show( "The generic template plugin \"" + p.PluginShortName + "\"isn't properly configured.", "Can't start", MessageBoxButtons.OK, MessageBoxIcon.Error); StopAWB(); goto SkipOrStop; } } catch { StopAWB(); goto SkipOrStop; } } switch (eventargs.NameSpaceKey) { case Namespace.Article: if (_pluginSettings.ManuallyAssess) { if (eventargs.Exists == Exists.Yes) { StatusText.Text += ": Click Preview to read the article; " + "click Save or Ignore to load the assessments form"; _assessmentsObject.ProcessMainSpaceArticle(eventargs.ArticleTitle); eventargs.EditSummary = "Clean up"; goto SkipOrStop; } //FIXME var eaArticleES = eventargs.EditSummary; var eaArticleSkip = eventargs.Skip; res = Skipping(ref eaArticleES, "", SkipReason.ProcessingMainArticleDoesntExist, eventargs.ArticleText, ref eaArticleSkip); eventargs.EditSummary = eaArticleES; eventargs.Skip = eaArticleSkip; goto ExitMe; } goto SkipBadNamespace; //break; case Namespace.Talk: AsyncApiEdit editor = AWBForm.TheSession.Editor.Clone(); editor.Open(Tools.ConvertFromTalk(eventargs.ArticleTitle), false); editor.Wait(); if (!editor.Page.Exists) { // FIXME var eaNotExistsES = eventargs.EditSummary; var eaNotExistsSkip = eventargs.Skip; res = Skipping(ref eaNotExistsES, "", SkipReason.ProcessingTalkPageArticleDoesntExist, eventargs.ArticleText, ref eaNotExistsSkip, eventargs.ArticleTitle); eventargs.EditSummary = eaNotExistsES; eventargs.Skip = eaNotExistsSkip; } else { theArticle = new Article(eventargs.ArticleText, eventargs.ArticleTitle, eventargs.NameSpaceKey); bool reqPhoto = ReqPhotoParamNeeded(theArticle); if (_pluginSettings.ManuallyAssess) { // reqphoto byref if (!_assessmentsObject.ProcessTalkPage(theArticle, _pluginSettings, ref reqPhoto)) { eventargs.Skip = true; goto SkipOrStop; } } else { reqPhoto = ProcessTalkPageAndCheckWeAddedReqPhotoParam(theArticle, reqPhoto); // We successfully added a reqphoto param } // FIXME var eaTalkSkip = eventargs.Skip; var eaTalkES = eventargs.EditSummary; res = FinaliseArticleProcessing(theArticle, ref eaTalkSkip, ref eaTalkES, eventargs.ArticleText, reqPhoto); eventargs.Skip = eaTalkSkip; eventargs.EditSummary = eaTalkES; } break; case Namespace.CategoryTalk: case 101: //101 is Portal Talk case Namespace.ProjectTalk: case Namespace.TemplateTalk: case Namespace.FileTalk: if (_pluginSettings.ManuallyAssess) { MessageBox.Show( "The plugin has received a non-standard namespace talk page in " + "manual assessment mode. Please remove this item from the list and start again.", "Manual Assessments", MessageBoxButtons.OK, MessageBoxIcon.Error); StopAWB(); goto SkipOrStop; } theArticle = new Article(eventargs.ArticleText, eventargs.ArticleTitle, eventargs.NameSpaceKey); foreach (PluginBase p in ActivePlugins) { p.ProcessTalkPage(theArticle, Classification.Code, Importance.NA, false, false, false, ProcessTalkPageMode.NonStandardTalk, false); if (theArticle.PluginManagerGetSkipResults == SkipResults.SkipBadTag) { break; // TODO: might not be correct. Was : Exit For } } // FIXME var eaMiscSkip = eventargs.Skip; var eaMiscES = eventargs.EditSummary; res = FinaliseArticleProcessing(theArticle, ref eaMiscSkip, ref eaMiscES, eventargs.ArticleText, false); eventargs.Skip = eaMiscSkip; eventargs.EditSummary = eaMiscES; break; default: goto SkipBadNamespace; } if (!eventargs.Skip) { //TempHackInsteadOfDefaultSettings: if (AWBForm.EditSummaryComboBox.Text == "clean up") { AWBForm.EditSummaryComboBox.Text = "Tagging"; } } ExitMe: if (!_pluginSettings.ManuallyAssess) { DefaultStatusText(); } AWBForm.TraceManager.Flush(); return(res); SkipBadNamespace: //FIXME var eaES = eventargs.EditSummary; var eaSkip = eventargs.Skip; res = Skipping(ref eaES, "", SkipReason.BadNamespace, eventargs.ArticleText, ref eaSkip); eventargs.EditSummary = eaES; eventargs.Skip = eaSkip; goto ExitMe; SkipOrStop: res = eventargs.ArticleText; goto ExitMe; }
public string ProcessArticle(IAutoWikiBrowser sender, IProcessArticleEventArgs eventargs) { return eventargs.ArticleText; }