System.Xaml.Schema.XamlMemberInvoker.GetValue C# (CSharp) Method

GetValue() public method

public GetValue ( object instance ) : object
instance object
return object
		public virtual object GetValue (object instance)
		{
			ThrowIfUnknown ();
			if (instance == null)
				throw new ArgumentNullException ("instance");
			if (member is XamlDirective)
				throw new NotSupportedException (String.Format ("not supported operation on directive member {0}", member));
			if (UnderlyingGetter == null)
				throw new NotSupportedException (String.Format ("Attempt to get value from write-only property or event {0}", member));
			return UnderlyingGetter.Invoke (instance, new object [0]);
		}
		public virtual void SetValue (object instance, object value)

Usage Example

Esempio n. 1
0
		public void FromProperty ()
		{
			var pi = str_len;
			var i = new XamlMemberInvoker (new XamlMember (pi, sctx));
			Assert.AreEqual (pi.GetGetMethod (), i.UnderlyingGetter, "#1");
			Assert.IsNull (i.UnderlyingSetter, "#2");
			Assert.AreEqual (5, i.GetValue ("hello"), "#3");
		}
All Usage Examples Of System.Xaml.Schema.XamlMemberInvoker::GetValue