示例#1
0
 internal void InitState(HtmlEngine engine, bool designMode)
 {
     if (engine != null)
     {
         if (!designMode)
         {
             this.previousLine = engine.previousLine;
             this.context      = engine.context;
             this.stack        = engine.stack;
             this.residualText = engine.residualText;
         }
     }
 }
示例#2
0
        internal bool CreateLines(Graphics g, bool fromStart, bool forceResize)
        {
            int position = fromStart ? 0 : renderingIndex;

            ArrayList parameterPositions = new ArrayList();
            ArrayList parameterEnds      = new ArrayList();

            string fullText = this.ResolveParameterValues(content, parameterPositions, parameterEnds);
            string text     = section.Document.DesignMode ? content.Substring(position) : fullText.Substring(position);

            Rectangle bounds = this.Section.Document.DesignMode ? theRegion : Bounds;

            bounds.Inflate(-innerPadding, -innerPadding);


            Context previousContext = null;

            if (previousState != null && previousState.Context != null)
            {
                previousContext = previousState.Context;
            }

            Com.Delta.PrintManager.Engine.Parse.Html.HtmlEngine engine = section.Document.DesignMode ? new Com.Delta.PrintManager.Engine.Parse.Html.HtmlEngine(this, g, bounds, this.font, this.foregroundColor) : (previousContext == null ? new Com.Delta.PrintManager.Engine.Parse.Html.HtmlEngine(this, g, bounds, this.font, this.foregroundColor) : new Com.Delta.PrintManager.Engine.Parse.Html.HtmlEngine(this, g, bounds, previousContext.Font, previousContext.Color));

            engine.InitState(previousState, section.Document.DesignMode);
            int parsingLength = engine.Parse(text, lines);


            double minimalHeight = 0;

            foreach (TextLine line in lines)
            {
                minimalHeight += line.Height;
            }

            int netHeight = (int)minimalHeight + 2 * innerPadding + 2;

            if (forceResize)
            {
                Bounds.Height = netHeight;
            }



            this.previousState = engine;

            renderingIndex += parsingLength;

            return(renderingIndex < fullText.Length || engine.Residual != null || engine.ResidualText != string.Empty);
        }