Exemplo n.º 1
0
        /// <summary>
        /// calculates the axis org and end using the databounds
        /// the org / end is adjusted only if it is not fixed
        /// and the DataBound object contains valid data
        /// </summary>
        public override void ProcessDataBounds(AltaxoVariant org, bool orgfixed, AltaxoVariant end, bool endfixed)
        {
            double dorg = org.ToDouble();
            double dend = end.ToDouble();

            ProcessDataBounds(dorg, orgfixed, dend, endfixed);
        }
Exemplo n.º 2
0
        private static void ConvertOrgEndToDateTimeValues(AltaxoVariant org, AltaxoVariant end, out DateTime dorg, out DateTime dend)
        {
            if (org.IsType(AltaxoVariant.Content.VDateTime))
            {
                dorg = org;
            }
            else if (org.CanConvertedToDouble)
            {
                dorg = new DateTime((long)(org.ToDouble() * 1E7));
            }
            else
            {
                throw new ArgumentException("Variant org is not a DateTime nor a numeric value");
            }

            if (end.IsType(AltaxoVariant.Content.VDateTime))
            {
                dend = end;
            }
            else if (end.CanConvertedToDouble)
            {
                dend = new DateTime((long)(end.ToDouble() * 1E7));
            }
            else
            {
                throw new ArgumentException("Variant end is not a DateTime nor a numeric value");
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// calculates the axis org and end using the databounds
        /// the org / end is adjusted only if it is not fixed
        /// and the DataBound object contains valid data
        /// </summary>
        public override void ProcessDataBounds(AltaxoVariant org, bool orgfixed, AltaxoVariant end, bool endfixed)
        {
            DateTime dorg;
            DateTime dend;

            if (org.IsType(AltaxoVariant.Content.VDateTime))
            {
                dorg = (DateTime)org;
            }
            else if (org.CanConvertedToDouble)
            {
                dorg = new DateTime((long)(org.ToDouble() * 1E7));
            }
            else
            {
                throw new ArgumentException("Variant org is not a DateTime nor a numeric value");
            }

            if (end.IsType(AltaxoVariant.Content.VDateTime))
            {
                dend = (DateTime)end;
            }
            else if (end.CanConvertedToDouble)
            {
                dend = new DateTime((long)(end.ToDouble() * 1E7));
            }
            else
            {
                throw new ArgumentException("Variant end is not a DateTime nor a numeric value");
            }


            ProcessDataBounds(dorg, orgfixed, dend, endfixed);
        }