0

J'utilise Château DictionaryAdapter afin d'obtenir les paramètres de l'application de la app.config d'interface (basée sur Getting rid of strings (3): take your app settings to the next level):format chaîne pour le château DictionaryAdapter

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="[email protected]"/> 
    <add key="LastUserLogin" value="2009-06-15T13:45:30.0900000"/> 
    </appSettings> 
</configuration> 

Est-il possible de configurer DictionaryAdapter d'utiliser un format de chaîne personnalisée comme "aaaaMMjj-hHmm" pour convertir la valeur stockée dans app.config?

Répondre