Ejemplo n.º 1
0
 public List <FileViewModel> GetWebFiles(string folder)
 {
     stackVariable1    = new string[3];
     stackVariable1[0] = "wwwroot";
     stackVariable1[1] = "content";
     stackVariable1[2] = folder;
     V_0 = CommonHelper.GetFullPath(stackVariable1);
     this.CreateDirectoryIfNotExist(V_0);
     V_1 = new List <FileViewModel>();
     V_2 = Directory.GetDirectories(V_0, "*", 1);
     V_3 = 0;
     while (V_3 < (int)V_2.Length)
     {
         V_4             = new DirectoryInfo(V_2[V_3]);
         V_5             = V_4.ToString().Replace("\\", "/").Replace("wwwroot", string.Empty);
         stackVariable34 = V_4.GetFiles();
         stackVariable35 = FileRepository.u003cu003ec.u003cu003e9__31_0;
         if (stackVariable35 == null)
         {
             dummyVar0       = stackVariable35;
             stackVariable35 = new Func <FileInfo, DateTime>(FileRepository.u003cu003ec.u003cu003e9.u003cGetWebFilesu003eb__31_0);
             FileRepository.u003cu003ec.u003cu003e9__31_0 = stackVariable35;
         }
         V_6 = ((IEnumerable <FileInfo>)stackVariable34).OrderByDescending <FileInfo, DateTime>(stackVariable35).GetEnumerator();
         try
         {
             while (V_6.MoveNext())
             {
                 V_7             = V_6.get_Current();
                 stackVariable42 = V_1;
                 stackVariable43 = new FileViewModel();
                 stackVariable43.set_FolderName(V_4.get_Name());
                 stackVariable43.set_FileFolder(V_5);
                 if (V_7.get_Name().LastIndexOf('.') >= 0)
                 {
                     stackVariable59 = V_7.get_Name().Substring(0, V_7.get_Name().LastIndexOf('.'));
                 }
                 else
                 {
                     stackVariable59 = V_7.get_Name();
                 }
                 stackVariable43.set_Filename(stackVariable59);
                 stackVariable43.set_Extension(V_7.get_Extension());
                 stackVariable42.Add(stackVariable43);
             }
         }
         finally
         {
             if (V_6 != null)
             {
                 V_6.Dispose();
             }
         }
         V_3 = V_3 + 1;
     }
     return(V_1);
 }
Ejemplo n.º 2
0
 public static int CompareToSecurityAttribute(this SecurityAttribute first, SecurityAttribute second, SecurityDeclaration firstDeclaration, SecurityDeclaration secondDeclaration)
 {
     if ((object)first == (object)second)
     {
         return(0);
     }
     V_0 = firstDeclaration.get_Action().ToString();
     V_1 = secondDeclaration.get_Action().ToString();
     if (String.op_Inequality(V_0, V_1))
     {
         return(V_0.CompareTo(V_1));
     }
     V_2 = Math.Max(first.get_Properties().get_Count(), second.get_Properties().get_Count());
     V_5 = 0;
     while (V_5 < V_2)
     {
         if (V_5 >= first.get_Properties().get_Count())
         {
             return(1);
         }
         if (V_5 >= second.get_Properties().get_Count())
         {
             return(-1);
         }
         V_6 = first.get_Properties().get_Item(V_5);
         V_7 = second.get_Properties().get_Item(V_5);
         if (!String.op_Equality(V_6.get_Name(), V_7.get_Name()))
         {
             return(V_6.get_Name().CompareTo(V_7.get_Name()));
         }
         V_10 = V_6.get_Argument();
         V_8  = V_10.get_Value().ToString();
         V_10 = V_7.get_Argument();
         V_9  = V_10.get_Value().ToString();
         if (String.op_Inequality(V_8, V_9))
         {
             return(V_8.CompareTo(V_9));
         }
         V_5 = V_5 + 1;
     }
     V_3  = Math.Max(first.get_Fields().get_Count(), second.get_Fields().get_Count());
     V_11 = 0;
     while (V_11 < V_3)
     {
         if (V_11 >= first.get_Fields().get_Count())
         {
             return(1);
         }
         if (V_11 >= second.get_Fields().get_Count())
         {
             return(-1);
         }
         V_12 = first.get_Fields().get_Item(V_11);
         V_13 = second.get_Fields().get_Item(V_11);
         if (!String.op_Equality(V_12.get_Name(), V_13.get_Name()))
         {
             return(V_12.get_Name().CompareTo(V_13.get_Name()));
         }
         V_10 = V_12.get_Argument();
         V_14 = V_10.get_Value().ToString();
         V_10 = V_13.get_Argument();
         V_15 = V_10.get_Value().ToString();
         if (String.op_Inequality(V_14, V_15))
         {
             return(V_14.CompareTo(V_15));
         }
         V_11 = V_11 + 1;
     }
     return(0);
 }