Ejemplo n.º 1
0
 /// <summary>
 ///		Loads this XML configuration file's data from a file .
 /// </summary>
 /// <param name="url">Url of file to read data from.</param>
 public void Load(object url)
 {
     if (url is BinaryReader)
     {
         _xmlDocument.Load((url as BinaryReader).BaseStream);
     }
     else
     {
         Stream stream = StreamFactory.RequestStream(url, StreamMode.Open);
         if (stream == null)
         {
             return;
         }
         _xmlDocument.Load(stream);
         stream.Close();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 ///		Saves this XML configuration file into a file.
 /// </summary>
 /// <param name="url">Url of file to write data into.</param>
 public void Save(object url)
 {
     if (url is BinaryWriter)
     {
         _xmlDocument.Save((url as BinaryWriter).BaseStream);
     }
     else
     {
         Stream stream = StreamFactory.RequestStream(url, StreamMode.Truncate);
         if (stream == null)
         {
             return;
         }
         _xmlDocument.Save(stream);
         stream.Close();
     }
 }