|
@@ -138,6 +138,23 @@ namespace PDF_Office.ViewModels.Dialog.Redaction
|
|
|
set
|
|
|
{
|
|
|
SetProperty(ref fontFamilySelectedIndex, value);
|
|
|
+ if(value>0)
|
|
|
+ {
|
|
|
+ switch (value)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ fontFamily = "Courier";
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ fontFamily = "Helvetica";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ fontFamily = "Times Roman";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -151,11 +168,33 @@ namespace PDF_Office.ViewModels.Dialog.Redaction
|
|
|
set
|
|
|
{
|
|
|
SetProperty(ref fontWeightSelectedIndex, value);
|
|
|
+ if (value > 0)
|
|
|
+ {
|
|
|
+ switch (value)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ fontWeight = FontWeights.Regular;
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ fontWeight = FontWeights.Bold;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ fontWeight = FontWeights.SemiBold;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ fontWeight = FontWeights.UltraBold;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private FontWeight fontWeight = FontWeights.Regular;
|
|
|
|
|
|
+ private int fontSize = 12;
|
|
|
+
|
|
|
private int fontSizeSelectedIndex;
|
|
|
|
|
|
public int FontSizeSelectedIndex
|
|
@@ -173,6 +212,8 @@ namespace PDF_Office.ViewModels.Dialog.Redaction
|
|
|
|
|
|
public List<string> FontSizes { get; set; }
|
|
|
|
|
|
+ public TextAlignment textAlignment { get; set; } = TextAlignment.Left;
|
|
|
+
|
|
|
|
|
|
|
|
|
public MarkSettingDialogViewModel()
|
|
@@ -188,6 +229,7 @@ namespace PDF_Office.ViewModels.Dialog.Redaction
|
|
|
|
|
|
private void InitFontFamily()
|
|
|
{
|
|
|
+ FontFamilys = new List<string>();
|
|
|
FontFamilys.Add("Courier New");
|
|
|
FontFamilys.Add("Arial");
|
|
|
FontFamilys.Add("Times New Roman");
|
|
@@ -195,6 +237,7 @@ namespace PDF_Office.ViewModels.Dialog.Redaction
|
|
|
|
|
|
private void InitFontWeight()
|
|
|
{
|
|
|
+ FontWeight = new List<string>();
|
|
|
FontWeight.Add("Regular");
|
|
|
FontWeight.Add("Bold");
|
|
|
FontWeight.Add("Italic");
|
|
@@ -203,6 +246,7 @@ namespace PDF_Office.ViewModels.Dialog.Redaction
|
|
|
|
|
|
private void InitFontSize()
|
|
|
{
|
|
|
+ FontSizes = new List<string>();
|
|
|
FontSizes.Add("Auto");
|
|
|
}
|
|
|
|
|
@@ -213,26 +257,44 @@ namespace PDF_Office.ViewModels.Dialog.Redaction
|
|
|
|
|
|
private void ok()
|
|
|
{
|
|
|
- //annotArgs.UpdateAttrib(AnnotAttrib.FillColor, frm.SaveredactionArgs.BgColor);
|
|
|
- //annotArgs.UpdateAttrib(AnnotAttrib.NoteText, frm.SaveredactionArgs.Content);
|
|
|
- //annotArgs.UpdateAttrib(AnnotAttrib.FontColor, frm.SaveredactionArgs.FontColor);
|
|
|
+ AnnotAttribEvent eventargs = AnnotAttribEvent.GetAnnotAttribEvent(annotArgs, annotArgs.GetAnnotAttrib());
|
|
|
+ eventargs.UpdateAttrib(AnnotAttrib.FillColor,BgColor);
|
|
|
+ eventargs.UpdateAttrib(AnnotAttrib.NoteText, OvertText);
|
|
|
+ eventargs.UpdateAttrib(AnnotAttrib.FontColor,FontColor);
|
|
|
|
|
|
- //annotArgs.UpdateAttrib(AnnotAttrib.Color, frm.SaveredactionArgs.LineColor);
|
|
|
+ eventargs.UpdateAttrib(AnnotAttrib.Color, LineColor);
|
|
|
|
|
|
- //annotArgs.UpdateAttrib(AnnotAttrib.FontSize, frm.SaveredactionArgs.FontSize);
|
|
|
+ eventargs.UpdateAttrib(AnnotAttrib.FontSize,fontSize);
|
|
|
|
|
|
- //annotArgs.UpdateAttrib(AnnotAttrib.TextAlign, frm.SaveredactionArgs.Align);
|
|
|
- //if (IsUseText)
|
|
|
- //{
|
|
|
- // annotArgs.UpdateAttrib(AnnotAttrib.NoteText, string.Empty);
|
|
|
- //}
|
|
|
- //annotArgs.UpdateAnnot();
|
|
|
+ eventargs.UpdateAttrib(AnnotAttrib.TextAlign, textAlignment);
|
|
|
+ eventargs.UpdateAttrib(AnnotAttrib.FontWeight, fontWeight);
|
|
|
+ if (IsUseText)
|
|
|
+ {
|
|
|
+ eventargs.UpdateAttrib(AnnotAttrib.NoteText, string.Empty);
|
|
|
+ }
|
|
|
+ eventargs.UpdateAnnot();
|
|
|
RequestClose.Invoke(new DialogResult(ButtonResult.OK));
|
|
|
}
|
|
|
|
|
|
private void align(string tag)
|
|
|
{
|
|
|
-
|
|
|
+ switch (tag)
|
|
|
+ {
|
|
|
+ case "Left":
|
|
|
+ textAlignment = TextAlignment.Left;
|
|
|
+ break;
|
|
|
+ case "Center":
|
|
|
+ textAlignment = TextAlignment.Center;
|
|
|
+ break;
|
|
|
+ case "Right":
|
|
|
+ textAlignment = TextAlignment.Right;
|
|
|
+ break;
|
|
|
+ case "Strech":
|
|
|
+ textAlignment = TextAlignment.Justify;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public bool CanCloseDialog()
|
|
@@ -256,20 +318,36 @@ namespace PDF_Office.ViewModels.Dialog.Redaction
|
|
|
OvertText = annotArgs.Content;
|
|
|
switch (annotArgs.FontFamily.ToString())
|
|
|
{
|
|
|
- case "":
|
|
|
- FontFamilySelectedIndex = 0;
|
|
|
- break;
|
|
|
- case "1":
|
|
|
+
|
|
|
+ case "Helvetica":
|
|
|
FontFamilySelectedIndex = 1;
|
|
|
break;
|
|
|
- case "2":
|
|
|
+ case "Times Roman":
|
|
|
FontFamilySelectedIndex = 2;
|
|
|
break;
|
|
|
default:
|
|
|
+ case "Courier":
|
|
|
+ FontFamilySelectedIndex = 0;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ switch (annotArgs.Align)
|
|
|
+ {
|
|
|
+ case TextAlignment.Left:
|
|
|
+ LeftChecked = true;
|
|
|
+ break;
|
|
|
+ case TextAlignment.Right:
|
|
|
+ RightChecked = true;
|
|
|
+ break;
|
|
|
+ case TextAlignment.Center:
|
|
|
+ CenterChecked = true;
|
|
|
+ break;
|
|
|
+ case TextAlignment.Justify:
|
|
|
+ StrechChecked = true;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|