public Watermark CopyOf()
        {
            if (ImageSource == null)
            {
                return(null);
            }

            var waterMark = new Watermark {
                ImageSource = _imageSource.Clone(), Opacity = _opacity, Size = _size
            };

            return(waterMark);
        }
 public TextFile()
 {
     //ScrollOffset = -1d;
     IncFontWhenPrinting = 0;
     Watermark           = new Watermark {
         Size = new Size(1, 1), Opacity = 1d
     };
     PageCountElement = new PageCountElement
     {
         FontFamily     = new FontFamily("Arial"),
         ForgroundBrush = Brushes.Black,
         UseLeadingZero = false
     };
     SpellCheckEnabled             = true;
     Styles                        = new ComplexStyles();
     OpeningQuote                  = ClosingQuote = "\u0022";
     SingleOpeningQuote            = SingleClosingQuote = "\u0027";
     ReadOnly                      = false;
     Characters                    = new ObservableCollection <Character>();
     Characters.CollectionChanged += CharactersCollectionChanged;
 }
        private void LoadWatermark(SerializationInfo info)
        {
            try
            {
                Watermark = new Watermark();
                var arr = (byte[])info.GetValue("Watermark", typeof(byte[]));

                if (arr == null)
                {
                    return;
                }

                Watermark.ImageSource = Utilities.GetImageSourceFromByteArray(arr);
                Watermark.Size        = (Size)info.GetValue("WatermarkSize", typeof(Size));
                Watermark.Opacity     = info.GetDouble("WatermarkOpacity");
            }
            catch (Exception)
            {
                Watermark = new Watermark {
                    Size = new Size(1, 1), Opacity = 1d
                };
            }
        }