Пример #1
0
        void ExtractFiles()   //1.2
        {
            string winRarPath     = Properties.Settings.Default.WinRarPath;
            string argsFullWinRar = GetArgsForWinRar();

            MyFileWorker.ProcessStart(winRarPath, argsFullWinRar);
            if (isExample)
            {
                var oldSolutionFolderName = Path.Combine(solutionFolderName, archiveFileName);
                var newFolderName         = Path.Combine(solutionFolderName, "dxExampl-" + archiveFileName.Substring(0, 10));
                while (true)
                {
                    var allProcesses = Process.GetProcesses();
                    var wRarProc     = allProcesses.Where(x => x.ProcessName == "WinRAR");
                    if (wRarProc.Count() == 0)
                    {
                        break;
                    }
                    Thread.Sleep(500);
                }
                MyFileWorker.DirectoryMove(oldSolutionFolderName, newFolderName);

                solutionFolderName = Path.Combine(newFolderName, "CS");
                solutionFolderInfo = MyFileWorker.CreateDirectory(solutionFolderName);
            }
            var vsDirectories = MyFileWorker.DirectoryGetDirectories(solutionFolderInfo, ".vs", SearchOption.AllDirectories);

            if (vsDirectories.Count() > 0)
            {
                MyFileWorker.DirectoryDelete(vsDirectories[0].FullName, true);
            }
        }