+2010-04-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XamlMemberInvoker.cs : make sure GetValue() is not supported
+ on directives.
+
2010-04-14 Atsushi Enomoto <atsushi@ximian.com>
* XamlTypeTypeConverter.cs : this prefers UnderlyingType.ToString()
{
if (instance == null)
throw new ArgumentNullException ("instance");
+ if (this is XamlDirective)
+ throw new NotSupportedException ("not supported operation on directive members.");
if (UnderlyingGetter == null)
throw new NotSupportedException ("Attempt to get value from write-only property or event");
return UnderlyingGetter.Invoke (instance, new object [0]);
{
if (instance == null)
throw new ArgumentNullException ("instance");
+ if (this is XamlDirective)
+ throw new NotSupportedException ("not supported operation on directive members.");
if (UnderlyingSetter == null)
throw new NotSupportedException ("Attempt to get value from read-only property");
UnderlyingSetter.Invoke (instance, new object [] {value});
+2010-04-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XamlMemberInvokerTest.cs : make sure GetValue() is not supported
+ on directives.
+
2010-04-22 Atsushi Enomoto <atsushi@ximian.com>
* XamlMemberInvokerTest.cs : make sure that the invoker returns Type
Assert.AreEqual (typeof (int), o, "#1");
}
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
+ public void GetValueInitialization ()
+ {
+ var xm = XamlLanguage.Initialization;
+ var i = xm.Invoker;
+ i.GetValue ("foo");
+ }
+
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
+ public void GetValuePositionalParameter ()
+ {
+ var xm = XamlLanguage.PositionalParameters;
+ var i = xm.Invoker;
+ i.GetValue (new TypeExtension (typeof (int)));
+ }
+
[Test]
[ExpectedException (typeof (TargetException))]
public void SetValueOnIrrelevantObject ()