throw new InvalidProjectFileException (string.Format ("Invalid static method invocation syntax '{0}'", text.Substring (p)));
name = text.Substring (p, end - p);
+
+ //
+ // It can be instance member on static property
+ //
+ if (name.IndexOf ('.') > 0) {
+ var names = name.Split ('.');
+ int i;
+ for (i = 0; i < names.Length - 1; ++i) {
+ instance = new MemberInvocationReference (type, names [i]) {
+ Instance = instance
+ };
+ }
+
+ type = null;
+ name = names [i];
+ }
+
args = null;
}
Assert.AreEqual (DateTime.Now.ToString ("yyyy.MM.dd"), proj.GetEvaluatedProperty ("Prop1"), "#1");
}
+ [Test]
+ public void InstanceMemberOnStaticProperty ()
+ {
+ string documentString = @"
+ <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+ <PropertyGroup>
+ <Prop1>$([System.DateTime]::Now.Year)</Prop1>
+ </PropertyGroup>
+ </Project>
+ ";
+
+ proj.LoadXml (documentString);
+ Assert.AreEqual (DateTime.Now.Year.ToString (), proj.GetEvaluatedProperty ("Prop1"), "#1");
+ }
+
[Test]
public void MSBuildPropertyFunctions ()
{