ConfigurationPropertyCollection 類別

定義

表示組態項目屬性的集合。

public ref class ConfigurationPropertyCollection : System::Collections::ICollection
public class ConfigurationPropertyCollection : System.Collections.ICollection
type ConfigurationPropertyCollection = class
    interface ICollection
    interface IEnumerable
Public Class ConfigurationPropertyCollection
Implements ICollection
繼承
ConfigurationPropertyCollection
實作

範例

下列範例示範的其中一個可能用法 ConfigurationPropertyCollection 。 請參閱相關類型的 ConfigurationProperty 範例。

以下是上述範例所使用的組態摘錄。

<?xml version="1.0" encoding="utf-8"?>  
<configuration>  
  <configSections>  
    <section name="CustomSection" type="Samples.AspNet, ConfigurationProperty, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" />  
    </configSections>  
    <CustomSection fileName="default.txt" alias="alias.txt" maxUsers="1000"  
      maxIdleTime="00:05:00" />  
</configuration>  

備註

類別 ConfigurationPropertyCollection 代表可以是組態專案之屬性或 ConfigurationElement 物件的 物件集合 ConfigurationProperty

類別 ConfigurationProperty 代表個別組態設定。 它可讓您取得或設定特定組態實體的名稱、類型和預設值, (屬性或元素) 。 其他選項可讓您指定是否需要屬性、是元素索引鍵,或代表預設專案集合。

建構函式

ConfigurationPropertyCollection()

初始化 ConfigurationPropertyCollection 類別的新執行個體。

屬性

Count

取得集合中的屬性數目。

IsSynchronized

取得值,表示是否同步化存取集合 (執行緒安全)。

Item[String]

取得具有指定之名稱的集合項目。

SyncRoot

取得用於同步化存取集合的物件。

方法

Add(ConfigurationProperty)

將組態屬性加入集合。

Clear()

移除集合中的所有組態屬性物件。

Contains(String)

指定組態屬性是否包含在這個集合中。

CopyTo(ConfigurationProperty[], Int32)

複製這個 ConfigurationPropertyCollection 至陣列。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetEnumerator()

IEnumerator 物件套用至集合時取得它。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
Remove(String)

移除集合中的組態屬性。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

ICollection.CopyTo(Array, Int32)

複製這個集合至陣列。

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於

另請參閱