• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IProgressMonitor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: CreateTextureBitmaps

        /// <summary>
        /// Creates bitmaps for the texture
        /// </summary>
        private static Bitmap[] CreateTextureBitmaps( IProgressMonitor progressMonitor, ISpherePlanet planet )
        {
            Bitmap[] faceBitmaps = new Bitmap[ 6 ];
            int width = 256;
            int height = 256;
            progressMonitor.UpdateProgress( 0 );

            ISpherePlanetTerrainRenderer renderer = planet.Renderer.GetRenderer<ISpherePlanetTerrainRenderer>( );
            if ( renderer == null )
            {
                throw new InvalidOperationException( "Expected a valid ISpherePlanetTerrainRenderer to be available" );
            }

            faceBitmaps[ ( int )CubeMapFace.PositiveX ] = renderer.CreateMarbleTextureFace( CubeMapFace.PositiveX, width, height ); progressMonitor.UpdateProgress( 1 / 6.0f );
            faceBitmaps[ ( int )CubeMapFace.NegativeX ] = renderer.CreateMarbleTextureFace( CubeMapFace.NegativeX, width, height ); progressMonitor.UpdateProgress( 2 / 6.0f );
            faceBitmaps[ ( int )CubeMapFace.PositiveY ] = renderer.CreateMarbleTextureFace( CubeMapFace.PositiveY, width, height ); progressMonitor.UpdateProgress( 3 / 6.0f );
            faceBitmaps[ ( int )CubeMapFace.NegativeY ] = renderer.CreateMarbleTextureFace( CubeMapFace.NegativeY, width, height ); progressMonitor.UpdateProgress( 4 / 6.0f );
            faceBitmaps[ ( int )CubeMapFace.PositiveZ ] = renderer.CreateMarbleTextureFace( CubeMapFace.PositiveZ, width, height ); progressMonitor.UpdateProgress( 5 / 6.0f );
            faceBitmaps[ ( int )CubeMapFace.NegativeZ ] = renderer.CreateMarbleTextureFace( CubeMapFace.NegativeZ, width, height );
            progressMonitor.UpdateProgress( 1 );

            foreach ( object cubeMapFace in Enum.GetValues( typeof( CubeMapFace ) ) )
            {
                faceBitmaps[ ( int )cubeMapFace ].Save( "PlanetCubeMap" + cubeMapFace + ".png" );
            }

            return faceBitmaps;
        }
开发者ID:johann-gambolputty,项目名称:robotbastards,代码行数:31,代码来源:SpherePlanetMarbleTextureBuilder.cs


示例2: WriteFile

		public void WriteFile (string file, object obj, MSBuildFileFormat format, bool saveProjects, IProgressMonitor monitor)
		{
			Solution sol = (Solution) obj;

			string tmpfilename = String.Empty;
			try {
				monitor.BeginTask (GettextCatalog.GetString ("Saving solution: {0}", file), 1);
				try {
					if (File.Exists (file))
						tmpfilename = Path.GetTempFileName ();
				} catch (IOException) {
				}

				string baseDir = Path.GetDirectoryName (file);
				if (tmpfilename == String.Empty) {
					WriteFileInternal (file, sol, baseDir, format, saveProjects, monitor);
				} else {
					WriteFileInternal (tmpfilename, sol, baseDir, format, saveProjects, monitor);
					FileService.SystemRename (tmpfilename, file);
				}
			} catch (Exception ex) {
				monitor.ReportError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex);
				LoggingService.LogError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex);

				if (!String.IsNullOrEmpty (tmpfilename) && File.Exists (tmpfilename))
					File.Delete (tmpfilename);
				throw;
			} finally {
				monitor.EndTask ();
			}
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:31,代码来源:SlnFileFormat.cs


