Skip to content
Permalink
Browse files
…esting in NMS.ActiveMQ
  • Loading branch information
Timothy A. Bish committed Nov 1, 2011
1 parent d0a6021 commit a26975799cdfbb875ca94c428a804d54e75be96b
Showing 1 changed file with 19 additions and 12 deletions.
@@ -55,28 +55,35 @@ protected override object GetObjectProperty(string name)
{
PropertyInfo propertyInfo = this.messageType.GetProperty(name, publicBinding);

if(null != propertyInfo && propertyInfo.CanRead)
{
return propertyInfo.GetValue(this.message, null);
}
else
{
FieldInfo fieldInfo = this.messageType.GetField(name, publicBinding);

if(null != fieldInfo)
if(name.StartsWith("NMS"))
{
if(null != propertyInfo && propertyInfo.CanRead)
{
return fieldInfo.GetValue(this.message);
return propertyInfo.GetValue(this.message, null);
}
else
{
FieldInfo fieldInfo = this.messageType.GetField(name, publicBinding);

if(null != fieldInfo)
{
return fieldInfo.GetValue(this.message);
}
}
}

return base.GetObjectProperty(name);
}

protected override void SetObjectProperty(string name, object value)
{
PropertyInfo propertyInfo = this.messageType.GetProperty(name, publicBinding);

if(null != propertyInfo && propertyInfo.CanWrite)
if(!name.StartsWith("NMS"))
{
base.SetObjectProperty(name, value);
}
else if(null != propertyInfo && propertyInfo.CanWrite)
{
propertyInfo.SetValue(this.message, value, null);
}

0 comments on commit a269757

Please sign in to comment.