本文整理汇总了C#中Microsoft.Build.Framework.ProjectStartedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ProjectStartedEventArgs类的具体用法?C# ProjectStartedEventArgs怎么用?C# ProjectStartedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectStartedEventArgs类属于Microsoft.Build.Framework命名空间,在下文中一共展示了ProjectStartedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ProjectStarted
void ProjectStarted(object sender, ProjectStartedEventArgs e)
{
string directoryName = Path.GetDirectoryName(e.ProjectFile);
if (null != directoryName)
this.ProjectDirectory = directoryName;
// Console.WriteLine("Project Started: " + e.ProjectFile);
}
开发者ID:psineur,项目名称:MonoSublimeLogger,代码行数:7,代码来源:LoggerImpl.cs
示例2: VerifyEventType
public void VerifyEventType()
{
BuildFinishedEventArgs buildFinished = new BuildFinishedEventArgs("Message", "Keyword", true);
BuildStartedEventArgs buildStarted = new BuildStartedEventArgs("Message", "Help");
BuildMessageEventArgs lowMessage = new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low);
TaskStartedEventArgs taskStarted = new TaskStartedEventArgs("message", "help", "projectFile", "taskFile", "taskName");
TaskFinishedEventArgs taskFinished = new TaskFinishedEventArgs("message", "help", "projectFile", "taskFile", "taskName", true);
TaskCommandLineEventArgs commandLine = new TaskCommandLineEventArgs("commandLine", "taskName", MessageImportance.Low);
BuildWarningEventArgs warning = new BuildWarningEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender");
BuildErrorEventArgs error = new BuildErrorEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender");
TargetStartedEventArgs targetStarted = new TargetStartedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile");
TargetFinishedEventArgs targetFinished = new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true);
ProjectStartedEventArgs projectStarted = new ProjectStartedEventArgs(-1, "message", "help", "ProjectFile", "targetNames", null, null, null);
ProjectFinishedEventArgs projectFinished = new ProjectFinishedEventArgs("message", "help", "ProjectFile", true);
ExternalProjectStartedEventArgs externalStartedEvent = new ExternalProjectStartedEventArgs("message", "help", "senderName", "projectFile", "targetNames");
VerifyLoggingPacket(buildFinished, LoggingEventType.BuildFinishedEvent);
VerifyLoggingPacket(buildStarted, LoggingEventType.BuildStartedEvent);
VerifyLoggingPacket(lowMessage, LoggingEventType.BuildMessageEvent);
VerifyLoggingPacket(taskStarted, LoggingEventType.TaskStartedEvent);
VerifyLoggingPacket(taskFinished, LoggingEventType.TaskFinishedEvent);
VerifyLoggingPacket(commandLine, LoggingEventType.TaskCommandLineEvent);
VerifyLoggingPacket(warning, LoggingEventType.BuildWarningEvent);
VerifyLoggingPacket(error, LoggingEventType.BuildErrorEvent);
VerifyLoggingPacket(targetStarted, LoggingEventType.TargetStartedEvent);
VerifyLoggingPacket(targetFinished, LoggingEventType.TargetFinishedEvent);
VerifyLoggingPacket(projectStarted, LoggingEventType.ProjectStartedEvent);
VerifyLoggingPacket(projectFinished, LoggingEventType.ProjectFinishedEvent);
VerifyLoggingPacket(externalStartedEvent, LoggingEventType.CustomEvent);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:30,代码来源:NodePackets_Tests.cs
示例3: eventSource_ProjectStarted
void eventSource_ProjectStarted(object sender, ProjectStartedEventArgs e)
{
// ProjectStartedEventArgs adds ProjectFile, TargetNames
// Just the regular message string is good enough here, so just display that.
WriteLine(String.Empty, e);
indent++;
}
开发者ID:twistedtwig,项目名称:NHibernateRepository,代码行数:7,代码来源:MsBuildLogger.cs
示例4: Project
/// <summary>
/// Initializes a new instance of the <see cref="Project"/> class.
/// </summary>
/// <param name="projectId">The project identifier.</param>
/// <param name="e">The <see cref="ProjectStartedEventArgs"/> instance containing the event data.</param>
/// <param name="parentPropertyBag">The parent property bag (to check for inherited properties).</param>
public Project(int projectId, ProjectStartedEventArgs e, PropertyBag parentPropertyBag)
{
Properties = new PropertyBag(parentPropertyBag);
Id = projectId;
TryUpdate(e);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:13,代码来源:Project.cs
示例5: eventSource_ProjectStarted
/// <summary>
/// Handler for the ProjectStarted event.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void eventSource_ProjectStarted(object sender, ProjectStartedEventArgs e)
{
// Clone and store the properties so we can inspect the values later on
foreach (DictionaryEntry property in e.Properties)
{
projectStartedProperties[(string) property.Key] = (string) property.Value;
}
}
开发者ID:nikson,项目名称:msbuild,代码行数:13,代码来源:MockProjectStartedLogger.cs
示例6: ProjectState
public ProjectState(ProjectStartedEventArgs args)
{
GlobalProperties = args.GlobalProperties;
ProjectFile = args.ProjectFile;
ContextId = args.BuildEventContext.ProjectContextId;
ParentContextId = args.ParentProjectBuildEventContext.ProjectContextId;
TargetPath = (string)args.Properties?.Cast<DictionaryEntry>().FirstOrDefault(p => ((string)p.Key).Equals("TargetPath")).Value;
}
开发者ID:dsgouda,项目名称:buildtools,代码行数:8,代码来源:BinClashLogger.cs
示例7: EventArgsCtors
public void EventArgsCtors()
{
ProjectStartedEventArgs projectStartedEvent = new ProjectStartedEventArgs2();
Assert.IsNotNull(projectStartedEvent);
projectStartedEvent = new ProjectStartedEventArgs("Message", "HelpKeyword", "ProjecFile", "TargetNames", null, null);
projectStartedEvent = new ProjectStartedEventArgs("Message", "HelpKeyword", "ProjecFile", "TargetNames", null, null, DateTime.Now);
projectStartedEvent = new ProjectStartedEventArgs(1, "Message", "HelpKeyword", "ProjecFile", "TargetNames", null, null, null);
projectStartedEvent = new ProjectStartedEventArgs(1, "Message", "HelpKeyword", "ProjecFile", "TargetNames", null, null, null, DateTime.Now);
projectStartedEvent = new ProjectStartedEventArgs(null, null, null, null, null, null);
projectStartedEvent = new ProjectStartedEventArgs(null, null, null, null, null, null, DateTime.Now);
projectStartedEvent = new ProjectStartedEventArgs(1, null, null, null, null, null, null, null);
projectStartedEvent = new ProjectStartedEventArgs(1, null, null, null, null, null, null, null, DateTime.Now);
}
开发者ID:JamesLinus,项目名称:msbuild,代码行数:14,代码来源:ProjectStartedEventArgs_Tests.cs
示例8: AssignmentTest
public void AssignmentTest ()
{
ProjectStartedEventArgs psea;
string message = "message";
string helpKeyword = "helpKeyword";
string projectFile = "projectFile";
string targetNames = "targetNames";
string [] properties = new string [2] { "a", "b" };
string [] items = new string [2] { "c", "d" };
psea = new ProjectStartedEventArgs (message, helpKeyword, projectFile, targetNames, properties, items);
Assert.AreEqual (message, psea.Message, "A1");
Assert.AreEqual (helpKeyword, psea.HelpKeyword, "A2");
Assert.AreEqual (projectFile, psea.ProjectFile, "A3");
Assert.AreEqual (targetNames, psea.TargetNames, "A4");
Assert.AreEqual (properties, psea.Properties, "A5");
Assert.AreEqual (items, psea.Items, "A6");
}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:20,代码来源:ProjectStartedEventArgsTest.cs
示例9: ItemsAndPropertiesDifferentEquals
public void ItemsAndPropertiesDifferentEquals()
{
ArrayList itemsList = new ArrayList();
ArrayList propertiesList = new ArrayList();
ProjectStartedEventArgs differentItemsAndProperties = new ProjectStartedEventArgs
(
s_baseProjectStartedEvent.ProjectId,
s_baseProjectStartedEvent.Message,
s_baseProjectStartedEvent.HelpKeyword,
s_baseProjectStartedEvent.ProjectFile,
s_baseProjectStartedEvent.TargetNames,
propertiesList,
itemsList,
s_baseProjectStartedEvent.ParentProjectBuildEventContext,
s_baseProjectStartedEvent.Timestamp
);
Assert.IsFalse(propertiesList == s_baseProjectStartedEvent.Properties);
Assert.IsFalse(itemsList == s_baseProjectStartedEvent.Items);
}
开发者ID:JamesLinus,项目名称:msbuild,代码行数:20,代码来源:ProjectStartedEventArgs_Tests.cs
示例10: eventSource_ProjectStartedHandler
private void eventSource_ProjectStartedHandler(object sender, ProjectStartedEventArgs e)
{
LogStageStarted(XmlLoggerElements.Project, e.TargetNames, e.ProjectFile, e.Timestamp);
}
开发者ID:jlewin,项目名称:Kobush.Build,代码行数:4,代码来源:XmlLogger.cs
示例11: ProjectStartedHandler
/// <summary>
/// This is the delegate for ProjectStartedHandler events.
/// </summary>
private void ProjectStartedHandler(object sender, ProjectStartedEventArgs buildEvent)
{
try
{
if (LogAtImportance(MessageImportance.Low))
{
LogEvent(sender, buildEvent);
}
}
catch (Exception e)
{
Debug.Assert(false, "Problem logging projectstarted event: " + e.Message + " at " + e.TargetSite);
// swallow the exception
}
}
开发者ID:CaptainHayashi,项目名称:visualfsharp,代码行数:18,代码来源:IDEBuildLogger.cs
示例12: ProjectStarted
private void ProjectStarted(object sender, ProjectStartedEventArgs e)
{
string targets = string.IsNullOrEmpty(e.TargetNames) ? "default" : e.TargetNames;
string line = string.Format(CultureInfo.InvariantCulture, "Project \"{0}\" ({1} target(s)):", e.ProjectFile, targets);
this.WriteLine(line + Environment.NewLine);
if (this.IsVerbosityAtLeast(LoggerVerbosity.Diagnostic))
{
this.WriteLine("Initial Properties:");
SortedDictionary<string, string> sortedProperties = new SortedDictionary<string, string>();
foreach (DictionaryEntry k in e.Properties.Cast<DictionaryEntry>())
{
sortedProperties.Add(k.Key.ToString(), k.Value.ToString());
}
foreach (var p in sortedProperties)
{
bool matched = this.regExRules.Select(s => new Regex(s)).Select(r => r.Match(p.Key)).Any(m => m.Success);
if (matched)
{
this.WriteLine(p.Key + "\t = " + SecureChar.Repeat(p.Value.Length));
}
else
{
this.WriteLine(p.Key + "\t = " + p.Value);
}
}
}
}
开发者ID:simondmorias,项目名称:MSBuildExtensionPack,代码行数:31,代码来源:SecureFileLogger.cs
示例13: OnProjectStarted
private void OnProjectStarted(object sender, ProjectStartedEventArgs e)
{
_projects.Add(new BuildProjectContextEntry(
e.BuildEventContext.ProjectInstanceId,
e.BuildEventContext.ProjectContextId,
e.ProjectFile,
e.GlobalProperties));
}
开发者ID:ashwinsathyar,项目名称:BuildVision,代码行数:8,代码来源:BuildOutputLogger.cs
示例14: ProjectStarted
/// <summary>
/// Event handler which signals the event.
/// </summary>
private void ProjectStarted(object sender, ProjectStartedEventArgs e)
{
_projectStartedEvent.Set();
}
开发者ID:cameron314,项目名称:msbuild,代码行数:7,代码来源:MuxLogger_Tests.cs
示例15: eventSource_ProjectStarted
private void eventSource_ProjectStarted(object sender, ProjectStartedEventArgs e)
{
Console.WriteLine("project started: file=\"{0}\"", e.ProjectFile);
}
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:4,代码来源:ConsoleLogger.cs
示例16: IsEquivalent
/// <summary>
/// Compare this build event context with another object to determine
/// equality. This means the values inside the object are identical.
/// </summary>
/// <param name="obj">Object to compare to this object</param>
/// <returns>True if the object values are identical, false if they are not identical</returns>
public static bool IsEquivalent(ProjectStartedEventArgs args, ProjectStartedEventArgs other)
{
if (!String.Equals(args.ProjectFile, other.ProjectFile, StringComparison.OrdinalIgnoreCase))
{
return false;
}
if (!String.Equals(args.TargetNames, other.TargetNames, StringComparison.OrdinalIgnoreCase))
{
return false;
}
return ((BuildEventArgs)args).IsEquivalent(other);
}
开发者ID:JamesLinus,项目名称:msbuild,代码行数:20,代码来源:BuildEventArgsExtension.cs
示例17: TestLoggingEventCustomerSerialization
public void TestLoggingEventCustomerSerialization()
{
Hashtable loggingTypeCacheWrites = new Hashtable();
stream.Position = 0;
BuildEventContext context = new BuildEventContext(1,3,5,7);
GenericBuildEventArg genericBuildEvent = new GenericBuildEventArg("Message","Help","Sender");
genericBuildEvent.BuildEventContext = context;
NodeLoggingEvent genericBuildEventLoggingEvent = new NodeLoggingEvent(genericBuildEvent);
genericBuildEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
GenericCustomBuildEventArg genericCustomEvent = new GenericCustomBuildEventArg("FooFighter");
genericCustomEvent.BuildEventContext = context;
NodeLoggingEvent genericCustomEventLoggingEvent = new NodeLoggingEvent(genericCustomEvent);
genericCustomEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
BuildErrorEventArgs errorEvent = new BuildErrorEventArgs("Subcategory", "Code", "File", 1, 2, 3, 4, "Message", "HelpKeyword", "SenderName");
errorEvent.BuildEventContext = context;
NodeLoggingEvent errorEventLoggingEvent = new NodeLoggingEvent(errorEvent);
errorEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
BuildMessageEventArgs messageEvent = new BuildMessageEventArgs("Message", "HelpKeyword", "SenderName",MessageImportance.High);
messageEvent.BuildEventContext = context;
NodeLoggingEvent messageEventLoggingEvent = new NodeLoggingEvent(messageEvent);
messageEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
BuildWarningEventArgs warningEvent = new BuildWarningEventArgs("Subcategory", "Code", "File", 1, 2, 3, 4, "Message", "HelpKeyword", "SenderName");
warningEvent.BuildEventContext = context;
NodeLoggingEvent warningEventLoggingEvent = new NodeLoggingEvent(warningEvent);
warningEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
ProjectStartedEventArgs projectStartedEvent = new ProjectStartedEventArgs( 8,"Message", "HelpKeyword", "ProjectFile", "TargetNames", null, null, new BuildEventContext(7,8,9,10));
projectStartedEvent.BuildEventContext = context;
NodeLoggingEvent projectStartedEventLoggingEvent = new NodeLoggingEvent(projectStartedEvent);
projectStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
ProjectFinishedEventArgs projectFinishedEvent = new ProjectFinishedEventArgs("Message", "HelpKeyword","ProjectFile",true);
projectFinishedEvent.BuildEventContext = context;
NodeLoggingEvent projectFinishedEventLoggingEvent = new NodeLoggingEvent(projectFinishedEvent);
projectFinishedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
TargetStartedEventArgs targetStartedEvent = new TargetStartedEventArgs("Message", "HelpKeyword", "TargetName", "ProjectFile", "TargetFile");
targetStartedEvent.BuildEventContext = context;
NodeLoggingEvent targetStartedEventLoggingEvent = new NodeLoggingEvent(targetStartedEvent);
targetStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
TargetFinishedEventArgs targetFinished = new TargetFinishedEventArgs("Message", "HelpKeyword","TargetName", "ProjectFile", "TargetFile", true);
targetFinished.BuildEventContext = context;
NodeLoggingEvent targetFinishedEventLoggingEvent = new NodeLoggingEvent(targetFinished);
targetFinishedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
TaskStartedEventArgs taskStartedEvent = new TaskStartedEventArgs("Message", "HelpKeyword", "ProjectFile", "TaskFile", "TaskName");
taskStartedEvent.BuildEventContext = context;
NodeLoggingEvent taskStartedEventLoggingEvent = new NodeLoggingEvent(taskStartedEvent);
taskStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
TaskFinishedEventArgs taskFinishedEvent = new TaskFinishedEventArgs("Message", "HelpKeyword", "ProjectFile", "TaskFile", "TaskName", true);
taskFinishedEvent.BuildEventContext = context;
NodeLoggingEvent taskFinishedEventLoggingEvent = new NodeLoggingEvent(taskFinishedEvent);
taskFinishedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
BuildFinishedEventArgs buildFinishedEvent = new BuildFinishedEventArgs("Message","Help",true);
buildFinishedEvent.BuildEventContext = context;
NodeLoggingEvent buildFinishedEventEventLoggingEvent = new NodeLoggingEvent(buildFinishedEvent);
buildFinishedEventEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
BuildStartedEventArgs buildStartedEvent = new BuildStartedEventArgs("Message","Help");
buildStartedEvent.BuildEventContext = context;
NodeLoggingEvent buildStartedEventLoggingEvent = new NodeLoggingEvent(buildStartedEvent);
buildStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
TaskCommandLineEventArgs commandlineEventArg = new TaskCommandLineEventArgs("CommandLine","TaskName", MessageImportance.High);
commandlineEventArg.BuildEventContext = context;
NodeLoggingEvent commandlineEventArgLoggingEvent = new NodeLoggingEvent(commandlineEventArg);
commandlineEventArgLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);
Hashtable loggingTypeCacheReads = new Hashtable();
long streamWriteEndPosition = stream.Position;
stream.Position = 0;
NodeLoggingEvent nodeLoggingEvent = new NodeLoggingEvent(null);
nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(GenericBuildEventArg));
nodeLoggingEvent = new NodeLoggingEvent(null);
nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(GenericCustomBuildEventArg));
nodeLoggingEvent = new NodeLoggingEvent(null);
nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildErrorEventArgs));
nodeLoggingEvent = new NodeLoggingEvent(null);
nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildMessageEventArgs));
nodeLoggingEvent = new NodeLoggingEvent(null);
nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildWarningEventArgs));
nodeLoggingEvent = new NodeLoggingEvent(null);
//.........这里部分代码省略.........
开发者ID:nikson,项目名称:msbuild,代码行数:101,代码来源:NodeLoggingEventTests.cs
示例18: onProjectStarted
protected void onProjectStarted(object sender, ProjectStartedEventArgs e)
{
termination(); // This is first place where we can use it
if(e.ProjectFile.EndsWith(".metaproj", StringComparison.OrdinalIgnoreCase)) {
debug(".metaproj has been ignored for '{0}'", e.ProjectFile);
return;
}
if(projects.ContainsKey(e.ProjectId)) {
// already pushed
return;
}
//updateBuildType(e.TargetNames);
if(e.Properties == null) {
debug("onProjectStarted: e.Properties is null :: '{0}' ({1})", e.ProjectFile, e.Message);
return;
}
Dictionary<object, string> properties = e.Properties.OfType<DictionaryEntry>().ToDictionary(k => k.Key, v => v.Value.ToString());
if(properties.ContainsKey("ProjectName"))
{
projects[e.ProjectId] = new Project() {
Name = properties["ProjectName"],
File = e.ProjectFile,
Properties = properties
};
}
}
开发者ID:hilbertdu,项目名称:vsSolutionBuildEvent,代码行数:30,代码来源:EventManager.cs
示例19: ProjectStartedHandler
/// <summary>
/// This is the delegate for ProjectStartedHandler events.
/// </summary>
private void ProjectStartedHandler(object sender, ProjectStartedEventArgs buildEvent)
{
if (LogAtImportance(MessageImportance.Low))
{
LogEvent(sender, buildEvent);
}
}
开发者ID:Jeremiahf,项目名称:wix3,代码行数:10,代码来源:idebuildlogger.cs
示例20: EventSource_ProjectStarted
void EventSource_ProjectStarted(object sender, ProjectStartedEventArgs e)
{
if (projectFilename == null)
projectFilename = e.ProjectFile;
}
开发者ID:modulexcite,项目名称:BuildAnalyzer,代码行数:5,代码来源:TaskLogger.cs
注:本文中的Microsoft.Build.Framework.ProjectStartedEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论