語言

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類別代表了所有可以是屬性或ConfigurationProperty配置元素物件的集合ConfigurationElement。

該 ConfigurationProperty 類別代表一個個別的配置設定。 它允許你取得或設定特定配置實體(屬性或元素)的名稱、類型和預設值。 其他選項允許你指定屬性是必需的、是元素鍵,或是代表預設元素集合。

建構函式

名稱 Description
ConfigurationPropertyCollection()

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

屬性

名稱 Description
Count

取得集合中的物件數量。

IsSynchronized

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

Item[String]

取得指定名稱的收藏品。

SyncRoot

取得物件以同步存取集合。

方法

名稱 Description
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)

明確介面實作

名稱 Description
ICollection.CopyTo(Array, Int32)

將此集合複製到陣列。

擴充方法

名稱 Description
AsParallel(IEnumerable)

啟用查詢的平行處理。

AsQueryable(IEnumerable)

將 IEnumerable 轉換成 IQueryable。

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

根據指定的型別篩選 IEnumerable 的專案。

適用於

另請參閱