namespace Microsoft.Build.Tasks {
public sealed class Message : TaskExtension {
- MessageImportance messageImportance;
string importance;
string text;
public override bool Execute ()
{
+ if (text == null)
+ return true;
+
+ MessageImportance messageImportance;
+
if (importance == null)
messageImportance = MessageImportance.Normal;
- else if (importance == "Low")
+ else if (importance.ToLower () == "low")
messageImportance = MessageImportance.Low;
- else if (importance == "Normal")
+ else if (importance.ToLower () == "normal")
messageImportance = MessageImportance.Normal;
- else if (importance == "High")
+ else if (importance.ToLower () == "high")
messageImportance = MessageImportance.High;
else {
- Log.LogError (null, null, null, BuildEngine.ProjectFileOfTaskNode,
- BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
- BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
- "Invalid Importance attribute.", null);
return false;
}
+
Log.LogMessage (messageImportance, text, null);
+
return true;
}
public string Importance {
- get {
- return importance;
- }
- set {
- importance = value;
- }
+ get { return importance; }
+ set { importance = value; }
}
public string Text {
- get {
- return text;
- }
- set {
- text = value;
- }
+ get { return text; }
+ set { text = value; }
}
}
}
-#endif
\ No newline at end of file
+#endif