public virtual void Save(Wiki wiki, WikiPage page, Dictionary<string, string> archives, int topics)
{
StringBuilder linksToArchives = new StringBuilder();
foreach (var archive in archives)
{
linksToArchives.AppendFormat(", [[{0}]]", archive.Key);
}
linksToArchives.Remove(0, 2);
Console.Out.WriteLine("Saving " + MainPage + "...");
string revid = page.Save(wiki, string.Format("{0} ({1}) → {2}",
L10i.UpdateComment,
topics,
linksToArchives));
if (revid != null)
{
Cache.CachePage(MainPage, _cacheDir, revid, page.Text);
}
foreach (var archive in archives)
{
WikiPage a = new WikiPage(archive.Key, archive.Value);
Console.Out.WriteLine("Saving " + a.Title + "...");
for (int i = 0; i < 5; ++i)
{
try
{
a.Save(wiki, string.Format("{0} ← [[{1}]]", L10i.UpdateComment, page.Title));
break;
}
catch (WikiException)
{
}
}
}
}