using PaintDotNet.Measurement.HistoryMementos; using System.Drawing.Drawing2D; namespace PaintDotNet.Measurement.HistoryFunctions { public sealed class SelectAllFunction : HistoryFunction { public static string StaticName { get { return PdnResources.GetString("SelectAllAction.Name"); } } public override HistoryMemento OnExecute(IDocumentWorkspace historyWorkspace) { SelectionHistoryMemento sha = new SelectionHistoryMemento( StaticName, PdnResources.GetImageResource("Icons.MenuEditSelectAllIcon.png"), historyWorkspace); EnterCriticalRegion(); historyWorkspace.GetSelection().PerformChanging(); historyWorkspace.GetSelection().Reset(); historyWorkspace.GetSelection().SetContinuation(historyWorkspace.GetDocument().Bounds, CombineMode.Replace); historyWorkspace.GetSelection().CommitContinuation(); historyWorkspace.GetSelection().PerformChanged(); return sha; } public SelectAllFunction() : base(PaintDotNet.Measurement.Enum.ActionFlags.None) { } } }