Click here to Skip to main content
15,896,409 members
Articles / Programming Languages / C#

Use .NET Reflection APIs to facilitate get/set property

Rate me:
Please Sign up or sign in to vote.
2.63/5 (10 votes)
13 Jan 20051 min read 42.8K   488   12  
Dynamic access to .NET object's property/field.
//---------------------------------------------------------------------
//
// Copyright (C) 2005 Hongju Cao <hjcao_wei@hotmail.com>
//
// Permission to copy, use, modify, sell and distribute this software is 
// granted provided this copyright notice appears in all copies. 
// This software is provided "as is" without express or implied warranty, 
// and with no claim as to its suitability for any purpose.
//
//---------------------------------------------------------------------

using System;
using System.Runtime.Serialization;

namespace First.Commons.Property
{
	public class DynaAccessException  : System.ApplicationException
	{
		public DynaAccessException()
			: base("A property reflection error has occurred.")
		{
		}

		public DynaAccessException(Exception ex)
			: base (ex.Message,ex)
		{
		}

		public DynaAccessException( string message )
			: base ( message )
		{
		}

		public DynaAccessException( string message, Exception inner )
			: base ( message, inner )
		{
		}

		protected DynaAccessException(SerializationInfo info, StreamingContext context)
			: base (info, context)
		{
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
China China
developer located in Tianjin, China.interests include C++/.NET/Java, etc. like coding.

Comments and Discussions