本文整理汇总了C#中MonoDevelop.Core.ProgressMonitor类的典型用法代码示例。如果您正苦于以下问题:C# ProgressMonitor类的具体用法?C# ProgressMonitor怎么用?C# ProgressMonitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressMonitor类属于MonoDevelop.Core命名空间,在下文中一共展示了ProgressMonitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateInternal
static void GenerateInternal (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
if (file.Project.SupportedLanguages.All (l => l != "C#")) {
string msg = GettextCatalog.GetString ("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);
}
}
示例2: CreateEventMonitor
protected override PackageManagementEventsMonitor CreateEventMonitor (
ProgressMonitor monitor,
IPackageManagementEvents packageManagementEvents)
{
EventsMonitor = new TestablePackageManagementEventsMonitor (monitor, packageManagementEvents);
return EventsMonitor;
}
示例3: Build
public async Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets = false, OperationContext operationContext = null)
{
var res = new BuildResult { BuildCount = 0 };
foreach (var bt in Items.OfType<IBuildTarget> ())
res.Append (await bt.Build (monitor, configuration, operationContext:operationContext));
return res;
}
示例4: OnExecute
protected override Task OnExecute(ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
if (base.OnGetCanExecute(context, configuration))
{
return base.OnExecute(monitor, context, configuration);
}
try
{
var project = Project as DotNetProject;
if (project != null && IsSupportedProject)
{
const string SoftDebuggerName = RhinoSoftDebuggerEngine.DebuggerName;
var config = project.GetConfiguration(configuration) as DotNetProjectConfiguration;
var cmd = new RhinoCommonExecutionCommand(project.GetOutputFileName(configuration), project);
cmd.Arguments = config.CommandLineParameters;
cmd.WorkingDirectory = Path.GetDirectoryName(config.CompiledOutputName);
cmd.EnvironmentVariables = config.GetParsedEnvironmentVariables();
cmd.TargetRuntime = project.TargetRuntime;
cmd.UserAssemblyPaths = project.GetUserAssemblyPaths(configuration);
var executionModes = Runtime.ProcessService.GetExecutionModes();
var executionMode = executionModes.SelectMany(r => r.ExecutionModes).FirstOrDefault(r => r.Id == SoftDebuggerName);
var console = context.ConsoleFactory.CreateConsole(new OperationConsoleFactory.CreateConsoleOptions(true));
var operation = executionMode.ExecutionHandler.Execute(cmd, console);
monitor.CancellationToken.Register(() => operation.Cancel());
return operation.Task;
}
}
catch (Exception ex)
{
monitor.ReportError($"An error occurred starting Rhino.\n{ex}", ex);
}
return null;
}
示例5: TestablePackageManagementEventsMonitor
public TestablePackageManagementEventsMonitor (
ProgressMonitor progressMonitor,
IPackageManagementEvents packageManagementEvents,
IProgressProvider progressProvider)
: base (progressMonitor, packageManagementEvents, progressProvider)
{
}
示例6: Start
public void Start() {
tracker = CreateProgressMonitor ();
tracker.BeginTask(GetDescription(), 1);
// Sync invoke background worker which will end up doing async invoke on the internal run.
BackgroundWorker ();
}
示例7: Execute
internal protected virtual Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration, SolutionRunConfiguration runConfiguration)
{
context.RunConfiguration = runConfiguration;
#pragma warning disable 618 // Type or member is obsolete
return Execute (monitor, context, configuration);
#pragma warning restore 618 // Type or member is obsolete
}
示例8: BuildPackage
public virtual bool BuildPackage (ProgressMonitor monitor, PackageBuilder builder)
{
if (Next != null)
return Next.BuildPackage (monitor, builder);
else
return builder.Build (monitor);
}
示例9: OnWriteProject
internal protected override void OnWriteProject (ProgressMonitor monitor, MSBuildProject project)
{
base.OnWriteProject (monitor, project);
HashSet<string> validProjitems = new HashSet<string> ();
foreach (var r in Project.References.Where (rp => rp.ReferenceType == ReferenceType.Project)) {
var ip = r.GetItemsProjectPath ();
if (!string.IsNullOrEmpty (ip)) {
ip = MSBuildProjectService.ToMSBuildPath (Project.ItemDirectory, ip);
validProjitems.Add (ip);
if (!project.Imports.Any (im => im.Project == ip)) {
// If there is already a Shared import, place the new import in the same location
MSBuildObject before = project.Imports.FirstOrDefault (i => i.Label == "Shared" && i.Project.EndsWith (".projitems"));
if (before == null) {
var fsharpProject = project.ProjectTypeGuids.Contains("{F2A71F9B-5D33-465A-A702-920D77279786}");
if (fsharpProject)
//For F# use the first item group as the shared project files have to be listed first
before = project.ItemGroups.FirstOrDefault (i => i.Label != "Shared");
else
before = project.Imports.FirstOrDefault (i => i.Label != "Shared");
}
var im = project.AddNewImport (ip, beforeObject: before);
im.Label = "Shared";
im.Condition = "Exists('" + ip + "')";
}
}
}
foreach (var im in project.Imports.ToArray ()) {
if (im.Label == "Shared" && im.Project.EndsWith (".projitems") && !(validProjitems.Contains (im.Project)))
project.RemoveImport (im.Project);
}
}
示例10: OnBuild
protected async override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
foreach (Package p in packages)
if (!await p.Build (monitor))
break;
return BuildResult.CreateSuccess ();
}
示例11: OnBuild
protected override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
Task restoreTask = PackageRestoreTask;
if (restoreTask != null) {
return WaitForRestoreThenBuild (restoreTask, monitor, configuration, operationContext);
}
return base.OnBuild (monitor, configuration, operationContext);
}
示例12: ProgressMonitorWrapperJob
public ProgressMonitorWrapperJob (IAnalysisJob wrappedJob, string message)
{
this.wrappedJob = wrappedJob;
monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (message, null, false);
var work = wrappedJob.GetFiles ().Sum (f => wrappedJob.GetIssueProviders (f).Count ());
monitor.BeginTask (message, work);
}
示例13: Install
public void Install (ProgressMonitor monitor, SolutionFolderItem entry, string appName, string prefix, ConfigurationSelector configuration)
{
this.appName = appName;
using (DeployContext ctx = new DeployContext (this, DeployService.CurrentPlatform, prefix)) {
InstallEntry (monitor, ctx, entry, configuration);
}
}
示例14: LoadWorkspaceItem
public override Task<WorkspaceItem> LoadWorkspaceItem (ProgressMonitor monitor, string fileName)
{
return Task.Run (async () => {
var workspaceItem = ReadWorkspaceItemFile (fileName, monitor);
await workspaceItem.LoadUserProperties ();
return workspaceItem;
});
}
示例15: Build
/// <summary>
/// If the project is a NuGet packaging project then just use the normal build target.
/// This ensures that the dependent projects are built.
///
/// Otherwise the Pack target is called.
/// </summary>
public async Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets = false, OperationContext operationContext = null)
{
if (project is PackagingProject) {
return await project.Build (monitor, configuration, buildReferencedTargets, new TargetEvaluationContext (operationContext));
} else {
return await Pack (monitor, configuration, buildReferencedTargets, operationContext);
}
}