Example #1
0
 /// <summary>
 /// Helper method for Clone.
 /// </summary>
 /// <param name="a">The cloned target object.</param>
 /// <param name="b">The cloned source object.</param>
 protected static void DoClone(TradingDateTimeAxis b, TradingDateTimeAxis a)
 {
     DateTimeAxis.DoClone(b, a);
     a.startTradingTime_ = b.startTradingTime_;
     a.endTradingTime_   = b.endTradingTime_;
     a.tradingTimeSpan_  = b.tradingTimeSpan_;
     a.WorldMin          = b.WorldMin;
     a.WorldMax          = b.WorldMax;
 }
Example #2
0
        /// <summary>
        /// Deep copy of DateTimeAxis.
        /// </summary>
        /// <returns>A copy of the DateTimeAxis Class.</returns>
        public override object Clone()
        {
            TradingDateTimeAxis a = new TradingDateTimeAxis();

            // ensure that this isn't being called on a derived type. If it is, then oh no!
            if (this.GetType() != a.GetType())
            {
                throw new XwPlotException("Clone not defined in derived type. Help!");
            }
            DoClone(this, a);
            return(a);
        }
Example #3
0
 /// <summary>
 /// Helper method for Clone.
 /// </summary>
 /// <param name="a">The cloned target object.</param>
 /// <param name="b">The cloned source object.</param>
 protected static void DoClone(TradingDateTimeAxis b, TradingDateTimeAxis a)
 {
     DateTimeAxis.DoClone (b, a);
     a.startTradingTime_ = b.startTradingTime_;
     a.endTradingTime_ = b.endTradingTime_;
     a.tradingTimeSpan_ = b.tradingTimeSpan_;
     a.WorldMin = b.WorldMin;
     a.WorldMax = b.WorldMax;
 }
Example #4
0
 /// <summary>
 /// Deep copy of DateTimeAxis.
 /// </summary>
 /// <returns>A copy of the DateTimeAxis Class.</returns>
 public override object Clone()
 {
     TradingDateTimeAxis a = new TradingDateTimeAxis ();
     // ensure that this isn't being called on a derived type. If it is, then oh no!
     if (this.GetType() != a.GetType()) {
         throw new XwPlotException ( "Clone not defined in derived type. Help!" );
     }
     DoClone (this, a);
     return a;
 }
        private void DrawAxisTests(Context ctx, Rectangle bounds)
        {
            Rectangle boundingBox;
            Point tl = Point.Zero;
            Point br = Point.Zero;

            tl.X = bounds.Left + 30;	tl.Y = bounds.Top + 20;
            br.X = bounds.Right - 30;	br.Y = bounds.Top + 20;

            DateTime timeMin = new DateTime (2003, 10, 22, 15, 00, 00);
            DateTime timeMax = new DateTime (2004, 03, 12, 13, 30, 00);

            TradingDateTimeAxis axis = new TradingDateTimeAxis ();
            axis.WorldMin = (double)timeMin.Ticks;
            axis.WorldMax = (double)timeMax.Ticks;
            axis.Draw (ctx, tl, br, out boundingBox);

            timeMin = new DateTime (2013, 09, 17, 12, 30, 10);
            timeMax = new DateTime (2014, 01, 23, 12, 59, 30);
            axis.WorldMin = (double)timeMin.Ticks;
            axis.WorldMax = (double)timeMax.Ticks;

            tl.Y += 50;		br.Y += 50;
            axis.Draw (ctx, tl, br, out boundingBox);
        }