Author: msierad
Date: 2006-09-20 06:47:33 -0400 (Wed, 20 Sep 2006)
New Revision: 65700
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ExpressionCollection.cs
Log:
2006-09-20 Marek Sieradzki <[EMAIL PROTECTED]>
* ConditionParser.cs: Copyright note.
* ExpressionCollection.cs: Fixed arrays passing.
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
2006-09-20 07:47:03 UTC (rev 65699)
+++
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
2006-09-20 10:47:33 UTC (rev 65700)
@@ -1,3 +1,8 @@
+2006-09-20 Marek Sieradzki <[EMAIL PROTECTED]>
+
+ * ConditionParser.cs: Copyright note.
+ * ExpressionCollection.cs: Fixed arrays passing.
+
2006-08-06 Marek Sieradzki <[EMAIL PROTECTED]>
* BuildTask.cs, UsingTaskCollection.cs, ImportCollection.cs,
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
2006-09-20 07:47:03 UTC (rev 65699)
+++
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
2006-09-20 10:47:33 UTC (rev 65700)
@@ -3,8 +3,10 @@
//
// Author:
// Marek Sieradzki ([EMAIL PROTECTED])
+// Jaroslaw Kowalski <[EMAIL PROTECTED]>
//
// (C) 2006 Marek Sieradzki
+// (C) 2004-2006 Jaroslaw Kowalski
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ExpressionCollection.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ExpressionCollection.cs
2006-09-20 07:47:03 UTC (rev 65699)
+++
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ExpressionCollection.cs
2006-09-20 10:47:33 UTC (rev 65700)
@@ -67,7 +67,7 @@
public object ConvertTo (Type type)
{
- if (type.IsArray == true) {
+ if (type.IsArray) {
if (type == typeof (ITaskItem[]))
return ConvertToITaskItemArray ();
else
@@ -90,24 +90,39 @@
{
return ConvertToObject (ConvertToString (), type);
}
-
+
object ConvertToArray (Type type)
{
- string[] rawTable = ToString ().Split (';');
+ string[] rawTable = ConvertToString ().Split (';');
int i = 0;
- if (type == typeof (bool[]) ||
- type == typeof (string[]) ||
- type == typeof (int[]) ||
- type == typeof (uint[]) ||
- type == typeof (DateTime[])) {
-
- object[] array = new object [rawTable.Length];
+ if (type == typeof (bool[])) {
+ bool[] array = new bool [rawTable.Length];
foreach (string raw in rawTable)
- array [i++] = ConvertToObject (raw,
type.GetElementType ());
+ array [i++] = (bool) ConvertToObject
(raw, type.GetElementType ());
return array;
-
- } else throw new Exception ("Invalid type.");
+ } else if (type == typeof (string[])) {
+ string[] array = new string [rawTable.Length];
+ foreach (string raw in rawTable)
+ array [i++] = (string) ConvertToObject
(raw, type.GetElementType ());
+ return array;
+ } else if (type == typeof (int[])) {
+ int[] array = new int [rawTable.Length];
+ foreach (string raw in rawTable)
+ array [i++] = (int) ConvertToObject
(raw, type.GetElementType ());
+ return array;
+ } else if (type == typeof (uint[])) {
+ uint[] array = new uint [rawTable.Length];
+ foreach (string raw in rawTable)
+ array [i++] = (uint) ConvertToObject
(raw, type.GetElementType ());
+ return array;
+ } else if (type == typeof (DateTime[])) {
+ DateTime[] array = new DateTime
[rawTable.Length];
+ foreach (string raw in rawTable)
+ array [i++] = (DateTime)
ConvertToObject (raw, type.GetElementType ());
+ return array;
+ } else
+ throw new Exception ("Invalid type");
}
object ConvertToObject (string raw, Type type)
@@ -126,7 +141,6 @@
throw new Exception (String.Format ("Unknown
type: {0}", type.ToString ()));
}
}
-
string ConvertToString ()
{
StringBuilder sb = new StringBuilder ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches