public static bool DeleteDirectory(string directory)
    {
        if (!CFileManager.IsDirectoryExist(directory))
        {
            return(true);
        }
        int  num = 0;
        bool result;

        while (true)
        {
            try
            {
                Directory.Delete(directory, true);
                result = true;
                break;
            }
            catch (Exception ex)
            {
                num++;
                if (num >= 3)
                {
                    Debug.Log("Delete Directory " + directory + " Error! Exception = " + ex.ToString());
                    CFileManager.s_delegateOnOperateFileFail(directory, enFileOperation.DeleteDirectory, ex);
                    result = false;
                    break;
                }
            }
        }
        return(result);
    }
Exemplo n.º 2
0
    private void MakeDirReady()
    {
        if (CFileManager.IsDirectoryExist(s_httpFileRootDir) == false)
        {
            CFileManager.CreateDirectory(s_httpFileRootDir);
        }

        if (!CFileManager.IsDirectoryExist(m_dir))
        {
            CFileManager.CreateDirectory(m_dir);
        }
    }
Exemplo n.º 3
0
 public CCachedTextureManager()
 {
     if (!CFileManager.IsDirectoryExist(s_cachedTextureDirectory))
     {
         CFileManager.CreateDirectory(s_cachedTextureDirectory);
     }
     if (CFileManager.IsFileExist(s_cachedTextureInfoSetFileFullPath))
     {
         byte[] data   = CFileManager.ReadFile(s_cachedTextureInfoSetFileFullPath);
         int    offset = 0;
         this.m_cachedTextureInfoSet.Read(data, ref offset);
     }
 }
Exemplo n.º 4
0
 public CCachedTextureManager()
 {
     this.m_cachedTextureInfoSet = new CCachedTextureInfoSet();
     if (!CFileManager.IsDirectoryExist(CCachedTextureManager.s_cachedTextureDirectory))
     {
         CFileManager.CreateDirectory(CCachedTextureManager.s_cachedTextureDirectory);
     }
     if (CFileManager.IsFileExist(CCachedTextureManager.s_cachedTextureInfoSetFileFullPath))
     {
         byte[] data = CFileManager.ReadFile(CCachedTextureManager.s_cachedTextureInfoSetFileFullPath);
         int    num  = 0;
         this.m_cachedTextureInfoSet.Read(data, ref num);
     }
 }