示例3: RunImpl

        protected internal override TestResult RunImpl(ITestCommand rootTestCommand, Model.Tree.TestStep parentTestStep, TestExecutionOptions options, IProgressMonitor progressMonitor)
        {
            using (progressMonitor.BeginTask("Running tests.", rootTestCommand.TestCount))
            {
                // Note: We do not check options.SkipTestExecution here because we want to build up
                // the tree of data-driven test steps.  So we actually check it later on in the
                // PatternTestExecutor.  This is different from framework adapters
                // at this time (because they do not generally support dynamically generated data-driven tests).
                Sandbox sandbox = new Sandbox();
                EventHandler canceledHandler = delegate { sandbox.Abort(TestOutcome.Canceled, "The user canceled the test run."); };
                try
                {
                    progressMonitor.Canceled += canceledHandler;

                    TestAssemblyExecutionParameters.Reset();

                    PatternTestExecutor executor = new PatternTestExecutor(options, progressMonitor, formatter, converter, environmentManager);

                    // Inlined to minimize stack depth.
                    var action = executor.CreateActionToRunTest(rootTestCommand, parentTestStep, sandbox, null);
                    action.Run();
                    return action.Result;
                }
                finally
                {
                    progressMonitor.Canceled -= canceledHandler;
                    sandbox.Dispose();
                }
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:30,代码来源:PatternTestController.cs


示例4: FindReferences

		public override IEnumerable<MemberReference> FindReferences (MonoDevelop.Projects.Project project, IProjectContent content, IEnumerable<FilePath> files, IProgressMonitor monitor, IEnumerable<object> searchedMembers)
		{ // TODO: Type system conversion.
			yield break;
//			var editor = TextFileProvider.Instance.GetTextEditorData (fileName);
//			AspNetAppProject project = dom.Project as AspNetAppProject;
//			if (project == null)
//				yield break;
//			
//			var unit = AspNetParserService.GetCompileUnit (project, fileName, true);
//			if (unit == null)
//				yield break;
//			var refman = new DocumentReferenceManager (project);
//			
//			var parsedAspDocument = (AspNetParsedDocument)new AspNetParser ().Parse (dom, fileName, editor.Text);
//			refman.Doc = parsedAspDocument;
//			
//			var usings = refman.GetUsings ();
//			var documentInfo = new DocumentInfo (dom, unit, usings, refman.GetDoms ());
//			
//			var builder = new AspLanguageBuilder ();
//			
//			
//			var buildDocument = new Mono.TextEditor.TextDocument ();
//			var offsetInfos = new List<LocalDocumentInfo.OffsetInfo> ();
//			buildDocument.Text = builder.BuildDocumentString (documentInfo, editor, offsetInfos, true);
//			var parsedDocument = AspLanguageBuilder.Parse (dom, fileName, buildDocument.Text);
//			foreach (var member in searchedMembers) {
//				foreach (var reference in SearchMember (member, dom, fileName, editor, buildDocument, offsetInfos, parsedDocument)) {
//					yield return reference;
//				}
//			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:32,代码来源:ASPNetReferenceFinder.cs


示例5: Initialize1

		internal void Initialize1(IProgressMonitor progressMonitor)
		{
			ICollection<ProjectItem> items = project.Items;
			ProjectService.ProjectItemAdded   += OnProjectItemAdded;
			ProjectService.ProjectItemRemoved += OnProjectItemRemoved;
			UpdateDefaultImports(items);
			// TODO: Translate me
//			progressMonitor.TaskName = "Resolving references for " + project.Name + "...";
			AbstractProject abstractProject = project as AbstractProject;
			if (abstractProject != null) {
				foreach (var reference in abstractProject.ResolveAssemblyReferences(progressMonitor.CancellationToken)) {
					if (!initializing) return; // abort initialization
					AddReference(reference, false, progressMonitor.CancellationToken);
				}
			} else {
				project.ResolveAssemblyReferences();
				AddReferencedContent(AssemblyParserService.DefaultProjectContentRegistry.Mscorlib);
				foreach (ProjectItem item in items) {
					if (!initializing) return; // abort initialization
					progressMonitor.CancellationToken.ThrowIfCancellationRequested();
					if (ItemType.ReferenceItemTypes.Contains(item.ItemType)) {
						ReferenceProjectItem reference = item as ReferenceProjectItem;
						if (reference != null) {
							AddReference(reference, false, progressMonitor.CancellationToken);
						}
					}
				}
			}
			UpdateReferenceInterDependencies();
			OnReferencedContentsChanged(EventArgs.Empty);
		}
开发者ID:dondublon,项目名称:SharpDevelop,代码行数:31,代码来源:ParseProjectContent.cs


示例6: CustomToolContext

		public CustomToolContext(IProject project, IProgressMonitor progressMonitor)
		{
			if (project == null)
				throw new ArgumentNullException("project");
			this.project = project;
			this.ProgressMonitor = progressMonitor;
		}
开发者ID:siegfriedpammer,项目名称:SharpDevelop,代码行数:7,代码来源:CustomTool.cs


示例7: FindReferencesAsync

		/// <summary>
		/// Finds all references to the specified entity.
		/// The results are reported using the callback.
		/// FindReferences may internally use parallelism, and may invoke the callback on multiple
		/// threads in parallel.
		/// </summary>
		public static async Task FindReferencesAsync(IEntity entity, IProgressMonitor progressMonitor, Action<SearchedFile> callback)
		{
			if (entity == null)
				throw new ArgumentNullException("entity");
			if (progressMonitor == null)
				throw new ArgumentNullException("progressMonitor");
			if (callback == null)
				throw new ArgumentNullException("callback");
			SD.MainThread.VerifyAccess();
			if (SD.ParserService.LoadSolutionProjectsThread.IsRunning) {
				progressMonitor.ShowingDialog = true;
				MessageService.ShowMessage("${res:SharpDevelop.Refactoring.LoadSolutionProjectsThreadRunning}");
				progressMonitor.ShowingDialog = false;
				return;
			}
			double totalWorkAmount;
			List<ISymbolSearch> symbolSearches = PrepareSymbolSearch(entity, progressMonitor.CancellationToken, out totalWorkAmount);
			double workDone = 0;
			ParseableFileContentFinder parseableFileContentFinder = new ParseableFileContentFinder();
			foreach (ISymbolSearch s in symbolSearches) {
				progressMonitor.CancellationToken.ThrowIfCancellationRequested();
				using (var childProgressMonitor = progressMonitor.CreateSubTask(s.WorkAmount / totalWorkAmount)) {
					await s.FindReferencesAsync(new SymbolSearchArgs(childProgressMonitor, parseableFileContentFinder), callback);
				}
				
				workDone += s.WorkAmount;
				progressMonitor.Progress = workDone / totalWorkAmount;
			}
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:35,代码来源:FindReferenceService.cs


示例8: ApplyPendingSettingsChanges

        public override void ApplyPendingSettingsChanges(IElevationContext elevationContext, IProgressMonitor progressMonitor)
        {
            base.ApplyPendingSettingsChanges(elevationContext, progressMonitor);

            optionsController.AutoSaveProject = autoSave.Checked;
            optionsController.Save();
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:ShutdownPane.cs


示例9: Execute

        protected override void Execute(IntPtr bridgeFunc, IProgressMonitor subMonitor)
        {
            using (subMonitor.BeginTask("Exploring " + File.Name, 100))
            {
                BoostTestExploreDelegate bridge =
                    (BoostTestExploreDelegate)Marshal.GetDelegateForFunctionPointer(
                        bridgeFunc,
                        typeof(BoostTestExploreDelegate)
                    );

                VisitorDelegate visitTestCase = new VisitorDelegate(VisitTestCase);
                VisitorDelegate beginVisitTestSuite = new VisitorDelegate(BeginVisitTestSuite);
                VisitorDelegate endVisitTestSuite = new VisitorDelegate(EndVisitTestSuite);

                ErrorReporterDelegate errorReporter =
                    new ErrorReporterDelegate((text) => Logger.Log(LogSeverity.Error, text));

                bridge(
                    File.FullName,

                    visitTestCase,
                    beginVisitTestSuite,
                    endVisitTestSuite,

                    errorReporter
                );

                TestModelSerializer.PublishTestModel(TestModel, MessageSink);
            }
        }
开发者ID:ndl,项目名称:Gallio.BoostAdapter,代码行数:30,代码来源:ExploreTask.cs


示例10: OnCancel

 void OnCancel(IProgressMonitor m)
 {
     lock (list) {
         foreach (IAsyncOperation operation in list)
             operation.Cancel ();
     }
 }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:7,代码来源:AggregatedOperationMonitor.cs


示例11: 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


示例12: RunImpl

        protected override TestResult RunImpl( ITestCommand rootTestCommand, TestStep parentTestStep, TestExecutionOptions options, IProgressMonitor progressMonitor )
        {
            using(progressMonitor.BeginTask( "Verifying Specifications", rootTestCommand.TestCount ) )
            {
                if( options.SkipTestExecution )
                {
                    return SkipAll( rootTestCommand, parentTestStep );
                }
                else
                {
                    ITestContext rootContext = rootTestCommand.StartPrimaryChildStep( parentTestStep );
                    TestStep rootStep = rootContext.TestStep;
                    TestOutcome outcome = TestOutcome.Passed;

                    foreach( ITestCommand command in rootTestCommand.Children )
                    {
                        NSpecAssemblyTest assemblyTest = command.Test as NSpecAssemblyTest;
                        if( assemblyTest == null )
                            continue;

                        var assemblyResult = this.RunAssembly( command, rootStep );
                        outcome = outcome.CombineWith( assemblyResult.Outcome );
                    }

                    return rootContext.FinishStep( outcome, null );
                }
            }
        }
开发者ID:JosephJung,项目名称:NSpec,代码行数:28,代码来源:NSpecController.cs


示例13: ReadFile

        public object ReadFile(string file, IProgressMonitor monitor)
        {
            XmlTextReader reader = new XmlTextReader (new StreamReader (file));
            reader.MoveToContent ();

            string version = reader.GetAttribute ("version");
            if (version == null) version = reader.GetAttribute ("fileversion");

            DataSerializer serializer = new DataSerializer (Runtime.ProjectService.DataContext, file);
            ICombineReader combineReader = null;

            if (version == "1.0" || version == "1") {
                combineReader = new CombineReaderV1 (serializer, monitor);
                monitor.ReportWarning (string.Format (GettextCatalog.GetString ("The file '{0}' is using an old combine file format. It will be automatically converted to the current format."), file));
            }
            else if (version == "2.0")
                combineReader = new CombineReaderV2 (serializer, monitor);

            try {
                if (combineReader != null)
                    return combineReader.ReadCombine (reader);
                else
                    throw new UnknownProjectVersionException (file, version);
            } finally {
                reader.Close ();
            }
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:27,代码来源:CmbxFileFormat.cs


示例14: GenerateInternal

		static void GenerateInternal (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
		{
			if (file.Project.SupportedLanguages.All (l => l != "C#")) {
				const string msg = "Razor templates are only supported in C# projects";
				result.Errors.Add (new CompilerError (file.Name, -1, -1, null, msg));
				monitor.Log.WriteLine (msg);
				return;
			}

			var host = new PreprocessedRazorHost (file.FilePath);

			var defaultOutputName = file.FilePath.ChangeExtension (".cs");

			var ns = CustomToolService.GetFileNamespace (file, defaultOutputName);
			host.DefaultNamespace = ns;

			CompilerErrorCollection errors;
			var code = host.GenerateCode (out errors);
			result.Errors.AddRange (errors);

			var writer = new MonoDevelop.DesignerSupport.CodeBehindWriter ();
			writer.WriteFile (defaultOutputName, code);
			writer.WriteOpenFiles ();

			result.GeneratedFilePath = defaultOutputName;

			foreach (var err in result.Errors) {
				monitor.Log.WriteLine (err);
			}
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:30,代码来源:RazorTemplatePreprocessor.cs


示例15: GetTypeUpdates

		public Dictionary<string, List<NSObjectTypeInfo>> GetTypeUpdates (IProgressMonitor monitor, CodeDomProvider provider,
			out Dictionary<string, NSObjectTypeInfo> newTypes,
			out Dictionary<string, ProjectFile> newFiles)
		{
			Dictionary<string, List<NSObjectTypeInfo>> designerFiles = new Dictionary<string, List<NSObjectTypeInfo>> ();
			string defaultNamespace;
			
			// First, we need to name any new user-defined types.
			foreach (var job in TypeSyncJobs) {
				if (!job.IsFreshlyAdded) {
					monitor.Log.WriteLine ("Found updated class: {0}", job.Type.CliName);
					continue;
				}
				
				defaultNamespace = Project.GetDefaultNamespace (job.RelativePath);
				job.Type.CliName = defaultNamespace + "." + provider.CreateValidIdentifier (job.Type.ObjCName);
				monitor.Log.WriteLine ("Found newly-added class: {0}", job.Type.CliName);
				ProjectInfo.InsertUpdatedType (job.Type);
			}
			
			// Next we can resolve base-types, outlet types, and action parameter types for each of our user-defined types.
			foreach (var job in TypeSyncJobs) {
				defaultNamespace = Project.GetDefaultNamespace (job.RelativePath);
				ProjectInfo.ResolveObjcToCli (monitor, job.Type, provider, defaultNamespace);
			}
			
			AggregateTypeUpdates (monitor, provider, designerFiles, out newTypes, out newFiles);
			MergeExistingTypes (designerFiles);
			
			return designerFiles;
		}
开发者ID:JamesChan,项目名称:monodevelop,代码行数:31,代码来源:XcodeSyncBackContext.cs


示例16: Build

		protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
		{
			BuildResult res = base.Build (monitor, entry, configuration);
			if (res.ErrorCount > 0 || !(entry is DotNetProject))
				return res;
			
			DotNetProject project = (DotNetProject) entry;
			AddinData data = AddinData.GetAddinData (project);
			if (data == null)
				return res;
			
			monitor.Log.WriteLine (AddinManager.CurrentLocalizer.GetString ("Verifying add-in description..."));
			string fileName = data.AddinManifestFileName;
			ProjectFile file = data.Project.Files.GetFile (fileName);
			if (file == null)
				return res;
			
			string addinFile;
			if (file.BuildAction == BuildAction.EmbeddedResource)
				addinFile = project.GetOutputFileName (ConfigurationSelector.Default);
			else
				addinFile = file.FilePath;
			
			AddinDescription desc = data.AddinRegistry.GetAddinDescription (new ProgressStatusMonitor (monitor), addinFile);
			StringCollection errors = desc.Verify ();
			
			foreach (string err in errors) {
				res.AddError (data.AddinManifestFileName, 0, 0, "", err);
				monitor.Log.WriteLine ("ERROR: " + err);
			}
			
			return res;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:33,代码来源:AddinProjectExtension.cs


示例17: LoadProject

		public override void LoadProject (IProgressMonitor monitor, SolutionEntityItem item, MSBuildProject msproject)
		{
			base.LoadProject (monitor, item, msproject);

			var dnp = item as DotNetProject;
			if (dnp == null)
				return;

			// Convert .projitems imports into project references

			foreach (var sp in msproject.Imports.Where (im => im.Label == "Shared" && im.Project.EndsWith (".projitems"))) {
				var projitemsFile = sp.Project;
				if (!string.IsNullOrEmpty (projitemsFile)) {
					projitemsFile = MSBuildProjectService.FromMSBuildPath (item.ItemDirectory, projitemsFile);
					projitemsFile = Path.Combine (Path.GetDirectoryName (msproject.FileName), projitemsFile);
					if (File.Exists (projitemsFile)) {
						MSBuildSerializer iser = Handler.CreateSerializer ();
						iser.SerializationContext.BaseFile = projitemsFile;
						iser.SerializationContext.ProgressMonitor = monitor;
						MSBuildProject p = new MSBuildProject ();
						p.Load (projitemsFile);
						Handler.LoadProjectItems (p, iser, ProjectItemFlags.Hidden | ProjectItemFlags.DontPersist);
						var r = new ProjectReference (ReferenceType.Project, Path.GetFileNameWithoutExtension (projitemsFile));
						r.Flags = ProjectItemFlags.DontPersist;
						r.SetItemsProjectPath (projitemsFile);
						dnp.References.Add (r);
					}
				}
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:30,代码来源:SharedAssetsProjectMSBuildExtension.cs


示例18: BuildProject

		public static BuildResult BuildProject(DubProject prj, IProgressMonitor mon, ConfigurationSelector sel)
		{
			var br = new BuildResult();

			// Skip building sourceLibraries
			string targetType = null;
			var cfg = prj.GetConfiguration (sel) as DubProjectConfiguration;
			if (cfg != null){
				cfg.BuildSettings.TryGetTargetTypeProperty (prj, sel, ref targetType);
				if(string.IsNullOrWhiteSpace(targetType))
					prj.CommonBuildSettings.TryGetTargetTypeProperty (prj, sel, ref targetType);

				if (targetType != null && targetType.ToLower ().Contains("sourcelibrary")) {
					br.BuildCount = 1;
					return br;
				}
			}

			var args = new StringBuilder("build");

			BuildCommonArgAppendix(args, prj, sel);

			string output;
			string errDump;

			int status = ProjectBuilder.ExecuteCommand(DubSettings.Instance.DubCommand, args.ToString(), prj.BaseDirectory, 
				mon, out errDump, out output);
			br.CompilerOutput = output;

			ErrorExtracting.HandleReturnCode (mon, br, status);
			ErrorExtracting.HandleCompilerOutput(prj, br, output);
			ErrorExtracting.HandleCompilerOutput(prj, br, errDump);

			return br;
		}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:35,代码来源:DubBuilder.cs


示例19: RunImpl

 protected internal override TestResult RunImpl(ITestCommand rootTestCommand, TestStep parentTestStep, TestExecutionOptions options, IProgressMonitor progressMonitor)
 {
     using (progressMonitor.BeginTask("Running tests.", rootTestCommand.TestCount))
     {
         return RunTest(rootTestCommand, parentTestStep, options, progressMonitor);
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:DelegatingTestController.cs


示例20: Install

        public override void Install(IProgressMonitor progressMonitor)
        {
            using (progressMonitor.BeginTask("Installing TestDriven.Net Runner", testFrameworkManager.TestFrameworkHandles.Count + 2))
            {
                // Remove old registrations.
                RemoveExistingRegistryKeys(progressMonitor);
                progressMonitor.Worked(1);

                // Register Icarus
                string icarusPath = FindIcarusPath();
                if (icarusPath != null)
                    InstallRegistryKeysForIcarus(icarusPath, progressMonitor);
                progressMonitor.Worked(1);

                // Register frameworks
                foreach (ComponentHandle<ITestFramework, TestFrameworkTraits> testFrameworkHandle in testFrameworkManager.TestFrameworkHandles)
                {
                    TestFrameworkTraits testFrameworkTraits = testFrameworkHandle.GetTraits();
                    TDNetRunnerInstallationMode installationMode = preferenceManager.GetInstallationModeForFramework(testFrameworkHandle.Id);

                    if (installationMode != TDNetRunnerInstallationMode.Disabled)
                    {
                        int priority = installationMode == TDNetRunnerInstallationMode.Default ? 25 : 5;
                        foreach (AssemblySignature frameworkAssembly in testFrameworkTraits.FrameworkAssemblies)
                        {
                            InstallRegistryKeysForFramework(testFrameworkTraits.Name, frameworkAssembly, priority,
                                progressMonitor);
                        }
                    }

                    progressMonitor.Worked(1);
                }
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:34,代码来源:TDNetRunnerInstaller.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IProgressReporter类代码示例发布时间:2022-05-24
下一篇:
C# IProgressIndicator类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap