From 2ce6afb909f34af7d78c20cfeb9f2d8311e91336 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Fri, 3 Oct 2025 01:55:11 +0300 Subject: Changed RealTimeGraphX to .NET 4.6.1 --- .../RealTimeGraphX/GraphDataPointHelper.cs | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphDataPointHelper.cs (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphDataPointHelper.cs') diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphDataPointHelper.cs b/Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphDataPointHelper.cs new file mode 100644 index 000000000..b28d7a501 --- /dev/null +++ b/Software/Visual_Studio/SideChains/RealTimeGraphXNet/RealTimeGraphX/GraphDataPointHelper.cs @@ -0,0 +1,48 @@ +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; + } + } +} -- cgit v1.3.1