コード例 #1
0
 public bool SaveFile(FileViewModel file)
 {
     try
     {
         if (string.IsNullOrEmpty(file.get_Filename()))
         {
             V_2 = false;
         }
         else
         {
             this.CreateDirectoryIfNotExist(file.get_FileFolder());
             V_0 = string.Concat(file.get_Filename(), file.get_Extension());
             if (!string.IsNullOrEmpty(file.get_FileFolder()))
             {
                 stackVariable49    = new string[2];
                 stackVariable49[0] = file.get_FileFolder();
                 stackVariable49[1] = V_0;
                 V_0 = CommonHelper.GetFullPath(stackVariable49);
             }
             if (File.Exists(V_0))
             {
                 dummyVar0 = this.DeleteFile(V_0);
             }
             if (string.IsNullOrEmpty(file.get_Content()))
             {
                 V_3 = Convert.FromBase64String(file.get_FileStream().Split(',', 0)[1]);
                 V_4 = File.Create(V_0);
                 try
                 {
                     V_4.Write(V_3, 0, (int)V_3.Length);
                     V_2 = true;
                 }
                 finally
                 {
                     if (V_4 != null)
                     {
                         ((IDisposable)V_4).Dispose();
                     }
                 }
             }
             else
             {
                 V_1 = File.CreateText(V_0);
                 try
                 {
                     V_1.WriteLine(file.get_Content());
                     V_1.Dispose();
                     V_2 = true;
                 }
                 finally
                 {
                     if (V_1 != null)
                     {
                         ((IDisposable)V_1).Dispose();
                     }
                 }
             }
         }
     }
     catch
     {
         dummyVar1 = exception_0;
         V_2       = false;
     }
     return(V_2);
 }