private void EvaluateTagValue()
        {
            if (m_tag.HasValue)
            {
                return;
            }
            ExpressionInfo expression = m_tagDef.Expression;

            if (expression != null)
            {
                if (expression.IsExpression)
                {
                    Image image = m_tagDef.Image;
                    m_tag = image.ImageDef.EvaluateTagExpression(expression, image.Instance.ReportScopeInstance, image.RenderingContext.OdpContext);
                }
                else
                {
                    VariantResult result = new VariantResult(errorOccurred: false, expression.Value);
                    ReportRuntime.SetVariantType(ref result);
                    m_tag = result;
                }
            }
            else
            {
                m_tag = new VariantResult(errorOccurred: false, null);
            }
        }
 private void EvaluateTagValue()
 {
     if (!this.m_tag.HasValue)
     {
         ExpressionInfo expression = this.m_tagDef.Expression;
         if (expression != null)
         {
             if (expression.IsExpression)
             {
                 Image image = this.m_tagDef.Image;
                 this.m_tag = image.ImageDef.EvaluateTagExpression(expression, image.Instance.ReportScopeInstance, image.RenderingContext.OdpContext);
             }
             else
             {
                 VariantResult value = new VariantResult(false, expression.Value);
                 ReportRuntime.SetVariantType(ref value);
                 this.m_tag = value;
             }
         }
         else
         {
             this.m_tag = new VariantResult(false, null);
         }
     }
 }
Example #3
0
 public VariantResult GetResult()
 {
     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;
         ObjectType objectType   = base.m_reportRT.ObjectType;
         string     objectName   = base.m_reportRT.ObjectName;
         string     propertyName = base.m_reportRT.PropertyName;
         ReportProcessing.IScope currentScope = base.m_reportRT.CurrentScope;
         base.m_reportRT.CurrentScope = base.m_scope;
         this.m_result = base.m_reportRT.EvaluateTextBoxValueExpression(this.m_textBox);
         base.m_reportRT.CurrentScope = currentScope;
         base.m_reportRT.ObjectType   = objectType;
         base.m_reportRT.ObjectName   = objectName;
         base.m_reportRT.PropertyName = propertyName;
         this.m_isVisited             = false;
         this.m_isValueReady          = true;
     }
     return(this.m_result);
 }
Example #4
0
        private void EvaluateOriginalValue()
        {
            if (m_originalValueEvaluated)
            {
                return;
            }
            m_originalValueEvaluated = true;
            Microsoft.ReportingServices.ReportIntermediateFormat.TextRun textRunDef = TextRunDef;
            ExpressionInfo value = textRunDef.Value;

            if (value != null)
            {
                if (value.IsExpression)
                {
                    m_originalValue           = textRunDef.EvaluateValue(ReportScopeInstance, base.ReportElementDef.RenderingContext.OdpContext);
                    m_originalValueNeedsReset = true;
                }
                else
                {
                    m_originalValue       = default(VariantResult);
                    m_originalValue.Value = value.Value;
                    ReportRuntime.SetVariantType(ref m_originalValue);
                }
            }
        }
 private void EvaluateOriginalValue()
 {
     if (!this.m_originalValueEvaluated)
     {
         this.m_originalValueEvaluated = true;
         AspNetCore.ReportingServices.ReportIntermediateFormat.TextBox texBoxDef = this.m_textBoxDef.TexBoxDef;
         if (texBoxDef.HasValue)
         {
             OnDemandProcessingContext odpContext = base.RenderingContext.OdpContext;
             this.m_originalValue = default(VariantResult);
             if (texBoxDef.IsSimple)
             {
                 InternalTextRunInstance internalTextRunInstance = (InternalTextRunInstance)((ReportElementCollectionBase <TextRun>)((ReportElementCollectionBase <Paragraph>) this.m_textBoxDef.Paragraphs)[0].TextRuns)[0].Instance;
                 this.m_originalValue.Value         = internalTextRunInstance.OriginalValue;
                 this.m_originalValue.ErrorOccurred = internalTextRunInstance.ProcessedWithError;
                 this.m_typeCode = internalTextRunInstance.TypeCode;
                 this.m_originalValue.TypeCode = this.m_typeCode.Value;
             }
             else
             {
                 StringBuilder stringBuilder = new StringBuilder();
                 bool          flag          = false;
                 bool          flag2         = true;
                 foreach (ParagraphInstance paragraphInstance in this.ParagraphInstances)
                 {
                     if (!flag2)
                     {
                         flag = true;
                         stringBuilder.Append(Environment.NewLine);
                     }
                     else
                     {
                         flag2 = false;
                     }
                     foreach (TextRunInstance textRunInstance in paragraphInstance.TextRunInstances)
                     {
                         object originalValue = textRunInstance.OriginalValue;
                         if (originalValue != null)
                         {
                             flag = true;
                             stringBuilder.Append(originalValue);
                         }
                     }
                 }
                 if (flag)
                 {
                     this.m_originalValue.Value    = stringBuilder.ToString();
                     this.m_originalValue.TypeCode = TypeCode.String;
                     this.m_typeCode = TypeCode.String;
                 }
             }
         }
         else
         {
             this.m_typeCode = TypeCode.Empty;
         }
     }
 }
