public List <TemplateViewModel> GetTemplates(string folder) { if (!Directory.Exists(folder)) { dummyVar0 = Directory.CreateDirectory(folder); } stackVariable7 = (new DirectoryInfo(folder)).GetFiles(string.Format("*{0}", ".cshtml")); V_0 = new List <TemplateViewModel>(); V_1 = stackVariable7; V_2 = 0; while (V_2 < (int)V_1.Length) { V_3 = V_1[V_2]; V_4 = V_3.OpenText(); try { stackVariable20 = new TemplateViewModel(); stackVariable20.set_FileFolder(folder); stackVariable20.set_Filename(V_3.get_Name()); stackVariable20.set_Extension(".cshtml"); stackVariable20.set_Content(V_4.ReadToEnd()); V_0.Add(stackVariable20); } finally { if (V_4 != null) { ((IDisposable)V_4).Dispose(); } } V_2 = V_2 + 1; } return(V_0); }
public List <FileViewModel> GetUploadFiles(string folder) { stackVariable1 = new string[2]; stackVariable1[0] = "Content/Uploads"; stackVariable1[1] = folder; V_0 = CommonHelper.GetFullPath(stackVariable1); this.CreateDirectoryIfNotExist(V_0); stackVariable11 = (new DirectoryInfo(V_0)).GetFiles(); V_1 = new List <FileViewModel>(); stackVariable13 = FileRepository.u003cu003ec.u003cu003e9__26_0; if (stackVariable13 == null) { dummyVar0 = stackVariable13; stackVariable13 = new Func <FileInfo, DateTime>(FileRepository.u003cu003ec.u003cu003e9.u003cGetUploadFilesu003eb__26_0); FileRepository.u003cu003ec.u003cu003e9__26_0 = stackVariable13; } V_2 = ((IEnumerable <FileInfo>)stackVariable11).OrderByDescending <FileInfo, DateTime>(stackVariable13).GetEnumerator(); try { while (V_2.MoveNext()) { V_3 = V_2.get_Current(); V_4 = V_3.OpenText(); try { stackVariable23 = new FileViewModel(); stackVariable23.set_FileFolder(folder); stackVariable23.set_Filename(V_3.get_Name().Substring(0, V_3.get_Name().LastIndexOf('.'))); stackVariable23.set_Extension(V_3.get_Extension()); stackVariable23.set_Content(V_4.ReadToEnd()); V_1.Add(stackVariable23); } finally { if (V_4 != null) { ((IDisposable)V_4).Dispose(); } } } } finally { if (V_2 != null) { V_2.Dispose(); } } return(V_1); }