private void FilteForRuntimeSetting(IVuGenScript script, string folder)
        {
            IVuGenProjectService projectService = VuGenServiceManager.GetService <IVuGenProjectService>();
            //get runtime files
            List <string> runtimeFiles             = new List <string>();
            ReadOnlyCollection <string> localFiles = projectService.GetScriptLocalFiles(folder);

            foreach (string file in localFiles)
            {
                runtimeFiles.Add(Path.GetFileName(file));
            }

            //delete all non-runtime files
            List <string> files = UttFileSystemUtils.GetFileList(folder, "*.*", true);

            foreach (string file in files)
            {
                string fileName = Path.GetFileName(file);
                if (!runtimeFiles.Contains(fileName))
                {
                    File.SetAttributes(file, FileAttributes.Normal);
                    File.Delete(file);
                }
            }

            //delete empty folders
            string[] directories = Directory.GetDirectories(folder, "*.*", SearchOption.AllDirectories);
            foreach (string directory in directories)
            {
                if (!Directory.EnumerateFileSystemEntries(directory).Any())
                {
                    UttFileSystemUtils.DeleteDirectory(directory);
                }
            }
        }
        private void InnerRun()
        {
            IVuGenProjectService projectService = VuGenServiceManager.GetService <IVuGenProjectService>();

            projectService.ScriptSaved   += projectService_ScriptSaved;
            projectService.ScriptSavedAs += projectService_ScriptSavedAs;
            if (projectService is UttProjectService)
            {
                (projectService as UttProjectService).ScriptExported += AutostartCommand_ScriptExported;
            }
        }
        public AnalysisControlViewModel()
        {
            _projectService = WpfFactotum.IsInDesignMode()
                ? null
                : VuGenServiceManager.GetService <IVuGenProjectService>().EnsureNotNull();

            _transactionInfosInternal = new List <TransactionInfo>();
            Transactions = new CollectionView(_transactionInfosInternal);

            AnalysisTypes       = CreateCollectionViewForEnumeration <AnalysisType>();
            ScoreUtilityTypes   = CreateCollectionViewForEnumeration <ScoreUtilityType>();
            PageSpeedStrategies = CreateCollectionViewForEnumeration <PageSpeedStrategy>();

            AnalyzeCommand = new AsyncRelayCommand(ExecuteAnalyzeCommand, CanExecuteAnalyzeCommand);

            Transactions.CurrentChanged        += Transactions_CurrentChanged;
            AnalysisTypes.CurrentChanged       += AnalysisTypes_CurrentChanged;
            ScoreUtilityTypes.CurrentChanged   += ScoreUtilityTypes_CurrentChanged;
            PageSpeedStrategies.CurrentChanged += PageSpeedStrategies_CurrentChanged;

            if (_projectService != null)
            {
                _projectService.LastReplayedRunChanged += (sender, args) => RefreshTransactions();
                _projectService.ActiveScriptChanged    += (sender, args) => RefreshTransactions();
                _projectService.ScriptOpened           += (sender, args) => RefreshTransactions();
                _projectService.ScriptClosed           += (sender, args) => RefreshTransactions();
                _projectService.SolutionClosed         += (sender, args) => RefreshTransactions();
            }

            RefreshTransactions();

            CoerceValue(SelectedTransactionProperty);
            CoerceValue(SelectedAnalysisTypeProperty);
            CoerceValue(SelectedScoreUtilityTypeProperty);
            CoerceValue(SelectedPageSpeedStrategyProperty);
        }