|
@@ -187,8 +187,8 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
ToolExpandDict.Add("Link", AnnotArgsType.AnnotLink);
|
|
|
ToolExpandDict.Add("Stamp", AnnotArgsType.AnnotStamp);
|
|
|
}
|
|
|
-
|
|
|
- //注释工具按钮悬浮文案
|
|
|
+
|
|
|
+ //注释工具按钮悬浮文案
|
|
|
private void InitToolTipDict()
|
|
|
{
|
|
|
//原来文案
|
|
@@ -309,6 +309,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
break;
|
|
|
}
|
|
|
break;
|
|
|
+
|
|
|
case "RectKey":
|
|
|
//选中时需设置以及点击图形按钮选中("Rect"->即代表按钮标识有代表矩形图案(将快捷键矩形改名为RectKey))
|
|
|
StrAnnotToolChecked = "Rect";
|
|
@@ -371,56 +372,6 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
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;
|
|
|
-
|
|
|
- if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotHighlight] == null)
|
|
|
- {
|
|
|
- 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();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- (HighLightColor as SolidColorBrush).Color = defaultAnnot.ForgoundColor;
|
|
|
-
|
|
|
- highlightArgs.Color = defaultAnnot.ForgoundColor;
|
|
|
- }
|
|
|
- highLightOpacity = highlightArgs.Transparency = defaultAnnot.Opacity;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
- selectedArgs.Add(highlightArgs);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- highlightArgs = selectedArgs[0] as TextHighlightAnnotArgs;
|
|
|
- HighLightColor =new SolidColorBrush( highlightArgs.Color);
|
|
|
- HighLightOpacity=highlightArgs.Transparency;
|
|
|
- }
|
|
|
- AddToPropertyPanel("TextAnnotProperty", "HighLight", selectedArgs);
|
|
|
- return highlightArgs;
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 链接
|
|
|
/// </summary>
|
|
@@ -462,6 +413,69 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
return linkArgs;
|
|
|
}
|
|
|
|
|
|
+ //创建,选中,保留上次属性值的注释
|
|
|
+ /// <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;
|
|
|
+
|
|
|
+ if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotHighlight] == null)
|
|
|
+ {
|
|
|
+ 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;
|
|
|
+ HighLightOpacity = defaultAnnot.Opacity;
|
|
|
+ HighLightColor = new SolidColorBrush(defaultAnnot.ForgoundColor);
|
|
|
+ SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // (HighLightColor as SolidColorBrush).Color = defaultAnnot.ForgoundColor;
|
|
|
+
|
|
|
+ // highlightArgs.Color = defaultAnnot.ForgoundColor;
|
|
|
+ //}
|
|
|
+ //HighLightOpacity = highlightArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ highlightArgs.Color = defaultAnnot.ForgoundColor;
|
|
|
+ highlightArgs.Transparency = defaultAnnot.Opacity;
|
|
|
+ }
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // TextHighlightAnnotArgs annotArgs = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotHighlight] as TextHighlightAnnotArgs;
|
|
|
+ // highlightArgs = new TextHighlightAnnotArgs();
|
|
|
+ // highlightArgs.Color = annotArgs.Color;
|
|
|
+ // highlightArgs.Transparency = annotArgs.Transparency;
|
|
|
+ // HighLightColor = new SolidColorBrush(highlightArgs.Color);
|
|
|
+ // HighLightOpacity = highlightArgs.Transparency;
|
|
|
+ //}
|
|
|
+ selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
+ highlightArgs.Color = (HighLightColor as SolidColorBrush).Color;
|
|
|
+ highlightArgs.Transparency = HighLightOpacity;
|
|
|
+ selectedArgs.Add(highlightArgs);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ highlightArgs = selectedArgs[0] as TextHighlightAnnotArgs;
|
|
|
+ HighLightColor = new SolidColorBrush(highlightArgs.Color);
|
|
|
+ HighLightOpacity = highlightArgs.Transparency;
|
|
|
+ }
|
|
|
+ selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
+ selectedArgs.Add(highlightArgs);
|
|
|
+ AddToPropertyPanel("TextAnnotProperty", "HighLight", selectedArgs);
|
|
|
+ return highlightArgs;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 下划线
|
|
|
/// </summary>
|
|
@@ -484,26 +498,30 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
defaultAnnot.AnnotToolType = underlineArgs.EventType;
|
|
|
defaultAnnot.ForgoundColor = (UnderLineColor as SolidColorBrush).Color;
|
|
|
defaultAnnot.Opacity = 1;
|
|
|
+ UnderLineOpacity = defaultAnnot.Opacity;
|
|
|
+ UnderLineColor = new SolidColorBrush(defaultAnnot.ForgoundColor);
|
|
|
SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
Settings.Default.Save();
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
underlineArgs.Color = defaultAnnot.ForgoundColor;
|
|
|
- UnderLineOpacity = underlineArgs.Transparency = defaultAnnot.Opacity;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ underlineArgs.Transparency = defaultAnnot.Opacity;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
- selectedArgs.Add(underlineArgs);
|
|
|
+ underlineArgs.Color = (UnderLineColor as SolidColorBrush).Color;
|
|
|
+ underlineArgs.Transparency = UnderLineOpacity;
|
|
|
+ selectedArgs.Add(underlineArgs);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
underlineArgs = selectedArgs[0] as TextUnderlineAnnotArgs;
|
|
|
- UnderLineColor=new SolidColorBrush(underlineArgs.Color);
|
|
|
- underLineOpacity = underlineArgs.Transparency;
|
|
|
+ UnderLineColor = new SolidColorBrush(underlineArgs.Color);
|
|
|
+ UnderLineOpacity = underlineArgs.Transparency;
|
|
|
}
|
|
|
-
|
|
|
+ //selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
+ //selectedArgs.Add(underlineArgs);
|
|
|
AddToPropertyPanel("TextAnnotProperty", "UnderLine", selectedArgs);
|
|
|
return underlineArgs;
|
|
|
}
|
|
@@ -563,8 +581,8 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
if (selectedArgs == null || selectedArgs.Count == 0)
|
|
|
{
|
|
|
strikeoutArgs = new TextStrikeoutAnnotArgs();
|
|
|
- strikeoutArgs.Transparency = strikeoutOpacity;
|
|
|
- strikeoutArgs.Color = (strikeoutColor as SolidColorBrush).Color;
|
|
|
+ strikeoutArgs.Transparency = StrikeoutOpacity;
|
|
|
+ strikeoutArgs.Color = (StrikeoutColor as SolidColorBrush).Color;
|
|
|
|
|
|
if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotStrikeout] == null)
|
|
|
{
|
|
@@ -573,23 +591,27 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
{
|
|
|
defaultAnnot = new DefaultAnnotProperty();
|
|
|
defaultAnnot.AnnotToolType = strikeoutArgs.EventType;
|
|
|
- defaultAnnot.ForgoundColor = (strikeoutColor as SolidColorBrush).Color;
|
|
|
+ defaultAnnot.ForgoundColor = (StrikeoutColor as SolidColorBrush).Color;
|
|
|
defaultAnnot.Opacity = 1;
|
|
|
+ StrikeoutOpacity = defaultAnnot.Opacity;
|
|
|
+ StrikeoutColor = new SolidColorBrush(defaultAnnot.ForgoundColor);
|
|
|
SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
|
|
|
Settings.Default.Save();
|
|
|
}
|
|
|
- strikeoutArgs.Color =defaultAnnot.ForgoundColor;
|
|
|
+ strikeoutArgs.Color = defaultAnnot.ForgoundColor;
|
|
|
strikeoutArgs.Transparency = defaultAnnot.Opacity;
|
|
|
}
|
|
|
|
|
|
selectedArgs = new List<AnnotHandlerEventArgs>();
|
|
|
+ strikeoutArgs.Color = (StrikeoutColor as SolidColorBrush).Color;
|
|
|
+ strikeoutArgs.Transparency = StrikeoutOpacity;
|
|
|
selectedArgs.Add(strikeoutArgs);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
strikeoutArgs = selectedArgs[0] as TextStrikeoutAnnotArgs;
|
|
|
- StrikeoutColor=new SolidColorBrush(strikeoutArgs.Color);
|
|
|
- StrikeoutOpacity=strikeoutArgs.Transparency;
|
|
|
+ StrikeoutColor = new SolidColorBrush(strikeoutArgs.Color);
|
|
|
+ StrikeoutOpacity = strikeoutArgs.Transparency;
|
|
|
}
|
|
|
|
|
|
AddToPropertyPanel("TextAnnotProperty", "Strikeout", selectedArgs);
|
|
@@ -732,7 +754,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
freetextArgs.FontWeight = defaultAnnot.FontWeight;
|
|
|
freetextArgs.FontStyle = defaultAnnot.FontStyle;
|
|
|
freetextArgs.LineWidth = defaultAnnot.Thickness;
|
|
|
- freetextArgs.BgColor= defaultAnnot.BackgroundColor;
|
|
|
+ freetextArgs.BgColor = defaultAnnot.BackgroundColor;
|
|
|
int align = (int)Settings.Default.AppProperties.Annotate.TextAlign;
|
|
|
|
|
|
if (align == 0)
|
|
@@ -1336,12 +1358,12 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
AddToPropertyPanel("StampAnnotProperty", null, stampAnnotArgsList);
|
|
|
return stampAnnotArgs;
|
|
|
}
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
-
|
|
|
+ viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
+
|
|
|
return stampAnnotArgs;
|
|
|
}
|
|
|
//已选中注释工具的前提下,选中页面已经添加的图章注释时,右侧属性面板显示空状态(不自动收起)
|
|
|
- if (StrAnnotToolChecked != "Stamp" && string.IsNullOrEmpty(StrAnnotToolChecked)==false)
|
|
|
+ if (StrAnnotToolChecked != "Stamp" && string.IsNullOrEmpty(StrAnnotToolChecked) == false)
|
|
|
{
|
|
|
viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
ShowPropertyPanel(true);
|