private void LoadUserTalkWarnings()
{
Regex userTalkTemplate = new Regex(@"# ?\[\["
+ Variables.NamespacesCaseInsensitive[Namespace.Template] + @"(.*?)\]\]");
UserTalkTemplatesRegex = null;
UserTalkWarningsLoaded = true; // or it will retry on each page load
List<string> userTalkTemplates = new List<string>();
try
{
string text;
try
{
text = TheSession.Editor.SynchronousEditor.Clone().Open("Project:AutoWikiBrowser/User talk templates", true);
}
catch
{
return;
}
foreach (Match m in userTalkTemplate.Matches(text))
{
userTalkTemplates.Add(m.Groups[1].Value);
}
}
catch (Exception ex)
{
ErrorHandler.HandleException(ex);
UserTalkWarningsLoaded = false;
}
if (userTalkTemplates.Any())
UserTalkTemplatesRegex = Tools.NestedTemplateRegex(userTalkTemplates);
}