SiteCollection SiteCollection SiteCollection SiteCollection Class

Definition

Represents a collection of Site objects.

public ref class SiteCollection sealed : Microsoft::Web::Administration::ConfigurationElementCollectionBase<Microsoft::Web::Administration::Site ^>
public sealed class SiteCollection : Microsoft.Web.Administration.ConfigurationElementCollectionBase<Microsoft.Web.Administration.Site>
type SiteCollection = class
    inherit ConfigurationElementCollectionBase<Site>
Public NotInheritable Class SiteCollection
Inherits ConfigurationElementCollectionBase(Of Site)
Inheritance

Remarks

This class is sealed and does not implement a public constructor. You can access the SiteCollection class through the Sites property of the ServerManager class. SiteCollection implements the System.Collections.Generic.IEnumerable<T> interface and includes an implementation for the <xref:Microsoft.Web.Administration.SiteCollection.GetEnumerator%2A> method. Use the Add and Remove methods, respectively, to create new sites or remove existing ones. In addition, you can use indexers to obtain a reference to an item in the collection by position or site name.

Properties

AllowsAdd AllowsAdd AllowsAdd AllowsAdd

Gets a value indicating whether an add element name is defined in the current collection schema.

(Inherited from ConfigurationElementCollectionBase<T>)
AllowsClear AllowsClear AllowsClear AllowsClear

Gets a value indicating whether a clear element name is defined in the current collection schema.

(Inherited from ConfigurationElementCollectionBase<T>)
AllowsRemove AllowsRemove AllowsRemove AllowsRemove

Gets a value indicating whether a remove element name is defined in the current collection schema.

(Inherited from ConfigurationElementCollectionBase<T>)
Attributes Attributes Attributes Attributes

Gets a configuration attribute collection that contains the list of attributes for this element.

(Inherited from ConfigurationElement)
ChildElements ChildElements ChildElements ChildElements

Gets all the child elements of the current element.

(Inherited from ConfigurationElement)
Count Count Count Count

Gets the number of items in the collection.

(Inherited from ConfigurationElementCollectionBase<T>)
ElementTagName ElementTagName ElementTagName ElementTagName Inherited from ConfigurationElement
ICollection.Count ICollection.Count ICollection.Count ICollection.Count Inherited from ConfigurationElementCollectionBase<T>
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized Inherited from ConfigurationElementCollectionBase<T>
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot Inherited from ConfigurationElementCollectionBase<T>
IsLocallyStored IsLocallyStored IsLocallyStored IsLocallyStored

Gets a value indicating whether the configuration element is stored in a particular configuration file.

(Inherited from ConfigurationElement)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Gets a configuration element at the specified index.

(Inherited from ConfigurationElementCollectionBase<T>)
Item[String] Item[String] Item[String] Item[String]

Gets a site that has the specified name in the collection.

Methods Methods Methods Methods

Gets a collection of methods for the configuration element.

(Inherited from ConfigurationElement)
RawAttributes RawAttributes RawAttributes RawAttributes Inherited from ConfigurationElement
Schema Schema Schema Schema

Gets the schema that describes the configuration element collection.

(Inherited from ConfigurationElementCollectionBase<T>)

Methods

Add(String, String, Int32) Add(String, String, Int32) Add(String, String, Int32) Add(String, String, Int32)

Adds a new Web site to the site collection by using the specified site name, path, and binding port.

Add(String, String, String, Byte[]) Add(String, String, String, Byte[]) Add(String, String, String, Byte[]) Add(String, String, String, Byte[])

Adds a new Web site to the site collection by using the specified site name, binding information, physical file path, and certificate hash.

Add(String, String, String, Byte[], String) Add(String, String, String, Byte[], String) Add(String, String, String, Byte[], String) Add(String, String, String, Byte[], String)
Add(String, String, String, Byte[], String, SslFlags) Add(String, String, String, Byte[], String, SslFlags) Add(String, String, String, Byte[], String, SslFlags) Add(String, String, String, Byte[], String, SslFlags)
Add(String, String, String, String) Add(String, String, String, String) Add(String, String, String, String) Add(String, String, String, String)

Creates a new site by using the specified parameters and adds it to the site collection.

Add(T) Add(T) Add(T) Add(T)

Adds a configuration element to the end of the current collection.

