Exemplo n.º 1
0
        }//end CalcHeight

        protected internal string PrintStartEndValue()
        {
            //if no range given print empty
            if (StartValue == 0 && EndValue == 0)
            {
                return(string.Empty);
            }

            //convert to nullables
            var entrySv = StartValue == 0 ? null : new double?(StartValue);
            var entryEv = EndValue == 0 ? null : new double?(EndValue);

            //short-circuit out with when just StartValue
            if (entrySv.HasValue && entryEv.HasValue && entrySv == entryEv)
            {
                return(((int)Math.Round(entrySv.Value)).ToString());
            }

            var dfRuleValues = GetRulerStartEndValues();

            return(TimelineExtensions.PrintYearsRange(new[] { new Tuple <double?, double?>(entrySv, entryEv) }, dfRuleValues.Item1,
                                                      dfRuleValues.Item2));
        }
Exemplo n.º 2
0
        }//end ToTextCanvas

        protected internal virtual string PrintYearsRange(IEnumerable <Tuple <double?, double?> > years)
        {
            return(TimelineExtensions.PrintYearsRange(years, StartValue, EndValue));
        }