/// <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));
        }
示例#2
0
        /// <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);
     }
 }
示例#6
0
 public void RequestNavigateToError(BuildError error)
 {
     if (NavigateToErrorRequested != null)
         NavigateToErrorRequested(this, new BuildErrorEventArgs(error));
 }
示例#7
0
 public void ReportError(BuildError error)
 {
     if (ReportedError != null)
         ReportedError(this, new BuildErrorEventArgs(error));
 }
示例#8
0
 public BuildErrorEventArgs(BuildError error)
 {
     Error = error;
 }