Bamboo.Prevalence.Implementation.PrevalentSubSystemHolderProxy.CreateProxy C# (CSharp) Method

CreateProxy() private method

private CreateProxy ( IMethodReturnMessage message ) : object
message IMethodReturnMessage
return object
		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();
		}