Beispiel #1
0
        public void Update(GuestConfigInfo config)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(GuestConfigInfo));

            using (Stream stream = new FileStream(this.filePath, FileMode.Create, FileAccess.Write, FileShare.None))
            {
                serializer.Serialize(stream, config);
                stream.Close();
                GuestConfig.ConfigReadFromFile();
            }
        }
Beispiel #2
0
 public void Update(GuestConfigInfo config)
 {
     try
     {
         XmlSerializer serializer = new XmlSerializer(typeof(GuestConfigInfo));
         using (Stream stream = new FileStream(this.filePath, FileMode.Create, FileAccess.Write, FileShare.None))
         {
             serializer.Serialize(stream, config);
             stream.Close();
             GuestConfig.ConfigReadFromFile();
         }
     }
     catch (SecurityException exception)
     {
         throw new SecurityException(exception.Message, exception.DenySetInstance, exception.PermitOnlySetInstance, exception.Method, exception.Demanded, exception.FirstPermissionThatFailed);
     }
     finally
     {
     }
 }