ProxyAttribute.CreateProxy メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Public Overridable Function CreateProxy ( _ objRef As ObjRef, _ serverType As Type, _ serverObject As Object, _ serverContext As Context _ ) As RealProxy
Dim instance As ProxyAttribute Dim objRef As ObjRef Dim serverType As Type Dim serverObject As Object Dim serverContext As Context Dim returnValue As RealProxy returnValue = instance.CreateProxy(objRef, serverType, serverObject, serverContext)
public virtual RealProxy CreateProxy ( ObjRef objRef, Type serverType, Object serverObject, Context serverContext )
public: virtual RealProxy^ CreateProxy ( ObjRef^ objRef, Type^ serverType, Object^ serverObject, Context^ serverContext )
public RealProxy CreateProxy ( ObjRef objRef, Type serverType, Object serverObject, Context serverContext )
public function CreateProxy ( objRef : ObjRef, serverType : Type, serverObject : Object, serverContext : Context ) : RealProxy
戻り値
指定した ObjRef で記述されたリモート オブジェクトのリモート処理プロキシの新しいインスタンス。

![]() |
---|
現在のメソッドは、ProxyAttribute 属性でマークされたクラスを参照する ObjRef インスタンスからプロキシが作成されると呼び出されます。したがって、このメソッドは、呼び出しの返信またはパラメータから ObjRef を受信したとき、あるいはクライアント側でアクティブ化されるオブジェクトがアクティブ化中にだけ使用します。ProxyAttribute は、既知のオブジェクト型としては使用されません。 |

Public Overrides Function CreateProxy(objRef1 As ObjRef, serverType As Type, _ serverObject As Object, serverContext As Context) As RealProxy Dim myCustomProxy As New MyProxy(serverType) If Not (serverContext Is Nothing) Then RealProxy.SetStubData(myCustomProxy, serverContext) End If If Not serverType.IsMarshalByRef And serverContext Is Nothing Then Throw New RemotingException("Bad Type for CreateProxy") End If Return myCustomProxy End Function 'CreateProxy
public override RealProxy CreateProxy(ObjRef objRef1, Type serverType, object serverObject, Context serverContext) { MyProxy myCustomProxy = new MyProxy(serverType); if(serverContext != null) { RealProxy.SetStubData(myCustomProxy,serverContext); } if((!serverType.IsMarshalByRef)&&(serverContext == null)) { throw new RemotingException("Bad Type for CreateProxy"); } return myCustomProxy; }
virtual RealProxy^ CreateProxy( ObjRef^ objRef1, Type^ serverType, Object^ serverObject, Context^ serverContext ) override { MyProxy^ myCustomProxy = gcnew MyProxy( serverType ); if ( serverContext != nullptr ) { RealProxy::SetStubData( myCustomProxy, serverContext ); } if ( ( !serverType->IsMarshalByRef) && (serverContext == nullptr) ) { throw gcnew RemotingException( "Bad Type for CreateProxy" ); } return myCustomProxy; }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からProxyAttribute.CreateProxy メソッドを検索する場合は、下記のリンクをクリックしてください。

- ProxyAttribute.CreateProxy メソッドのページへのリンク