Bagikan melalui


RealProxy.GetTransparentProxy Metode

Definisi

Mengembalikan proksi transparan untuk instans saat ini dari 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

Mengembalikan

Proksi transparan untuk instans proksi saat ini.

Contoh

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

Berlaku untuk