Exemple #1
0
        private void  RmDir(System.String dir)
        {
            System.IO.FileInfo fileDir = new System.IO.FileInfo(FullDir(dir));
            bool tmpBool;

            if (System.IO.File.Exists(fileDir.FullName))
            {
                tmpBool = true;
            }
            else
            {
                tmpBool = System.IO.Directory.Exists(fileDir.FullName);
            }
            if (tmpBool)
            {
                System.IO.FileInfo[] files = FileSupport.GetFiles(fileDir);
                if (files != null)
                {
                    for (int i = 0; i < files.Length; i++)
                    {
                        bool tmpBool2;
                        if (System.IO.File.Exists(files[i].FullName))
                        {
                            System.IO.File.Delete(files[i].FullName);
                            tmpBool2 = true;
                        }
                        else if (System.IO.Directory.Exists(files[i].FullName))
                        {
                            System.IO.Directory.Delete(files[i].FullName);
                            tmpBool2 = true;
                        }
                        else
                        {
                            tmpBool2 = false;
                        }
                        bool generatedAux = tmpBool2;
                    }
                }
                bool tmpBool3;
                if (System.IO.File.Exists(fileDir.FullName))
                {
                    System.IO.File.Delete(fileDir.FullName);
                    tmpBool3 = true;
                }
                else if (System.IO.Directory.Exists(fileDir.FullName))
                {
                    System.IO.Directory.Delete(fileDir.FullName);
                    tmpBool3 = true;
                }
                else
                {
                    tmpBool3 = false;
                }
                bool generatedAux2 = tmpBool3;
            }
        }
Exemple #2
0
        public override void  TearDown()
        {
            base.TearDown();
            if (this.__test_dir != null)
            {
                System.IO.FileInfo[] files = FileSupport.GetFiles(this.__test_dir);

                for (int i = 0; i < files.Length; ++i)
                {
                    bool tmpBool;
                    if (System.IO.File.Exists(files[i].FullName))
                    {
                        System.IO.File.Delete(files[i].FullName);
                        tmpBool = true;
                    }
                    else if (System.IO.Directory.Exists(files[i].FullName))
                    {
                        System.IO.Directory.Delete(files[i].FullName);
                        tmpBool = true;
                    }
                    else
                    {
                        tmpBool = false;
                    }
                    if (!tmpBool)
                    {
                        throw new System.IO.IOException("unable to remove file in test directory \"" + this.__test_dir.FullName + "\" (please remove by hand)");
                    }
                }

                bool tmpBool2;
                if (System.IO.File.Exists(this.__test_dir.FullName))
                {
                    System.IO.File.Delete(this.__test_dir.FullName);
                    tmpBool2 = true;
                }
                else if (System.IO.Directory.Exists(this.__test_dir.FullName))
                {
                    System.IO.Directory.Delete(this.__test_dir.FullName);
                    tmpBool2 = true;
                }
                else
                {
                    tmpBool2 = false;
                }
                if (!tmpBool2)
                {
                    throw new System.IO.IOException("unable to remove test directory \"" + this.__test_dir.FullName + "\" (please remove by hand)");
                }
            }
        }
        private void  RmDir(System.IO.FileInfo dir)
        {
            System.IO.FileInfo[] files = FileSupport.GetFiles(dir);
            for (int i = 0; i < files.Length; i++)
            {
                bool tmpBool;
                if (System.IO.File.Exists(files[i].FullName))
                {
                    System.IO.File.Delete(files[i].FullName);
                    tmpBool = true;
                }
                else if (System.IO.Directory.Exists(files[i].FullName))
                {
                    System.IO.Directory.Delete(files[i].FullName);
                    tmpBool = true;
                }
                else
                {
                    tmpBool = false;
                }
                bool generatedAux = tmpBool;
            }
            bool tmpBool2;

            if (System.IO.File.Exists(dir.FullName))
            {
                System.IO.File.Delete(dir.FullName);
                tmpBool2 = true;
            }
            else if (System.IO.Directory.Exists(dir.FullName))
            {
                System.IO.Directory.Delete(dir.FullName);
                tmpBool2 = true;
            }
            else
            {
                tmpBool2 = false;
            }
            bool generatedAux2 = tmpBool2;
        }