Example #1
0
        public Style Clone( )
        {
            Style newStyle = ( Style )MemberwiseClone( );

            newStyle.nameFont             = ( Font )NameFont.Clone( );
            newStyle.abstractNameFont     = ( Font )AbstractNameFont.Clone( );
            newStyle.identifierFont       = ( Font )IdentifierFont.Clone( );
            newStyle.memberFont           = ( Font )MemberFont.Clone( );
            newStyle.staticMemberFont     = ( Font )StaticMemberFont.Clone( );
            newStyle.abstractMemberFont   = ( Font )AbstractMemberFont.Clone( );
            newStyle.commentFont          = ( Font )CommentFont.Clone( );
            newStyle.relationshipTextFont = ( Font )RelationshipTextFont.Clone( );

            return(newStyle);
        }
Example #2
0
        public void Bind(FormulaChart fc)
        {
            foreach (FormulaArea fa in fc.Areas)
            {
                if (fa.AxisXs.Count != AxisXs.Count)
                {
                    fa.AxisXs.Clear();
                    for (int i = 0; i < AxisXs.Count; i++)
                    {
                        fa.AxisXs.Add(new FormulaAxisX()); //AxisXs[i]
                    }
                    if (AxisXs.Count > 0)
                    {
                        fa.AxisX = fa.AxisXs[0];
                    }
                }

                for (int i = 0; i < AxisXs.Count; i++)
                {
                    fa.AxisXs[i].CopyFrom(AxisXs[i]);
                }

                foreach (FormulaAxisY fay in fa.AxisYs)
                {
                    fay.CopyFrom(AxisY);
                }
                fa.Back    = (FormulaBack)Back.Clone();
                fa.Colors  = (Color[])Colors.Clone();
                fa.LinePen = LinePen.GetPen();                                                                    // LinePen.Clone();

                fa.BarPens         = new Pen[] { BarPens[0].GetPen(), BarPens[1].GetPen(), BarPens[2].GetPen() }; // (Pen[])BarPens.Clone();
                fa.BarBrushes      = new Brush[] { BarBrushes[0].GetBrush(), BarBrushes[1].GetBrush(), BarBrushes[2].GetBrush() };
                fa.NameBrush       = NameBrush.GetBrush();
                fa.NameFont        = (Font)NameFont.Clone();
                fa.TextFont        = (Font)TextFont.Clone();
                fa.StockRenderType = StockRenderType;
                if (fa.IsMain())
                {
                    fa.AxisY.Scale = scaleType;
                }
            }
            fc.StickRenderType     = StickRenderType;
            fc.CursorPen           = CursorPen.GetPen();
            fc.ShowXAxisInLastArea = ShowXAxisInLastArea;
            fc.ShowValueLabel      = ShowValueLabel;
            fc.AllXFormats         = AllXFormats;
        }