/// <summary> /// Called when output should be added to the Output pane. /// </summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void CoreOutputGenerated(object sender, OutputEventArgs e) { Param.Ignore(sender, e); lock (this) { this.OnOutputGenerated(new OutputEventArgs(e.Output, e.Importance)); } }
/// <summary> /// Called when output is generated during an analysis. /// </summary> /// <param name="e">The event arguments.</param> protected void OnOutputGenerated(OutputEventArgs e) { Param.RequireNotNull(e, "e"); if (this.OutputGenerated != null) { this.OutputGenerated(this, e); } }
/// <summary> /// Called when StyleCop outputs messages. /// </summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnOutputGenerated(object sender, OutputEventArgs e) { Param.Ignore(sender); Param.AssertNotNull(e, "e"); lock (this) { this.Log.LogMessage(e.Importance, e.Output.Trim()); } }
/// <summary> /// Called when output is generated during an analysis. This can be called simultaneously from several threads and so any code must be thread safe. /// </summary> /// <param name="e"> /// The event arguments. /// </param> protected void OnOutputGenerated(OutputEventArgs e) { Param.RequireNotNull(e, "e"); // Make sure we cache the delegate locally to avoid other threads unsubscribing before we call them. // See http://piers7.blogspot.com/2010/03/3-races-with-net-events.html for info. EventHandler <OutputEventArgs> handlers = this.OutputGenerated; if (handlers != null) { handlers(this, e); } }
//////////////////////////////////////////////////////////////////////// // Events /// <summary> /// Fired when output generated during analysis. /// </summary> /// <param name="sender"> /// Object representing source of event. /// </param> /// <param name="e"> /// OutputEventArgs representing output generated event data. /// </param> static void OnOutputGenerated(object sender, OutputEventArgs e) { Console.WriteLine(e.Output); }
/// <summary> /// Called when a line of output is generated while analyzing a code document. This can be called simultaneously from several threads and so any code must be thread safe. /// </summary> /// <param name="e">The event arguments.</param> private void OnOutputGenerated(OutputEventArgs e) { Param.AssertNotNull(e, "e"); // Make sure we cache the delegate locally to avoid other threads unsubscribing before we call them. // See http://piers7.blogspot.com/2010/03/3-races-with-net-events.html for info. EventHandler<OutputEventArgs> handlers = this.OutputGenerated; if (handlers != null) { handlers(this, e); } }
/// <summary> /// Called when output should be added to the Output pane. /// </summary> /// <param name="sender"> /// The event sender. /// </param> /// <param name="e"> /// The event arguments. /// </param> private void CoreOutputGenerated(object sender, OutputEventArgs e) { Param.Ignore(sender, e); lock (this) { this.OnOutputGenerated(new OutputEventArgs(e.Output, e.Importance)); } }
/// <summary> /// Called when StyleCop output is generated during fuzz test mode. /// </summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private static void OnFuzzOutputGenerated(object sender, OutputEventArgs e) { if (e.Output.StartsWith("Exception", StringComparison.OrdinalIgnoreCase)) { issues++; string id = String.Format("{0:0000}", issues); Console.WriteLine("{0} {1}", id, e.Output); Console.WriteLine("{0} Original file: {1}", id, currentFile); string saveAs = String.Format("ViolationFiles\\{0}.cs", id); File.Copy(currentFile, saveAs); } }
/// <summary> /// Called when StyleCop output is generated. /// </summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private static void OnOutputGenerated(object sender, OutputEventArgs e) { if (e.Output.StartsWith("Exception", StringComparison.OrdinalIgnoreCase)) { issues++; Console.WriteLine("{0:0000} {1}", issues, e.Output); } }
/// <summary> /// Handle Console output from StyleCop /// </summary> /// <param name="sender">Event source</param> /// <param name="e">Arguments supplied</param> private void ConsoleOutput(object sender, OutputEventArgs e) { Console.Write(e.Output); }
/// <summary> /// Called when a line of output is generated while analyzing a code document. /// </summary> /// <param name="e">The event arguments.</param> private void OnOutputGenerated(OutputEventArgs e) { Param.AssertNotNull(e, "e"); if (this.OutputGenerated != null) { this.OutputGenerated(this, e); } }
/// <summary> /// Handles generated output. /// </summary> private void OnOutputGenerated(object sender, OutputEventArgs e) { Output.AppendLine(e.Output); }