当前位置: 首页>>代码示例>>C#>>正文


C# IProgressMonitor.CreateSubProgressMonitor方法代码示例

本文整理汇总了C#中IProgressMonitor.CreateSubProgressMonitor方法的典型用法代码示例。如果您正苦于以下问题:C# IProgressMonitor.CreateSubProgressMonitor方法的具体用法?C# IProgressMonitor.CreateSubProgressMonitor怎么用?C# IProgressMonitor.CreateSubProgressMonitor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IProgressMonitor的用法示例。


在下文中一共展示了IProgressMonitor.CreateSubProgressMonitor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public void Execute(IProgressMonitor progressMonitor)
        {
            using (progressMonitor.BeginTask("Creating new project", 100))
            {
                using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(20))
                {
                    projectController.NewProject(subProgressMonitor);
                }

                using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(80))
                {
                    var command = commandFactory.CreateLoadPackageCommand();
                    command.Execute(subProgressMonitor);
                }
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:16,代码来源:NewProjectCommand.cs

示例2: ResetTestStatus

 private void ResetTestStatus(IProgressMonitor progressMonitor)
 {
     using (progressMonitor.CreateSubProgressMonitor(5))
     {
         eventAggregator.Send(this, new TestsReset());
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:OpenProjectCommand.cs

示例3: OpenProject

 private void OpenProject(IProgressMonitor progressMonitor)
 {
     using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(5))
     {
         projectController.OpenProject(subProgressMonitor, ProjectLocation);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:OpenProjectCommand.cs

示例4: SaveUserOptions

 private void SaveUserOptions(IProgressMonitor progressMonitor)
 {
     using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(40))
     {
         projectUserOptionsController.SaveUserOptions(ProjectLocation, subProgressMonitor);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:SaveProjectCommand.cs

示例5: InstallOrUninstallWithElevationContext

        private static bool InstallOrUninstallWithElevationContext(IEnumerable<ComponentHandle<IInstaller, InstallerTraits>> installerHandles,
            IElevationContext elevationContext, IProgressMonitor progressMonitor,
            InstallerOperation operation)
        {
            foreach (var installerHandle in installerHandles)
            {
                if (progressMonitor.IsCanceled)
                    return false;

                IProgressMonitor subProgressMonitor = progressMonitor.CreateSubProgressMonitor(1);
                if (elevationContext != null && installerHandle.GetTraits().RequiresElevation)
                {
                    elevationContext.Execute(InstallerElevatedCommand.ElevatedCommandId,
                        new InstallerElevatedCommand.Arguments(installerHandle.Id, operation),
                        subProgressMonitor);
                }
                else
                {
                    IInstaller installer = installerHandle.GetComponent();

                    if (operation == InstallerOperation.Install)
                        installer.Install(progressMonitor.CreateSubProgressMonitor(1));
                    else
                        installer.Uninstall(progressMonitor.CreateSubProgressMonitor(1));
                }
            }

            return true;
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:29,代码来源:DefaultInstallerManager.cs

示例6: SaveReportAs

        public string SaveReportAs(Report report, string fileName, string format, IProgressMonitor progressMonitor)
        {
            var file = string.Empty;
            using (progressMonitor.BeginTask("Generating report", 100))
            {
                var folderName = Path.GetDirectoryName(fileName);
                var reportContainer = new FileSystemReportContainer(folderName, 
                    Path.GetFileNameWithoutExtension(fileName));
                var reportWriter = reportManager.CreateReportWriter(report, reportContainer);

                if (progressMonitor.IsCanceled)
                    throw new OperationCanceledException();

                // Delete the report if it already exists
                reportContainer.DeleteReport();

                if (progressMonitor.IsCanceled)
                    throw new OperationCanceledException();

                progressMonitor.Worked(10);

                // Format the report
                var reportFormatterOptions = new ReportFormatterOptions();
                using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(90))
                    reportManager.Format(reportWriter, format, reportFormatterOptions, subProgressMonitor);

                if (progressMonitor.IsCanceled)
                    throw new OperationCanceledException();

                if (reportWriter.ReportDocumentPaths.Count > 0)
                    file = Path.Combine(folderName, reportWriter.ReportDocumentPaths[0]);
            }
            return file;
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:34,代码来源:ReportService.cs

示例7: SaveProject

 private void SaveProject(IProgressMonitor progressMonitor)
 {
     using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(50))
     {
         projectController.Save(ProjectLocation, subProgressMonitor);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:SaveProjectCommand.cs

示例8: Execute

        public void Execute(IProgressMonitor progressMonitor)
        {
            using (progressMonitor.BeginTask("Removing all files.", 100))
            {
                // remove all files from test package
                using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(50))
                    projectController.RemoveAllFiles();

                // reload
                using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(50))
                {
                    var loadPackageCommand = new LoadPackageCommand(testController, projectController);
                    loadPackageCommand.Execute(subProgressMonitor);
                }
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:16,代码来源:RemoveAllFilesCommand.cs

示例9: ExploreTests

 private void ExploreTests(IProgressMonitor progressMonitor)
 {
     using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(90))
     {
         testController.Explore(subProgressMonitor, projectController.TestRunnerExtensionSpecifications);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:LoadPackageCommand.cs

示例10: SetTestPackage

 private void SetTestPackage(IProgressMonitor progressMonitor)
 {
     using (progressMonitor.CreateSubProgressMonitor(10))
     {
         testController.SetTestPackage(projectController.TestPackage);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:LoadPackageCommand.cs

示例11: SaveCurrentTestFilter

 private void SaveCurrentTestFilter(IProgressMonitor progressMonitor)
 {
     using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(10))
     {
         var command = commandFactory.CreateSaveFilterCommand("AutoSave");
         command.Execute(subProgressMonitor);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:SaveProjectCommand.cs

示例12: RunTests

 private void RunTests(IProgressMonitor progressMonitor)
 {
     using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(50))
     {
         var runTestsCommand = commandFactory.CreateRunTestsCommand(false);
         runTestsCommand.Execute(subProgressMonitor);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:ReloadCommand.cs

示例13: RestoreTestFilter

 private void RestoreTestFilter(IProgressMonitor progressMonitor)
 {
     using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(5))
     {
         var restoreFilterCommand = commandFactory.CreateRestoreFilterCommand("AutoSave");
         restoreFilterCommand.Execute(subProgressMonitor);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:ReloadCommand.cs

示例14: SaveLastRunFilter

 private void SaveLastRunFilter(IProgressMonitor progressMonitor)
 {
     using (progressMonitor.CreateSubProgressMonitor(5))
     {
         var filterSet = filterService.GenerateFilterSetFromSelectedTests();
         projectController.SaveFilterSet("LastRun", filterSet);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:RunTestsCommand.cs

示例15: LoadPackage

 private void LoadPackage(IProgressMonitor progressMonitor)
 {
     using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(85))
     {
         var loadPackageCommand = commandFactory.CreateLoadPackageCommand();
         loadPackageCommand.Execute(subProgressMonitor);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:OpenProjectCommand.cs


注:本文中的IProgressMonitor.CreateSubProgressMonitor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。