/// <summary> /// Converts an instance of <see cref="System.CodeDom.Compiler.CompilerResults"/> to a BuildResult instance. /// </summary> /// <param name="results">The instance to convert.</param> /// <returns>A build result holding the elements of the given <see cref="System.CodeDom.Compiler.CompilerResults"/> instance</returns> public static BuildResult FromCompilerResults(CompilerResults results) { var errors = new BuildError[results.Errors.Count]; for (int i = 0; i < errors.Length; i++) { var currentError = results.Errors[i]; errors[i] = new BuildError( new SourceLocation( new FilePath(currentError.FileName), currentError.Line, currentError.Column), currentError.ErrorText, currentError.IsWarning ? MessageSeverity.Warning : MessageSeverity.Error); } return new BuildResult(BuildTarget.Build, errors, Path.GetDirectoryName(results.PathToAssembly)); }
/// <summary> /// Converts an instance of <see cref="System.CodeDom.Compiler.CompilerResults"/> to a BuildResult instance. /// </summary> /// <param name="results">The instance to convert.</param> /// <returns>A build result holding the elements of the given <see cref="System.CodeDom.Compiler.CompilerResults"/> instance</returns> public static BuildResult FromCompilerResults(CompilerResults results) { var errors = new BuildError[results.Errors.Count]; for (int i = 0; i < errors.Length; i++) { var currentError = results.Errors[i]; errors[i] = new BuildError( new SourceLocation( new FilePath(currentError.FileName), currentError.Line, currentError.Column), currentError.ErrorText, currentError.IsWarning ? MessageSeverity.Warning : MessageSeverity.Error); } return(new BuildResult(BuildTarget.Build, errors, Path.GetDirectoryName(results.PathToAssembly))); }
public BuildErrorEventArgs(BuildError error) { Error = error; }
public BuildResult(BuildTarget target, BuildError[] errors, string outputDirectory) { Target = target; Errors = errors; OutputDirectory = outputDirectory; }
private void AddError(BuildError error) { if (GetRowVisibility(error.Severity)) { var item = new ListViewItem(new string[] { error.Message, error.Location.FilePath.FileName, error.Location.Line.ToString(), error.Location.Column.ToString(), }); item.Tag = error; item.ImageIndex = _iconProvider.GetImageIndex(error.Severity); listView1.Items.Add(item); } }
public void RequestNavigateToError(BuildError error) { if (NavigateToErrorRequested != null) NavigateToErrorRequested(this, new BuildErrorEventArgs(error)); }
public void ReportError(BuildError error) { if (ReportedError != null) ReportedError(this, new BuildErrorEventArgs(error)); }