本文整理汇总了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);
}
}
}
示例2: ResetTestStatus
private void ResetTestStatus(IProgressMonitor progressMonitor)
{
using (progressMonitor.CreateSubProgressMonitor(5))
{
eventAggregator.Send(this, new TestsReset());
}
}
示例3: OpenProject
private void OpenProject(IProgressMonitor progressMonitor)
{
using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(5))
{
projectController.OpenProject(subProgressMonitor, ProjectLocation);
}
}
示例4: SaveUserOptions
private void SaveUserOptions(IProgressMonitor progressMonitor)
{
using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(40))
{
projectUserOptionsController.SaveUserOptions(ProjectLocation, subProgressMonitor);
}
}
示例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;
}
示例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;
}
示例7: SaveProject
private void SaveProject(IProgressMonitor progressMonitor)
{
using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(50))
{
projectController.Save(ProjectLocation, subProgressMonitor);
}
}
示例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);
}
}
}
示例9: ExploreTests
private void ExploreTests(IProgressMonitor progressMonitor)
{
using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(90))
{
testController.Explore(subProgressMonitor, projectController.TestRunnerExtensionSpecifications);
}
}
示例10: SetTestPackage
private void SetTestPackage(IProgressMonitor progressMonitor)
{
using (progressMonitor.CreateSubProgressMonitor(10))
{
testController.SetTestPackage(projectController.TestPackage);
}
}
示例11: SaveCurrentTestFilter
private void SaveCurrentTestFilter(IProgressMonitor progressMonitor)
{
using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(10))
{
var command = commandFactory.CreateSaveFilterCommand("AutoSave");
command.Execute(subProgressMonitor);
}
}
示例12: RunTests
private void RunTests(IProgressMonitor progressMonitor)
{
using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(50))
{
var runTestsCommand = commandFactory.CreateRunTestsCommand(false);
runTestsCommand.Execute(subProgressMonitor);
}
}
示例13: RestoreTestFilter
private void RestoreTestFilter(IProgressMonitor progressMonitor)
{
using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(5))
{
var restoreFilterCommand = commandFactory.CreateRestoreFilterCommand("AutoSave");
restoreFilterCommand.Execute(subProgressMonitor);
}
}
示例14: SaveLastRunFilter
private void SaveLastRunFilter(IProgressMonitor progressMonitor)
{
using (progressMonitor.CreateSubProgressMonitor(5))
{
var filterSet = filterService.GenerateFilterSetFromSelectedTests();
projectController.SaveFilterSet("LastRun", filterSet);
}
}
示例15: LoadPackage
private void LoadPackage(IProgressMonitor progressMonitor)
{
using (var subProgressMonitor = progressMonitor.CreateSubProgressMonitor(85))
{
var loadPackageCommand = commandFactory.CreateLoadPackageCommand();
loadPackageCommand.Execute(subProgressMonitor);
}
}