Partager via


RealProxy.GetTransparentProxy Méthode

Définition

Retourne le proxy transparent pour l'instance actuelle de 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

Retours

Proxy transparent associé à l'instance de proxy en cours.

Exemples

// 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())

S’applique à