ISqlActivationService.CreateInstance 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用最符合指定參數的建構子啟動指定類型的實例。
多載
| 名稱 | Description |
|---|---|
| CreateInstance<T>() |
建立由指定通用類型參數指定的類型實例。 |
| CreateInstance<T>(String) |
表示要建立實例的型別名稱。 |
| CreateInstance<T>(Type) |
表示要建立的實例類型。 |
| CreateInstance<T>(String, Object[]) |
利用建構子及傳遞給建構子的參數,建立指定型別名稱的實例。 |
| CreateInstance<T>(Type, Boolean) |
使用該類型預設建構子建立該類型實例。 |
| CreateInstance<T>(Type, Object[]) |
使用最符合指定參數的建構函式,建立指定型別的實例。 |
| CreateInstance<T>(Type, Object[], Object[]) |
使用最符合指定參數的建構函式,建立指定型別的實例。 |
| CreateInstance<T>(Type, BindingFlags, Binder, Object[], CultureInfo) |
使用最符合指定參數的建構函式,建立指定型別的實例。 |
| CreateInstance<T>(Type, BindingFlags, Binder, Object[], CultureInfo, Object[]) |
使用最符合指定參數的建構函式,建立指定型別的實例。 |
CreateInstance<T>()
建立由指定通用類型參數指定的類型實例。
public:
generic <typename T>
T CreateInstance();
public T CreateInstance<T>();
abstract member CreateInstance : unit -> 'T
Public Function CreateInstance(Of T) () As T
類型參數
- T
實例類型的類型。
傳回
那種實例。
適用於
CreateInstance<T>(String)
表示要建立實例的型別名稱。
public:
generic <typename T>
T CreateInstance(System::String ^ typeName);
public T CreateInstance<T>(string typeName);
abstract member CreateInstance : string -> 'T
Public Function CreateInstance(Of T) (typeName As String) As T
類型參數
- T
價值的通用類型。
參數
- typeName
- String
執行個體名稱。
傳回
要建立實例的類型名稱。
適用於
CreateInstance<T>(Type)
表示要建立的實例類型。
public:
generic <typename T>
T CreateInstance(Type ^ type);
public T CreateInstance<T>(Type type);
abstract member CreateInstance : Type -> 'T
Public Function CreateInstance(Of T) (type As Type) As T
類型參數
- T
這次事件的類型。
參數
- type
- Type
實例的類型。
傳回
要建立的實例類型。
適用於
CreateInstance<T>(String, Object[])
利用建構子及傳遞給建構子的參數,建立指定型別名稱的實例。
public:
generic <typename T>
T CreateInstance(System::String ^ typeName, ... cli::array <System::Object ^> ^ args);
public T CreateInstance<T>(string typeName, params object[] args);
abstract member CreateInstance : string * obj[] -> 'T
Public Function CreateInstance(Of T) (typeName As String, ParamArray args As Object()) As T
類型參數
- T
建立實例的物件類型。
參數
- typeName
- String
偏好的類型名稱。
- args
- Object[]
以數位、順序和輸入要叫用之建構函式參數的自變數陣列。
傳回
指定型別名稱的實例。
適用於
CreateInstance<T>(Type, Boolean)
使用該類型預設建構子建立該類型實例。
public:
generic <typename T>
T CreateInstance(Type ^ type, bool nonPublic);
public T CreateInstance<T>(Type type, bool nonPublic);
abstract member CreateInstance : Type * bool -> 'T
Public Function CreateInstance(Of T) (type As Type, nonPublic As Boolean) As T
類型參數
- T
通用型價值。
參數
- type
- Type
要創造的物件類型。
- nonPublic
- Boolean
true 如果公開或非公開的預設構造子能夠匹配;否則, false 如果只有公開預設建構子能匹配。
傳回
這是對新創造物體的指涉。
適用於
CreateInstance<T>(Type, Object[])
使用最符合指定參數的建構函式,建立指定型別的實例。
public:
generic <typename T>
T CreateInstance(Type ^ type, ... cli::array <System::Object ^> ^ args);
public T CreateInstance<T>(Type type, params object[] args);
abstract member CreateInstance : Type * obj[] -> 'T
Public Function CreateInstance(Of T) (type As Type, ParamArray args As Object()) As T
類型參數
- T
新成立的啟動服務類型。
參數
- type
- Type
服務的類型。
- args
- Object[]
以數位、順序和輸入要叫用之建構函式參數的自變數陣列。
傳回
這是對新創造物體的指涉。
適用於
CreateInstance<T>(Type, Object[], Object[])
使用最符合指定參數的建構函式,建立指定型別的實例。
public:
generic <typename T>
T CreateInstance(Type ^ type, cli::array <System::Object ^> ^ args, cli::array <System::Object ^> ^ activationAttributes);
public T CreateInstance<T>(Type type, object[] args, object[] activationAttributes);
abstract member CreateInstance : Type * obj[] * obj[] -> 'T
Public Function CreateInstance(Of T) (type As Type, args As Object(), activationAttributes As Object()) As T
類型參數
- T
要創造的物件類型。
參數
- type
- Type
要建立的物件類型。
- args
- Object[]
以數位、順序和輸入要叫用之建構函式參數的自變數陣列。
- activationAttributes
- Object[]
一或多個可以參與啟用的屬性陣列。 這通常是一個包含單一 UrlAttribute 物件的陣列。 UrlAttribute 指定啟動遠端物件所需的 URL。
傳回
這是對新創造物體的指涉。
適用於
CreateInstance<T>(Type, BindingFlags, Binder, Object[], CultureInfo)
使用最符合指定參數的建構函式,建立指定型別的實例。
public:
generic <typename T>
T CreateInstance(Type ^ type, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture);
public T CreateInstance<T>(Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture);
abstract member CreateInstance : Type * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo -> 'T
Public Function CreateInstance(Of T) (type As Type, bindingAttr As BindingFlags, binder As Binder, args As Object(), culture As CultureInfo) As T
類型參數
- T
類型實例。
參數
- type
- Type
要創造的物件類型。
- bindingAttr
- BindingFlags
零或多個位元旗標的組合,影響型別建構子的搜尋。 若 bindingAttr 為零,則會進行大小寫區分的公共建構子搜尋。
- binder
- Binder
一個使用 bindingAttr 和 args 來尋找並識別型別建構子的物件。
- args
- Object[]
以數位、順序和輸入要叫用之建構函式參數的自變數陣列。
- culture
- CultureInfo
一種文化特有的資訊,規範 args 強制化為型別構造子所宣告的形式型別。
傳回
這是對新創造物體的指涉。
適用於
CreateInstance<T>(Type, BindingFlags, Binder, Object[], CultureInfo, Object[])
使用最符合指定參數的建構函式,建立指定型別的實例。
public:
generic <typename T>
T CreateInstance(Type ^ type, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture, cli::array <System::Object ^> ^ activationAttributes);
public T CreateInstance<T>(Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes);
abstract member CreateInstance : Type * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] -> 'T
Public Function CreateInstance(Of T) (type As Type, bindingAttr As BindingFlags, binder As Binder, args As Object(), culture As CultureInfo, activationAttributes As Object()) As T
類型參數
- T
通用價值類型。
參數
- type
- Type
要創造的物件類型。
- bindingAttr
- BindingFlags
零或多個位元旗標的組合,影響型別建構子的搜尋。
- binder
- Binder
一個使用 bindingAttr 和 args 來尋找並識別型別建構子的物件。
- args
- Object[]
以數位、順序和輸入要叫用之建構函式參數的自變數陣列。
- culture
- CultureInfo
文化特有的資訊,規範 arg 強制化為型別建構子所宣告的形式型別。
- activationAttributes
- Object[]
一或多個可以參與啟用的屬性陣列。
傳回
這是對新創造物體的指涉。