using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RealTimeGraphX { /// /// Represents an helper class. /// public static class GraphDataPointHelper { /// /// Returns the absolute value of the specified percentage value between the specified minimum and maximum values. /// /// The minimum. /// The maximum. /// The percentage. /// public static T ComputeAbsolutePosition(T min, T max, double percentage) where T : class, IGraphDataPoint { return (Activator.CreateInstance(min.GetType()) as T).ComputeAbsolutePosition(min, max, percentage) as T; } /// /// Creates a range of values from the specified minimum and maximum. /// /// The minimum. /// The maximum. /// The count. /// public static IEnumerable CreateRange(IGraphDataPoint min, IGraphDataPoint max, int count) where T : class, IGraphDataPoint { return (Activator.CreateInstance(min.GetType()) as T).CreateRange(min, max, count) as IEnumerable; } /// /// Initializes a new instance of the specified type. /// /// /// public static T Init() where T : class, IGraphDataPoint { return Activator.CreateInstance(typeof(T)) as T; } } }