Esempio n. 1
0
        public DicomAge(int count, DicomAgeUnits units)
        {
            Platform.CheckArgumentRange(count, 0, 999, "count");

            _count = count;
            _units = units;
        }
Esempio n. 2
0
        public string ToString(DicomAgeUnits units)
        {
            switch (units)
            {
            case DicomAgeUnits.Days:
                return(string.Format("{0:000}D", (int)this.TotalDays));

            case DicomAgeUnits.Weeks:
                return(string.Format("{0:000}W", (int)this.TotalWeeks));

            case DicomAgeUnits.Months:
                return(string.Format("{0:000}M", (int)this.TotalMonths));

            default:
            case DicomAgeUnits.Years:
                return(string.Format("{0:000}Y", (int)this.TotalYears));
            }
        }