Container Klasa
Definicja
Hermetyzuje zero lub więcej składników.Encapsulates zero or more components.
public ref class Container : IDisposable, System::ComponentModel::IContainer
public ref class Container : System::ComponentModel::IContainer
public class Container : IDisposable, System.ComponentModel.IContainer
public class Container : System.ComponentModel.IContainer
type Container = class
interface IContainer
interface IDisposable
Public Class Container
Implements IContainer, IDisposable
Public Class Container
Implements IContainer
- Dziedziczenie
-
Container
- Pochodne
- Implementuje
Uwagi
ContainerKlasa jest domyślną implementacją IContainer interfejsu.The Container class is the default implementation for the IContainer interface.
Kontenery to obiekty, które hermetyzują i śledzą zero lub więcej składników.Containers are objects that encapsulate and track zero or more components. W tym kontekście zawiera odwołanie do logicznego zawierania, nie zawiera wizualizacji.In this context, containment refers to logical containment, not visual containment. Możesz użyć składników i kontenerów w różnych scenariuszach, w tym scenariuszy, które są wizualizacją, a nie wizualizacją.You can use components and containers in a variety of scenarios, including scenarios that are both visual and not visual.
Składniki w kontenerze są śledzone na pierwszej liście, w pierwszej kolejności, która definiuje kolejność składników w kontenerze.The components in a container are tracked in a first-in, first-out list, which also defines the order of the components within the container. Dodane składniki są dołączane na końcu listy.Added components are appended to the end of the list.
Konstruktory
Container() |
Inicjuje nowe wystąpienie klasy Container.Initializes a new instance of the Container class. |
Właściwości
Components |
Pobiera wszystkie składniki w Container .Gets all the components in the Container. |
Metody
Add(IComponent) |
Dodaje określony Component do Container .Adds the specified Component to the Container. Składnik nie ma nazwy.The component is unnamed. |
Add(IComponent, String) |
Dodaje określony Component Container element do i przypisuje mu nazwę.Adds the specified Component to the Container and assigns it a name. |
CreateSite(IComponent, String) |
Tworzy lokację ISite dla danego programu IComponent i przypisuje daną nazwę lokacji.Creates a site ISite for the given IComponent and assigns the given name to the site. |
Dispose() |
Zwalnia wszelkie zasoby używane przez element Container.Releases all resources used by the Container. |
Dispose(Boolean) |
Zwalnia zasoby niezarządzane używane przez Container program i opcjonalnie zwalnia zarządzane zasoby.Releases the unmanaged resources used by the Container, and optionally releases the managed resources. |
Equals(Object) |
Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.Determines whether the specified object is equal to the current object. (Odziedziczone po Object) |
Finalize() |
Zwalnia zasoby niezarządzane i wykonuje inne operacje czyszczenia przed Container odzyskiwaniem przez wyrzucanie elementów bezużytecznych.Releases unmanaged resources and performs other cleanup operations before the Container is reclaimed by garbage collection. |
GetHashCode() |
Służy jako domyślna funkcja skrótu.Serves as the default hash function. (Odziedziczone po Object) |
GetService(Type) |
Pobiera obiekt usługi określonego typu, jeśli jest dostępny.Gets the service object of the specified type, if it is available. |
GetType() |
Pobiera Type bieżące wystąpienie.Gets the Type of the current instance. (Odziedziczone po Object) |
MemberwiseClone() |
Tworzy skróconą kopię bieżącego elementu Object .Creates a shallow copy of the current Object. (Odziedziczone po Object) |
Remove(IComponent) |
Usuwa składnik z Container .Removes a component from the Container. |
RemoveWithoutUnsiting(IComponent) |
Usuwa składnik z Container Ustawienia bez Site |
ToString() |
Zwraca ciąg reprezentujący bieżący obiekt.Returns a string that represents the current object. (Odziedziczone po Object) |
ValidateName(IComponent, String) |
Określa, czy nazwa składnika jest unikatowa dla tego kontenera.Determines whether the component name is unique for this container. |