Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ObjectUtils.IsAssignableAndNotTransparentProxy Method

Checks whether the supplied instance is not a transparent proxy and is assignable to the supplied type.

[Visual Basic]
Public Shared Sub IsAssignableAndNotTransparentProxy( _
   ByVal type As Type, _
   ByVal instance As Object _
)
[C#]
public static bool IsAssignableAndNotTransparentProxy(
   Type type,
   object instance
);

Parameters

type
The target Type to be checked.
instance
The value that should be assigned to the type.

Return Value

true if the supplied instance is not a transparent proxy and is assignable to the supplied type.

Remarks

Neccessary when dealing with server-activated remote objects, because the object is of the type TransparentProxy and regular is testing for assignable types does not work.

Transparent proxy instances always return true when tested with the 'is' operator (C#). This method only checks if the object is assignable to the type if it is not a transparent proxy.

See Also

ObjectUtils Class | Spring.Util Namespace