コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RijndaelSymmetricCryptoSerialized"/> class.
 /// </summary>
 /// <param name="configurationFilePath">The configuration file path.</param>
 public RijndaelSymmetricCryptoSerialized(IFilePath configurationFilePath)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(RijndaelSymmetricCryptoConfiguration));
     using (Stream stream = configurationFilePath.GetFileStream())
     using (XmlTextReader reader = new XmlTextReader(stream))
     {
         RijndaelSymmetricCryptoConfiguration configuration = serializer.Deserialize(reader) as RijndaelSymmetricCryptoConfiguration;
         this.wrapped = new RijndaelSymmetricCrypto(configuration);
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AliasIpReader"/> class.
 /// </summary>
 /// <param name="configurationFilePath">The configuration file path.</param>
 public AliasIpReader(IFilePath configurationFilePath)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(AliasIpReaderConfiguration));
     using (Stream stream = configurationFilePath.GetFileStream())
     {
         using (XmlTextReader reader = new XmlTextReader(stream))
         {
             this.configuration = serializer.Deserialize(reader) as AliasIpReaderConfiguration;
         }
     }
 }