Esempio n. 1
0
        //private void LoadDefaultStyle(SerializationInfo info)
        //{
        //    try
        //    {
        //        var styleStr = info.GetString("DefaultStyle");

        //        DefaultStyle = new ComplexStyleConverter().ConvertFrom(styleStr) as ComplexStyle ?? new ComplexStyle();

        //    }
        //    catch {DefaultStyle = new ComplexStyle(); }
        //}

        private void LoadComplexStyle(SerializationInfo info)
        {
            try
            {
                var styleStr = info.GetString("ComplexStyles");

                Styles       = new ComplexStylesConverter().ConvertFrom(styleStr) as ComplexStyles ?? new ComplexStyles();
                Styles.Title = COMPLEX_STYLE_TITLE;
            }
            catch
            {
                Styles = new ComplexStyles {
                    Title = COMPLEX_STYLE_TITLE
                };
            }
        }
Esempio n. 2
0
 public TextFile()
 {
     //ScrollOffset = -1d;
     IncFontWhenPrinting = 0;
     Watermark           = new Watermark {
         Size = new Size(1, 1), Opacity = 1d
     };
     PageCountElement = new PageCountElement
     {
         FontFamily     = MainWindow.Global.FindResource("defaultFont") as FontFamily,
         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;
 }