Example #1
0
 private static void Load()
 {
     try
     {
         string fileName = Essentials.PluginPath + "Essentials-BlockManagement.xml";
         if (File.Exists(fileName))
         {
             using (StreamReader reader = new StreamReader(fileName))
             {
                 XmlSerializer x = new XmlSerializer(typeof(BlockManagement));
                 BlockManagement.m_instance = (BlockManagement)x.Deserialize(reader);
                 reader.Close();
             }
         }
         else
         {
             BlockManagement.m_instance = new BlockManagement();
         }
     }
     catch (Exception ex)
     {
         Logging.WriteLineAndConsole(string.Format("BlockManagement Load Error: {0}", ex.ToString()));
         BlockManagement.m_instance = new BlockManagement();
     }
 }
		private static void Load()
		{
			try
			{
				string fileName = Essentials.PluginPath + "Essentials-BlockManagement.xml";
				if (File.Exists(fileName))
				{
					using (StreamReader reader = new StreamReader(fileName))
					{
						XmlSerializer x = new XmlSerializer(typeof(BlockManagement));
						_instance = (BlockManagement)x.Deserialize(reader);
						reader.Close();
					}
				}
				else
					_instance = new BlockManagement();
			}
			catch (Exception ex)
			{
				Log.Info(string.Format("BlockManagement Load Error: {0}", ex.ToString()));
				_instance = new BlockManagement();
			}
		}