12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using PaintDotNet.Measurement.HistoryMementos;
- namespace PaintDotNet.Measurement.HistoryFunctions
- {
- public sealed class DeselectFunction : HistoryFunction
- {
- public static string StaticName
- {
- get
- {
- return PdnResources.GetString("DeselectAction.Name");
- }
- }
- public static ImageResource StaticImage
- {
- get
- {
- return PdnResources.GetImageResource("Icons.MenuEditDeselectIcon.png");
- }
- }
- public override HistoryMemento OnExecute(IDocumentWorkspace historyWorkspace)
- {
- if (historyWorkspace.GetSelection().IsEmpty)
- {
- return null;
- }
- else
- {
- SelectionHistoryMemento sha = new SelectionHistoryMemento(StaticName, StaticImage, historyWorkspace);
- EnterCriticalRegion();
- historyWorkspace.GetSelection().Reset();
- return sha;
- }
- }
- public DeselectFunction()
- : base(PaintDotNet.Measurement.Enum.ActionFlags.None)
- {
- }
- }
- }
|