Share via


ToolboxService.GetToolboxItems 方法

定義

傳回 ICollection 物件的 ToolboxItem

多載

GetToolboxItems(Assembly, String, Boolean)

傳回指定組件之 ICollection 物件的 ToolboxItem

GetToolboxItems(AssemblyName, Boolean)

傳回指定組件之 ICollection 物件的 ToolboxItem

GetToolboxItems(AssemblyName)

傳回指定組件之 ICollection 物件的 ToolboxItem

GetToolboxItems(Assembly, String)

傳回 ICollection,其中包含指定組件中的所有工具箱項目。

GetToolboxItems(Assembly, String, Boolean)

傳回指定組件之 ICollection 物件的 ToolboxItem

public:
 static System::Collections::ICollection ^ GetToolboxItems(System::Reflection::Assembly ^ a, System::String ^ newCodeBase, bool throwOnError);
public static System.Collections.ICollection GetToolboxItems (System.Reflection.Assembly a, string newCodeBase, bool throwOnError);
static member GetToolboxItems : System.Reflection.Assembly * string * bool -> System.Collections.ICollection
Public Shared Function GetToolboxItems (a As Assembly, newCodeBase As String, throwOnError As Boolean) As ICollection

參數

a
Assembly

要列舉的組件。

newCodeBase
String

字串,是組件的 URL 位置。

throwOnError
Boolean

若要在發生錯誤時擲回例外狀況,則為 true,否則為 false

傳回

包含組件中所有工具箱項目的集合,該組件是由指定的組件名稱所表示。

例外狀況

anull

備註

方法 GetToolboxItems 會掃描元件中所有支援工具箱專案的型別,並傳回這些類型的專案。 若要支援工具箱專案,類型必須具有下列特性:

元件會在進程期間鎖定,因此透過列舉各種檔案 GetToolboxItems 可能會導致載入許多元件。 GetToolboxItems採用元件名稱的方法會建立個別AppDomain的來搜尋元件。 當您完成一元件的列舉 ToolboxItem 物件時,您可以呼叫 UnloadToolboxItems 方法,以卸除 AppDomain ,並在載入的元件上釋放檔案參考。

適用於

GetToolboxItems(AssemblyName, Boolean)

傳回指定組件之 ICollection 物件的 ToolboxItem

public:
 static System::Collections::ICollection ^ GetToolboxItems(System::Reflection::AssemblyName ^ an, bool throwOnError);
public static System.Collections.ICollection GetToolboxItems (System.Reflection.AssemblyName an, bool throwOnError);
static member GetToolboxItems : System.Reflection.AssemblyName * bool -> System.Collections.ICollection
Public Shared Function GetToolboxItems (an As AssemblyName, throwOnError As Boolean) As ICollection

參數

an
AssemblyName

要載入組件的來源組件名稱。

throwOnError
Boolean

若要在發生錯誤時擲回例外狀況,則為 true,否則為 false

傳回

包含組件中所有工具箱項目的集合,該組件是由指定的組件名稱所表示。

例外狀況

annull

備註

方法 GetToolboxItems 會掃描元件中所有支援工具箱專案的型別,並傳回這些類型的專案。 若要支援工具箱專案,類型必須具有下列特性:

元件會在進程期間鎖定,因此透過列舉各種檔案 GetToolboxItems 可能會導致載入許多元件。 GetToolboxItems採用元件名稱的方法會建立個別AppDomain的來搜尋元件。 當您完成一元件的列舉 ToolboxItem 物件時,您可以呼叫 UnloadToolboxItems 方法,以卸除 AppDomain ,並在載入的元件上釋放檔案參考。

適用於

GetToolboxItems(AssemblyName)

傳回指定組件之 ICollection 物件的 ToolboxItem

public:
 static System::Collections::ICollection ^ GetToolboxItems(System::Reflection::AssemblyName ^ an);
public static System.Collections.ICollection GetToolboxItems (System.Reflection.AssemblyName an);
static member GetToolboxItems : System.Reflection.AssemblyName -> System.Collections.ICollection
Public Shared Function GetToolboxItems (an As AssemblyName) As ICollection

參數

an
AssemblyName

要載入組件的來源組件名稱。

傳回

包含組件中所有工具箱項目的集合,該組件是由指定的組件名稱所表示。

例外狀況

annull

備註

方法 GetToolboxItems 會掃描元件中所有支援工具箱專案的型別,並傳回這些類型的專案。 若要支援工具箱專案,類型必須具有下列特性:

元件會在進程期間鎖定,因此透過列舉各種檔案 GetToolboxItems 可能會導致載入許多元件。 GetToolboxItems採用元件名稱的方法會建立個別AppDomain的來搜尋元件。 當您完成一元件的列舉 ToolboxItem 物件時,您可以呼叫 UnloadToolboxItems 方法,以卸除 AppDomain ,並在載入的元件上釋放檔案參考。

以這種方式載入的元件會載入個別 AppDomain 元件,以便稍後卸除它們。 這隻會暫時鎖定元件檔案。

另請參閱

適用於

GetToolboxItems(Assembly, String)

傳回 ICollection,其中包含指定組件中的所有工具箱項目。

public:
 static System::Collections::ICollection ^ GetToolboxItems(System::Reflection::Assembly ^ a, System::String ^ newCodeBase);
public static System.Collections.ICollection GetToolboxItems (System.Reflection.Assembly a, string newCodeBase);
static member GetToolboxItems : System.Reflection.Assembly * string -> System.Collections.ICollection
Public Shared Function GetToolboxItems (a As Assembly, newCodeBase As String) As ICollection

參數

a
Assembly

要列舉的組件。

newCodeBase
String

字串,是組件的 URL 位置。

傳回

包含指定組件中所有工具箱項目的集合。

例外狀況

anull

備註

方法 GetToolboxItems 會掃描元件中所有支援工具箱專案的型別,並傳回這些類型的專案。 若要支援工具箱專案,類型必須具有下列特性:

元件會在進程期間鎖定,因此透過列舉各種檔案 GetToolboxItems 可能會導致載入許多元件。 GetToolboxItems採用元件名稱的方法會建立個別AppDomain的來搜尋元件。 當您完成一元件的列舉 ToolboxItem 物件時,您可以呼叫 UnloadToolboxItems 方法,以卸除 AppDomain ,並在載入的元件上釋放檔案參考。

另請參閱

適用於