コード例 #1
0
 public void Reset()
 {
     this.m_paragraphs = null;
     this.m_currentParagraphInstance = null;
     this.m_currentIndex             = 0;
     this.m_currentCompiledIndex     = 0;
 }
コード例 #2
0
        public bool MoveNext()
        {
            if (this.m_currentIndex < this.m_textbox.Paragraphs.Count)
            {
                Paragraph paragraph = ((ReportElementCollectionBase <Paragraph>) this.m_textbox.Paragraphs)[this.m_currentIndex];
                if (paragraph.TextRuns.Count == 1 && ((ReportElementCollectionBase <TextRun>)paragraph.TextRuns)[0].Instance.MarkupType != 0)
                {
                    if (this.m_paragraphs == null)
                    {
                        this.m_paragraphs = ((ReportElementCollectionBase <TextRun>)paragraph.TextRuns)[0].CompiledInstance.CompiledParagraphInstances;
                    }
                    if (this.m_currentCompiledIndex < this.m_paragraphs.Count)
                    {
                        this.m_currentParagraphInstance = ((ReportElementCollectionBase <CompiledParagraphInstance>) this.m_paragraphs)[this.m_currentCompiledIndex];
                        this.m_currentCompiledIndex++;
                        goto IL_00f9;
                    }
                    this.m_paragraphs           = null;
                    this.m_currentCompiledIndex = 0;
                    this.m_currentIndex++;
                    return(this.MoveNext());
                }
                this.m_currentParagraphInstance = paragraph.Instance;
                this.m_currentIndex++;
                goto IL_00f9;
            }
            return(false);

IL_00f9:
            return(true);
        }
コード例 #3
0
 protected override void ResetInstanceCache()
 {
     this.m_compiledParagraphCollection = null;
     this.m_parseErrorOccured           = false;
     this.m_parsed      = false;
     this.m_uniqueName  = null;
     this.m_objectCount = 0;
 }
コード例 #4
0
 private void Parse()
 {
     if (!this.m_parsed)
     {
         try
         {
             this.m_parsed = true;
             this.m_paragraphDef.CriGenerationPhase = ReportElement.CriGenerationPhases.Definition;
             this.m_textRunDef.CriGenerationPhase   = ReportElement.CriGenerationPhases.Definition;
             ReportEnumProperty <MarkupType> markupType = this.m_textRunDef.MarkupType;
             MarkupType     markupType2    = (!markupType.IsExpression) ? markupType.Value : this.m_textRunDef.Instance.MarkupType;
             RichTextParser richTextParser = null;
             MarkupType     markupType3    = markupType2;
             if (markupType3 == MarkupType.HTML)
             {
                 richTextParser = new HtmlParser(this.m_multipleParagraphsAllowed, this, this);
                 InternalTextRunInstance internalTextRunInstance = (InternalTextRunInstance)this.m_textRunDef.Instance;
                 AspNetCore.ReportingServices.RdlExpressions.VariantResult originalValue = internalTextRunInstance.GetOriginalValue();
                 if (!originalValue.ErrorOccurred && originalValue.TypeCode != 0)
                 {
                     try
                     {
                         string richText = (originalValue.TypeCode != TypeCode.String) ? internalTextRunInstance.TextRunDef.FormatTextRunValue(originalValue.Value, originalValue.TypeCode, this.m_textRunDef.RenderingContext.OdpContext) : (originalValue.Value as string);
                         this.m_compiledParagraphCollection = (CompiledParagraphInstanceCollection)richTextParser.Parse(richText);
                     }
                     catch (Exception ex)
                     {
                         this.m_errorContext.Register(ProcessingErrorCode.rsInvalidRichTextParseFailed, Severity.Warning, "TextRun", internalTextRunInstance.TextRunDef.Name, ex.Message);
                         this.m_parseErrorOccured = true;
                         ICompiledTextRunInstance compiledTextRunInstance = this.CreateSingleTextRun();
                         compiledTextRunInstance.Value = RPRes.rsRichTextParseErrorValue;
                     }
                 }
                 else
                 {
                     ICompiledTextRunInstance compiledTextRunInstance2 = this.CreateSingleTextRun();
                     if (originalValue.ErrorOccurred)
                     {
                         compiledTextRunInstance2.Value = RPRes.rsExpressionErrorValue;
                     }
                 }
             }
         }
         finally
         {
             this.m_textRunDef.CriGenerationPhase   = ReportElement.CriGenerationPhases.None;
             this.m_paragraphDef.CriGenerationPhase = ReportElement.CriGenerationPhases.None;
         }
     }
 }
コード例 #5
0
        private ICompiledTextRunInstance CreateSingleTextRun()
        {
            ICompiledParagraphInstance    compiledParagraphInstance = new CompiledParagraphInstance(this);
            ICompiledTextRunInstance      compiledTextRunInstance   = new CompiledTextRunInstance(this);
            CompiledRichTextStyleInstance style = new CompiledRichTextStyleInstance(this.m_textRunDef, this.m_textRunDef.ReportScope, this.m_textRunDef.RenderingContext);

            this.m_compiledParagraphCollection = new CompiledParagraphInstanceCollection(this);
            compiledParagraphInstance.CompiledTextRunInstances = new CompiledTextRunInstanceCollection(this);
            compiledTextRunInstance.Style   = style;
            compiledParagraphInstance.Style = style;
            ((ICollection <ICompiledParagraphInstance>) this.m_compiledParagraphCollection).Add(compiledParagraphInstance);
            compiledParagraphInstance.CompiledTextRunInstances.Add(compiledTextRunInstance);
            return(compiledTextRunInstance);
        }