Ejemplo n.º 1
0
        public static AddonsConfig LoadConfigFile(string _Filename)
        {
            AddonsConfig newAddonsConfig = new AddonsConfig();

            newAddonsConfig._LoadConfigFile(_Filename);
            return(newAddonsConfig);
        }
Ejemplo n.º 2
0
        private void UpdateAddons()
        {
            string characterDir = Settings.GetWowDirectory(WowVersionEnum.Vanilla) + "WTF\\Account\\" + (string)c_lbAccounts.SelectedItem
                                  + "\\" + StaticValues.RealmNameConverter.First((_Value) => _Value.Value == (string)c_ddlRealm.SelectedItem).Key
                                  + "\\" + (string)c_lbCharacters.SelectedItem + "\\";

            //if (System.IO.File.Exists(characterDir + "AddOns.txt") == true)
            //{
            if (m_AddonsConfig != null)
            {
                //m_AddonsConfig.ReleaseAllConfigsLB(c_lbAddons);
                m_AddonsConfig.ReleaseAllConfigsCLB(c_clbAddons);
            }
            m_AddonsConfig = AddonsConfig.LoadConfigFile(characterDir + "AddOns.txt");
            //m_AddonsConfig.InitAllConfigsLB(c_lbAddons);
            m_AddonsConfig.InitAllConfigsCLB(c_clbAddons);

            if (c_clbAddons.Items.Count >= 1)
            {
                c_btnDisableAllAddons.Enabled = true;
                c_btnEnableAllAddons.Enabled  = true;
            }
            else    // if (c_lbAddons.Items.Count < 1)
            {
                c_btnDisableAllAddons.Enabled = false;
                c_btnEnableAllAddons.Enabled  = false;
            }
            //}
            //else
            //{
            //    if (m_AddonsConfig != null)
            //    {
            //        c_lbAddons.MouseDoubleClick -= m_AddonsConfig.EventAllConfigsLB_MouseDoubleClick;
            //        m_AddonsConfig.Dispose();
            //    }
            //    c_lbAddons.Items.Clear();
            //}
        }