Files
PDFPatcher/App/Functions/Editor/Commands/BookmarkStyleCommand.cs
T
2022-01-06 09:08:16 +08:00

29 lines
646 B
C#

using System;
using BrightIdeasSoftware;
using PDFPatcher.Processor;
namespace PDFPatcher.Functions.Editor
{
sealed class BookmarkStyleCommand : IEditorCommand
{
readonly SetTextStyleProcessor.Style _style;
public BookmarkStyleCommand(SetTextStyleProcessor.Style style) {
_style = style;
}
public void Process(Controller controller, params string[] parameters) {
var b = controller.View.Bookmark;
if (b.FocusedItem == null) {
return;
}
var i = b.GetFirstSelectedModel<Model.BookmarkElement>();
if (i == null) {
return;
}
controller.ProcessBookmarks(new SetTextStyleProcessor(i, _style));
}
}
}