Files
PDFPatcher/App/Functions/Editor/Commands/SimpleBookmarkCommand.cs
T
2021-12-24 20:35:03 +08:00

40 lines
972 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using PDFPatcher.Common;
using PDFPatcher.Processor;
using System.Windows.Forms;
namespace PDFPatcher.Functions.Editor
{
sealed class SimpleBookmarkCommand<T> : IEditorCommand where T : IPdfInfoXmlProcessor, new ()
{
public void Process (Controller controller, params string[] parameters) {
var b = controller.View.Bookmark;
if (b.FocusedItem == null) {
return;
}
controller.ProcessBookmarks (new T ());
}
}
sealed class SimpleBookmarkCommand<T, P> : IEditorCommand where T : IPdfInfoXmlProcessor<P>, new ()
{
readonly P _parameter;
public SimpleBookmarkCommand (P parameter) {
_parameter = parameter;
}
public void Process (Controller controller, params string[] parameters) {
var b = controller.View.Bookmark;
if (b.FocusedItem == null) {
return;
}
controller.ProcessBookmarks (new T () { Parameter = _parameter });
}
}
}