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


C# IProgressMonitor.EndTask方法代码示例

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


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

示例1: Build

        /// <summary>
        ///   Builds the specified solution item.
        /// </summary>
        /// <param name = "monitor">The monitor.</param>
        /// <param name = "item">The item.</param>
        /// <param name = "configuration">The configuration.</param>
        /// <returns>The build result.</returns>
        protected override BuildResult Build(IProgressMonitor monitor, SolutionEntityItem item, ConfigurationSelector configuration)
        {
            BuildResult result = new BuildResult ();

            // Pre-build
            monitor.BeginTask (GettextCatalog.GetString ("Pre-Building..."), 1);
            this.PreBuild (result, monitor, item, configuration);
            monitor.EndTask();
            if (result.ErrorCount > 0) {
                return result;
            }

            // Build
            monitor.BeginTask (GettextCatalog.GetString ("Building"), 1);
            result.Append (base.Build (monitor, item, configuration));
            monitor.EndTask();
            if (result.ErrorCount > 0) {
                return result;
            }

            // Post-build
            monitor.BeginTask (GettextCatalog.GetString ("Post-Building..."), 1);
            this.PostBuild (result, monitor, item, configuration);
            monitor.EndTask();

            return result;
        }
开发者ID:Monobjc,项目名称:monobjc-monodevelop,代码行数:34,代码来源:MonobjcBuildExtension.cs

示例2: LoadByWorkItem

 public List<WorkItem> LoadByWorkItem(IProgressMonitor progress)
 {
     var ids = this.clientService.GetWorkItemIds(this.query, CachedMetaData.Instance.Fields);
     var list = new List<WorkItem>();
     progress.BeginTask("Loading WorkItems", ids.Count);
     foreach (var id in ids)
     {
         list.Add(clientService.GetWorkItem(id));
         progress.Step(1);
     }
     progress.EndTask();
     return list;
 }
开发者ID:Indomitable,项目名称:monodevelop-tfs-addin,代码行数:13,代码来源:WorkItemStore.cs

示例3: Archive

        public static void Archive(IProgressMonitor monitor, BuildResult result, MonobjcProject project, ConfigurationSelector configuration, String outputDirectory)
        {
            monitor.BeginTask(GettextCatalog.GetString("Archiving..."), 0);

            // Infer application name from configuration
            String applicationName = project.GetApplicationName(configuration);

            // Create the bundle maker
            BundleMaker maker = new BundleMaker(applicationName, outputDirectory);

            // Archive the application
            BuildHelper.ArchiveBundle(monitor, project, maker);

            monitor.EndTask();
        }
开发者ID:Monobjc,项目名称:monobjc-monodevelop,代码行数:15,代码来源:BundleGenerator.cs

示例4: LoadByPage

 public List<WorkItem> LoadByPage(IProgressMonitor progress)
 {
     var ids = this.clientService.GetWorkItemIds(this.query, CachedMetaData.Instance.Fields);
     int pages = (int)Math.Ceiling((double)ids.Count / (double)50);
     var result = new List<WorkItem>();
     progress.BeginTask("Loading WorkItems", pages);
     for (int i = 0; i < pages; i++)
     {
         var idList = new List<int>(ids.Skip(i * 50).Take(50));
         var items = this.clientService.PageWorkitemsByIds(this.query, idList);
         result.AddRange(items);
         progress.Step(1);
     }
     progress.EndTask();
     return result;
 }
开发者ID:Indomitable,项目名称:monodevelop-tfs-addin,代码行数:16,代码来源:WorkItemStore.cs

示例5: ArchiveBundle

        /// <summary>
        ///   Archive the application bundle.
        /// </summary>
        /// <param name = 'monitor'>The progress monitor.</param>
        /// <param name = 'project'>The project.</param>
        /// <param name = 'maker'>The bundle maker.</param>
        public static void ArchiveBundle(IProgressMonitor monitor, MonobjcProject project, BundleMaker maker)
        {
            if (project.Archive && project.ArchiveIdentity != null) {
                FilePath definitionFile = project.BaseDirectory.Combine ("Definition.plist");
                String definitionFilename = File.Exists (definitionFile) ? definitionFile.ToString () : null;
                monitor.BeginTask (GettextCatalog.GetString ("Signing archive..."), 0);

                using (StringWriter outputWriter = new StringWriter()) {
                    using (StringWriter errorWriter = new StringWriter()) {
                        ProductBuild.ArchiveApplication (maker.ApplicationDirectory, project.ArchiveIdentity, definitionFilename, outputWriter, errorWriter);
                        LoggingService.LogInfo ("ProductBuild returns: " + outputWriter.ToString ());
                    }
                }

                monitor.EndTask ();
            }
        }
