ToolboxItemContainer ToolboxItemContainer ToolboxItemContainer ToolboxItemContainer Class

定義

封裝 ToolboxItemEncapsulates a ToolboxItem.

public ref class ToolboxItemContainer : System::Runtime::Serialization::ISerializable
[System.Serializable]
public class ToolboxItemContainer : System.Runtime.Serialization.ISerializable
type ToolboxItemContainer = class
    interface ISerializable
Public Class ToolboxItemContainer
Implements ISerializable
繼承
ToolboxItemContainerToolboxItemContainerToolboxItemContainerToolboxItemContainer
屬性
實作

備註

ToolboxItemContainer 是一個簡單的類別,封裝ToolboxItem為了提高效率。ToolboxItemContainer is a simple class that encapsulates a ToolboxItem for efficiency. 您可以擁有會一律載入的單一類別,延後載入ToolboxItem直到需要為止。By having a single class that is always loaded, you can defer the loading of the ToolboxItem until it is needed. 因為新的類別可以衍生自ToolboxItem,您可以載入ToolboxItem,反而可以載入組件已不在記憶體中。Because new classes can be derived from ToolboxItem, you could load a ToolboxItem that could, in turn, load an assembly that is not already in memory. 大型集合的ToolboxItem物件,這可能會造成大量的組件載入,這會降低效能。For a large collection of ToolboxItem objects, this could cause a large number of assemblies to be loaded, which decreases performance. 相反地,工具箱服務只會處理經過ToolboxItemContainer物件,並擷取其包含ToolboxItem只在必要時。Instead, the toolbox service deals only with ToolboxItemContainer objects and retrieves their contained ToolboxItem only when necessary.

ToolboxItemContainer設計用來保存任何快取的資料,從ToolboxItemThe ToolboxItemContainer is designed to hold any cached data from the ToolboxItem. 預設實作只會保留的篩選條件ToolboxItem,但衍生類別可以選擇快取的名稱、 影像和其他資訊。The default implementation only holds the filter of the ToolboxItem, but deriving classes may choose to cache the name, image, and other information. ToolboxItemContainer 物件支援兩種形式的序列化: 可以透過標準的執行階段序列化進行序列化,以及它們也可以載入和儲存自己從System.Windows.Forms.IDataObjectToolboxItemContainer objects support two forms of serialization: they can be serialized through standard runtime serialization, and they can also load and save themselves from a System.Windows.Forms.IDataObject. 前者提供非常簡單的方法,以儲存ToolboxItemContainer永續性儲存體的物件。The former provides a very easy way to save ToolboxItemContainer objects to a persistent storage. 後者可用來整合ToolboxItemContainer混合的資料存放區格式的物件。The latter provides a way to integrate ToolboxItemContainer objects with mixed data storage formats.

建構函式

ToolboxItemContainer(IDataObject) ToolboxItemContainer(IDataObject) ToolboxItemContainer(IDataObject) ToolboxItemContainer(IDataObject)

ToolboxItemContainer 初始化 IDataObject 類別的新執行個體。Initializes a new instance of the ToolboxItemContainer class from a IDataObject.

ToolboxItemContainer(SerializationInfo, StreamingContext) ToolboxItemContainer(SerializationInfo, StreamingContext) ToolboxItemContainer(SerializationInfo, StreamingContext) ToolboxItemContainer(SerializationInfo, StreamingContext)

從序列化資料流初始化 ToolboxItemContainer 類別的新執行個體。Initializes a new instance of the ToolboxItemContainer class from a serialization stream.

ToolboxItemContainer(ToolboxItem) ToolboxItemContainer(ToolboxItem) ToolboxItemContainer(ToolboxItem) ToolboxItemContainer(ToolboxItem)

ToolboxItemContainer 初始化 ToolboxItem 類別的新執行個體。Initializes a new instance of the ToolboxItemContainer class from a ToolboxItem.

屬性

IsCreated IsCreated IsCreated IsCreated

取得值,表示基礎工具箱項目是否已經還原序列化。Gets a value indicating whether the underlying toolbox item has been deserialized.

IsTransient IsTransient IsTransient IsTransient

取得值,表示 ToolboxItem 中所含的 ToolboxItemContainer 是否為暫時性 (Transient)。Gets a value indicating if the ToolboxItem contained in the ToolboxItemContainer is transient.

ToolboxData ToolboxData ToolboxData ToolboxData

取得描述此 IDataObjectToolboxItemContainerGets an IDataObject that describes this ToolboxItemContainer.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷兩個 ToolboxItemContainer 執行個體是否相等。Determines whether two ToolboxItemContainer instances are equal.

GetFilter(ICollection) GetFilter(ICollection) GetFilter(ICollection) GetFilter(ICollection)

傳回由 ToolboxItemFilterAttribute 物件組成的集合,這些物件代表 ToolboxItem 目前的篩選條件。Returns a collection of ToolboxItemFilterAttribute objects that represent the current filter for the ToolboxItem.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個執行個體的雜湊碼。Returns the hash code for this instance.

GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext)

儲存物件的序列化狀態。Saves the serialization state for the object.

GetToolboxItem(ICollection) GetToolboxItem(ICollection) GetToolboxItem(ICollection) GetToolboxItem(ICollection)

傳回 ToolboxItem 中所包含的 ToolboxItemContainerReturns the ToolboxItem contained in the ToolboxItemContainer.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
UpdateFilter(ToolboxItem) UpdateFilter(ToolboxItem) UpdateFilter(ToolboxItem) UpdateFilter(ToolboxItem)

將容器的篩選條件與指定項目的篩選條件合併。Merges the container's filter with the filter from the given item.

明確介面實作

ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext)

如需這個成員的描述,請參閱 GetObjectData(SerializationInfo, StreamingContext) 方法。For a description of this member, see the GetObjectData(SerializationInfo, StreamingContext) method.

適用於

另請參閱