/// <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;
 }