本文整理汇总了C#中Microsoft.Build.Framework.BuildEventContext类的典型用法代码示例。如果您正苦于以下问题:C# BuildEventContext类的具体用法?C# BuildEventContext怎么用?C# BuildEventContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildEventContext类属于Microsoft.Build.Framework命名空间,在下文中一共展示了BuildEventContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
/// <summary>
/// Creates an instance of this class for the specified task.
/// </summary>
public TaskEngine
(
XmlElement taskNodeXmlElement,
ITaskHost hostObject,
string projectFileOfTaskNode,
string parentProjectFullFileName,
EngineLoggingServices loggingServices,
int handleId,
TaskExecutionModule parentModule,
BuildEventContext targetBuildEventContext
)
{
ErrorUtilities.VerifyThrow(taskNodeXmlElement != null, "Need to specify the task node.");
ErrorUtilities.VerifyThrow(projectFileOfTaskNode != null, "Need to specify path of project.");
ErrorUtilities.VerifyThrow(parentProjectFullFileName != null, "Need to specify name of project.");
ErrorUtilities.VerifyThrow(loggingServices != null, "Need to specify the node logger.");
this.taskNode = taskNodeXmlElement;
this.taskClass = null;
this.hostObject = hostObject;
this.projectFileOfTaskNode = projectFileOfTaskNode;
this.parentProjectFullFileName = parentProjectFullFileName;
this.loggingServices = loggingServices;
this.handleId = handleId;
this.parentModule = parentModule;
this.continueOnError = false;
this.conditionAttribute = taskNode.Attributes[XMakeAttributes.condition];
this.buildEventContext = targetBuildEventContext;
}
示例2:
/// <summary>
/// The constructor obtains the state information and the
/// callback delegate.
/// </summary>
internal TaskExecutionState
(
TaskExecutionMode howToExecuteTask,
Lookup lookupForInference,
Lookup lookupForExecution,
XmlElement taskXmlNode,
ITaskHost hostObject,
string projectFileOfTaskNode,
string parentProjectFullFileName,
string executionDirectory,
int handleId,
BuildEventContext buildEventContext
)
{
ErrorUtilities.VerifyThrow(taskXmlNode != null, "Must have task node");
this.howToExecuteTask = howToExecuteTask;
this.lookupForInference = lookupForInference;
this.lookupForExecution = lookupForExecution;
this.hostObject = hostObject;
this.projectFileOfTaskNode = projectFileOfTaskNode;
this.parentProjectFullFileName = parentProjectFullFileName;
this.executionDirectory = executionDirectory;
this.handleId = handleId;
this.buildEventContext = buildEventContext;
this.taskXmlNode = taskXmlNode;
}
示例3: LogCommentFromText
/// <summary>
/// Log a comment
/// </summary>
/// <param name="buildEventContext">Event context information which describes who is logging the event</param>
/// <param name="importance">How important is the message, this will determine which verbosities the message will show up on.
/// The higher the importance the lower the verbosity needs to be for the message to be seen</param>
/// <param name="message">Message to log</param>
/// <exception cref="InternalErrorException">BuildEventContext is null</exception>
/// <exception cref="InternalErrorException">Message is null</exception>
public void LogCommentFromText(BuildEventContext buildEventContext, MessageImportance importance, string message)
{
lock (_lockObject)
{
this.LogCommentFromText(buildEventContext, importance, message, null);
}
}
示例4:
internal TargetExecutionWrapper
(
Target targetClass,
ArrayList taskElementList,
List<string> targetParameters,
XmlElement targetElement,
Expander expander,
BuildEventContext targetBuildEventContext
)
{
// Initialize the data about the target XML that has been calculated in the target class
this.targetClass = targetClass;
this.parentEngine = targetClass.ParentEngine;
this.parentProject = targetClass.ParentProject;
this.targetElement = targetElement;
this.taskElementList = taskElementList;
this.targetParameters = targetParameters;
this.targetBuildEventContext = targetBuildEventContext;
// Expand the list of depends on targets
dependsOnTargetNames = expander.ExpandAllIntoStringList(targetClass.DependsOnTargets, targetClass.DependsOnTargetsAttribute);
// Starting to build the target
inProgressBuildState = InProgressBuildState.StartingBuild;
// No messages have been logged
loggedTargetStart = false;
}
示例5: ProjectBuildState
/// <summary>
/// Create a build request from the list of targets to build and build request object
/// </summary>
internal ProjectBuildState(BuildRequest buildRequest, ArrayList targetNamesToBuild, BuildEventContext buildEventContext)
{
this.buildRequest = buildRequest;
this.indexOfTargetInProgress = 0;
this.targetNamesToBuild = targetNamesToBuild;
this.buildContextState = BuildContextState.StartingFirstTarget;
this.projectBuildEventContext = buildEventContext;
}
示例6: FixtureSetup
public static void FixtureSetup(TestContext testContext)
{
BuildEventContext context = new BuildEventContext(1, 2, 3, 4);
s_error.BuildEventContext = context;
s_warning.BuildEventContext = context;
s_targetStarted.BuildEventContext = context;
s_targetFinished.BuildEventContext = context;
}
示例7: Throw
internal static void Throw(Exception innerException, BuildEventContext buildEventContext, string messageResourceName, params string[] messageArgs)
{
ErrorUtilities.VerifyThrow(messageResourceName != null, "Need error message.");
string message = ResourceUtilities.FormatResourceString(messageResourceName, messageArgs);
throw new RemoteErrorException(message, innerException, buildEventContext);
}
示例8: ConfigureableForwardingLogger_Tests
public ConfigureableForwardingLogger_Tests()
{
BuildEventContext context = new BuildEventContext(1, 2, 3, 4);
_error.BuildEventContext = context;
_warning.BuildEventContext = context;
_targetStarted.BuildEventContext = context;
_targetFinished.BuildEventContext = context;
}
示例9: RemoteErrorException
internal RemoteErrorException(string message, Exception innerException, BuildEventContext buildEventContext)
: base(message, innerException)
{
ErrorUtilities.VerifyThrow((message != null) && (message.Length > 0), "Need error message.");
ErrorUtilities.VerifyThrow(innerException != null, "Need the logger exception.");
this.buildEventContext = buildEventContext;
}
示例10: FixtureSetup
public void FixtureSetup()
{
BuildEventContext context = new BuildEventContext(1, 2, 3, 4);
error.BuildEventContext = context;
warning.BuildEventContext = context;
targetStarted.BuildEventContext = context;
targetFinished.BuildEventContext = context;
}
示例11: AddProjectStartedEvent
internal void AddProjectStartedEvent(string projectFile, BuildEventContext context)
{
lock (this.projectStartedEvents)
{
if (!this.projectStartedEvents.ContainsKey(context))
{
this.projectStartedEvents.Add(context, projectFile);
}
}
}
示例12: BuildEventArgs
protected BuildEventArgs (string message, string helpKeyword,
string senderName, DateTime eventTimestamp)
{
this.message = message;
this.helpKeyword = helpKeyword;
this.senderName = senderName;
this.threadId = Thread.CurrentThread.GetHashCode ();
this.timestamp = eventTimestamp;
this.context = BuildEventContext.NewInstance ();
}
示例13: GetProjectFile
internal string GetProjectFile(BuildEventContext e)
{
string file;
lock (projectStartedEvents)
{
projectStartedEvents.TryGetValue(e, out file);
}
return file;
}
示例14: Generate
/// <summary>
/// Given the full path to a solution, returns a string containing the v3.5 MSBuild-format
/// wrapper project for that solution.
/// </summary>
/// <param name="solutionPath">Full path to the solution we are wrapping</param>
/// <param name="toolsVersionOverride">May be null. If non-null, contains the ToolsVersion passed in on the command line</param>\
/// <param name="projectBuildEventContext">An event context for logging purposes.</param>
/// <returns></returns>
static public string Generate(string solutionPath, string toolsVersionOverride, BuildEventContext projectBuildEventContext)
{
Project msbuildProject = new Project();
SolutionParser solution = new SolutionParser();
solution.SolutionFile = solutionPath;
solution.ParseSolutionFile();
Generate(solution, msbuildProject, toolsVersionOverride, projectBuildEventContext);
return msbuildProject.Xml;
}
示例15: LogComment
/// <summary>
/// Logs a comment (BuildMessageEventArgs) with a certain MessageImportance level
/// </summary>
/// <param name="buildEventContext">Event context information which describes who is logging the event</param>
/// <param name="importance">How important is the message, this will determine which verbosities the message will show up on.
/// The higher the importance the lower the verbosity needs to be for the message to be seen</param>
/// <param name="messageResourceName">String which identifies the message in the string resx</param>
/// <param name="messageArgs">Arguments for the format string indexed by messageResourceName</param>
/// <exception cref="InternalErrorException">MessageResourceName is null</exception>
public void LogComment(BuildEventContext buildEventContext, MessageImportance importance, string messageResourceName, params object[] messageArgs)
{
lock (_lockObject)
{
if (!OnlyLogCriticalEvents)
{
ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(messageResourceName), "Need resource string for comment message.");
LogCommentFromText(buildEventContext, importance, ResourceUtilities.GetResourceString(messageResourceName), messageArgs);
}
}
}