using System;
using System.Collections.Generic;
using System.Text;
using ScrewTurn.Wiki.PluginFramework;
namespace ScrewTurn.Wiki {
///
/// Manages the Wiki's Recent Changes.
///
public static class RecentChanges {
///
/// Gets all the changes, sorted by date/time ascending.
///
public static RecentChange[] GetAllChanges() {
RecentChange[] changes = Settings.Provider.GetRecentChanges();
RecentChange[] myCopy = new RecentChange[changes.Length];
Array.Copy(changes, myCopy, changes.Length);
Array.Sort(myCopy, (x, y) => { return x.DateTime.CompareTo(y.DateTime); });
return myCopy;
}
///
/// Adds a new change.
///
/// The page name.
/// The page title.
/// The message subject.
/// The date/time.
/// The user.
/// The change.
/// The description (optional).
public static void AddChange(string page, string title, string messageSubject, DateTime dateTime, string user, Change change, string descr) {
Settings.Provider.AddRecentChange(page, title, messageSubject, dateTime, user, change, descr);
}
}
}