public static ReCategoriser ( string oldCategory, string newCategory, string articleText, bool &noChange ) : string | ||
oldCategory | string | The old category to replace. |
newCategory | string | The new category. |
articleText | string | The wiki text of the article. |
noChange | bool | Value that indicated whether no change was made. |
return | string |
public string ProcessArticle(IAutoWikiBrowser sender, ProcessArticleEventArgs eventargs) { //If menu item is not checked, then return if (!PluginEnabled || Settings.Categories.Count == 0) { eventargs.Skip = false; return eventargs.ArticleText; } eventargs.EditSummary = ""; string text = eventargs.ArticleText; Parsers parse = new Parsers(); foreach (KeyValuePair<string, string> p in Settings.Categories) { bool noChange = true; if (p.Value.Length == 0) { text = parse.RemoveCategory(p.Key, text, out noChange); if(!noChange) eventargs.EditSummary += ", removed " + Variables.Namespaces[14] + p.Key; } else { text = parse.ReCategoriser(p.Key, p.Value, text, out noChange); if (!noChange) eventargs.EditSummary += ", replaced: " + Variables.Namespaces[14] + p.Key + FindandReplace.Arrow + Variables.Namespaces[14] + p.Value; } if (!noChange) text = Regex.Replace(text, "<includeonly>[\\s\\r\\n]*\\</includeonly>", ""); } eventargs.Skip = (text == eventargs.ArticleText) && Settings.Skip; return text; }