mirror of
https://github.com/wmjordan/PDFPatcher.git
synced 2026-10-18 21:52:34 +08:00
7d279bc324
!重构代码
49 lines
1.0 KiB
C#
49 lines
1.0 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Windows.Forms;
|
|
using PDFPatcher.Model;
|
|
|
|
namespace PDFPatcher.Functions
|
|
{
|
|
[ToolboxItem(false)]
|
|
sealed partial class FontNameConditionEditor : UserControl, IFilterConditionEditor
|
|
{
|
|
AutoBookmarkCondition.FontNameCondition _filter;
|
|
bool _lock;
|
|
|
|
public FontNameConditionEditor() {
|
|
InitializeComponent();
|
|
}
|
|
|
|
#region ITextInfoFilterEditor 成员
|
|
public UserControl EditorControl => this;
|
|
|
|
public AutoBookmarkCondition Filter {
|
|
get => _filter;
|
|
set {
|
|
_filter = (AutoBookmarkCondition.FontNameCondition)value;
|
|
_lock = true;
|
|
_FontNameBox.Text = _filter.FontName;
|
|
_FullMatchBox.Checked = _filter.MatchFullName;
|
|
_lock = false;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
void ControlChanged(object sender, EventArgs e) {
|
|
if (_lock) {
|
|
return;
|
|
}
|
|
|
|
if (sender == _FontNameBox) {
|
|
_filter.FontName = _FontNameBox.Text;
|
|
}
|
|
else if (sender == _FullMatchBox) {
|
|
_filter.MatchFullName = _FullMatchBox.Checked;
|
|
}
|
|
EditAdjustmentForm.UpdateFilter(this);
|
|
}
|
|
}
|
|
}
|