summaryrefslogtreecommitdiff
path: root/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs')
-rw-r--r--mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs23
1 files changed, 20 insertions, 3 deletions
diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs
index 60be917bf4..fd2c709dd0 100644
--- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs
+++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs
@@ -41,7 +41,8 @@ namespace Microsoft.Build.Framework
string senderName;
int threadId;
DateTime timestamp;
-
+ BuildEventContext context;
+
protected BuildEventArgs ()
: this (null, null, null)
{
@@ -49,12 +50,19 @@ namespace Microsoft.Build.Framework
protected BuildEventArgs (string message, string helpKeyword,
string senderName)
+ : this (message, helpKeyword, senderName, DateTime.Now)
+ {
+ }
+
+ 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 = DateTime.Now;
+ this.timestamp = eventTimestamp;
+ this.context = BuildEventContext.NewInstance ();
}
public string HelpKeyword {
@@ -87,7 +95,16 @@ namespace Microsoft.Build.Framework
return timestamp;
}
}
+
+ public BuildEventContext BuildEventContext {
+ get { return context; }
+ set {
+ if (value == null)
+ throw new ArgumentNullException ("value");
+ context = value;
+ }
+ }
}
}
-#endif \ No newline at end of file
+#endif