public override int GetHashCode()
        {
            int hashCode = -285838355;

            if (Context != null)
            {
                hashCode += Context.GetHashCode();
            }

            if (BreakTypes != null)
            {
                hashCode += BreakTypes.GetHashCode();
            }

            if (Cursor != null)
            {
                hashCode += Cursor.GetHashCode();
            }

            if (Errors != null)
            {
                hashCode += Errors.GetHashCode();
            }

            return(hashCode);
        }
Beispiel #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ColorBreak()
 {
     _breakType  = BreakTypes.ColorBreak;
     _color      = Color.Red;
     _isNoData   = false;
     _drawShape  = true;
     _startValue = 0;
     _endValue   = 0;
     _caption    = "";
 }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is ListBreakTypesResponse other &&
                   ((Context == null && other.Context == null) || (Context?.Equals(other.Context) == true)) &&
                   ((BreakTypes == null && other.BreakTypes == null) || (BreakTypes?.Equals(other.BreakTypes) == true)) &&
                   ((Cursor == null && other.Cursor == null) || (Cursor?.Equals(other.Cursor) == true)) &&
                   ((Errors == null && other.Errors == null) || (Errors?.Equals(other.Errors) == true)));
        }
        private ColorBreak LoadLegend(XmlNode legendNode, ShapeTypes shapeType)
        {
            ColorBreak legend = new ColorBreak();

            try
            {
                Color      color      = ColorTranslator.FromHtml(legendNode.Attributes["Color"].InnerText);
                string     legendType = legendNode.Attributes["LegendType"].InnerText;
                BreakTypes breakType  = (BreakTypes)Enum.Parse(typeof(BreakTypes), legendType);
                switch (breakType)
                {
                case BreakTypes.PointBreak:
                    PointBreak aPB = new PointBreak();
                    try
                    {
                        aPB.Color        = color;
                        aPB.DrawFill     = bool.Parse(legendNode.Attributes["DrawFill"].InnerText);
                        aPB.DrawOutline  = bool.Parse(legendNode.Attributes["DrawOutline"].InnerText);
                        aPB.OutlineColor = ColorTranslator.FromHtml(legendNode.Attributes["OutlineColor"].InnerText);
                        aPB.Size         = float.Parse(legendNode.Attributes["Size"].InnerText);
                        aPB.Style        = (PointStyle)Enum.Parse(typeof(PointStyle), legendNode.Attributes["Style"].InnerText);
                        aPB.MarkerType   = (MarkerType)Enum.Parse(typeof(MarkerType), legendNode.Attributes["MarkerType"].InnerText, true);
                        aPB.FontName     = legendNode.Attributes["FontName"].InnerText;
                        aPB.CharIndex    = int.Parse(legendNode.Attributes["CharIndex"].InnerText);
                        aPB.ImagePath    = legendNode.Attributes["ImagePath"].InnerText;
                        aPB.Angle        = float.Parse(legendNode.Attributes["Angle"].InnerText);
                    }
                    catch { }
                    finally
                    {
                        legend = aPB;
                    }
                    break;

                case BreakTypes.LabelBreak:
                    LabelBreak aLB = new LabelBreak();
                    try
                    {
                        aLB.Color = color;
                        aLB.Angle = float.Parse(legendNode.Attributes["Angle"].InnerText);
                        aLB.Text  = legendNode.Attributes["Text"].InnerText;
                        string fontName = legendNode.Attributes["FontName"].InnerText;
                        float  fontSize = float.Parse(legendNode.Attributes["FontSize"].InnerText);
                        bool   fontBold = bool.Parse(legendNode.Attributes["FontBold"].InnerText);
                        if (fontBold)
                        {
                            aLB.Font = new Font(fontName, fontSize, FontStyle.Bold);
                        }
                        else
                        {
                            aLB.Font = new Font(fontName, fontSize);
                        }

                        aLB.YShift = float.Parse(legendNode.Attributes["YShift"].InnerText);
                    }
                    catch { }
                    finally
                    {
                        legend = aLB;
                    }
                    break;

                case BreakTypes.ChartBreak:
                    ChartBreak aChB = new ChartBreak(ChartTypes.BarChart);
                    try
                    {
                        ChartTypes chartType = (ChartTypes)Enum.Parse(typeof(ChartTypes), legendNode.Attributes["ChartType"].InnerText);
                        aChB            = new ChartBreak(chartType);
                        aChB.ShapeIndex = int.Parse(legendNode.Attributes["ShapeIndex"].InnerText);
                        List <float> cData    = new List <float>();
                        string[]     cDataStr = legendNode.Attributes["ChartData"].InnerText.Split(',');
                        for (int i = 0; i < cDataStr.Length; i++)
                        {
                            cData.Add(float.Parse(cDataStr[i]));
                        }

                        aChB.ChartData = cData;
                        aChB.XShift    = int.Parse(legendNode.Attributes["XShift"].InnerText);
                        aChB.YShift    = int.Parse(legendNode.Attributes["YShift"].InnerText);
                    }
                    catch { }
                    finally
                    {
                        legend = aChB;
                    }
                    break;

                case BreakTypes.VectorBreak:
                    VectorBreak aVB = new VectorBreak();
                    try
                    {
                        aVB.Color = color;
                    }
                    catch { }
                    finally
                    {
                        legend = aVB;
                    }
                    break;

                case BreakTypes.PolylineBreak:
                    PolyLineBreak aPLB = new PolyLineBreak();
                    try
                    {
                        aPLB.Color = color;
                        aPLB.Size  = Convert.ToSingle(legendNode.Attributes["Size"].InnerText);
                        aPLB.Style = (LineStyles)Enum.Parse(typeof(LineStyles),
                                                            legendNode.Attributes["Style"].InnerText, true);
                        aPLB.DrawSymbol  = bool.Parse(legendNode.Attributes["DrawSymbol"].InnerText);
                        aPLB.SymbolSize  = Single.Parse(legendNode.Attributes["SymbolSize"].InnerText);
                        aPLB.SymbolStyle = (PointStyle)Enum.Parse(typeof(PointStyle),
                                                                  legendNode.Attributes["SymbolStyle"].InnerText, true);
                        aPLB.SymbolColor    = ColorTranslator.FromHtml(legendNode.Attributes["SymbolColor"].InnerText);
                        aPLB.SymbolInterval = int.Parse(legendNode.Attributes["SymbolInterval"].InnerText);
                    }
                    catch { }
                    finally
                    {
                        legend = aPLB;
                    }
                    break;

                case BreakTypes.PolygonBreak:
                    PolygonBreak aPGB = new PolygonBreak();
                    try
                    {
                        aPGB.Color           = color;
                        aPGB.DrawFill        = Convert.ToBoolean(legendNode.Attributes["DrawFill"].InnerText);
                        aPGB.DrawOutline     = Convert.ToBoolean(legendNode.Attributes["DrawOutline"].InnerText);
                        aPGB.OutlineSize     = Convert.ToSingle(legendNode.Attributes["OutlineSize"].InnerText);
                        aPGB.OutlineColor    = ColorTranslator.FromHtml(legendNode.Attributes["OutlineColor"].InnerText);
                        aPGB.UsingHatchStyle = bool.Parse(legendNode.Attributes["UsingHatchStyle"].InnerText);
                        aPGB.Style           = (HatchStyle)Enum.Parse(typeof(HatchStyle), legendNode.Attributes["Style"].InnerText, true);
                        aPGB.BackColor       = ColorTranslator.FromHtml(legendNode.Attributes["BackColor"].InnerText);
                        //aPGB.TransparencyPercent = int.Parse(legendNode.Attributes["TransparencyPercent"].InnerText);
                        aPGB.IsMaskout = bool.Parse(legendNode.Attributes["IsMaskout"].InnerText);
                    }
                    catch { }
                    {
                        legend = aPGB;
                    }
                    break;
                }
            }
            catch { }
            return(legend);
        }
