diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/Tango.Core/Helpers | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/Helpers')
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); } } } |
