ApplicationCollection Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a collection of Application objects for a Site object.
public ref class ApplicationCollection sealed : Microsoft::Web::Administration::ConfigurationElementCollectionBase<Microsoft::Web::Administration::Application ^>
public sealed class ApplicationCollection : Microsoft.Web.Administration.ConfigurationElementCollectionBase<Microsoft.Web.Administration.Application>
type ApplicationCollection = class
inherit ConfigurationElementCollectionBase<Application>
Public NotInheritable Class ApplicationCollection
Inherits ConfigurationElementCollectionBase(Of Application)
- Inheritance
Examples
The following example displays all applications in the ApplicationCollection object for the default Web site.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;
namespace AdministrationSnippets
{
public class AdministrationApplicationCollection
{
// Displays all Applications under the "Default Web Site"
public void GetApplications()
{
ServerManager manager = new ServerManager();
Site defaultSite = manager.Sites["Default Web Site"];
foreach (Application app in defaultSite.Applications)
{
Console.WriteLine("Found an application: {0}", app.Path);
}
}
}
}
Remarks
This class is sealed and does not implement a public constructor. You can access the ApplicationCollection class through the Applications property of the Site class.
ApplicationCollection implements the IEnumerable<T> interface. Use the Add method to create new applications. In addition, you can use indexers to obtain a reference to an item in the collection by position or application name.
Properties
AllowsAdd |
Gets a value indicating whether an |
AllowsClear |
Gets a value indicating whether a |
AllowsRemove |
Gets a value indicating whether a |
Attributes |
Gets a configuration attribute collection that contains the list of attributes for this element. (Inherited from ConfigurationElement) |
ChildElements |
Gets all the child elements of the current element. (Inherited from ConfigurationElement) |
Count |
Gets the number of items in the collection. (Inherited from ConfigurationElementCollectionBase<T>) |
ElementTagName | (Inherited from ConfigurationElement) |
IsLocallyStored |
Gets a value indicating whether the configuration element is stored in a particular configuration file. (Inherited from ConfigurationElement) |
Item[Int32] |
Gets a configuration element at the specified index. (Inherited from ConfigurationElementCollectionBase<T>) |
Item[String] |
Gets an application with the specified path in the collection. |
Methods |
Gets a collection of methods for the configuration element. (Inherited from ConfigurationElement) |
RawAttributes | (Inherited from ConfigurationElement) |
Schema |
Gets the schema that describes the configuration element collection. (Inherited from ConfigurationElementCollectionBase<T>) |
Methods
Add(String, String) |
Creates a new application by using the specified parameters and adds it to the application collection. |
Add(T) |
Adds a configuration element to the end of the current collection. (Inherited from ConfigurationElementCollectionBase<T>) |
AddAt(Int32, T) |
Adds a configuration element to the current collection at the specified index. (Inherited from ConfigurationElementCollectionBase<T>) |
Clear() |
Clears all configuration elements from the current collection. (Inherited from ConfigurationElementCollectionBase<T>) |
CreateElement() |
Creates a new child element for the current collection. (Inherited from ConfigurationElementCollectionBase<T>) |
CreateElement(String) |
Creates a new child element by using the specified name. (Inherited from ConfigurationElementCollectionBase<T>) |
CreateNewElement(String) |
Creates a new element by using the specified element name. (Inherited from ConfigurationElementCollectionBase<T>) |
Delete() | (Inherited from ConfigurationElement) |
GetAttribute(String) |
Returns a ConfigurationAttribute object that represents the requested attribute. (Inherited from ConfigurationElement) |
GetAttributeValue(String) |
Returns the value of the specified attribute. (Inherited from ConfigurationElement) |
GetChildElement(String, Type) |
Returns a child element that is under the current configuration element and has the specified name and type. (Inherited from ConfigurationElement) |
GetChildElement(String) |
Returns a child element that is under the current configuration element and has the specified name. (Inherited from ConfigurationElement) |
GetCollection() |
Returns the default collection for the current configuration element. (Inherited from ConfigurationElement) |
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(String) |
Returns all configuration elements that belong to the current configuration element. (Inherited from ConfigurationElement) |
GetCollection(Type) |
Returns the configuration element that has the specified type and is under the current configuration element. (Inherited from ConfigurationElement) |
GetEnumerator() |
Returns an enumerator that iterates through a collection. (Inherited from ConfigurationElementCollectionBase<T>) |
GetMetadata(String) |
Returns metadata values from the element schema. (Inherited from ConfigurationElement) |
IndexOf(T) |
Determines the index of an element in the collection. (Inherited from ConfigurationElementCollectionBase<T>) |
InvalidApplicationPathCharacters() |
Retrieves an array of characters that cannot be used in the path of an application. |
Remove(T) |
Removes the first occurrence of an element from the collection. (Inherited from ConfigurationElementCollectionBase<T>) |
RemoveAt(Int32) |
Removes the element at the specified index of the collection. (Inherited from ConfigurationElementCollectionBase<T>) |
SetAttributeValue(String, Object) |
Sets the value of the specified attribute. (Inherited from ConfigurationElement) |
SetMetadata(String, Object) |
Sets metadata values from the element schema. (Inherited from ConfigurationElement) |
Explicit Interface Implementations
ICollection.CopyTo(Array, Int32) |
Copies the elements of the collection to an array, starting at a particular array index. (Inherited from ConfigurationElementCollectionBase<T>) |
ICollection.Count | (Inherited from ConfigurationElementCollectionBase<T>) |
ICollection.IsSynchronized | (Inherited from ConfigurationElementCollectionBase<T>) |
ICollection.SyncRoot | (Inherited from ConfigurationElementCollectionBase<T>) |
IEnumerable.GetEnumerator() |
Returns an enumerator that iterates through the collection. (Inherited from ConfigurationElementCollectionBase<T>) |