|
@@ -27,8 +27,6 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
|
|
|
public sealed partial class AnnotToolContentViewModel : BindableBase, INavigationAware
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
|
|
|
public AnnotToolContentViewModel(IRegionManager regionManager)
|
|
|
{
|
|
@@ -36,6 +34,7 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
|
|
|
MyToolsCommand = new DelegateCommand<CustomIconToggleBtn>(BtnMyTools_Click);
|
|
|
PropertyRegionName = Guid.NewGuid().ToString();
|
|
|
+ BindingEvent();
|
|
|
InitDefaultValue();
|
|
|
}
|
|
|
|
|
@@ -43,12 +42,8 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
private Dictionary<string, bool> ToolExpandDict = new Dictionary<string, bool>();
|
|
|
public void BtnMyTools_Click(CustomIconToggleBtn annotBtn)
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
if(annotBtn.IsChecked == true)
|
|
|
{
|
|
|
- Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
|
|
|
-
|
|
|
AnnotHandlerEventArgs annotArgs = null;
|
|
|
|
|
|
switch (annotBtn.Tag.ToString())
|
|
@@ -56,479 +51,59 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
case "SnapshotEdit":
|
|
|
break;
|
|
|
|
|
|
- case "HighLight":
|
|
|
- {
|
|
|
- TextHighlightAnnotArgs highlightArgs = new TextHighlightAnnotArgs();
|
|
|
- highlightArgs.Color = Color.FromRgb(0xFF, 0xBB, 0x00);
|
|
|
- highlightArgs.Transparency = 0.5;
|
|
|
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotHighlight);
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- highlightArgs.Color = annotProperty.ForgoundColor;
|
|
|
- highlightArgs.Transparency = annotProperty.Opacity;
|
|
|
- highlightArgs.Content = annotProperty.NoteText;
|
|
|
- }
|
|
|
- annotAttribsList[AnnotAttrib.Color] = highlightArgs.Color;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = highlightArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = string.Empty;
|
|
|
- annotArgs = highlightArgs;
|
|
|
-
|
|
|
- if (!ToolExpandDict.ContainsKey("HighLight"))
|
|
|
- {
|
|
|
- ToolExpandDict["HighLight"] = true;
|
|
|
- }
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = highlightArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("TextAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ case "HighLight":
|
|
|
+ annotArgs = GetHighLight();
|
|
|
break;
|
|
|
|
|
|
case "UnderLine":
|
|
|
- {
|
|
|
- TextUnderlineAnnotArgs underlineArgs = new TextUnderlineAnnotArgs();
|
|
|
- underlineArgs.Color = Color.FromRgb(0x12, 0xFD, 0xFF);
|
|
|
- underlineArgs.Transparency = 1;
|
|
|
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotUnderline);
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- underlineArgs.Color = annotProperty.ForgoundColor;
|
|
|
- underlineArgs.Transparency = annotProperty.Opacity;
|
|
|
- underlineArgs.Content = annotProperty.NoteText;
|
|
|
- }
|
|
|
- annotAttribsList[AnnotAttrib.Color] = underlineArgs.Color;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = underlineArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = string.Empty;
|
|
|
- annotArgs = underlineArgs;
|
|
|
- if (!ToolExpandDict.ContainsKey("UnderLine"))
|
|
|
- {
|
|
|
- ToolExpandDict["UnderLine"] = true;
|
|
|
- }
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = underlineArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("TextAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
+ annotArgs = GetUnderLine();
|
|
|
break;
|
|
|
|
|
|
case "Squiggly":
|
|
|
- {
|
|
|
- TextSquigglyAnnotArgs squigglyArgs = new TextSquigglyAnnotArgs();
|
|
|
- squigglyArgs.Color = Color.FromRgb(0xFF, 0x87, 0x16);
|
|
|
- squigglyArgs.Transparency = 1;
|
|
|
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotSquiggly);
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- squigglyArgs.Color = annotProperty.ForgoundColor;
|
|
|
- squigglyArgs.Transparency = annotProperty.Opacity;
|
|
|
- squigglyArgs.Content = annotProperty.NoteText;
|
|
|
- }
|
|
|
- annotAttribsList[AnnotAttrib.Color] = squigglyArgs.Color;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = squigglyArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = string.Empty;
|
|
|
-
|
|
|
- annotArgs = squigglyArgs;
|
|
|
- if (!ToolExpandDict.ContainsKey("Squiggly"))
|
|
|
- {
|
|
|
- ToolExpandDict["Squiggly"] = true;
|
|
|
- }
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = squigglyArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("TextAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
+ annotArgs = GetSquiggly();
|
|
|
break;
|
|
|
|
|
|
case "Strikeout":
|
|
|
- {
|
|
|
- TextStrikeoutAnnotArgs strikeoutArgs = new TextStrikeoutAnnotArgs();
|
|
|
- strikeoutArgs.Color = Color.FromRgb(0xFF, 0x3B, 0x30);
|
|
|
- strikeoutArgs.Transparency = 1;
|
|
|
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotStrikeout);
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- strikeoutArgs.Color = annotProperty.ForgoundColor;
|
|
|
- strikeoutArgs.Transparency = annotProperty.Opacity;
|
|
|
- strikeoutArgs.Content = annotProperty.NoteText;
|
|
|
- }
|
|
|
- annotAttribsList[AnnotAttrib.Color] = strikeoutArgs.Color;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = strikeoutArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = string.Empty;
|
|
|
- annotArgs = strikeoutArgs;
|
|
|
- if (!ToolExpandDict.ContainsKey("Strikeout"))
|
|
|
- {
|
|
|
- ToolExpandDict["Strikeout"] = true;
|
|
|
- }
|
|
|
-
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = strikeoutArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("TextAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
+ annotArgs = GetStrikeout();
|
|
|
break;
|
|
|
|
|
|
case "Freehand":
|
|
|
- {
|
|
|
- FreehandAnnotArgs freehandArgs = new FreehandAnnotArgs();
|
|
|
- freehandArgs.InkColor = Color.FromRgb(0x38, 0xE0, 0x2E);
|
|
|
- freehandArgs.Transparency = 1;
|
|
|
- freehandArgs.LineWidth = 1;
|
|
|
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotFreehand);
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- freehandArgs.InkColor = annotProperty.ForgoundColor;
|
|
|
- freehandArgs.Transparency = annotProperty.Opacity;
|
|
|
- freehandArgs.LineWidth = annotProperty.Thickness;
|
|
|
- freehandArgs.Content = annotProperty.NoteText;
|
|
|
- }
|
|
|
- annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
|
|
|
- annotArgs = freehandArgs;
|
|
|
- if (!ToolExpandDict.ContainsKey("Freehand"))
|
|
|
- {
|
|
|
- ToolExpandDict["Freehand"] = true;
|
|
|
- }
|
|
|
-
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = freehandArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("FreehandAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
+ annotArgs = GetFreehand();
|
|
|
break;
|
|
|
|
|
|
case "Freetext":
|
|
|
- {
|
|
|
- FreeTextAnnotArgs freetextArgs = new FreeTextAnnotArgs();
|
|
|
- freetextArgs.Align = TextAlignment.Left;
|
|
|
- freetextArgs.BgColor = Colors.Transparent;
|
|
|
- freetextArgs.FontFamily = new FontFamily(Settings.Default.AppProperties.Annotate.TextFontFamaily);
|
|
|
- freetextArgs.FontColor = Colors.Black;
|
|
|
- freetextArgs.FontSize = 14;
|
|
|
- freetextArgs.Transparency = 1;
|
|
|
- freetextArgs.LineColor = Colors.Black;
|
|
|
- freetextArgs.LineWidth = 0;
|
|
|
- freetextArgs.TextContent = string.Empty;
|
|
|
-
|
|
|
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotFreeText);
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- freetextArgs.Align = annotProperty.TextAlign;
|
|
|
- freetextArgs.BgColor = annotProperty.BackgroundColor;
|
|
|
- freetextArgs.FontFamily = new FontFamily(annotProperty.FontFamily);
|
|
|
- freetextArgs.FontColor = annotProperty.ForgoundColor;
|
|
|
- freetextArgs.FontSize = annotProperty.FontSize;
|
|
|
- freetextArgs.Transparency = annotProperty.Opacity;
|
|
|
- freetextArgs.LineColor = annotProperty.BorderColor;
|
|
|
- freetextArgs.LineWidth = annotProperty.Thickness;
|
|
|
- freetextArgs.TextContent = annotProperty.NoteText;
|
|
|
- freetextArgs.FontWeight = annotProperty.FontWeight;
|
|
|
- freetextArgs.FontStyle = annotProperty.FontStyle;
|
|
|
- }
|
|
|
- int align = Settings.Default.AppProperties.Annotate.TextAlign;
|
|
|
- TextAlignment textAlignment;
|
|
|
- if (align == 0)
|
|
|
- textAlignment = TextAlignment.Left;
|
|
|
- else if (align == 1)
|
|
|
- textAlignment = TextAlignment.Center;
|
|
|
- else
|
|
|
- textAlignment = TextAlignment.Right;
|
|
|
- annotAttribsList[AnnotAttrib.Color] = freetextArgs.LineColor;
|
|
|
- annotAttribsList[AnnotAttrib.FillColor] = freetextArgs.BgColor;
|
|
|
- annotAttribsList[AnnotAttrib.Thickness] = freetextArgs.LineWidth;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = freetextArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.FontColor] = freetextArgs.FontColor;
|
|
|
- annotAttribsList[AnnotAttrib.FontSize] = freetextArgs.FontSize;
|
|
|
- annotAttribsList[AnnotAttrib.FontFamily] = freetextArgs.FontFamily;
|
|
|
- annotAttribsList[AnnotAttrib.FontStyle] = freetextArgs.FontStyle;
|
|
|
- annotAttribsList[AnnotAttrib.FontWeight] = freetextArgs.FontWeight;
|
|
|
- annotAttribsList[AnnotAttrib.TextAlign] = textAlignment;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = freetextArgs.TextContent;
|
|
|
-
|
|
|
- annotArgs = freetextArgs;
|
|
|
- if (!ToolExpandDict.ContainsKey("Freetext"))
|
|
|
- {
|
|
|
- ToolExpandDict["Freetext"] = true;
|
|
|
- }
|
|
|
-
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = freetextArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("FreetextAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
+ annotArgs = GetFreetext();
|
|
|
break;
|
|
|
|
|
|
case "StickyNote":
|
|
|
- {
|
|
|
- StickyAnnotArgs stickyAnnotArgs = new StickyAnnotArgs();
|
|
|
- stickyAnnotArgs.Color = Color.FromRgb(0xFF, 0x81, 0x33);
|
|
|
- stickyAnnotArgs.StickyNote = string.Empty;
|
|
|
- stickyAnnotArgs.Transparency = 1;
|
|
|
-
|
|
|
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotSticky);
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- stickyAnnotArgs.Color = annotProperty.ForgoundColor;
|
|
|
- stickyAnnotArgs.StickyNote = annotProperty.NoteText;
|
|
|
- stickyAnnotArgs.Transparency = annotProperty.Opacity;
|
|
|
- }
|
|
|
-
|
|
|
- annotAttribsList[AnnotAttrib.Color] = stickyAnnotArgs.Color;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = stickyAnnotArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = stickyAnnotArgs.StickyNote;
|
|
|
-
|
|
|
- annotArgs = stickyAnnotArgs;
|
|
|
- if (!ToolExpandDict.ContainsKey("StickyNote"))
|
|
|
- {
|
|
|
- ToolExpandDict["StickyNote"] = true;
|
|
|
- }
|
|
|
-
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = stickyAnnotArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("FreetextAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
+ annotArgs = GetStickyNote();
|
|
|
break;
|
|
|
|
|
|
case "Rect":
|
|
|
- {
|
|
|
- SquareAnnotArgs squareArgs = new SquareAnnotArgs();
|
|
|
- squareArgs.LineColor = Colors.Red;
|
|
|
- squareArgs.BgColor = Colors.Transparent;
|
|
|
- squareArgs.LineWidth = 1;
|
|
|
- squareArgs.Transparency = 1;
|
|
|
- squareArgs.LineDash = DashStyles.Solid;
|
|
|
- squareArgs.Content = string.Empty;
|
|
|
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotSquare);
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- squareArgs.LineColor = annotProperty.BorderColor;
|
|
|
- squareArgs.BgColor = annotProperty.BackgroundColor;
|
|
|
- if (annotProperty.DashArray == null || annotProperty.DashArray.Count == 0)
|
|
|
- {
|
|
|
- squareArgs.LineDash = DashStyles.Solid;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DashStyle dash = new DashStyle();
|
|
|
- foreach (var offset in annotProperty.DashArray)
|
|
|
- {
|
|
|
- dash.Dashes.Add(offset);
|
|
|
- }
|
|
|
- squareArgs.LineDash = dash;
|
|
|
- }
|
|
|
- squareArgs.LineWidth = annotProperty.Thickness;
|
|
|
- squareArgs.Transparency = annotProperty.Opacity;
|
|
|
- squareArgs.Content = annotProperty.NoteText;
|
|
|
- }
|
|
|
- annotAttribsList[AnnotAttrib.Color] = squareArgs.LineColor;
|
|
|
- annotAttribsList[AnnotAttrib.FillColor] = squareArgs.BgColor;
|
|
|
- annotAttribsList[AnnotAttrib.LineStyle] = squareArgs.LineDash;
|
|
|
- annotAttribsList[AnnotAttrib.Thickness] = squareArgs.LineWidth;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = squareArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = squareArgs.Content;
|
|
|
- annotArgs = squareArgs;
|
|
|
- if (!ToolExpandDict.ContainsKey("Rect"))
|
|
|
- {
|
|
|
- ToolExpandDict["Rect"] = true;
|
|
|
- }
|
|
|
-
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = squareArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("SharpsAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
+ annotArgs = GetRect();
|
|
|
break;
|
|
|
|
|
|
case "Circle":
|
|
|
- {
|
|
|
- CircleAnnotArgs circleAnnotArgs = new CircleAnnotArgs();
|
|
|
- circleAnnotArgs.LineColor = Colors.Red;
|
|
|
- circleAnnotArgs.BgColor = Colors.Transparent;
|
|
|
- circleAnnotArgs.LineWidth = 1;
|
|
|
- circleAnnotArgs.Transparency = 1;
|
|
|
- circleAnnotArgs.LineDash = DashStyles.Solid;
|
|
|
- circleAnnotArgs.Content = string.Empty;
|
|
|
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotCircle);
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- circleAnnotArgs.LineColor = annotProperty.BorderColor;
|
|
|
- circleAnnotArgs.BgColor = annotProperty.BackgroundColor;
|
|
|
- if (annotProperty.DashArray == null || annotProperty.DashArray.Count == 0)
|
|
|
- {
|
|
|
- circleAnnotArgs.LineDash = DashStyles.Solid;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DashStyle dash = new DashStyle();
|
|
|
- foreach (var offset in annotProperty.DashArray)
|
|
|
- {
|
|
|
- dash.Dashes.Add(offset);
|
|
|
- }
|
|
|
- circleAnnotArgs.LineDash = dash;
|
|
|
- }
|
|
|
- circleAnnotArgs.LineWidth = annotProperty.Thickness;
|
|
|
- circleAnnotArgs.Transparency = annotProperty.Opacity;
|
|
|
- circleAnnotArgs.Content = annotProperty.NoteText;
|
|
|
- }
|
|
|
- annotAttribsList[AnnotAttrib.Color] = circleAnnotArgs.LineColor;
|
|
|
- annotAttribsList[AnnotAttrib.FillColor] = circleAnnotArgs.BgColor;
|
|
|
- annotAttribsList[AnnotAttrib.LineStyle] = circleAnnotArgs.LineDash;
|
|
|
- annotAttribsList[AnnotAttrib.Thickness] = circleAnnotArgs.LineWidth;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = circleAnnotArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = circleAnnotArgs.Content;
|
|
|
-
|
|
|
- annotArgs = circleAnnotArgs;
|
|
|
- if (!ToolExpandDict.ContainsKey("Circle"))
|
|
|
- {
|
|
|
- ToolExpandDict["Circle"] = true;
|
|
|
- }
|
|
|
-
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = circleAnnotArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("SharpsAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
+ annotArgs = GetCircle();
|
|
|
break;
|
|
|
|
|
|
case "Arrow":
|
|
|
case "Line":
|
|
|
- {
|
|
|
- LineAnnotArgs lineArgs = new LineAnnotArgs();
|
|
|
- lineArgs.LineColor = Colors.Red;
|
|
|
- lineArgs.HeadLineType = C_LINE_TYPE.LINETYPE_NONE;
|
|
|
- if (annotBtn.Tag.ToString() == "Line")
|
|
|
- {
|
|
|
- lineArgs.TailLineType = C_LINE_TYPE.LINETYPE_NONE;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lineArgs.TailLineType = C_LINE_TYPE.LINETYPE_ARROW;
|
|
|
- }
|
|
|
- lineArgs.LineDash = DashStyles.Solid;
|
|
|
- lineArgs.LineWidth = 1;
|
|
|
- lineArgs.Transparency = 1;
|
|
|
- lineArgs.Content = string.Empty;
|
|
|
-
|
|
|
- DefaultAnnotProperty annotProperty = null;
|
|
|
- if (annotBtn.Tag.ToString() == "Line")
|
|
|
- {
|
|
|
- annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotLine, "Line");
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- annotProperty.HeadLineType = C_LINE_TYPE.LINETYPE_NONE;
|
|
|
- annotProperty.TailLineType = C_LINE_TYPE.LINETYPE_NONE;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotLine, "Arrow");
|
|
|
- }
|
|
|
-
|
|
|
- if (annotProperty != null)
|
|
|
- {
|
|
|
- lineArgs.LineColor = annotProperty.BorderColor;
|
|
|
- lineArgs.HeadLineType = annotProperty.HeadLineType;
|
|
|
- lineArgs.TailLineType = annotProperty.TailLineType;
|
|
|
-
|
|
|
- DashStyle dash = new DashStyle();
|
|
|
- foreach (var offset in annotProperty.DashArray)
|
|
|
- {
|
|
|
- dash.Dashes.Add(offset);
|
|
|
- }
|
|
|
- lineArgs.LineDash = dash;
|
|
|
- lineArgs.LineWidth = annotProperty.Thickness;
|
|
|
- lineArgs.Transparency = annotProperty.Opacity;
|
|
|
- lineArgs.Content = annotProperty.NoteText;
|
|
|
- }
|
|
|
- annotAttribsList[AnnotAttrib.Color] = lineArgs.LineColor;
|
|
|
- annotAttribsList[AnnotAttrib.LineStart] = lineArgs.HeadLineType;
|
|
|
- annotAttribsList[AnnotAttrib.LineEnd] = lineArgs.TailLineType;
|
|
|
- annotAttribsList[AnnotAttrib.LineStyle] = lineArgs.LineDash;
|
|
|
- annotAttribsList[AnnotAttrib.Thickness] = lineArgs.LineWidth;
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = lineArgs.Transparency;
|
|
|
- annotAttribsList[AnnotAttrib.NoteText] = lineArgs.Content;
|
|
|
-
|
|
|
- annotArgs = lineArgs;
|
|
|
- if (!ToolExpandDict.ContainsKey(annotBtn.Tag.ToString()))
|
|
|
- {
|
|
|
- ToolExpandDict[annotBtn.Tag.ToString()] = true;
|
|
|
- }
|
|
|
-
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = lineArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("SharpsAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
+ annotArgs = GetArrowLine(annotBtn.Tag.ToString());
|
|
|
break;
|
|
|
|
|
|
case "Stamp":
|
|
|
- {
|
|
|
- StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
|
|
|
- stampAnnotArgs.Opacity = 1;
|
|
|
- stampAnnotArgs.StampText = "APPROVED";
|
|
|
- stampAnnotArgs.Type = StampType.STANDARD_STAMP;
|
|
|
-
|
|
|
- annotAttribsList[AnnotAttrib.Transparency] = stampAnnotArgs.Opacity;
|
|
|
-
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = stampAnnotArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("StampAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
+ annotArgs = GetStamp();
|
|
|
break;
|
|
|
|
|
|
case "Image":
|
|
|
- {
|
|
|
- annotBtn.IsChecked = false;
|
|
|
- StampAnnotArgs stampArgs = new StampAnnotArgs();
|
|
|
- stampArgs.Opacity = 1;
|
|
|
- stampArgs.Type = StampType.IMAGE_STAMP;
|
|
|
- OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
|
- openFileDialog.Filter = "Image Files(*.jpg;*.jpeg;*.png;*.bmp)|*.jpg;*.jpeg;*.png;*.bmp;";
|
|
|
- if (openFileDialog.ShowDialog() == true)
|
|
|
- {
|
|
|
- stampArgs.ImagePath = openFileDialog.FileName;
|
|
|
-
|
|
|
- annotArgs = stampArgs;
|
|
|
- }
|
|
|
-
|
|
|
- AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
- propertyPanel.annot = stampArgs;
|
|
|
- propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
|
|
|
- propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("ImageAnnotProperty", propertyPanel);
|
|
|
- }
|
|
|
-
|
|
|
+ annotArgs = GetImage(annotBtn);
|
|
|
break;
|
|
|
|
|
|
case "Signature":
|
|
|
break;
|
|
|
|
|
|
case "Link":
|
|
|
- // viewContentViewModel.SelectedPrpoertyPanel("LinkAnnotProperty");
|
|
|
break;
|
|
|
|
|
|
}
|
|
@@ -542,12 +117,13 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
|
|
|
}
|
|
|
ShowPropertyPanel();
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
PDFViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent",null);
|
|
|
+ viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent",null);
|
|
|
+ ShowPropertyPanel(false);
|
|
|
}
|
|
|
|
|
|
|