本文整理汇总了C#中Microsoft.Build.Framework.CustomBuildEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# CustomBuildEventArgs类的具体用法?C# CustomBuildEventArgs怎么用?C# CustomBuildEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CustomBuildEventArgs类属于Microsoft.Build.Framework命名空间,在下文中一共展示了CustomBuildEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomEvent
void CustomEvent(object sender, CustomBuildEventArgs e)
{
//Do nothing, really a place holder for sub-classes
}
示例2: LogCustomEvent
// Raises a custom event to all registered loggers.
public void LogCustomEvent (CustomBuildEventArgs e)
{
engine.EventSource.FireCustomEventRaised (this, e);
}
示例3: CustomHandler
/// <summary>
/// This is the delegate for CustomHandler events.
/// </summary>
/// <param name="sender"></param>
/// <param name="buildEvent"></param>
protected virtual void CustomHandler(object sender, CustomBuildEventArgs buildEvent)
{
// NOTE: This may run on a background thread!
QueueOutputEvent(MessageImportance.High, buildEvent);
}
示例4: LogCustomEvent
/// <summary>
/// Raises a custom event to all registered loggers.
/// </summary>
/// <param name="e">The event data.</param>
public void LogCustomEvent(CustomBuildEventArgs e)
{
this.context.Information(e.Message);
}
示例5: CustomHandler
/// <summary>
/// This is the delegate for CustomHandler events.
/// </summary>
/// <param name="sender"></param>
/// <param name="buildEvent"></param>
private void CustomHandler(object sender, CustomBuildEventArgs buildEvent)
{
try
{
LogEvent(sender, buildEvent);
}
catch (Exception e)
{
Debug.Assert(false, "Problem logging custom event: " + e.Message + " at " + e.TargetSite);
// swallow the exception
}
}
示例6: MyCustomBuildHandler
/// <summary>
/// Log and record the number of custom build events.
/// </summary>
internal void MyCustomBuildHandler(object s, CustomBuildEventArgs e)
{
_numberOfCustom++;
_lastCustom = e;
if (e.Message != null)
{
Console.Out.WriteLine("CustomEvent:" + e.Message.ToString());
}
}
示例7: LogCustomEvent
public void LogCustomEvent(CustomBuildEventArgs e)
{
_log.LogMessage(e.Message);
}
示例8: RaiseCustomEvent
/// <summary>
/// Raises a custom event to all registered loggers.
/// </summary>
/// <param name="sender">sender of the event</param>
/// <param name="buildEvent">CustomBuildEventArgs</param>
/// <exception cref="LoggerException">When EventHandler raises an logger exception the LoggerException is rethrown</exception>
/// <exception cref="InternalLoggerException">Any exceptions which are not LoggerExceptions are wrapped in an InternalLoggerException</exception>
/// <exception cref="Exception">ExceptionHandling.IsCriticalException exceptions will not be wrapped</exception>
private void RaiseCustomEvent(object sender, CustomBuildEventArgs buildEvent)
{
if (CustomEventRaised != null)
{
try
{
CustomEventRaised(sender, buildEvent);
}
catch (LoggerException)
{
// if a logger has failed politely, abort immediately
// first unregister all loggers, since other loggers may receive remaining events in unexpected orderings
// if a fellow logger is throwing in an event handler.
this.UnregisterAllEventHandlers();
throw;
}
catch (Exception exception)
{
// first unregister all loggers, since other loggers may receive remaining events in unexpected orderings
// if a fellow logger is throwing in an event handler.
this.UnregisterAllEventHandlers();
if (ExceptionHandling.IsCriticalException(exception))
{
throw;
}
InternalLoggerException.Throw(exception, buildEvent, "FatalErrorWhileLogging", false);
}
}
RaiseAnyEvent(sender, buildEvent);
}
示例9: CustomBuildEventRaised
private void CustomBuildEventRaised(object sender, CustomBuildEventArgs e)
{
this.LogMessage("custom", e.Message, MessageImportance.Normal);
}
示例10: CustomEventHandler
/// <summary>
/// Prints a custom event
/// </summary>
public void CustomEventHandler(object sender, CustomBuildEventArgs e)
{
InitializeBaseConsoleLogger(); // for compat: see DDB#136924
_consoleLogger.CustomEventHandler(sender, e);
}
示例11: LogCustomEvent
public virtual void LogCustomEvent(CustomBuildEventArgs e)
{
throw new Exception("The method or operation is not implemented.");
}
示例12: LogCustomEvent
/// <summary>
/// Allows tasks to raise custom events to all registered loggers.
/// The build engine may perform some filtering or
/// pre-processing on the events, before dispatching them.
/// </summary>
/// <param name="e">Details of event to raise.</param>
public void LogCustomEvent(CustomBuildEventArgs e)
{
OnLogBuildEvent(e);
}
示例13: CustomEventHandler
/// <summary>
/// Prints a custom event
/// </summary>
public override void CustomEventHandler(object sender, CustomBuildEventArgs e)
{
// if verbosity is detailed or diagnostic
if (IsVerbosityAtLeast(LoggerVerbosity.Detailed))
{
// ignore custom events with null messages -- some other
// logger will handle them appropriately
if (e.Message != null)
{
ShowDeferredMessages();
WriteLinePretty(e.Message);
}
}
}
示例14: LogCustomEvent
/// <summary>
/// Unused.
/// </summary>
public void LogCustomEvent(CustomBuildEventArgs e)
{
throw new NotImplementedException();
}
示例15: LogCustomEvent
public void LogCustomEvent (CustomBuildEventArgs e)
{
event_source.FireCustomEventRaised (this, e);
}