Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XDate"/> struct. 
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">
 /// The GraphPane object from which to copy
 /// </param>
 public XDate(XDate rhs)
 {
     this._xlDate = rhs._xlDate;
 }
Пример #2
0
        /// <summary>
        /// Determine the value for any minor tic.
        /// </summary>
        /// <remarks>
        /// This method properly accounts for <see cref="Scale.IsLog"/>, <see cref="Scale.IsText"/>, and other axis format settings.
        /// </remarks>
        /// <param name="baseVal">
        /// The value of the first major tic (floating point double).  This tic value is the base reference for all tics (including minor
        /// ones).
        /// </param>
        /// <param name="iTic">
        /// The major tic number (0 = first major tic).  For log scales, this is the actual power of 10.
        /// </param>
        /// <returns>
        /// The specified minor tic value (floating point double).
        /// </returns>
        internal override double CalcMinorTicValue(double baseVal, int iTic)
        {
            XDate xDate = new XDate(baseVal);

            switch (this._minorUnit)
            {
                case DateUnit.Year:
                default:
                    xDate.AddYears(iTic * this._minorStep);
                    break;
                case DateUnit.Month:
                    xDate.AddMonths(iTic * this._minorStep);
                    break;
                case DateUnit.Day:
                    xDate.AddDays(iTic * this._minorStep);
                    break;
                case DateUnit.Hour:
                    xDate.AddHours(iTic * this._minorStep);
                    break;
                case DateUnit.Minute:
                    xDate.AddMinutes(iTic * this._minorStep);
                    break;
                case DateUnit.Second:
                    xDate.AddSeconds(iTic * this._minorStep);
                    break;
            }

            return xDate.XLDate;
        }