ConfigurationElement.Properties プロパティ
アセンブリ: System.Configuration (system.configuration.dll 内)

Protected Friend Overridable ReadOnly Property Properties As ConfigurationPropertyCollection
protected public: virtual property ConfigurationPropertyCollection^ Properties { ConfigurationPropertyCollection^ get (); }
要素のプロパティの ConfigurationPropertyCollection のコレクション。


Properties プロパティを使用する方法の例を次に示します。
' Show the use of Properties. ' It displays the ConfigurationElement ' properties. Shared Sub GetProperties() Try ' Get the current configuration file. Dim config _ As System.Configuration.Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None) ' Get the configuration section MyUrls. Dim myUrlsSection As UrlsSection = _ config.Sections("MyUrls") ' Get the configuration element collection. Dim elements As UrlsCollection = _ myUrlsSection.Urls Dim elemEnum As IEnumerator = _ elements.GetEnumerator() Dim i As Integer = 0 While elemEnum.MoveNext() ' Get the current element configuration ' property collection. Dim properties _ As PropertyInformationCollection = _ elements(i).ElementInformation.Properties ' Display the current configuration ' element properties. Dim proprty As PropertyInformation For Each proprty In properties Console.WriteLine("Name: {0}" + _ vbTab + "Default: {1}" + _ vbTab + "Required: {2}", _ [proprty].Name, [proprty].DefaultValue, _ [proprty].IsRequired.ToString()) Next proprty End While Catch e As ConfigurationErrorsException Console.WriteLine("[GetProperties: {0}]", _ e.ToString()) End Try End Sub 'GetProperties
// Show the use of Properties. // It displays the ConfigurationElement // properties. static void GetProperties() { try { // Get the current configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None); // Get the configuration section MyUrls. UrlsSection myUrlsSection = config.Sections["MyUrls"] as UrlsSection; // Get the configuration element collection. UrlsCollection elements = myUrlsSection.Urls; IEnumerator elemEnum = elements.GetEnumerator(); int i = 0; while (elemEnum.MoveNext()) { // Get the current element configuration // property collection. PropertyInformationCollection properties = elements[i].ElementInformation.Properties; // Display the current configuration // element properties. foreach (PropertyInformation property in properties) { Console.WriteLine("Name: {0}\tDefault: {1}\tRequired: {2}" , property.Name, property.DefaultValue, property.IsRequired.ToString()); } } } catch (ConfigurationErrorsException e) { Console.WriteLine("[GetProperties: {0}]", e.ToString()); } }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationElement クラス
ConfigurationElement メンバ
System.Configuration 名前空間
ConfigurationPropertyCollection
Weblioに収録されているすべての辞書からConfigurationElement.Properties プロパティを検索する場合は、下記のリンクをクリックしてください。

- ConfigurationElement.Properties プロパティのページへのリンク