static TimeAngleConverter() { Type mapperType = typeof(TimeAngleConverter); FieldInfo[] fields = mapperType.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly); foreach (FieldInfo fi in fields) { TimeAngleConverter instance = fi.GetValue(null) as TimeAngleConverter; if (fi.FieldType == typeof(TimeAngleConverter)) { All.Add(fi.Name, instance); } } }
public LineItem CurveOf(TimeAngleConverter clock, DateTimeOffset since, DateTimeOffset until) { if (clock == null) { return(null); } List <Double> dateValues = new List <Double>(); List <Double> clockValues = new List <Double>(); double clockDegree; for (DateTimeOffset date = since; date <= until; date += TimeSpan.FromDays(1)) { dateValues.Add(date.UtcDateTime.ToOADate()); clockDegree = clock.DegreeOf(date); clockValues.Add(clockDegree); } return(CurveOf("A", dateValues, clockValues, clock.DisplayColor, SymbolType.None)); }