示例#1
0
 public List <FileViewModel> GetFilesWithContent(string fullPath)
 {
     this.CreateDirectoryIfNotExist(fullPath);
     V_0 = new List <FileViewModel>();
     V_1 = Directory.GetDirectories(fullPath, "*", 1);
     V_2 = 0;
     while (V_2 < (int)V_1.Length)
     {
         stackVariable15 = new DirectoryInfo(V_1[V_2]);
         V_3             = stackVariable15.get_Name();
         stackVariable17 = stackVariable15.GetFiles();
         stackVariable18 = FileRepository.u003cu003ec.u003cu003e9__29_0;
         if (stackVariable18 == null)
         {
             dummyVar0       = stackVariable18;
             stackVariable18 = new Func <FileInfo, DateTime>(FileRepository.u003cu003ec.u003cu003e9.u003cGetFilesWithContentu003eb__29_0);
             FileRepository.u003cu003ec.u003cu003e9__29_0 = stackVariable18;
         }
         V_4 = ((IEnumerable <FileInfo>)stackVariable17).OrderByDescending <FileInfo, DateTime>(stackVariable18).GetEnumerator();
         try
         {
             while (V_4.MoveNext())
             {
                 V_5 = V_4.get_Current();
                 V_6 = V_5.OpenText();
                 try
                 {
                     V_7 = new FileViewModel();
                     V_7.set_FolderName(V_3);
                     stackVariable33    = new string[2];
                     stackVariable33[0] = fullPath;
                     stackVariable33[1] = V_3;
                     V_7.set_FileFolder(CommonHelper.GetFullPath(stackVariable33));
                     V_7.set_Filename(V_5.get_Name().Substring(0, V_5.get_Name().LastIndexOf('.')));
                     V_7.set_Extension(V_5.get_Extension());
                     V_7.set_Content(V_6.ReadToEnd());
                     V_0.Add(V_7);
                 }
                 finally
                 {
                     if (V_6 != null)
                     {
                         ((IDisposable)V_6).Dispose();
                     }
                 }
             }
         }
         finally
         {
             if (V_4 != null)
             {
                 V_4.Dispose();
             }
         }
         V_2 = V_2 + 1;
     }
     return(V_0);
 }