aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core/Helpers
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/Helpers')
-rw-r--r--Software/Visual_Studio/Tango.Core/Helpers/AssemblyHelper.cs16
-rw-r--r--Software/Visual_Studio/Tango.Core/Helpers/FileHelper.cs2
-rw-r--r--Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs11
3 files changed, 3 insertions, 26 deletions
diff --git a/Software/Visual_Studio/Tango.Core/Helpers/AssemblyHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/AssemblyHelper.cs
index 27daa223b..11ef751e2 100644
--- a/Software/Visual_Studio/Tango.Core/Helpers/AssemblyHelper.cs
+++ b/Software/Visual_Studio/Tango.Core/Helpers/AssemblyHelper.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
-using System.Runtime.Versioning;
using System.Text;
using System.Threading.Tasks;
@@ -53,20 +52,5 @@ namespace Tango.Core.Helpers
{
return assembly.GetName().Version;
}
-
- public static Version GetTargetFrameworkVersion(Assembly assembly)
- {
- object[] list = Assembly.GetExecutingAssembly().GetCustomAttributes(true);
- var attribute = list.OfType<TargetFrameworkAttribute>().First();
-
- return Version.Parse(attribute.FrameworkName.Replace(".NETFramework,Version=v", ""));
- }
-
- public static String GetAssemblyTargetFrameworkFolder(Assembly assembly)
- {
- String dotNetVersion = AssemblyHelper.GetTargetFrameworkVersion(Assembly.GetExecutingAssembly()).ToString();
- String dotNetPath = $@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v{dotNetVersion}";
- return dotNetPath;
- }
}
}
diff --git a/Software/Visual_Studio/Tango.Core/Helpers/FileHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/FileHelper.cs
index 8ee0f4b8f..0b65de64d 100644
--- a/Software/Visual_Studio/Tango.Core/Helpers/FileHelper.cs
+++ b/Software/Visual_Studio/Tango.Core/Helpers/FileHelper.cs
@@ -16,7 +16,7 @@ namespace Tango.Core.Helpers
long bytes = Math.Abs(fileSize);
int place = System.Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024)));
double num = Math.Round(bytes / Math.Pow(1024, place), 1);
- return (Math.Sign(fileSize) * num).ToString() + " " + suf[place];
+ return (Math.Sign(fileSize) * num).ToString() + suf[place];
}
}
}
diff --git a/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs
index 11716ccda..ee2e3e132 100644
--- a/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs
+++ b/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs
@@ -72,12 +72,7 @@ namespace Tango.Core.Helpers
/// <param name="copySubDirs">if set to <c>true</c> will copy sub directories.</param>
/// <exception cref="DirectoryNotFoundException">Source directory does not exist or could not be found: "
/// + sourcePath</exception>
- public static void CopyDirectory(string sourcePath, string destinationPath, bool copySubDirs, Action<int, int> progress = null)
- {
- CopyDirectoryInternal(sourcePath, destinationPath, copySubDirs, progress, Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories).Length, 0);
- }
-
- private static void CopyDirectoryInternal(string sourcePath, string destinationPath, bool copySubDirs, Action<int, int> progress, int total, int current)
+ public static void CopyDirectory(string sourcePath, string destinationPath, bool copySubDirs)
{
// Get the subdirectories for the specified directory.
DirectoryInfo dir = new DirectoryInfo(sourcePath);
@@ -102,8 +97,6 @@ namespace Tango.Core.Helpers
{
string temppath = Path.Combine(destinationPath, file.Name);
file.CopyTo(temppath, false);
- current++;
- progress?.Invoke(current, total);
}
// If copying subdirectories, copy them and their contents to new location.
@@ -112,7 +105,7 @@ namespace Tango.Core.Helpers
foreach (DirectoryInfo subdir in dirs)
{
string temppath = Path.Combine(destinationPath, subdir.Name);
- CopyDirectoryInternal(subdir.FullName, temppath, copySubDirs, progress, total, current);
+ CopyDirectory(subdir.FullName, temppath, copySubDirs);
}
}
}