Beispiel #5
0
 public BreakElement()
 {
     ElementType = ElementTypes.Break;
     BreakType   = BreakTypes.LineBreak;
 }
Beispiel #6
0
        public Theme(string indicator, string id, decimal min, decimal max, int decimalPoint, DataView presentationData, Color[] legendColor, Themes themes, int themeIndex, bool isFreequenctTableTheme)
        {
            this._Indicator = indicator;
            this._IndicatorNId = id;
            string FormatString = this.FormatNumber(decimalPoint);
            this._Minimum = Convert.ToDecimal(min.ToString(FormatString));
            this._Maximum = Convert.ToDecimal(max.ToString(FormatString));
            this._Decimal = decimalPoint;
            this.LegendColor = legendColor;
            this.PresentationData = presentationData;
            this.ThemeIndex = themeIndex;
            this._IsFreequenctTableTheme = isFreequenctTableTheme;

            if (this.Themes == null)
            {
                this.Themes = new Themes();
            }
            this.Themes = themes;

            if (isFreequenctTableTheme)
            {
                this._BreakType = BreakTypes.EqualSize;

                // -- set the default legends for frequency table
                this.EqualSize(this.PresentationData);
            }
            else
            {
                // -- set the default legends
                this.EqualCount(this.PresentationData);
            }
        }
Beispiel #7
0
 public ParagraphElement()
 {
     ElementType = ElementTypes.Paragraph;
     BreakType   = BreakTypes.ParapgraphBreak;
 }