Beispiel #1
0
        public static Run GetRunFormatting(Run run, DifferencesFormatting differencesFormatting)
        {
            if (differencesFormatting.FontSpecifyColor && differencesFormatting.FontColor.Trim() != string.Empty)
            {
                var color     = ColorTranslator.FromHtml(differencesFormatting.FontColor.Trim());
                var converted = System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B);
                run.Foreground = new SolidColorBrush(converted);
            }
            if (differencesFormatting.FontSpecifyBackroundColor && differencesFormatting.FontBackroundColor.Trim() != string.Empty)
            {
                var color     = ColorTranslator.FromHtml(differencesFormatting.FontBackroundColor.Trim());
                var converted = System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B);
                run.Background = new SolidColorBrush(converted);
            }

            if (string.Compare(differencesFormatting.StyleBold, "Activate", StringComparison.OrdinalIgnoreCase) == 0)
            {
                run.FontWeight = FontWeights.Bold;
            }
            if (string.Compare(differencesFormatting.StyleItalic, "Activate", StringComparison.OrdinalIgnoreCase) == 0)
            {
                run.FontStyle = FontStyles.Italic;
            }
            if (string.Compare(differencesFormatting.StyleStrikethrough, "Activate", StringComparison.OrdinalIgnoreCase) == 0)
            {
                run.TextDecorations.Add(TextDecorations.Strikethrough);
            }
            if (string.Compare(differencesFormatting.StyleUnderline, "Activate", StringComparison.OrdinalIgnoreCase) == 0)
            {
                run.TextDecorations.Add(TextDecorations.Underline);
            }
            if (string.Compare(differencesFormatting.TextPosition, "Superscript", StringComparison.OrdinalIgnoreCase) == 0)
            {
                run.Typography.Variants = FontVariants.Superscript;
            }
            else if (string.Compare(differencesFormatting.TextPosition, "Subscript", StringComparison.OrdinalIgnoreCase) == 0)
            {
                run.Typography.Variants = FontVariants.Subscript;
            }

            return(run);
        }
Beispiel #2
0
        public Settings()
        {
            #region  |  new text style  |

            StyleNewText = new DifferencesFormatting
            {
                StyleBold                 = "Deactivate",
                StyleItalic               = "Deactivate",
                StyleStrikethrough        = "Deactivate",
                StyleUnderline            = "Activate",
                TextPosition              = "Normal",
                FontSpecifyColor          = true,
                FontColor                 = "#0000FF",
                FontSpecifyBackroundColor = true,
                FontBackroundColor        = "#FFFF66"
            };

            #endregion

            #region  |  removed text style  |

            StyleRemovedText = new DifferencesFormatting
            {
                StyleBold                 = "Deactivate",
                StyleItalic               = "Deactivate",
                StyleStrikethrough        = "Activate",
                StyleUnderline            = "Deactivate",
                TextPosition              = "Normal",
                FontSpecifyColor          = true,
                FontColor                 = "#FF0000",
                FontSpecifyBackroundColor = false,
                FontBackroundColor        = "#FFFFFF"
            };

            #endregion

            #region  |  new tag style  |

            StyleNewTag = new DifferencesFormatting
            {
                StyleBold                 = "Deactivate",
                StyleItalic               = "Deactivate",
                StyleStrikethrough        = "Deactivate",
                StyleUnderline            = "Deactivate",
                TextPosition              = "Normal",
                FontSpecifyColor          = false,
                FontColor                 = "#000000",
                FontSpecifyBackroundColor = true,
                FontBackroundColor        = "#DDEEFF"
            };

            #endregion

            #region  |  removed tag style  |

            StyleRemovedTag = new DifferencesFormatting
            {
                StyleBold                 = "Deactivate",
                StyleItalic               = "Deactivate",
                StyleStrikethrough        = "Deactivate",
                StyleUnderline            = "Deactivate",
                TextPosition              = "Normal",
                FontSpecifyColor          = false,
                FontColor                 = "#000000",
                FontSpecifyBackroundColor = true,
                FontBackroundColor        = "#FFE8E8"
            };

            #endregion

            ReportFilterChangedTargetContent       = true;
            ReportFilterSegmentStatusChanged       = false;
            ReportFilterSegmentsContainingComments = true;
            ReportFilterFilesWithNoRecordsFiltered = true;

            CompareType                      = ComparisonType.Words;
            ComparisonIncludeTags            = true;
            IncludeIndividualFileInformation = true;

            FilePathOriginal = string.Empty;
            FilePathUpdated  = string.Empty;

            DirectoryPathOriginal = string.Empty;
            DirectoryPathUpdated  = string.Empty;
            SearchSubFolders      = true;

            ReportDirectory = string.Empty;
            ReportFileName  = string.Empty;
            ReportingFormat = ReportFormat.Html;
            ViewReportWhenFinishedProcessing = true;

            UseCustomStyleSheet      = false;
            FilePathCustomStyleSheet = string.Empty;
        }