Exemplo n.º 1
0
        public void Load()
        {
            if (m_loading)
            {
                return;
            }

            lock (m_instance)
            {
                try
                {
                    m_loading = true;
                    string fileName = Essentials.PluginPath + "Eessentials-Docking.xml";

                    if (File.Exists(fileName))
                    {
                        using (StreamReader reader = new StreamReader(fileName))
                        {
                            XmlSerializer x = new XmlSerializer(typeof(Docking));
                            m_instance = (Docking)x.Deserialize(reader);
                            reader.Close();
                        }

                        Logging.WriteLineAndConsole(string.Format("Loaded {0} Docking Items", m_instance.DockingItems.Count));
                    }
                }
                catch (Exception ex)
                {
                    Logging.WriteLineAndConsole(string.Format("Load(): {0}", ex.ToString()));
                }
                finally
                {
                    m_loading = false;
                }
            }
        }
        public void Load()
        {
            if (_loading)
            {
                return;
            }

            lock (_instance)
            {
                try
                {
                    _loading = true;
                    string fileName = Essentials.PluginPath + "Eessentials-Docking.xml";

                    if (File.Exists(fileName))
                    {
                        using (StreamReader reader = new StreamReader(fileName))
                        {
                            XmlSerializer x = new XmlSerializer(typeof(Docking));
                            _instance = (Docking)x.Deserialize(reader);
                            reader.Close();
                        }

                        Log.Info("Loaded {0} Docking Items from {1}", _instance.DockingItems.Count, fileName);
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                }
                finally
                {
                    _loading = false;
                }
            }
        }
Exemplo n.º 3
0
        public void Load()
        {
            if (m_loading)
                return;

            lock (m_instance)
            {
                try
                {
                    m_loading = true;
                    string fileName = Essentials.PluginPath + "Eessentials-Docking.xml";

                    if (File.Exists(fileName))
                    {
                        using (StreamReader reader = new StreamReader(fileName))
                        {
                            XmlSerializer x = new XmlSerializer(typeof(Docking));
                            m_instance = (Docking)x.Deserialize(reader);
                            reader.Close();
                        }

                        Logging.WriteLineAndConsole(string.Format("Loaded {0} Docking Items", m_instance.DockingItems.Count));
                    }
                }
                catch (Exception ex)
                {
                    Logging.WriteLineAndConsole(string.Format("Load(): {0}", ex.ToString()));
                }
                finally
                {
                    m_loading = false;
                }
            }
        }
Exemplo n.º 4
0
		public void Load()
		{
			if (_loading)
				return;

			lock (_instance)
			{
				try
				{
					_loading = true;
					string fileName = Essentials.PluginPath + "Eessentials-Docking.xml";

					if (File.Exists(fileName))
					{
						using (StreamReader reader = new StreamReader(fileName))
						{
							XmlSerializer x = new XmlSerializer(typeof(Docking));
							_instance = (Docking)x.Deserialize(reader);
							reader.Close();
						}

						Log.Info( "Loaded {0} Docking Items from {1}", _instance.DockingItems.Count, fileName );
					}
				}
				catch (Exception ex)
				{
					Log.Error( ex );
				}
				finally
				{
					_loading = false;
				}
			}
		}