21 public bool DesignMode =>
false;
31 if (value ==
null || name ==
null || !value.Equals(name))
41 this.component = component;
42 this.container = container;
48 if (!(service == typeof(
ISite)))
56 private ISite[] sites;
58 private int siteCount;
64 private bool checkedFilter;
66 private object syncObj =
new object();
76 if (components ==
null)
79 for (
int i = 0; i < siteCount; i++)
84 if (filter ==
null && checkedFilter)
86 checkedFilter =
false;
97 if (componentCollection !=
null)
99 components = componentCollection;
119 Add(component,
null);
134 if (component !=
null)
137 if (site ==
null || site.
Container !=
this)
141 sites =
new ISite[4];
146 if (sites.Length == siteCount)
148 ISite[] destinationArray =
new ISite[siteCount * 2];
149 Array.
Copy(sites, 0, destinationArray, 0, siteCount);
150 sites = destinationArray;
155 sites[siteCount++] = site2;
156 component.
Site = site2;
169 return new Site(component,
this, name);
182 protected virtual void Dispose(
bool disposing)
188 while (siteCount > 0)
190 ISite site = sites[--siteCount];
216 Remove(component, preserveSite:
false);
223 if (component !=
null)
226 if (site !=
null && site.
Container ==
this)
230 component.
Site =
null;
235 if (num >= siteCount)
239 if (sites[num] == site)
246 Array.Copy(sites, num + 1, sites, num, siteCount - num);
247 sites[siteCount] =
null;
258 Remove(component, preserveSite:
true);
270 if (component ==
null)
281 if (num >=
Math.
Min(siteCount, sites.Length))
285 ISite site = sites[num];
Provides a base class for the container filter service.
static AttributeCollection GetAttributes(Type componentType)
Returns a collection of attributes for the specified type of component.
string Name
Gets or sets the name of the component associated with the T:System.ComponentModel....
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
virtual void ValidateName(IComponent component, string name)
Determines whether the component name is unique for this container.
virtual void Remove(IComponent component)
Removes a component from the T:System.ComponentModel.Container.
static void SuppressFinalize(object obj)
Requests that the common language runtime not call the finalizer for the specified object.
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
Provides a mechanism for releasing unmanaged resources.To browse the .NET Framework source code for t...
static sbyte Min(sbyte val1, sbyte val2)
Returns the smaller of two 8-bit signed integers.
virtual void Dispose(bool disposing)
Releases the unmanaged resources used by the T:System.ComponentModel.Container, and optionally releas...
virtual ISite CreateSite(IComponent component, string name)
Creates a site T:System.ComponentModel.ISite for the given T:System.ComponentModel....
virtual void Add(IComponent component)
Adds the specified T:System.ComponentModel.Component to the T:System.ComponentModel....
InheritanceLevel
Defines identifiers for types of inheritance levels.
Indicates whether the component associated with this attribute has been inherited from a base class....
SecurityAction
Specifies the security actions that can be performed using declarative security.
Provides functionality for containers. Containers are objects that logically contain zero or more com...
IComponent Component
Gets the component associated with the T:System.ComponentModel.ISite when implemented by a class.
Provides the base implementation for the T:System.ComponentModel.IComponent interface and enables obj...
virtual object GetService(Type service)
Gets the service object of the specified type, if it is available.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Provides functionality required by all components.
Represents type declarations: class types, interface types, array types, value types,...
Provides information about the characteristics for a component, such as its attributes,...
void Remove(IComponent component)
Removes a component from the T:System.ComponentModel.IContainer.
Controls the system garbage collector, a service that automatically reclaims unused memory.
virtual ComponentCollection Components
Gets all the components in the T:System.ComponentModel.Container.
void RemoveWithoutUnsiting(IComponent component)
Removes a component from the T:System.ComponentModel.Container without setting P:System....
The exception that is thrown when one of the arguments provided to a method is not valid.
Defines a mechanism for retrieving a service object; that is, an object that provides custom support ...
static void Copy(Array sourceArray, Array destinationArray, int length)
Copies a range of elements from an T:System.Array starting at the first element and pastes them into ...
Provides a read-only container for a collection of T:System.ComponentModel.IComponent objects.
Encapsulates zero or more components.
IContainer Container
Gets the T:System.ComponentModel.IContainer associated with the T:System.ComponentModel....
Provides constants and static methods for trigonometric, logarithmic, and other common mathematical f...
Provides functionality required by sites.
InheritanceLevel InheritanceLevel
Gets or sets the current inheritance level stored in this attribute.
virtual ComponentCollection FilterComponents(ComponentCollection components)
Filters the component collection.
void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resourc...
ISite Site
Gets or sets the T:System.ComponentModel.ISite associated with the T:System.ComponentModel....
void Dispose()
Releases all resources used by the T:System.ComponentModel.Container.
virtual void Add(IComponent component, string name)
Adds the specified T:System.ComponentModel.Component to the T:System.ComponentModel....