public ReportSize(AspNetCore.ReportingServices.ReportRendering.ReportSize oldSize)
 {
     this.m_size   = oldSize.ToString();
     this.m_parsed = oldSize.Parsed;
     if (this.m_parsed)
     {
         this.m_sizeInMM = oldSize.ToMillimeters();
     }
 }
Example #2
0
        public ReportSize DeepClone()
        {
            ReportSize reportSize = new ReportSize();

            if (this.m_size != null)
            {
                reportSize.m_size = string.Copy(this.m_size);
            }
            reportSize.m_parsed   = this.m_parsed;
            reportSize.m_sizeInMM = this.m_sizeInMM;
            return(reportSize);
        }
Example #3
0
 public ReportSize(ReportSize newSize)
 {
     this.m_size     = newSize.ToString();
     this.m_sizeInMM = newSize.ToMillimeters();
     this.m_parsed   = true;
 }
        public void SetStyle(Style.StyleName style, object value, bool isShared)
        {
            object obj  = null;
            bool   flag = false;

            switch (style)
            {
            case Style.StyleName.BorderColor:
            case Style.StyleName.BorderColorTop:
            case Style.StyleName.BorderColorLeft:
            case Style.StyleName.BorderColorRight:
            case Style.StyleName.BorderColorBottom:
            case Style.StyleName.BackgroundColor:
            case Style.StyleName.Color:
                if (value is ReportColor)
                {
                    obj = (value as ReportColor);
                }
                else if (value is string)
                {
                    obj = new ReportColor(value as string);
                }
                if (obj == null)
                {
                    throw new ReportRenderingException(ErrorCode.rrInvalidStyleArgumentType, "ReportColor");
                }
                obj  = ((ReportColor)obj).ToString();
                flag = true;
                break;

            case Style.StyleName.BorderStyle:
            case Style.StyleName.BorderStyleTop:
            case Style.StyleName.BorderStyleLeft:
            case Style.StyleName.BorderStyleRight:
            case Style.StyleName.BorderStyleBottom:
                if (value != null)
                {
                    obj = (value as string);
                    if (obj == null)
                    {
                        throw new ReportRenderingException(ErrorCode.rrInvalidStyleArgumentType, "String");
                    }
                    string text = default(string);
                    if (!Validator.ValidateBorderStyle(obj as string, out text))
                    {
                        throw new ReportRenderingException(ErrorCode.rrInvalidBorderStyle, obj);
                    }
                }
                flag = true;
                break;

            case Style.StyleName.BorderWidth:
            case Style.StyleName.BorderWidthTop:
            case Style.StyleName.BorderWidthLeft:
            case Style.StyleName.BorderWidthRight:
            case Style.StyleName.BorderWidthBottom:
            case Style.StyleName.FontSize:
            case Style.StyleName.PaddingLeft:
            case Style.StyleName.PaddingRight:
            case Style.StyleName.PaddingTop:
            case Style.StyleName.PaddingBottom:
            case Style.StyleName.LineHeight:
                if (value is ReportSize)
                {
                    obj = (value as ReportSize);
                }
                else if (value is string)
                {
                    obj = new ReportSize(value as string);
                }
                if (obj == null)
                {
                    throw new ReportRenderingException(ErrorCode.rrInvalidStyleArgumentType, "ReportSize");
                }
                flag = true;
                break;

            case Style.StyleName.NumeralVariant:
            {
                int num = default(int);
                if (!int.TryParse(value as string, out num))
                {
                    throw new ReportRenderingException(ErrorCode.rrInvalidStyleArgumentType, "Int32");
                }
                obj  = num;
                flag = true;
                break;
            }

            default:
                if (value != null)
                {
                    obj = (value as string);
                    if (obj == null)
                    {
                        throw new ReportRenderingException(ErrorCode.rrInvalidStyleArgumentType, "String");
                    }
                }
                flag = true;
                break;
            }
            if (flag)
            {
                if (isShared)
                {
                    if (this.m_sharedProperties == null)
                    {
                        this.m_sharedProperties = new StyleProperties();
                    }
                    this.m_sharedProperties.Set(style.ToString(), obj);
                }
                else
                {
                    if (this.m_nonSharedProperties == null)
                    {
                        this.m_nonSharedProperties = new StyleProperties();
                    }
                    this.m_nonSharedProperties.Set(style.ToString(), obj);
                }
            }
        }