diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-11-16 18:07:34 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-11-16 18:07:34 +0200 |
| commit | fc703faaa6326e28e146e00615db01c48ded0ece (patch) | |
| tree | 26b8b3134ab8562d8a7bf3c04bf99b897c5c3edb /Software/Visual_Studio/Tango.Core | |
| parent | 4be586d903da2b0dbba23f4978e14ad7d51edcbf (diff) | |
| download | Tango-fc703faaa6326e28e146e00615db01c48ded0ece.tar.gz Tango-fc703faaa6326e28e146e00615db01c48ded0ece.zip | |
Implemented PMR for CCS!
First test working.
Parsed and returned Calculate Stub!
Implemented custom proto C compiling to achieve shorter struct names!
Diffstat (limited to 'Software/Visual_Studio/Tango.Core')
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs index fa52eb42b..dd613ac5e 100644 --- a/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs +++ b/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs @@ -28,5 +28,44 @@ namespace Tango.Core.Helpers return false; } } + + + public static void CopyDirectory(string sourceDirName, string destDirName, bool copySubDirs) + { + // Get the subdirectories for the specified directory. + DirectoryInfo dir = new DirectoryInfo(sourceDirName); + + if (!dir.Exists) + { + throw new DirectoryNotFoundException( + "Source directory does not exist or could not be found: " + + sourceDirName); + } + + DirectoryInfo[] dirs = dir.GetDirectories(); + // If the destination directory doesn't exist, create it. + if (!Directory.Exists(destDirName)) + { + Directory.CreateDirectory(destDirName); + } + + // Get the files in the directory and copy them to the new location. + FileInfo[] files = dir.GetFiles(); + foreach (FileInfo file in files) + { + string temppath = Path.Combine(destDirName, file.Name); + file.CopyTo(temppath, false); + } + + // If copying subdirectories, copy them and their contents to new location. + if (copySubDirs) + { + foreach (DirectoryInfo subdir in dirs) + { + string temppath = Path.Combine(destDirName, subdir.Name); + CopyDirectory(subdir.FullName, temppath, copySubDirs); + } + } + } } } |
