Exemplo n.º 1
0
 private void Load()
 {
     try
     {
         var serializer = new XmlSerializer(typeof(NetworkSettingsList), new XmlRootAttribute("EpicServerList"));
         var fs         = new FileStream(settingsPath, FileMode.Open);
         Networks = (NetworkSettingsList)serializer.Deserialize(fs);
         fs.Close();
     }
     catch (Exception ex)
     {
         if (ex is DirectoryNotFoundException ||
             ex is FileNotFoundException)
         {
             NetworkSettings net = AddNetwork("Freenode");
             net.AddServer(new ServerSettings("irc.freenode.net", "Random", "6667", false));
             net.AddChannel(new ChannelSettings("#ortzirc", true));
         }
         else
         {
             throw;
         }
     }
 }
Exemplo n.º 2
0
 public bool RemoveNetwork(NetworkSettings network)
 {
     return(Networks.Remove(network));
 }