示例#1
0
 public void Reset()
 {
     for (int i = 0; i < this.m_textRuns.Length; i++)
     {
         TextRunImpl textRunImpl = this.m_textRuns[i];
         if (textRunImpl != null)
         {
             textRunImpl.Reset();
         }
     }
 }
示例#2
0
 public override TextRun this[int index]
 {
     get
     {
         if (index >= 0 && index < this.Count)
         {
             TextRunImpl textRunImpl = this.m_textRuns[index];
             if (textRunImpl == null)
             {
                 AspNetCore.ReportingServices.ReportIntermediateFormat.TextRun textRunDef = this.m_paragraphDef.TextRuns[index];
                 textRunImpl            = new TextRunImpl(this.m_textBoxDef, textRunDef, this.m_reportRT, this.m_iErrorContext, this.m_scope);
                 this.m_textRuns[index] = textRunImpl;
             }
             return(textRunImpl);
         }
         throw new ArgumentOutOfRangeException("index");
     }
 }
 public AspNetCore.ReportingServices.RdlExpressions.VariantResult GetResult(IReportScopeInstance romInstance, bool calledFromValue)
 {
     if (calledFromValue && !this.IsTextboxInScope())
     {
         this.m_result = default(AspNetCore.ReportingServices.RdlExpressions.VariantResult);
     }
     else if (!this.m_isValueReady)
     {
         if (this.m_isVisited)
         {
             base.m_iErrorContext.Register(ProcessingErrorCode.rsCyclicExpression, Severity.Warning, this.m_textBox.ObjectType, this.m_textBox.Name, "Value");
             throw new ReportProcessingException_InvalidOperationException();
         }
         this.m_isVisited = true;
         ObjectModelImpl           reportObjectModel = base.m_reportRT.ReportObjectModel;
         OnDemandProcessingContext odpContext        = base.m_reportRT.ReportObjectModel.OdpContext;
         bool          contextUpdated = base.m_reportRT.ContextUpdated;
         IInstancePath originalObject = null;
         base.m_reportRT.ContextUpdated = false;
         if (odpContext.IsTablixProcessingMode || calledFromValue)
         {
             originalObject = odpContext.LastRIFObject;
         }
         bool flag = this.m_textBox.Action != null && this.m_textBox.Action.TrackFieldsUsedInValueExpression;
         Dictionary <string, bool> dictionary = null;
         if (flag)
         {
             dictionary = new Dictionary <string, bool>();
         }
         try
         {
             bool flag2 = false;
             if (this.m_paragraphs.Count == 1)
             {
                 TextRunsImpl textRunsImpl = (TextRunsImpl)((Paragraphs)this.m_paragraphs)[0].TextRuns;
                 if (textRunsImpl.Count == 1)
                 {
                     flag2 = true;
                     TextRunImpl textRunImpl = (TextRunImpl)((TextRuns)textRunsImpl)[0];
                     this.m_result = textRunImpl.GetResult(romInstance);
                     if (flag)
                     {
                         textRunImpl.MergeFieldsUsedInValueExpression(dictionary);
                     }
                 }
             }
             if (!flag2)
             {
                 bool flag3 = false;
                 this.m_result = default(AspNetCore.ReportingServices.RdlExpressions.VariantResult);
                 StringBuilder stringBuilder = new StringBuilder();
                 for (int i = 0; i < this.m_paragraphs.Count; i++)
                 {
                     if (i > 0)
                     {
                         flag3 = true;
                         stringBuilder.Append(Environment.NewLine);
                     }
                     TextRunsImpl textRunsImpl2 = (TextRunsImpl)((Paragraphs)this.m_paragraphs)[i].TextRuns;
                     for (int j = 0; j < textRunsImpl2.Count; j++)
                     {
                         TextRunImpl textRunImpl2 = (TextRunImpl)((TextRuns)textRunsImpl2)[j];
                         AspNetCore.ReportingServices.RdlExpressions.VariantResult result = textRunImpl2.GetResult(romInstance);
                         if (result.Value != null)
                         {
                             if (result.TypeCode == TypeCode.Object && (result.Value is TimeSpan || result.Value is DateTimeOffset))
                             {
                                 string text = textRunImpl2.TextRunDef.FormatTextRunValue(result, odpContext);
                                 if (text != null)
                                 {
                                     result.Value = text;
                                 }
                                 else
                                 {
                                     result.Value = AspNetCore.ReportingServices.RdlExpressions.ReportRuntime.ConvertToStringFallBack(result.Value);
                                 }
                             }
                             flag3 = true;
                             stringBuilder.Append(result.Value);
                         }
                         if (flag)
                         {
                             textRunImpl2.MergeFieldsUsedInValueExpression(dictionary);
                         }
                     }
                 }
                 if (flag3)
                 {
                     this.m_result.Value    = stringBuilder.ToString();
                     this.m_result.TypeCode = TypeCode.String;
                 }
             }
             if (flag)
             {
                 this.m_fieldsUsedInValueExpression = new List <string>();
                 foreach (string key in dictionary.Keys)
                 {
                     this.m_fieldsUsedInValueExpression.Add(key);
                 }
             }
         }
         finally
         {
             odpContext.RestoreContext(originalObject);
             base.m_reportRT.ContextUpdated = contextUpdated;
             this.m_isVisited    = false;
             this.m_isValueReady = true;
         }
     }
     return(this.m_result);
 }