using System.IO; using System.Reflection; namespace RGB.NET.Devices.CoolerMaster.Helper { /// /// Offers some helper-methods for file-path related things. /// internal static class PathHelper { /// /// Returns an absolute path created from an relative path relatvie to the location of the executung assembly. /// /// The relative path to convert. /// The absolute path. internal static string GetAbsolutePath(string relativePath) { string assemblyLocation = Assembly.GetEntryAssembly()?.Location; if (assemblyLocation == null) return relativePath; return Path.Combine(Path.GetDirectoryName(assemblyLocation), relativePath); } } }