แก้ไข

แชร์ผ่าน


RealProxy.GetTransparentProxy Method

Definition

Returns the transparent proxy for the current instance of RealProxy.

public:
 virtual System::Object ^ GetTransparentProxy();
public virtual object GetTransparentProxy ();
abstract member GetTransparentProxy : unit -> obj
override this.GetTransparentProxy : unit -> obj
Public Overridable Function GetTransparentProxy () As Object

Returns

The transparent proxy for the current proxy instance.

Examples

// Create an instance of MyProxy.
MyProxy^ myProxyInstance = gcnew MyProxy( CustomServer::typeid );

// Get a CustomServer proxy.
CustomServer^ myHelloServer = static_cast<CustomServer^>(myProxyInstance->GetTransparentProxy());

// Get stubdata.
Console::WriteLine( "GetStubData = {0}", RealProxy::GetStubData( myProxyInstance ) );

// Get ProxyType.
Console::WriteLine( "Type of object represented by RealProxy is : {0}", myProxyInstance->GetProxiedType() );
// Create an instance of MyProxy.
MyProxy myProxyInstance = new MyProxy(typeof(CustomServer));
// Get a CustomServer proxy.
CustomServer myHelloServer = (CustomServer)myProxyInstance.GetTransparentProxy();
// Get stubdata.
Console.WriteLine("GetStubData = " + RealProxy.GetStubData(myProxyInstance).ToString());
// Get ProxyType.
Console.WriteLine("Type of object represented by RealProxy is :"
                  + myProxyInstance.GetProxiedType());
' Create an instance of MyProxy.
Dim myProxyInstance As New MyProxy(GetType(CustomServer))
' Get a CustomServer proxy.
Dim myHelloServer As CustomServer = _
            CType(myProxyInstance.GetTransparentProxy(), CustomServer)
' Get stubdata.
Console.WriteLine("GetStubData = " + RealProxy.GetStubData(myProxyInstance).ToString())
' Get ProxyType.
Console.WriteLine("Type of object represented by RealProxy is :" + _
                                       myProxyInstance.GetProxiedType().ToString())

Applies to