Index: examples/net/1.0/Appenders/SampleAppendersApp/cs/src/Appender/MessageObjectExpanderAppender.cs
===================================================================
RCS file: /home/cvspublic/logging-log4net/examples/net/1.0/Appenders/SampleAppendersApp/cs/src/Appender/MessageObjectExpanderAppender.cs,v
retrieving revision 1.2
diff -u -r1.2 MessageObjectExpanderAppender.cs
--- examples/net/1.0/Appenders/SampleAppendersApp/cs/src/Appender/MessageObjectExpanderAppender.cs	17 Jan 2005 21:39:46 -0000	1.2
+++ examples/net/1.0/Appenders/SampleAppendersApp/cs/src/Appender/MessageObjectExpanderAppender.cs	15 Jun 2005 17:05:54 -0000
@@ -30,6 +30,9 @@
 	/// </summary>
 	public class MessageObjectExpanderAppender : log4net.Appender.ForwardingAppender
 	{
+		private bool expandProperties = true;
+		private bool expandFields = true;
+
 		override protected void Append(LoggingEvent loggingEvent)
 		{
 			object messageObject = loggingEvent.MessageObject;
@@ -38,23 +41,55 @@
 			{
 				Type messageType = messageObject.GetType();
 
-				// Get all public instance properties
-				foreach(PropertyInfo propertyInfo in messageType.GetProperties(BindingFlags.Instance | BindingFlags.Public))
+				if (expandProperties)
 				{
-					if (propertyInfo.CanRead)
+					// Get all public instance properties
+					foreach(PropertyInfo propertyInfo in messageType.GetProperties(BindingFlags.Instance | BindingFlags.Public))
 					{
-						loggingEvent.Properties[propertyInfo.Name] = propertyInfo.GetValue(messageObject, null);
+						if (propertyInfo.CanRead)
+						{
+							loggingEvent.Properties[propertyInfo.Name] = propertyInfo.GetValue(messageObject, null);
+						}
 					}
 				}
-				// Get all public instance fileds
-				foreach(FieldInfo fieldInfo in messageType.GetFields(BindingFlags.Instance | BindingFlags.Public))
+
+				if (expandFields)
 				{
-					loggingEvent.Properties[fieldInfo.Name] = fieldInfo.GetValue(messageObject);
+					// Get all public instance fields
+					foreach(FieldInfo fieldInfo in messageType.GetFields(BindingFlags.Instance | BindingFlags.Public))
+					{
+						loggingEvent.Properties[fieldInfo.Name] = fieldInfo.GetValue(messageObject);
+					}
 				}
 			}
 
 			// Delegate to base class which will forward
 			base.Append(loggingEvent);
 		}
+
+		public bool ExpandProperties
+		{
+			get
+			{
+				return expandProperties;
+			}
+			set
+			{
+				expandProperties = value;
+			}
+		}
+
+		public bool ExpandFields
+		{
+			get
+			{
+				return expandFields;
+			}
+			set
+			{
+				expandFields = value;
+			}
+		}
+
 	}
 }
