NPlot.DateTimeAxis.Clone C# (CSharp) Метод

Clone() публичный Метод

Deep copy of DateTimeAxis.
public Clone ( ) : object
Результат object
        public override object Clone()
        {
            DateTimeAxis a = new DateTimeAxis();
            // ensure that this isn't being called on a derived type. If it is, then oh no!
            if (this.GetType() != a.GetType())
            {
                throw new NPlotException("Clone not defined in derived type. Help!");
            }
            DoClone(this, a);
            return a;
        }

Usage Example

Пример #1
0
        private void DetermineAxesToDraw(out Axis xAxis1, out Axis xAxis2, out Axis yAxis1, out Axis yAxis2)
        {
            xAxis1 = m_xAxis1;
            xAxis2 = m_xAxis2;
            yAxis1 = m_yAxis1;
            yAxis2 = m_yAxis2;

            if (m_xAxis1 == null)
            {
                if (m_xAxis2 == null)
                {
                    throw new NPlotException("Error: No X-Axis specified");
                }
                xAxis1 = (Axis)m_xAxis2.Clone();
                xAxis1.HideTickText = true;
                xAxis1.TicksAngle   = -(float)Math.PI / 2.0f;
            }

            if (m_xAxis2 == null)
            {
                // don't need to check if xAxis1_ == null, as case already handled above.
                xAxis2 = (Axis)m_xAxis1.Clone();
                xAxis2.HideTickText = true;
                xAxis2.TicksAngle   = (float)Math.PI / 2.0f;
            }

            if (m_yAxis1 == null)
            {
                if (m_yAxis2 == null)
                {
                    throw new NPlotException("Error: No Y-Axis specified");
                }
                yAxis1 = (Axis)m_yAxis2.Clone();
                yAxis1.HideTickText = true;
                yAxis1.TicksAngle   = (float)Math.PI / 2.0f;
            }

            if (m_yAxis2 == null)
            {
                // don't need to check if yAxis1_ == null, as case already handled above.
                yAxis2 = (Axis)m_yAxis1.Clone();
                yAxis2.HideTickText = true;
                yAxis2.TicksAngle   = -(float)Math.PI / 2.0f;
            }
        }