RealProxy.CreateObjRef(Type) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立指定物件型別的 ObjRef,並向遠端基礎結構將它註冊為用戶端啟動的物件。
public:
virtual System::Runtime::Remoting::ObjRef ^ CreateObjRef(Type ^ requestedType);
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);
[System.Security.SecurityCritical]
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);
abstract member CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
override this.CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
[<System.Security.SecurityCritical>]
abstract member CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
override this.CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
Public Overridable Function CreateObjRef (requestedType As Type) As ObjRef
參數
傳回
為指定之型別建立的 ObjRef 的新執行個體。
- 屬性
範例
virtual ObjRef^ CreateObjRef( Type^ ServerType ) override
{
Console::WriteLine( "CreateObjRef Method Called ..." );
CustomObjRef ^ myObjRef = gcnew CustomObjRef( myMarshalByRefObject,ServerType );
myObjRef->URI = myUri;
return myObjRef;
}
public override ObjRef CreateObjRef(Type ServerType)
{
Console.WriteLine ("CreateObjRef Method Called ...");
CustomObjRef myObjRef = new CustomObjRef(myMarshalByRefObject,ServerType);
myObjRef.URI = myUri ;
return myObjRef;
}
Public Overrides Function CreateObjRef(ServerType As Type) As ObjRef
Console.WriteLine("CreateObjRef Method Called ...")
Dim myObjRef As New CustomObjRef(myMarshalByRefObject, ServerType)
myObjRef.URI = myUri
Return myObjRef
End Function 'CreateObjRef