mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
refactor: Tidying
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using ICD.Common.Properties;
|
using ICD.Common.Properties;
|
||||||
|
using ICD.Common.Utils.Extensions;
|
||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
#else
|
#else
|
||||||
@@ -69,16 +70,16 @@ namespace ICD.Common.Utils.IO
|
|||||||
return Path.ChangeExtension(path, ext);
|
return Path.ChangeExtension(path, ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetRelativePath(string folder, string filespec)
|
public static string GetRelativePath(string folder, string filespec)
|
||||||
{
|
{
|
||||||
Uri pathUri = new Uri(filespec);
|
Uri pathUri = new Uri(filespec);
|
||||||
// Folders must end in a slash
|
|
||||||
if (!folder.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
// Folders must end in a slash
|
||||||
{
|
if (!folder.EndsWith(Path.DirectorySeparatorChar))
|
||||||
folder += Path.DirectorySeparatorChar;
|
folder += Path.DirectorySeparatorChar;
|
||||||
}
|
|
||||||
Uri folderUri = new Uri(folder);
|
Uri folderUri = new Uri(folder);
|
||||||
return Uri.UnescapeDataString(folderUri.MakeRelativeUri(pathUri).ToString().Replace('/', Path.DirectorySeparatorChar));
|
return Uri.UnescapeDataString(folderUri.MakeRelativeUri(pathUri).ToString().Replace('/', Path.DirectorySeparatorChar));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
#if SIMPLSHARP
|
||||||
#if SIMPLSHARP
|
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
#elif STANDARD
|
#elif STANDARD
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|||||||
Reference in New Issue
Block a user