/// <summary>
        ///
        /// </summary>
        /// <param name="pixelsPerDip"></param>
        /// <param name="tf"></param>
        /// <param name="st"></param>
        /// <param name="node"></param>
        /// <param name="compilation"></param>
        /// <param name="fontSize"></param>
        /// <param name="pDebugFn"></param>
        /// <returns></returns>
        public static CustomTextSource4 CreateAndInitTextSource(double pixelsPerDip,
                                                                Typeface tf, SyntaxTree st, SyntaxNode node, Compilation compilation, double fontSize,
                                                                RoslynCodeBase.DebugDelegate pDebugFn)

        {
            if (st == null)
            {
                st          = SyntaxFactory.ParseSyntaxTree("");
                node        = st.GetRoot();
                compilation = null;
            }

            var textDecorationCollection = new TextDecorationCollection();
            var typeface      = tf;
            var fontRendering = FontRendering.CreateInstance(fontSize,
                                                             TextAlignment.Left, textDecorationCollection,
                                                             Brushes.Black, typeface);
            var genericTextRunProperties = new GenericTextRunProperties(
                fontRendering,
                pixelsPerDip);
            var source = new CustomTextSource4(pixelsPerDip, fontRendering, genericTextRunProperties, pDebugFn)
            {
                EmSize      = fontSize,
                Compilation = compilation,
                Tree        = st,
                Node        = node
            };

            //source.PropertyChanged += x;
            source.Init();
            return(source);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="pixelsPerDip"></param>
        /// <param name="fontRendering"></param>
        /// <param name="genericTextRunProperties"></param>
        /// <param name="debugFn"></param>
        public CustomTextSource4(double pixelsPerDip, FontRendering fontRendering,
                                 GenericTextRunProperties genericTextRunProperties, RoslynCodeBase.DebugDelegate debugFn)
        {
            CurrentRendering = fontRendering;
            PixelsPerDip     = pixelsPerDip;

            BaseProps = genericTextRunProperties;
            _debugFn  = debugFn;
        }
Example #3
0
 public MainUpdateParameters(int textStorePosition, int lineNo,
                             Point linePosition, TextFormatter textFormatter, double paragraphWidth, double pixelsPerDip, double emSize0,
                             string faceName, ChannelWriter <UpdateInfo> channelWriter, FontWeight fontWeight,
                             DocumentPaginator paginator, TextSourceInitializationParameters textSourceInitializationParameters,
                             RoslynCodeBase.DebugDelegate debugFn = null,
                             Size?pageSize = null, bool paginate = false)
 {
     TextStorePosition = textStorePosition;
     LineNo            = lineNo;
     LinePosition      = linePosition;
     TextFormatter     = textFormatter;
     ParagraphWidth    = paragraphWidth;
     PixelsPerDip      = pixelsPerDip;
     FontSize          = emSize0;
     FaceName          = faceName;
     ChannelWriter     = channelWriter;
     FontWeight        = fontWeight;
     Paginator         = paginator;
     TextSourceInitializationParameters = textSourceInitializationParameters;
     DebugFn  = debugFn;
     PageSize = pageSize;
     Paginate = paginate;
 }
 protected ParametersBase(RoslynCodeBase.DebugDelegate debugFn)
 {
     DebugFn = debugFn;
 }
Example #5
0
 public TextSourceInitializationParameters(double pixelsPerDip, double emSize0,
                                           SyntaxTree tree, SyntaxNode node0, Compilation compilation, Typeface tf, RoslynCodeBase.DebugDelegate debugFn) : base(debugFn)
 {
     PixelsPerDip = pixelsPerDip;
     EmSize0      = emSize0;
     Tree         = tree;
     Node0        = node0;
     Compilation  = compilation;
     Tf           = tf;
 }