Example #6
0
 private void EvaluateOriginalValue()
 {
     if (m_originalValueEvaluated)
     {
         return;
     }
     m_originalValueEvaluated = true;
     Microsoft.ReportingServices.ReportIntermediateFormat.TextBox texBoxDef = m_textBoxDef.TexBoxDef;
     if (texBoxDef.HasValue)
     {
         _ = base.RenderingContext.OdpContext;
         m_originalValue = default(VariantResult);
         if (texBoxDef.IsSimple)
         {
             InternalTextRunInstance internalTextRunInstance = (InternalTextRunInstance)m_textBoxDef.Paragraphs[0].TextRuns[0].Instance;
             m_originalValue.Value         = internalTextRunInstance.OriginalValue;
             m_originalValue.ErrorOccurred = internalTextRunInstance.ProcessedWithError;
             m_typeCode = internalTextRunInstance.TypeCode;
             m_originalValue.TypeCode = m_typeCode.Value;
             return;
         }
         StringBuilder stringBuilder = new StringBuilder();
         bool          flag          = false;
         bool          flag2         = true;
         foreach (ParagraphInstance paragraphInstance in ParagraphInstances)
         {
             if (!flag2)
             {
                 flag = true;
                 stringBuilder.Append(Environment.NewLine);
             }
             else
             {
                 flag2 = false;
             }
             foreach (TextRunInstance textRunInstance in paragraphInstance.TextRunInstances)
             {
                 object originalValue = textRunInstance.OriginalValue;
                 if (originalValue != null)
                 {
                     flag = true;
                     stringBuilder.Append(originalValue);
                 }
             }
         }
         if (flag)
         {
             m_originalValue.Value    = stringBuilder.ToString();
             m_originalValue.TypeCode = TypeCode.String;
             m_typeCode = TypeCode.String;
         }
     }
     else
     {
         m_typeCode = TypeCode.Empty;
     }
 }
        public override object EvaluateValidValueExpr(IParameterDef aParamDef, int aIndex)
        {
            VariantResult variantResult = this.GetLegacyContext().ReportRuntime.EvaluateParamValidValue((ParameterDef)aParamDef, aIndex);

            if (variantResult.ErrorOccurred)
            {
                throw new ReportProcessingException(ErrorCode.rsReportParameterProcessingError, aParamDef.Name);
            }
            return(variantResult.Value);
        }
Example #8
0
 private void EvaluateOriginalValue()
 {
     if (!this.m_originalValueEvaluated)
     {
         this.m_originalValueEvaluated = true;
         AspNetCore.ReportingServices.ReportIntermediateFormat.TextRun textRunDef = this.TextRunDef;
         ExpressionInfo value = textRunDef.Value;
         if (value != null)
         {
             if (value.IsExpression)
             {
                 this.m_originalValue           = textRunDef.EvaluateValue(this.ReportScopeInstance, base.ReportElementDef.RenderingContext.OdpContext);
                 this.m_originalValueNeedsReset = true;
             }
             else
             {
                 this.m_originalValue       = default(VariantResult);
                 this.m_originalValue.Value = value.Value;
                 ReportRuntime.SetVariantType(ref this.m_originalValue);
             }
         }
     }
 }
Example #9
0
        public async Task <VariantResult> GetVariantAsync(Proxy Proxy, string API, int Id)
        {
            return(await Task.Factory.StartNew(() =>
            {
                HttpWebRequest webRequest =
                    WebRequest.Create($"https://api.printful.com/products/variant/{Id}") as HttpWebRequest;

                if (Proxy != null)
                {
                    webRequest.Proxy = Proxy.Get();
                    webRequest.Credentials = Proxy.GetCredential();
                }
                webRequest.Method = "GET";
                webRequest.ContentType = "application/json; charset=utf-8";
                webRequest.Headers.Add("Authorization", "Basic " + Manager.API.Encode(API));

                WebResponse response = webRequest.GetResponse();
                if (((HttpWebResponse)response).StatusCode == HttpStatusCode.OK)
                {
                    // Get the stream containing content returned by the server.
                    Stream dataStream = response.GetResponseStream();
                    if (dataStream != null)
                    {
                        // Open the stream using a StreamReader for easy access.
                        StreamReader reader = new StreamReader(dataStream);
                        // Read the content.
                        string responseFromServer = reader.ReadToEnd();
                        // Display the content.
                        VariantResult result =
                            JsonConvert.DeserializeObject <VariantResult>(responseFromServer, Converter.Settings);

                        return result;
                    }
                }
                return null;
            }));
        }
Example #10
0
 public void SetResult(VariantResult result)
 {
     this.m_result       = result;
     this.m_isValueReady = true;
 }
 internal void SetResult(VariantResult result)
 {
     m_result       = result;
     m_isValueReady = true;
 }