|
@@ -187,6 +187,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
customStamp.Type = stamps[i].Type;
|
|
|
customStamp.TextSharp = stamps[i].TextSharp;
|
|
|
customStamp.TextColor = stamps[i].TextColor;
|
|
|
+ customStamp.IsCheckedTime = stamps[i].IsCheckedTime;
|
|
|
+ customStamp.IsCheckedDate = stamps[i].IsCheckedDate;
|
|
|
CustomStampList.Add(customStamp);
|
|
|
}
|
|
|
}
|
|
@@ -329,6 +331,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
standardStamp.MaxHeight = (int)DpiHelpers.GetDpiUnrelatedNum(stampHeight / 72D * DpiHelpers.Dpi);
|
|
|
standardStamp.Type = StampType.TEXT_STAMP;
|
|
|
standardStamp.ImageSource = bps;
|
|
|
+ standardStamp.IsCheckedDate = true;
|
|
|
+ standardStamp.IsCheckedTime = true;
|
|
|
switch (DynamicColor[i])
|
|
|
{
|
|
|
case C_TEXTSTAMP_COLOR.TEXTSTAMP_WHITE:
|
|
@@ -423,7 +427,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
ShowDynamicPropertyDialog();
|
|
|
break;
|
|
|
case 2:
|
|
|
- ShowCustomCreateDialog();
|
|
|
+ ShowCustomCreateDialog(null);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -455,11 +459,11 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void ShowCustomCreateDialog()
|
|
|
+ private void ShowCustomCreateDialog(Stamp stamp)
|
|
|
{
|
|
|
bool result = true;
|
|
|
DialogParameters value = new DialogParameters();
|
|
|
- value.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
+ value.Add(ParameterNames.DataModel, stamp);
|
|
|
dialogs.ShowDialog(DialogNames.CustomCreateDialog, value, e =>
|
|
|
{
|
|
|
if (e.Result != ButtonResult.OK)
|
|
@@ -478,6 +482,69 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void EditorCustomStamp(Stamp stamp)
|
|
|
+ {
|
|
|
+ bool result = true;
|
|
|
+ DialogParameters value = new DialogParameters();
|
|
|
+ value.Add(ParameterNames.DataModel, stamp);
|
|
|
+ dialogs.ShowDialog(DialogNames.CustomCreateDialog, value, e =>
|
|
|
+ {
|
|
|
+ if (e.Result != ButtonResult.OK)
|
|
|
+ {
|
|
|
+ result = false;
|
|
|
+ }
|
|
|
+ CustomCreateDialogViewModel CustomVM = e.Parameters.GetValue<CustomCreateDialogViewModel>(ParameterNames.DataModel);
|
|
|
+ if (CustomVM != null)
|
|
|
+ {
|
|
|
+ UpDataCustomStamp(CustomVM, stamp);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (!result)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void UpDataCustomStamp(CustomCreateDialogViewModel viewModel, Stamp oldstamp)
|
|
|
+ {
|
|
|
+ Stamp stamp = new Stamp();
|
|
|
+ stamp.Author = "";
|
|
|
+ stamp.Opacity = 1;
|
|
|
+ stamp.SourcePath = viewModel.SaveToPath;
|
|
|
+ stamp.StampText = viewModel.StampText;
|
|
|
+ stamp.MaxWidth = (int)DpiHelpers.GetDpiUnrelatedNum(viewModel.StampWidth / 72D * DpiHelpers.Dpi);
|
|
|
+ stamp.MaxHeight = (int)DpiHelpers.GetDpiUnrelatedNum(viewModel.StampHeight / 72D * DpiHelpers.Dpi);
|
|
|
+ stamp.StampTextDate = viewModel.StampTextDate;
|
|
|
+ stamp.Type = viewModel.Type;
|
|
|
+ stamp.TextColor = (TextStampColor)(int)viewModel.Color;
|
|
|
+ stamp.TextSharp = (TextStampSharp)(int)viewModel.Shape;
|
|
|
+ stamp.IsCheckedDate = viewModel.IsCheckedDate;
|
|
|
+ stamp.IsCheckedTime = viewModel.IsCheckedTime;
|
|
|
+ int index= CustomStampList.IndexOf(oldstamp);
|
|
|
+ CustomStampList[index] = stamp;
|
|
|
+
|
|
|
+ PDFSettings.CustomStampList stamps = Settings.Default.CustomStampList;
|
|
|
+ if (stamps == null)
|
|
|
+ {
|
|
|
+ stamps = Settings.Default.CustomStampList = new PDFSettings.CustomStampList();
|
|
|
+ }
|
|
|
+ PDFSettings.StampAnnote annote = new PDFSettings.StampAnnote();
|
|
|
+ Stamp customStamp = new Stamp();
|
|
|
+ annote.Author = stamp.Author;
|
|
|
+ annote.StampText = stamp.StampText;
|
|
|
+ annote.StampTextDate = stamp.StampTextDate;
|
|
|
+ annote.ImageWidth = stamp.MaxWidth;
|
|
|
+ annote.ImageHeight = stamp.MaxHeight;
|
|
|
+ annote.SourcePath = stamp.SourcePath;
|
|
|
+ annote.Type = stamp.Type;
|
|
|
+ annote.TextSharp = stamp.TextSharp;
|
|
|
+ annote.TextColor = stamp.TextColor;
|
|
|
+ annote.IsCheckedDate = stamp.IsCheckedDate;
|
|
|
+ annote.IsCheckedTime = stamp.IsCheckedTime;
|
|
|
+ stamps[index] = annote;
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 创建自定义图章,并且保存到APP缓存
|
|
|
/// </summary>
|
|
@@ -494,6 +561,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
stamp.Type = viewModel.Type;
|
|
|
stamp.TextColor = (TextStampColor)(int)viewModel.Color;
|
|
|
stamp.TextSharp = (TextStampSharp)(int)viewModel.Shape;
|
|
|
+ stamp.IsCheckedDate = viewModel.IsCheckedDate;
|
|
|
+ stamp.IsCheckedTime = viewModel.IsCheckedTime;
|
|
|
CustomStampList.Add(stamp);
|
|
|
|
|
|
PDFSettings.CustomStampList stamps = Settings.Default.CustomStampList;
|
|
@@ -512,6 +581,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
annote.Type = stamp.Type;
|
|
|
annote.TextSharp = stamp.TextSharp;
|
|
|
annote.TextColor = stamp.TextColor;
|
|
|
+ annote.IsCheckedDate = stamp.IsCheckedDate;
|
|
|
+ annote.IsCheckedTime = stamp.IsCheckedTime;
|
|
|
stamps.Add(annote);
|
|
|
Settings.Default.Save();
|
|
|
}
|