Ejemplo n.º 1
0
 static SizeD()
 {
     MaxValue = new SizeD(double.MaxValue, double.MaxValue);
 }
Ejemplo n.º 2
0
 public static Size Round(SizeD value)
 {
     return(new Size((int)Math.Round(value.Width), (int)Math.Round(value.Height)));
 }
Ejemplo n.º 3
0
 public void Inflate(SizeD size)
 {
     Inflate(size.Width, size.Height);
 }
Ejemplo n.º 4
0
 public SizeD(SizeD size)
 {
     _width  = size.Width;
     _height = size.Height;
 }
Ejemplo n.º 5
0
        private void DetermineLabelStrategy(Graphics g)
        {
            LabelStrategy.ShowDayLabel = true;
            int  num   = 0;
            int  num2  = 7;
            int  num3  = 0;
            int  num4  = 0x1f;
            int  num5  = 0;
            int  num6  = 270;
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;

            foreach (XAxisLabelInfo info in Dates)
            {
                num++;
                num3++;
                num5++;
                if (info.StartWeek)
                {
                    if (flag)
                    {
                        num2 = (num < num2) ? num : num2;
                    }
                    flag = true;
                    num  = 0;
                }
                if (info.StartMonth)
                {
                    if (flag2)
                    {
                        num4 = (num3 < num4) ? num3 : num4;
                    }
                    flag2 = true;
                    num3  = 0;
                    if (!info.StartYear)
                    {
                        continue;
                    }
                    if (flag3)
                    {
                        num6 = (num5 < num6) ? num5 : num6;
                    }
                    flag3 = true;
                    num5  = 0;
                }
            }
            RectangleD worldRect  = Owner.WorldRect;
            Rectangle  canvasRect = Owner.CanvasRect;
            SizeF      ef         = g.MeasureString("00.", Font);
            SizeF      ef2        = g.MeasureString("00.", Font);
            SizeF      ef3        = g.MeasureString("September.", Font);
            SizeF      ef4        = g.MeasureString("Sep.", Font);
            SizeF      ef5        = g.MeasureString("S.", Font);
            SizeF      ef6        = g.MeasureString("2005.", Font);
            SizeD      ed2        = Conversion.WorldToScreen(new SizeD(StockSeries.MinimumXDelta, 0.0), worldRect,
                                                             canvasRect);

            LabelStrategy.ShowDayTick      = ed2.Width > 8.0;
            LabelStrategy.ShowWeekTick     = (ed2.Width * num2) > 8.0;
            LabelStrategy.ShowMonthTick    = (ed2.Width * num4) > 8.0;
            LabelStrategy.ShowQuarterTick  = ((ed2.Width * num4) * 3.0) > 8.0;
            LabelStrategy.ShowDayLabel     = ed2.Width > ef.Width;
            LabelStrategy.ShowWeekLabel    = (ed2.Width * num2) > ef2.Width;
            LabelStrategy.ShowMonthLabel   = (ed2.Width * num4) > ef5.Width;
            LabelStrategy.ShowQuarterLabel = ((ed2.Width * num4) * 3.0) > ef5.Width;
            LabelStrategy.Show1YearLabel   = (ed2.Width * num6) > ef6.Width;
            LabelStrategy.Show5YearLabel   = ((ed2.Width * num6) * 5.0) > ef6.Width;
            if (LabelStrategy.ShowMonthLabel)
            {
                LabelStrategy.ShowLongMonth  = (ed2.Width * num4) > ef3.Width;
                LabelStrategy.ShowShortMonth = ((ed2.Width * num4) > ef4.Width) && ((ed2.Width * num4) <= ef3.Width);
                LabelStrategy.ShowCharMonth  = ((ed2.Width * num4) > ef5.Width) && ((ed2.Width * num4) <= ef4.Width);
            }
            else
            {
                LabelStrategy.ShowLongMonth  = ((ed2.Width * num4) * 3.0) > ef3.Width;
                LabelStrategy.ShowShortMonth = (((ed2.Width * num4) * 3.0) > ef4.Width) &&
                                               (((ed2.Width * num4) * 3.0) <= ef3.Width);
                LabelStrategy.ShowCharMonth = (((ed2.Width * num4) * 3.0) > ef5.Width) &&
                                              (((ed2.Width * num4) * 3.0) <= ef4.Width);
            }
        }