本文整理汇总了C#中MonoDevelop.Core.ProgressMonitor类的典型用法代码示例。如果您正苦于以下问题:C# ProgressMonitor类的具体用法?C# ProgressMonitor怎么用?C# ProgressMonitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressMonitor类属于MonoDevelop.Core命名空间,在下文中一共展示了ProgressMonitor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:30,代码来源:RazorTemplatePreprocessor.cs
示例2: CreateEventMonitor
protected override PackageManagementEventsMonitor CreateEventMonitor (
ProgressMonitor monitor,
IPackageManagementEvents packageManagementEvents)
{
EventsMonitor = new TestablePackageManagementEventsMonitor (monitor, packageManagementEvents);
return EventsMonitor;
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:TestablePackageCompatibilityRunner.cs
示例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;
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:Workspace.cs
示例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;
}
开发者ID:mcneel,项目名称:RhinoCommonXamarinStudioAddin,代码行数:35,代码来源:RhinoProjectServiceExtension.cs
示例5: TestablePackageManagementEventsMonitor
public TestablePackageManagementEventsMonitor (
ProgressMonitor progressMonitor,
IPackageManagementEvents packageManagementEvents,
IProgressProvider progressProvider)
: base (progressMonitor, packageManagementEvents, progressProvider)
{
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:7,代码来源:TestablePackageManagementEventsMonitor.cs
示例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 ();
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:7,代码来源:VersionControlTask.cs
示例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
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:7,代码来源:SolutionExtension.cs
示例8: BuildPackage
public virtual bool BuildPackage (ProgressMonitor monitor, PackageBuilder builder)
{
if (Next != null)
return Next.BuildPackage (monitor, builder);
else
return builder.Build (monitor);
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:7,代码来源:DeployServiceExtension.cs
示例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);
}
}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:33,代码来源:SharedAssetsProjectMSBuildExtension.cs
示例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 ();
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:7,代码来源:PackagingProject.cs
示例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);
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:8,代码来源:PackageManagementMSBuildExtension.cs
示例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);
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:ProgressMonitorWrapperJob.cs
示例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);
}
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:InstallResolver.cs
示例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;
});
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:8,代码来源:WorkspaceSerializationExtension.cs
示例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);
}
}
开发者ID:PlayScriptRedux,项目名称:monodevelop,代码行数:14,代码来源:CreateNuGetPackageBuildTarget.cs
示例16: BuildEventArgs
public BuildEventArgs (ProgressMonitor monitor, bool success)
{
this.monitor = monitor;
this.success = success;
this.WarningCount = -1;
this.ErrorCount = -1;
this.BuildCount = -1;
this.FailedBuildCount = -1;
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:9,代码来源:BuildEventHandler.cs
示例17: OnRunTarget
protected override Task<TargetEvaluationResult> OnRunTarget(ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
{
if (Commands.SelectActiveCompilerHandler.IsRoslynCompilerSet) {
context.GlobalProperties.SetValue("CscToolExe", "csc.exe");
context.GlobalProperties.SetValue("CscToolPath", Path.Combine(Path.GetDirectoryName(typeof(ProjectExtension).Assembly.Location), "RoslynCompilerFiles"));
context.GlobalProperties.SetValue("DebugType", "portable");
}
return base.OnRunTarget(monitor, target, configuration, context);
}
开发者ID:berlamont,项目名称:RoslynCompilerAddIn,代码行数:9,代码来源:ProjectExtension.cs
示例18: Generate
public Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
return Task.Run (delegate {
try {
GenerateInternal (monitor, file, result);
} catch (Exception ex) {
result.UnhandledException = ex;
}
});
}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:10,代码来源:RazorTemplatePreprocessor.cs
示例19: Generate
public async Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
var buildResult = await file.Project.PerformGeneratorAsync (monitor, IdeApp.Workspace.ActiveConfiguration, this.targetName);
foreach (var err in buildResult.BuildResult.Errors) {
result.Errors.Add (new CompilerError (err.FileName, err.Line, err.Column, err.ErrorNumber, err.ErrorText) {
IsWarning = err.IsWarning
});
}
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:10,代码来源:MSBuildCustomTool.cs
示例20: LoadSolutionItem
public override Task<SolutionItem> LoadSolutionItem (ProgressMonitor monitor, SolutionLoadContext ctx, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid)
{
return Task.Run (() => {
foreach (var f in MSBuildFileFormat.GetSupportedFormats ()) {
if (f.CanReadFile (fileName, typeof(SolutionItem)))
return MSBuildProjectService.LoadItem (monitor, fileName, f, typeGuid, itemGuid, ctx);
}
throw new NotSupportedException ();
});
}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:10,代码来源:MSBuildSerializationExtension.cs
注:本文中的MonoDevelop.Core.ProgressMonitor类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论