Author: msierad
Date: 2006-06-02 17:45:22 -0400 (Fri, 02 Jun 2006)
New Revision: 61425

Modified:
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroupCollection.cs
   trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
Log:
2006-06-02  Marek Sieradzki  <[EMAIL PROTECTED]>

        * BuildItem.cs, BuildProperty.cs, BuildPropertyGroup.cs,
        BuildPropertyGroupCollection.cs: Fixed to match the tests.



Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs 
    2006-06-02 21:41:12 UTC (rev 61424)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs 
    2006-06-02 21:45:22 UTC (rev 61425)
@@ -43,6 +43,7 @@
                XmlElement      itemElement;
                string          finalItemSpec;
                bool            isImported;
+               string          itemInclude;
                string          name;
                BuildItemGroup  parentItemGroup;
                string          recursiveDir;
@@ -57,6 +58,7 @@
                {
                        this.name = itemName;
                        this.finalItemSpec = taskItem.ItemSpec;
+                       this.itemInclude = Utilities.Escape (taskItem.ItemSpec);
                        this.evaluatedMetadata = (Hashtable) 
taskItem.CloneCustomMetadata ();
                        this.unevaluatedMetadata = (Hashtable) 
taskItem.CloneCustomMetadata ();
                }
@@ -304,6 +306,8 @@
                        get {
                                if (FromXml)
                                        return itemElement.GetAttribute 
("Include");
+                               else if (itemInclude != null)
+                                       return itemInclude;
                                else
                                        return finalItemSpec;
                        }

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
 2006-06-02 21:41:12 UTC (rev 61424)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
 2006-06-02 21:45:22 UTC (rev 61425)
@@ -49,6 +49,12 @@
                public BuildProperty (string propertyName, string propertyValue)
                        : this (propertyName, propertyValue, 
PropertyType.Normal)
                {
+                       if (propertyName == null)
+                               throw new ArgumentNullException (null,
+                                       "Parameter \"propertyName\" cannot be 
null.");
+                       if (propertyValue == null)
+                               throw new ArgumentNullException (null,
+                                       "Parameter \"propertyValue\" cannot be 
null.");
                }
 
                internal BuildProperty (string propertyName,
@@ -77,7 +83,17 @@
                [MonoTODO]
                public BuildProperty Clone (bool deepClone)
                {
-                       return (BuildProperty) this.MemberwiseClone ();
+                       if (deepClone) {
+                               if (FromXml == false) {
+                                       return (BuildProperty) 
this.MemberwiseClone ();
+                               } else {
+                                       throw new NotImplementedException ();
+                               }
+                       } else {
+                               if (FromXml == false)
+                                       throw new InvalidOperationException ("A 
shallow clone of this object cannot be created.");
+                               throw new NotImplementedException ();
+                       }
                }
 
                public static explicit operator string (BuildProperty 
propertyToCast)
@@ -112,8 +128,16 @@
                }
        
                public string Condition {
-                       get { return propertyElement.GetAttribute 
("Condition"); }
-                       set { propertyElement.SetAttribute ("Condition", 
value); }
+                       get {
+                               if (FromXml)
+                                       return propertyElement.GetAttribute 
("Condition");
+                               else
+                                       return String.Empty;
+                       }
+                       set {
+                               if (FromXml)
+                                       propertyElement.SetAttribute 
("Condition", value);
+                       }
                }
 
                public string FinalValue {

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
    2006-06-02 21:41:12 UTC (rev 61424)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
    2006-06-02 21:45:22 UTC (rev 61425)
@@ -114,10 +114,12 @@
                        }
                }
                
+               [MonoTODO]
                public void Clear ()
                {
                }
 
+               [MonoTODO]
                public BuildPropertyGroup Clone (bool deepClone)
                {
                        return null;
@@ -213,8 +215,11 @@
                        }
                }
 
-               public BuildProperty this[string propertyName] {
+               public BuildProperty this [string propertyName] {
                        get {
+                               if (FromXml)
+                                       throw new InvalidOperationException 
("Properties in persisted property groups cannot be accessed by name.");
+                               
                                if (propertiesByName.Contains (propertyName)) {
                                        return (BuildProperty) propertiesByName 
[propertyName];
                                } else {

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroupCollection.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroupCollection.cs
  2006-06-02 21:41:12 UTC (rev 61424)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroupCollection.cs
  2006-06-02 21:45:22 UTC (rev 61425)
@@ -50,18 +50,18 @@
                        if (array == null)
                                throw new ArgumentNullException ("array");
                        if (index < 0)
-                               throw new ArgumentOutOfRangeException ("index");
+                               throw new IndexOutOfRangeException ("Index was 
outside the bounds of the array.");
                        if (array.Rank > 1)
                                throw new ArgumentException ("array is 
multidimensional");
                        if ((array.Length > 0) && (index >= array.Length))
-                               throw new ArgumentException ("index is equal or 
greater than array.Length");
+                               throw new IndexOutOfRangeException ("Index was 
outside the bounds of the array.");
                        if (index + this.Count > array.Length)
-                               throw new ArgumentException ("Not enough room 
from index to end of array for this BuildPropertyGroupCollection");
+                               throw new IndexOutOfRangeException ("Index was 
outside the bounds of the array.");
                
                        IEnumerator it = GetEnumerator ();
                        int i = index;
                        while (it.MoveNext ()) {
-                               array.SetValue(it.Current, i++);
+                               array.SetValue (it.Current, i++);
                        }
                }
 
@@ -96,4 +96,4 @@
        }
 }
 
-#endif
\ No newline at end of file
+#endif

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog    
    2006-06-02 21:41:12 UTC (rev 61424)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog    
    2006-06-02 21:45:22 UTC (rev 61425)
@@ -1,3 +1,8 @@
+2006-06-02  Marek Sieradzki  <[EMAIL PROTECTED]>
+
+       * BuildItem.cs, BuildProperty.cs, BuildPropertyGroup.cs,
+       BuildPropertyGroupCollection.cs: Fixed to match the tests.
+
 2006-05-27  Marek Sieradzki  <[EMAIL PROTECTED]>
 
        * Utilities.cs: Implemented Escape ().

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to