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);
                }
            }
        }
        public override void Run()
        {
            var stepService = VuGenServiceManager.GetService <IStepService>();
            var step        = stepService.CurrentStep;

            if (step != null)
            {
                FindInReplayLog(step);
            }
        }
Пример #3
0
        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 override void Run()
        {
            IVuGenScript script = VuGenServiceManager.GetService <IVuGenProjectService>().GetActiveScript();

            if (script == null)
            {
                UttDialogMessageService.Instance.ShowWarning("Export to Zip operation is available for the currently loaded script only");
            }
            else
            {
                ZipExportDialogSettings settings = GetDefaultExportToZipSettings(script);
                using (VuGenZipExportDialog dialog = new VuGenZipExportDialog(script, settings))
                {
                    if (dialog.ShowDialog() == CustomDialogResult.Ok)
                    {
                        Process.Start("explorer.exe", "/select," + dialog.ExportZipFile);
                    }
                }
            }
        }
        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);
        }
Пример #6
0
 public override void Run()
 {
     VuGenServiceManager.RunWhenInitialized(InnerRun);
 }
 private void ExportScript(IVuGenScript script, UttPersistenceToken token)
 {
     VuGenServiceManager.GetService <IVuGenProjectService>().Export(script, token);
 }