(Inherited from ConfigurationElementCollectionBase<T>)
AddAt(Int32, T) AddAt(Int32, T) AddAt(Int32, T) AddAt(Int32, T)

Adds a configuration element to the current collection at the specified index.

(Inherited from ConfigurationElementCollectionBase<T>)
Clear() Clear() Clear() Clear()

Clears all configuration elements from the current collection.

(Inherited from ConfigurationElementCollectionBase<T>)
CreateElement() CreateElement() CreateElement() CreateElement()

Creates a new child element for the current collection.

(Inherited from ConfigurationElementCollectionBase<T>)
CreateElement(String) CreateElement(String) CreateElement(String) CreateElement(String)

Creates a new child element by using the specified name.

(Inherited from ConfigurationElementCollectionBase<T>)
CreateNewElement(String) CreateNewElement(String) CreateNewElement(String) CreateNewElement(String)

Creates a new element by using the specified element name.

(Inherited from ConfigurationElementCollectionBase<T>)
Delete() Delete() Delete() Delete() Inherited from ConfigurationElement
GetAttribute(String) GetAttribute(String) GetAttribute(String) GetAttribute(String)

Returns a ConfigurationAttribute object that represents the requested attribute.

(Inherited from ConfigurationElement)
GetAttributeValue(String) GetAttributeValue(String) GetAttributeValue(String) GetAttributeValue(String)

Returns the value of the specified attribute.

(Inherited from ConfigurationElement)
GetChildElement(String) GetChildElement(String) GetChildElement(String) GetChildElement(String)

Returns a child element that is under the current configuration element and has the specified name.

(Inherited from ConfigurationElement)
GetChildElement(String, Type) GetChildElement(String, Type) GetChildElement(String, Type) GetChildElement(String, Type)

Returns a child element that is under the current configuration element and has the specified name and type.

(Inherited from ConfigurationElement)
GetCollection() GetCollection() GetCollection() GetCollection()

Returns the default collection for the current configuration element.

(Inherited from ConfigurationElement)
GetCollection(String) GetCollection(String) GetCollection(String) GetCollection(String)

Returns all configuration elements that belong to the current configuration element.

(Inherited from ConfigurationElement)
GetCollection(String, Type) GetCollection(String, Type) GetCollection(String, Type) GetCollection(String, Type)

Returns the configuration element that has the specified name and type and is under the current configuration element.

(Inherited from ConfigurationElement)
GetCollection(Type) GetCollection(Type) GetCollection(Type) GetCollection(Type)

Returns the configuration element that has the specified type and is under the current configuration element.

(Inherited from ConfigurationElement)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through a collection.

(Inherited from ConfigurationElementCollectionBase<T>)
GetMetadata(String) GetMetadata(String) GetMetadata(String) GetMetadata(String)

Returns metadata values from the element schema.

(Inherited from ConfigurationElement)
IndexOf(T) IndexOf(T) IndexOf(T) IndexOf(T)

Determines the index of an element in the collection.

(Inherited from ConfigurationElementCollectionBase<T>)
InvalidSiteNameCharacters() InvalidSiteNameCharacters() InvalidSiteNameCharacters() InvalidSiteNameCharacters()

Retrieves an array of characters that cannot be used in the name of a site.

Remove(Site) Remove(Site) Remove(Site) Remove(Site)

Removes the specified site from the site collection.

Remove(T) Remove(T) Remove(T) Remove(T)

Removes the first occurrence of an element from the collection.

(Inherited from ConfigurationElementCollectionBase<T>)
RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

Removes a Web site from the site collection at the specified collection index.

SetAttributeValue(String, Object) SetAttributeValue(String, Object) SetAttributeValue(String, Object) SetAttributeValue(String, Object)

Sets the value of the specified attribute.

(Inherited from ConfigurationElement)
SetMetadata(String, Object) SetMetadata(String, Object) SetMetadata(String, Object) SetMetadata(String, Object)

Sets metadata values from the element schema.

(Inherited from ConfigurationElement)

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

Copies the elements of the collection to an array, starting at a particular array index.

(Inherited from ConfigurationElementCollectionBase<T>)
IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Returns an enumerator that iterates through the collection.

(Inherited from ConfigurationElementCollectionBase<T>)

Applies to