WhiteSpaceTrimStringConverter クラス
アセンブリ: System.Configuration (system.configuration.dll 内)


この WhiteSpaceTrimStringConverter オブジェクトは、構成の文字列値と標準の形式との間で変換を行います。標準の形式とは、文字列の先頭および末尾からすべての空白を削除したものです。

WhiteSpaceTrimStringConverter をカスタム文字列プロパティ FileName に適用する方法を次のコード例に示します。
<ConfigurationProperty("fileName", _ DefaultValue:=" default.txt "), _ TypeConverter(GetType(WhiteSpaceTrimStringConverter))> _ Public Property FileName() As String Get Return CStr(Me("fileName")) End Get Set(ByVal value As String) Me("fileName") = value End Set End Property
[ConfigurationProperty("fileName", DefaultValue=" default.txt ")] [TypeConverter(typeof(WhiteSpaceTrimStringConverter))] public String FileName { get { return (String)this["fileName"]; } set { this["fileName"] = value; } }
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="CustomSection" type="Samples.AspNet.CustomSection, ConfigurationConverters, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" /> </configSections> <CustomSection fileName="default.txt" maxIdleTime="90" timeDelay="infinite" cdStr="str0, str1" permission="Read" maxUsers="Infinite"/> </configuration>

System.ComponentModel.TypeConverter
System.Configuration.ConfigurationConverterBase
System.Configuration.WhiteSpaceTrimStringConverter


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- WhiteSpaceTrimStringConverter クラスのページへのリンク