private object CreateProxy(IMethodReturnMessage message)
{
SubSystemAttribute subSystemAttr = Attribute.GetCustomAttribute(GetMemberInfo(message.MethodBase), typeof(SubSystemAttribute)) as SubSystemAttribute;
MarshalByRefObject subSystem = message.ReturnValue as MarshalByRefObject;
if (subSystem == null)
{
throw new InvalidOperationException("SubSystem type must extend MarshalByRefObject to be used with TransparentPrevalenceEngine!");
}
return new PrevalentSubSystemProxy(_engine, subSystem, subSystemAttr.FieldName).GetTransparentProxy();
}