Normalize line endings.
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / Message.cs
index 959d8ccb68593f54de588d238b7d296c9422bcd0..8f0783b3f2410047a264bdade1f9d5cc73ef698a 100644 (file)
@@ -33,7 +33,6 @@ using Microsoft.Build.Tasks;
 namespace Microsoft.Build.Tasks {
        public sealed class Message : TaskExtension {
        
-               MessageImportance       messageImportance;
                string                  importance;
                string                  text;
        
@@ -43,43 +42,38 @@ namespace Microsoft.Build.Tasks {
 
                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