|
@@ -281,32 +281,39 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
if (annotArgs != null)
|
|
|
annotArgs.Author = Settings.Default.AppProperties.Description.Author;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //创建,选中,保留上次属性值的注释
|
|
|
/// <summary>
|
|
|
/// 高亮注释
|
|
|
/// </summary>
|
|
|
private AnnotHandlerEventArgs GetHighLight(List<AnnotHandlerEventArgs> selectedArgs = null)
|
|
|
{
|
|
|
TextHighlightAnnotArgs highlightArgs = null;
|
|
|
-
|
|
|
if (selectedArgs == null || selectedArgs.Count == 0)
|
|
|
{
|
|
|
highlightArgs = new TextHighlightAnnotArgs();
|
|
|
highlightArgs.Transparency = highLightOpacity;
|
|
|
highlightArgs.Color = (highLightColor as SolidColorBrush).Color;
|
|
|
|
|
|
- var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(highlightArgs.EventType);
|
|
|
- if (defaultAnnot == null)
|
|
|
+ if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotHighlight] == null)
|
|
|
{
|
|
|
- defaultAnnot = new DefaultAnnotProperty();
|
|
|
- defaultAnnot.AnnotToolType = highlightArgs.EventType;
|
|
|
- defaultAnnot.ForgoundColor = (highLightColor as SolidColorBrush).Color;
|
|
|
- defaultAnnot.Opacity = 1;
|
|
|
- SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
- Settings.Default.Save();
|
|
|
+ var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(highlightArgs.EventType);
|
|
|
+ if (defaultAnnot == null)
|
|
|
+ {
|
|
|
+ defaultAnnot = new DefaultAnnotProperty();
|
|
|
+ defaultAnnot.AnnotToolType = highlightArgs.EventType;
|
|
|
+ defaultAnnot.ForgoundColor = (highLightColor as SolidColorBrush).Color;
|
|
|
+ defaultAnnot.Opacity = 1;
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
+
|
|
|
+ highLightOpacity = highlightArgs.Transparency = defaultAnnot.Opacity;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
|
|
|
- highLightOpacity = highlightArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ }
|
|
|
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
selectedArgs.Add(highlightArgs);
|
|
@@ -360,19 +367,21 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
underlineArgs = new TextUnderlineAnnotArgs();
|
|
|
underlineArgs.Transparency = UnderLineOpacity;
|
|
|
underlineArgs.Color = (UnderLineColor as SolidColorBrush).Color;
|
|
|
-
|
|
|
- var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(underlineArgs.EventType);
|
|
|
- if (defaultAnnot == null)
|
|
|
+ if(propertyPanel.LastAnnotDict[AnnotArgsType.AnnotUnderline] == null)
|
|
|
{
|
|
|
- defaultAnnot = new DefaultAnnotProperty();
|
|
|
- defaultAnnot.AnnotToolType = underlineArgs.EventType;
|
|
|
- defaultAnnot.ForgoundColor = (UnderLineColor as SolidColorBrush).Color;
|
|
|
- defaultAnnot.Opacity = 1;
|
|
|
- SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
- Settings.Default.Save();
|
|
|
- }
|
|
|
+ var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(underlineArgs.EventType);
|
|
|
+ if (defaultAnnot == null)
|
|
|
+ {
|
|
|
+ defaultAnnot = new DefaultAnnotProperty();
|
|
|
+ defaultAnnot.AnnotToolType = underlineArgs.EventType;
|
|
|
+ defaultAnnot.ForgoundColor = (UnderLineColor as SolidColorBrush).Color;
|
|
|
+ defaultAnnot.Opacity = 1;
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
|
|
|
- UnderLineOpacity = underlineArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ UnderLineOpacity = underlineArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ }
|
|
|
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
selectedArgs.Add(underlineArgs);
|
|
@@ -401,18 +410,21 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
squigglyArgs.Transparency = SquigglyOpacity;
|
|
|
squigglyArgs.Color = (squigglyColor as SolidColorBrush).Color;
|
|
|
|
|
|
- var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(squigglyArgs.EventType);
|
|
|
- if (defaultAnnot == null)
|
|
|
+ if(propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquiggly] == null)
|
|
|
{
|
|
|
- defaultAnnot = new DefaultAnnotProperty();
|
|
|
- defaultAnnot.AnnotToolType = squigglyArgs.EventType;
|
|
|
- defaultAnnot.ForgoundColor = (squigglyColor as SolidColorBrush).Color;
|
|
|
- defaultAnnot.Opacity = 1;
|
|
|
- SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
- Settings.Default.Save();
|
|
|
- }
|
|
|
+ var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(squigglyArgs.EventType);
|
|
|
+ if (defaultAnnot == null)
|
|
|
+ {
|
|
|
+ defaultAnnot = new DefaultAnnotProperty();
|
|
|
+ defaultAnnot.AnnotToolType = squigglyArgs.EventType;
|
|
|
+ defaultAnnot.ForgoundColor = (squigglyColor as SolidColorBrush).Color;
|
|
|
+ defaultAnnot.Opacity = 1;
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
|
|
|
- SquigglyOpacity = squigglyArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ SquigglyOpacity = squigglyArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ }
|
|
|
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
selectedArgs.Add(squigglyArgs);
|
|
@@ -441,18 +453,22 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
strikeoutArgs.Transparency = strikeoutOpacity;
|
|
|
strikeoutArgs.Color = (strikeoutColor as SolidColorBrush).Color;
|
|
|
|
|
|
- var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(strikeoutArgs.EventType);
|
|
|
- if (defaultAnnot == null)
|
|
|
+ if(propertyPanel.LastAnnotDict[AnnotArgsType.AnnotStrikeout] == null)
|
|
|
{
|
|
|
- defaultAnnot = new DefaultAnnotProperty();
|
|
|
- defaultAnnot.AnnotToolType = strikeoutArgs.EventType;
|
|
|
- defaultAnnot.ForgoundColor = (strikeoutColor as SolidColorBrush).Color;
|
|
|
- defaultAnnot.Opacity = 1;
|
|
|
- SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
- Settings.Default.Save();
|
|
|
- }
|
|
|
+ var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(strikeoutArgs.EventType);
|
|
|
+ if (defaultAnnot == null)
|
|
|
+ {
|
|
|
+ defaultAnnot = new DefaultAnnotProperty();
|
|
|
+ defaultAnnot.AnnotToolType = strikeoutArgs.EventType;
|
|
|
+ defaultAnnot.ForgoundColor = (strikeoutColor as SolidColorBrush).Color;
|
|
|
+ defaultAnnot.Opacity = 1;
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
|
|
|
- strikeoutArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ strikeoutArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
selectedArgs.Add(strikeoutArgs);
|
|
@@ -488,37 +504,45 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
freehandArgs.InkColor = Color.FromRgb(0x38, 0xE0, 0x2E);
|
|
|
}
|
|
|
|
|
|
- var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(freehandArgs.EventType);
|
|
|
- if (defaultAnnot == null)
|
|
|
+ if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreehand] == null)
|
|
|
{
|
|
|
- defaultAnnot = new DefaultAnnotProperty();
|
|
|
- defaultAnnot.AnnotToolType = freehandArgs.EventType;
|
|
|
- defaultAnnot.ForgoundColor = annotate.FreeHandColor;
|
|
|
- defaultAnnot.Opacity = 1;
|
|
|
- defaultAnnot.Thickness = 2;
|
|
|
- SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
- Settings.Default.Save();
|
|
|
- }
|
|
|
|
|
|
- freehandArgs.Transparency = defaultAnnot.Opacity;
|
|
|
- freehandArgs.LineWidth = defaultAnnot.Thickness;
|
|
|
+ var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(freehandArgs.EventType);
|
|
|
+ if (defaultAnnot == null)
|
|
|
+ {
|
|
|
+ defaultAnnot = new DefaultAnnotProperty();
|
|
|
+ defaultAnnot.AnnotToolType = freehandArgs.EventType;
|
|
|
+ defaultAnnot.ForgoundColor = annotate.FreeHandColor;
|
|
|
+ defaultAnnot.Opacity = 1;
|
|
|
+ defaultAnnot.Thickness = 2;
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
|
|
|
- if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
|
|
|
- {
|
|
|
- freehandArgs.LineDash = DashStyles.Solid;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var collect = new DoubleCollection();
|
|
|
- foreach (var item in defaultAnnot.DashArray)
|
|
|
+ freehandArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ freehandArgs.LineWidth = defaultAnnot.Thickness;
|
|
|
+
|
|
|
+ if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
|
|
|
{
|
|
|
- collect.Add(item);
|
|
|
+ freehandArgs.LineDash = DashStyles.Solid;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var collect = new DoubleCollection();
|
|
|
+ foreach (var item in defaultAnnot.DashArray)
|
|
|
+ {
|
|
|
+ collect.Add(item);
|
|
|
+ }
|
|
|
|
|
|
- if (freehandArgs.LineDash == null)
|
|
|
- freehandArgs.LineDash = new DashStyle();
|
|
|
+ if (freehandArgs.LineDash == null)
|
|
|
+ freehandArgs.LineDash = new DashStyle();
|
|
|
|
|
|
- freehandArgs.LineDash.Dashes = collect;
|
|
|
+ freehandArgs.LineDash.Dashes = collect;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ freehandArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreehand] as FreehandAnnotArgs;
|
|
|
}
|
|
|
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
@@ -561,45 +585,55 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
freetextArgs.FontColor = Colors.Black;
|
|
|
}
|
|
|
|
|
|
- var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(freetextArgs.EventType);
|
|
|
- if (defaultAnnot == null)
|
|
|
+ if(propertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreeText] == null)
|
|
|
{
|
|
|
- defaultAnnot = new DefaultAnnotProperty();
|
|
|
- defaultAnnot.AnnotToolType = freetextArgs.EventType;
|
|
|
- defaultAnnot.ForgoundColor = freetextArgs.FontColor;
|
|
|
- defaultAnnot.BorderColor = Colors.Transparent;
|
|
|
- defaultAnnot.BackgroundColor = Colors.Transparent;
|
|
|
- defaultAnnot.Opacity = 1;
|
|
|
- defaultAnnot.FontFamily = Settings.Default.AppProperties.Annotate.TextFontFamaily;
|
|
|
- defaultAnnot.FontSize = 14;
|
|
|
- defaultAnnot.TextAlign = TextAlignment.Left;
|
|
|
- defaultAnnot.Thickness = 0;
|
|
|
- defaultAnnot.NoteText = string.Empty;
|
|
|
- SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
- Settings.Default.Save();
|
|
|
- }
|
|
|
+ var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(freetextArgs.EventType);
|
|
|
+ if (defaultAnnot == null)
|
|
|
+ {
|
|
|
+ defaultAnnot = new DefaultAnnotProperty();
|
|
|
+ defaultAnnot.AnnotToolType = freetextArgs.EventType;
|
|
|
+ defaultAnnot.ForgoundColor = freetextArgs.FontColor;
|
|
|
+ defaultAnnot.BorderColor = Colors.Transparent;
|
|
|
+ defaultAnnot.BackgroundColor = Colors.Transparent;
|
|
|
+ defaultAnnot.Opacity = 1;
|
|
|
+ defaultAnnot.FontFamily = Settings.Default.AppProperties.Annotate.TextFontFamaily;
|
|
|
+ defaultAnnot.FontSize = 14;
|
|
|
+ defaultAnnot.TextAlign = TextAlignment.Left;
|
|
|
+ defaultAnnot.Thickness = 0;
|
|
|
+ defaultAnnot.NoteText = string.Empty;
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
|
|
|
- freetextArgs.FontColor = defaultAnnot.ForgoundColor;
|
|
|
- freetextArgs.LineColor = defaultAnnot.BorderColor;
|
|
|
- freetextArgs.BgColor = defaultAnnot.BackgroundColor;
|
|
|
- freetextArgs.Transparency = defaultAnnot.Opacity;
|
|
|
- freetextArgs.FontFamily = new FontFamily(defaultAnnot.FontFamily);
|
|
|
- freetextArgs.FontSize = defaultAnnot.FontSize;
|
|
|
- freetextArgs.FontWeight = defaultAnnot.FontWeight;
|
|
|
- freetextArgs.FontStyle = defaultAnnot.FontStyle;
|
|
|
- freetextArgs.LineWidth = defaultAnnot.Thickness;
|
|
|
+ freetextArgs.FontColor = defaultAnnot.ForgoundColor;
|
|
|
+ freetextArgs.LineColor = defaultAnnot.BorderColor;
|
|
|
+ freetextArgs.BgColor = defaultAnnot.BackgroundColor;
|
|
|
+ freetextArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ freetextArgs.FontFamily = new FontFamily(defaultAnnot.FontFamily);
|
|
|
+ freetextArgs.FontSize = defaultAnnot.FontSize;
|
|
|
+ freetextArgs.FontWeight = defaultAnnot.FontWeight;
|
|
|
+ freetextArgs.FontStyle = defaultAnnot.FontStyle;
|
|
|
+ freetextArgs.LineWidth = defaultAnnot.Thickness;
|
|
|
+
|
|
|
+ int align = (int)Settings.Default.AppProperties.Annotate.TextAlign;
|
|
|
+
|
|
|
+ if (align == 0)
|
|
|
+ textAlignment = TextAlignment.Left;
|
|
|
+ else if (align == 1)
|
|
|
+ textAlignment = TextAlignment.Center;
|
|
|
+ else
|
|
|
+ textAlignment = TextAlignment.Right;
|
|
|
|
|
|
- int align = (int)Settings.Default.AppProperties.Annotate.TextAlign;
|
|
|
+ freetextArgs.Align = textAlignment;
|
|
|
|
|
|
- if (align == 0)
|
|
|
- textAlignment = TextAlignment.Left;
|
|
|
- else if (align == 1)
|
|
|
- textAlignment = TextAlignment.Center;
|
|
|
- else
|
|
|
- textAlignment = TextAlignment.Right;
|
|
|
|
|
|
- freetextArgs.Align = textAlignment;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ freetextArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreeText] as FreeTextAnnotArgs;
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
if (freetextArgs != null)
|
|
|
{
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
@@ -671,18 +705,25 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
stickyAnnotArgs.Color = Color.FromRgb(0xFF, 0x81, 0x33);
|
|
|
}
|
|
|
|
|
|
- var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(stickyAnnotArgs.EventType);
|
|
|
- if (defaultAnnot == null)
|
|
|
+ if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSticky] == null)
|
|
|
{
|
|
|
- defaultAnnot = new DefaultAnnotProperty();
|
|
|
- defaultAnnot.AnnotToolType = stickyAnnotArgs.EventType;
|
|
|
- defaultAnnot.NoteText = string.Empty;
|
|
|
- defaultAnnot.Opacity = 1;
|
|
|
- SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
- Settings.Default.Save();
|
|
|
- }
|
|
|
+ var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(stickyAnnotArgs.EventType);
|
|
|
+ if (defaultAnnot == null)
|
|
|
+ {
|
|
|
+ defaultAnnot = new DefaultAnnotProperty();
|
|
|
+ defaultAnnot.AnnotToolType = stickyAnnotArgs.EventType;
|
|
|
+ defaultAnnot.NoteText = string.Empty;
|
|
|
+ defaultAnnot.Opacity = 1;
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
|
|
|
- stickyAnnotArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ stickyAnnotArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ stickyAnnotArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSticky] as StickyAnnotArgs;
|
|
|
+ }
|
|
|
|
|
|
if (stickyAnnotArgs != null)
|
|
|
{
|
|
@@ -727,6 +768,9 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
squareArgs.BgColor = Colors.Red;
|
|
|
}
|
|
|
|
|
|
+ if(propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquare] == null)
|
|
|
+ {
|
|
|
+
|
|
|
var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(squareArgs.EventType);
|
|
|
if (defaultAnnot == null)
|
|
|
{
|
|
@@ -759,6 +803,13 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
squareArgs.LineDash.Dashes = collect;
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ squareArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquare] as SquareAnnotArgs;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if (squareArgs != null)
|
|
|
{
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
@@ -798,40 +849,49 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
circleAnnotArgs.BgColor = Colors.Red;
|
|
|
}
|
|
|
|
|
|
- var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(circleAnnotArgs.EventType);
|
|
|
- if (defaultAnnot == null)
|
|
|
+ if(propertyPanel.LastAnnotDict[AnnotArgsType.AnnotCircle] == null)
|
|
|
{
|
|
|
- defaultAnnot = new DefaultAnnotProperty();
|
|
|
- defaultAnnot.AnnotToolType = circleAnnotArgs.EventType;
|
|
|
- defaultAnnot.Thickness = 1;
|
|
|
- defaultAnnot.Opacity = 1;
|
|
|
- defaultAnnot.NoteText = string.Empty;
|
|
|
- defaultAnnot.DashArray = null;
|
|
|
- SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
- Settings.Default.Save();
|
|
|
- }
|
|
|
+ var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(circleAnnotArgs.EventType);
|
|
|
+ if (defaultAnnot == null)
|
|
|
+ {
|
|
|
+ defaultAnnot = new DefaultAnnotProperty();
|
|
|
+ defaultAnnot.AnnotToolType = circleAnnotArgs.EventType;
|
|
|
+ defaultAnnot.Thickness = 1;
|
|
|
+ defaultAnnot.Opacity = 1;
|
|
|
+ defaultAnnot.NoteText = string.Empty;
|
|
|
+ defaultAnnot.DashArray = null;
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
|
|
|
- circleAnnotArgs.LineWidth = defaultAnnot.Thickness;
|
|
|
- circleAnnotArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ circleAnnotArgs.LineWidth = defaultAnnot.Thickness;
|
|
|
+ circleAnnotArgs.Transparency = defaultAnnot.Opacity;
|
|
|
|
|
|
- if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
|
|
|
- {
|
|
|
- circleAnnotArgs.LineDash = DashStyles.Solid;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var collect = new DoubleCollection();
|
|
|
- foreach (var item in defaultAnnot.DashArray)
|
|
|
+ if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
|
|
|
{
|
|
|
- collect.Add(item);
|
|
|
+ circleAnnotArgs.LineDash = DashStyles.Solid;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var collect = new DoubleCollection();
|
|
|
+ foreach (var item in defaultAnnot.DashArray)
|
|
|
+ {
|
|
|
+ collect.Add(item);
|
|
|
+ }
|
|
|
|
|
|
- if (circleAnnotArgs.LineDash == null)
|
|
|
- circleAnnotArgs.LineDash = new DashStyle();
|
|
|
+ if (circleAnnotArgs.LineDash == null)
|
|
|
+ circleAnnotArgs.LineDash = new DashStyle();
|
|
|
|
|
|
- circleAnnotArgs.LineDash.Dashes = collect;
|
|
|
+ circleAnnotArgs.LineDash.Dashes = collect;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ circleAnnotArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotCircle] as CircleAnnotArgs;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if (circleAnnotArgs != null)
|
|
|
{
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
@@ -870,48 +930,66 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
}
|
|
|
lineArgs.LineColor = Colors.Red;
|
|
|
lineArgs.HeadLineType = C_LINE_TYPE.LINETYPE_NONE;
|
|
|
+ bool isLastAnnot = false;
|
|
|
if (TagStr == "Line")
|
|
|
{
|
|
|
lineArgs.TailLineType = C_LINE_TYPE.LINETYPE_NONE;
|
|
|
+ isLastAnnot = (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotLine] != null ? true : false);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
lineArgs.TailLineType = C_LINE_TYPE.LINETYPE_ARROW;
|
|
|
+ isLastAnnot = (propertyPanel.LastArrowAnnot != null ? true : false);
|
|
|
}
|
|
|
|
|
|
- var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(lineArgs.EventType);
|
|
|
- if (defaultAnnot == null)
|
|
|
+ if(isLastAnnot == false)
|
|
|
{
|
|
|
- defaultAnnot = new DefaultAnnotProperty();
|
|
|
- defaultAnnot.AnnotToolType = lineArgs.EventType;
|
|
|
- defaultAnnot.Thickness = 1;
|
|
|
- defaultAnnot.Opacity = 1;
|
|
|
- defaultAnnot.NoteText = string.Empty;
|
|
|
- defaultAnnot.DashArray = null;
|
|
|
- SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
- Settings.Default.Save();
|
|
|
- }
|
|
|
-
|
|
|
- lineArgs.LineDash = DashStyles.Solid;
|
|
|
- lineArgs.LineWidth = defaultAnnot.Thickness;
|
|
|
- lineArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(lineArgs.EventType);
|
|
|
+ if (defaultAnnot == null)
|
|
|
+ {
|
|
|
+ defaultAnnot = new DefaultAnnotProperty();
|
|
|
+ defaultAnnot.AnnotToolType = lineArgs.EventType;
|
|
|
+ defaultAnnot.Thickness = 1;
|
|
|
+ defaultAnnot.Opacity = 1;
|
|
|
+ defaultAnnot.NoteText = string.Empty;
|
|
|
+ defaultAnnot.DashArray = null;
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
|
|
|
- if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
|
|
|
- {
|
|
|
lineArgs.LineDash = DashStyles.Solid;
|
|
|
+ lineArgs.LineWidth = defaultAnnot.Thickness;
|
|
|
+ lineArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+
|
|
|
+ if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
|
|
|
+ {
|
|
|
+ lineArgs.LineDash = DashStyles.Solid;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var collect = new DoubleCollection();
|
|
|
+ foreach (var item in defaultAnnot.DashArray)
|
|
|
+ {
|
|
|
+ collect.Add(item);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lineArgs.LineDash == null)
|
|
|
+ lineArgs.LineDash = new DashStyle();
|
|
|
+
|
|
|
+ lineArgs.LineDash.Dashes = collect;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- var collect = new DoubleCollection();
|
|
|
- foreach (var item in defaultAnnot.DashArray)
|
|
|
+ if (lineArgs.TailLineType == C_LINE_TYPE.LINETYPE_ARROW)
|
|
|
{
|
|
|
- collect.Add(item);
|
|
|
+ lineArgs = propertyPanel.LastArrowAnnot as LineAnnotArgs;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lineArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotLine] as LineAnnotArgs;
|
|
|
}
|
|
|
-
|
|
|
- if (lineArgs.LineDash == null)
|
|
|
- lineArgs.LineDash = new DashStyle();
|
|
|
-
|
|
|
- lineArgs.LineDash.Dashes = collect;
|
|
|
}
|
|
|
|
|
|
if (lineArgs != null)
|