コード例 #1
0
        public static void ReportWarning( this IProgress<GeneratorProgress> progress, string message )
        {
            Arg.NotNull( progress, nameof( progress ) );
            Arg.NotNullOrEmpty( message, nameof( message ) );

            var error = new GeneratorError( message )
            {
                IsWarning = true
            };
            var value = new GeneratorProgress( error );

            progress.Report( value );
        }
コード例 #2
0
        public static void ReportWarning( this IProgress<GeneratorProgress> progress, string message, int line, int column )
        {
            Arg.NotNull( progress, nameof( progress ) );
            Arg.NotNullOrEmpty( message, nameof( message ) );
            Arg.GreaterThanOrEqualTo( line, 0, nameof( line ) );
            Arg.GreaterThanOrEqualTo( column, 0, nameof( column ) );

            var error = new GeneratorError( message, line, column )
            {
                IsWarning = true
            };
            var value = new GeneratorProgress( error );

            progress.Report( value );
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeneratorProgress"/> class.
 /// </summary>
 /// <param name="error">The <see cref="GeneratorError">error</see> that occurred.</param>
 public GeneratorProgress( GeneratorError error )
 {
     Arg.NotNull( error, nameof( error ) );
     Error = error;
 }