我正在使用Castle DictionaryAdapter,以便从
App.CONFIG
作为接口(基于
Getting rid of strings (3): take your app settings to the next level
):
public interface ISettings {
int MaxUsers { get; }
string FeedbackMail { get; }
DateTime LastUserLogin { get; }
}
App.CONFIG
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="MaxUsers" value="20"/>
<add key="FeedbackMail" value="foo@localhost"/>
<add key="LastUserLogin" value="2009-06-15T13:45:30.0900000"/>
</appSettings>
</configuration>
是否可以将DictionaryAdapter配置为使用自定义字符串格式,如
“YYYYMMD HDHMM”
用于转换存储在
App.CONFIG
?