Пример #1
0
 private void LoadPluginFiles()
 {
     if (File.Exists(pluginsFile))
     {
         XmlTextReader textReader = null;
         try
         {
             XmlSerializer deserializer = new XmlSerializer(typeof(IceChatPluginFile));
             textReader     = new XmlTextReader(pluginsFile);
             iceChatPlugins = (IceChatPluginFile)deserializer.Deserialize(textReader);
             textReader.Close();
         }
         catch (Exception)
         {
             textReader.Close();
             errorMessages.Add("There was a problem loading IceChatPlugins.xml. No plugins loaded");
             iceChatPlugins = new IceChatPluginFile();
             SavePluginFiles();
         }
     }
     else
     {
         iceChatPlugins = new IceChatPluginFile();
         SavePluginFiles();
     }
 }
Пример #2
0
 private void LoadPluginFiles()
 {
     if (File.Exists(pluginsFile))
     {
         XmlSerializer deserializer = new XmlSerializer(typeof(IceChatPluginFile));
         TextReader textReader = new StreamReader(pluginsFile);
         iceChatPlugins = (IceChatPluginFile)deserializer.Deserialize(textReader);
         textReader.Close();
         textReader.Dispose();
     }
     else
     {
         iceChatPlugins = new IceChatPluginFile();
         SavePluginFiles();
     }
 }