/[AnywhereTS-MSSQL]/trunk/Tools/ATSClientManager/ATSClientManager/ATSClientFilesCollection.cs
ViewVC logotype

Diff of /trunk/Tools/ATSClientManager/ATSClientManager/ATSClientFilesCollection.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/Tools/ATSClientManager/ATSClientManager/ATSClientFilesCollection.cs	2012/08/27 22:06:40	335
+++ trunk/Tools/ATSClientManager/ATSClientManager/ATSClientFilesCollection.cs	2012/08/27 22:56:48	341
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.IO;
 namespace AnywhereTS.ATSClientManager
 {   
     public static class ATSClientFilesCollection
@@ -41,5 +42,24 @@
             if (found == ATSClientFileTypes.ClientUnknown) { Logging.ATSClientManagerLog.FatalFormat("ATSClientFilesCollection does not contain a client type for file: {0}", name); }
             return found;
         }
+
+        public static ATSClientFileList GetClientFilesInPath(DirectoryInfo path)
+        {
+            ATSClientFileList list = new ATSClientFileList();
+            List<IATSClientFile> client_files = new List<IATSClientFile>();
+            List<FileInfo> files = new List<FileInfo>(path.GetFiles());            
+            foreach (var file in files)
+            {
+                ATSClientFileTypes type = GetClientFileTypeByName(file.Name);
+                client_files.Add(ATSClientFile.Create(type, file.FullName));
+            }
+            list = new ATSClientFileList(client_files);
+            return list;
+        }
+        public static ATSClientFileList GetClientFilesInPath(string path)
+        {
+            return GetClientFilesInPath(new DirectoryInfo(path));
+        }
+
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22