开发者ID:Monobjc,项目名称:monobjc-monodevelop,代码行数:23,代码来源:BuildHelper.cs

示例6: Build

		protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem project, ConfigurationSelector configuration)
		{
			var aspProject = project as AspNetAppProject;
			
			//get the config object and validate
			AspNetAppProjectConfiguration config = (AspNetAppProjectConfiguration)aspProject.GetConfiguration (configuration);
			if (config == null || config.DisableCodeBehindGeneration) {
				return base.Build (monitor, project, configuration);
			}
			
			var writer = CodeBehindWriter.CreateForProject (monitor, aspProject);
			if (!writer.SupportsPartialTypes) {
				return base.Build (monitor, project, configuration);
			}

			var result = new BuildResult ();

			monitor.BeginTask ("Updating CodeBehind designer files", 0);

			foreach (var file in aspProject.Files) {
				ProjectFile designerFile = CodeBehind.GetDesignerFile (file);
				if (designerFile == null)
					continue;

				if (File.GetLastWriteTimeUtc (designerFile.FilePath) > File.GetLastWriteTimeUtc (file.FilePath))
					continue;

				monitor.Log.WriteLine ("Updating CodeBehind for file '{0}'", file);
				result.Append (CodeBehind.UpdateDesignerFile (writer, aspProject, file, designerFile));
			}
			
			writer.WriteOpenFiles ();

			monitor.EndTask ();

			if (writer.WrittenCount > 0)
				monitor.Log.WriteLine ("{0} CodeBehind designer classes updated.", writer.WrittenCount);
			else
				monitor.Log.WriteLine ("No changes made to CodeBehind classes.");
			
			if (result.Failed)
				return result;

			return result.Append (base.Build (monitor, project, configuration));
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:45,代码来源:VerifyCodeBehindBuildStep.cs

示例7: GetFileNames

 public IEnumerable<Tuple<ProjectDom, FilePath>> GetFileNames(Solution solution, ProjectDom dom, ICompilationUnit unit, IProgressMonitor monitor)
 {
     int counter = 0;
     ReadOnlyCollection<Project> allProjects = solution.GetAllProjects();
     if (monitor != null)
         monitor.BeginTask(GettextCatalog.GetString("Finding references in solution..."),
       			allProjects.Sum<Project>(p => p.Files.Count));
         foreach (Project project in allProjects) {
             if (monitor != null && monitor.IsCancelRequested) yield break;
             ProjectDom currentDom = ProjectDomService.GetProjectDom(project);
             foreach (ProjectFile projectFile in (Collection<ProjectFile>) project.Files) {
                 if (monitor != null && monitor.IsCancelRequested) yield break;
                 yield return Tuple.Create<ProjectDom, FilePath>(currentDom, projectFile.FilePath);
                 if (monitor != null) {
                     if (counter % 10 == 0) monitor.Step(10);
                     ++counter;
                 }
             }
         }
       if (monitor != null) monitor.EndTask();
 }
开发者ID:nieve,项目名称:Stereo,代码行数:21,代码来源:ExtractProjectFiles.cs

示例8: InstallEntry

		void InstallEntry (IProgressMonitor monitor, DeployContext ctx, SolutionItem entry, ConfigurationSelector configuration)
		{
			foreach (DeployFile df in DeployService.GetDeployFiles (ctx, new SolutionItem[] { entry }, configuration)) {
				string targetPath = df.ResolvedTargetFile;
				if (targetPath == null) {
					monitor.ReportWarning ("Could not copy file '" + df.RelativeTargetPath + "': Unknown target directory.");
					continue;
				}
				
				CopyFile (monitor, df.SourcePath, df.ResolvedTargetFile, df.FileAttributes);
			}
			
			SolutionFolder c = entry as SolutionFolder;
			if (c != null) {
				monitor.BeginTask ("Installing solution '" + c.Name + "'", c.Items.Count);
				foreach (SolutionItem ce in c.Items) {
					InstallEntry (monitor, ctx, ce, configuration);
					monitor.Step (1);
				}
				monitor.EndTask ();
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:22,代码来源:InstallResolver.cs

示例9: LoadSolutionItem

		protected override SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName)
		{
			SolutionEntityItem entry = base.LoadSolutionItem (monitor, fileName);
			if (entry == null)
				return null;
			
			Project project = entry as Project;
			if (project == null)
				return entry;

			//Project
			MakefileData data = entry.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
			if (data == null)
				return entry;

			monitor.BeginTask (GettextCatalog.GetString ("Updating project from Makefile"), 1);
			try { 
				data.OwnerProject = project;
				if (data.SupportsIntegration)
					data.UpdateProject (monitor, false);
				monitor.Step (1);
			} catch (Exception e) {
				monitor.ReportError (GettextCatalog.GetString (
					"Error loading Makefile for project {0}", project.Name), e);
			} finally {
				monitor.EndTask ();
			}

			entry.SetNeedsBuilding (false);
			return entry;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:31,代码来源:MakefileProjectServiceExtension.cs

示例10: Clean

		protected override void Clean (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
		{
			Project proj = entry as Project;
			if (proj == null) {
				base.Clean (monitor, entry, configuration);
				return;
			}

			MakefileData data = proj.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
			if (data == null || !data.SupportsIntegration || String.IsNullOrEmpty (data.CleanTargetName)) {
				base.Clean (monitor, entry, configuration); 
				return;
			}

			monitor.BeginTask (GettextCatalog.GetString ("Cleaning project"), 1);
			try {
				string baseDir = proj.BaseDirectory;
	
				ProcessWrapper process = Runtime.ProcessService.StartProcess (data.AbsoluteMakeCommand, 
						data.CleanTargetName, 
						baseDir, 
						monitor.Log, 
						monitor.Log, 
						null);
				process.WaitForOutput ();

				if (process.ExitCode > 0)
					throw new Exception ( GettextCatalog.GetString ("An unspecified error occurred while running '{0} {1}'", data.AbsoluteMakeCommand, data.CleanTargetName) );

				monitor.Step (1);
			} catch (Exception e) {
				monitor.ReportError (GettextCatalog.GetString ("Project could not be cleaned: "), e);
				return;
			} finally {
				monitor.EndTask ();
			}
			monitor.ReportSuccess (GettextCatalog.GetString ("Project successfully cleaned"));
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:38,代码来源:MakefileProjectServiceExtension.cs

示例11: CompileXIBFiles

 /// <summary>
 ///   Compiles the XIB files.
 /// </summary>
 /// <param name = 'monitor'>The progress monitor.</param>
 /// <param name = 'project'>The project.</param>
 /// <param name = 'maker'>The bundle maker.</param>
 /// <param name = 'result'>The build result.</param>
 public static void CompileXIBFiles(IProgressMonitor monitor, MonobjcProject project, BundleMaker maker, BuildResult result)
 {
     XibCompiler xibCompiler = new XibCompiler ();
     IEnumerable<FilePair> files = project.GetIBFiles (Constants.InterfaceDefinition, maker.ResourcesFolder);
     if (files == null || files.Count() == 0) {
         return;
     }
     List<FilePair> pairs = new List<FilePair> (files);
     monitor.BeginTask (GettextCatalog.GetString ("Compiling XIB files..."), files.Count ());
     foreach (FilePair pair in pairs) {
         monitor.Log.WriteLine (GettextCatalog.GetString ("Compiling {0}", pair.Source.ToRelative (project.BaseDirectory)));
         xibCompiler.Logger = new BuildLogger (pair.Source, monitor, result);
         xibCompiler.Compile (pair.Source, pair.DestinationDir);
         monitor.Step (1);
     }
     monitor.EndTask ();
 }
开发者ID:Monobjc,项目名称:monobjc-monodevelop,代码行数:24,代码来源:BuildHelper.cs

示例12: SignBundle

        /// <summary>
        ///   Sign the application bundle.
        /// </summary>
        /// <param name = 'monitor'>The progress monitor.</param>
        /// <param name = 'project'>The project.</param>
        /// <param name = 'maker'>The bundle maker.</param>
        public static void SignBundle(IProgressMonitor monitor, MonobjcProject project, BundleMaker maker)
        {
            if (project.Signing && !String.IsNullOrEmpty(project.SigningIdentity)) {
                monitor.BeginTask (GettextCatalog.GetString ("Signing bundle..."), 0);

                using (StringWriter outputWriter = new StringWriter()) {
                    using (StringWriter errorWriter = new StringWriter()) {
                        FilePath file = project.BaseDirectory.Combine(Constants.APP_ENTITLEMENTS);
                        if (project.UseEntitlements && File.Exists(file)) {
                            monitor.Log.WriteLine (GettextCatalog.GetString ("Signing with identity '{0}' and entitlements '{1}'", project.SigningIdentity, file.FileName));
                            CodeSign.PerformSigning (maker.ApplicationDirectory, project.SigningIdentity, file, outputWriter, errorWriter);
                        } else {
                            monitor.Log.WriteLine (GettextCatalog.GetString ("Signing with identity='{0}'", project.SigningIdentity));
                            CodeSign.PerformSigning (maker.ApplicationDirectory, project.SigningIdentity, outputWriter, errorWriter);
                        }
                        LoggingService.LogInfo ("CodeSign returns: " + outputWriter.ToString ());
                    }
                }

                monitor.EndTask ();
            }
        }
开发者ID:Monobjc,项目名称:monobjc-monodevelop,代码行数:28,代码来源:BuildHelper.cs

示例13: EmbedXIBFiles

        /// <summary>
        ///   Embeds the XIB files.
        /// </summary>
        /// <param name = 'monitor'>The progress monitor.</param>
        /// <param name = 'project'>The project.</param>
        /// <param name = 'maker'>The bundle maker.</param>
        /// <param name = 'result'>The build result.</param>
        public static void EmbedXIBFiles(IProgressMonitor monitor, MonobjcProject project, BuildResult result)
        {
            XibCompiler xibCompiler = new XibCompiler ();
            IEnumerable<FilePair> files = project.GetIBFiles (Constants.EmbeddedInterfaceDefinition, null);
            if (files == null || files.Count() == 0) {
                return;
            }

            monitor.BeginTask (GettextCatalog.GetString ("Embed XIB files..."), files.Count ());
            foreach (FilePair pair in files) {
                // If the destination file is a place-holder, change its dates
                FileInfo sourceInfo = new FileInfo (pair.Source);
                FileInfo destInfo = new FileInfo (pair.Destination);
                if (destInfo.Length == 0) {
                    DateTime dateTime = sourceInfo.CreationTime.Subtract (new TimeSpan (0, 0, 1));
                    File.SetCreationTime (pair.Destination, dateTime);
                    File.SetLastAccessTime (pair.Destination, dateTime);
                    File.SetLastWriteTime (pair.Destination, dateTime);
                }

                FilePath relativeFile = pair.Source.ToRelative (project.BaseDirectory);
                monitor.Log.WriteLine (GettextCatalog.GetString ("Compiling {0}", relativeFile));
                xibCompiler.Logger = new BuildLogger (pair.Source, monitor, result);
                xibCompiler.Compile (pair.Source, pair.DestinationDir);

                monitor.Step (1);
            }
            monitor.EndTask ();
        }
开发者ID:Monobjc,项目名称:monobjc-monodevelop,代码行数:36,代码来源:BuildHelper.cs

示例14: Update

		public override void Update (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
		{
			IEnumerable<DiffEntry> statusList = null;
			
			monitor.BeginTask (GettextCatalog.GetString ("Updating"), 5);
			
			// Fetch remote commits
			string remote = GetCurrentRemote ();
			if (remote == null)
				throw new InvalidOperationException ("No remotes defined");
			monitor.Log.WriteLine (GettextCatalog.GetString ("Fetching from '{0}'", remote));
			RemoteConfig remoteConfig = new RemoteConfig (RootRepository.GetConfig (), remote);
			Transport tn = Transport.Open (RootRepository, remoteConfig);
			using (var gm = new GitMonitor (monitor))
				tn.Fetch (gm, null);
			monitor.Step (1);
			
			string upstreamRef = GitUtil.GetUpstreamSource (RootRepository, GetCurrentBranch ());
			if (upstreamRef == null)
				upstreamRef = GetCurrentRemote () + "/" + GetCurrentBranch ();
			
			if (GitService.UseRebaseOptionWhenPulling)
				Rebase (upstreamRef, GitService.StashUnstashWhenUpdating, monitor);
			else
				Merge (upstreamRef, GitService.StashUnstashWhenUpdating, monitor);

			monitor.Step (1);
			
			// Notify changes
			if (statusList != null)
				NotifyFileChanges (monitor, statusList);
			
			monitor.EndTask ();
		}
开发者ID:kthguru,项目名称:monodevelop,代码行数:34,代码来源:GitRepository.cs

示例15: MoveDirectory

		public override void MoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
		{
			VersionInfo[] versionedFiles = GetDirectoryVersionInfo (localSrcPath, false, true);
			base.MoveDirectory (localSrcPath, localDestPath, force, monitor);
			monitor.BeginTask ("Moving files", versionedFiles.Length);
			foreach (VersionInfo vif in versionedFiles) {
				if (vif.IsDirectory)
					continue;
				FilePath newDestPath = vif.LocalPath.ToRelative (localSrcPath).ToAbsolute (localDestPath);
				Add (newDestPath, false, monitor);
				monitor.Step (1);
			}
			monitor.EndTask ();
		}
开发者ID:kthguru,项目名称:monodevelop,代码行数:14,代码来源:GitRepository.cs


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