Ejemplo n.º 1
0
        private void LoadButton_Click(object sender,
                                      EventArgs e)
        {
            try
            {
                string file =
                    Others.DialogBoxOpenFile(Application.StartupPath + "\\Profiles\\Battlegrounder\\",
                                             "Profile files (*.xml)|*.xml|All files (*.*)|*.*");

                if (File.Exists(file))
                {
                    _profile = new BattlegrounderProfile();
                    _profile = XmlSerializer.Deserialize <BattlegrounderProfile>(file);
                    RefreshListZones();
                    RefreshForm();
                }
            }
            catch (Exception ex)
            {
                Logging.WriteError(
                    "Battlegrounder > Bot > ProfileCreator > LoadButton_Click(object sender, EventArgs e): " +
                    ex);
                RefreshListZones();
                RefreshForm();
            }
        }
Ejemplo n.º 2
0
 private void LoadGrid(string filePath = "")
 {
     try
     {
         if (string.IsNullOrEmpty(filePath))
         {
             filePath = Others.DialogBoxOpenFile(Application.StartupPath + @"\Data\Lang\", "Langage files (*.xml)|*.xml");
         }
         if (File.Exists(filePath))
         {
             Translate.Language currentLangage = XmlSerializer.Deserialize <Translate.Language>(filePath);
             CheckIdListAndReOrganize(ref currentLangage);
             for (int i = 0; i <= _defaultLangage.Translations.Count - 1; i++)
             {
                 if (string.IsNullOrEmpty(currentLangage.Translations[i].Text) || currentLangage.Translations[i].Text == currentLangage.Translations[i].Id.ToString() ||
                     currentLangage.Translations[i].Text.Contains("_"))
                 {
                     currentLangage.Translations[i].Text = _defaultLangage.Translations[i].Text;
                 }
             }
             TranslationTable.Rows.Clear();
             for (int i = 0; i < _defaultLangage.Translations.Count; i++)
             {
                 Translate.Translation translation = _defaultLangage.Translations[i];
                 TranslationTable.Rows.Add(new object[] { translation.Id.ToString(), currentLangage.Translations[i].Text, translation.Text });
             }
         }
     }
     catch (Exception ex)
     {
         Logging.WriteError("Translate_Tools > LoadGrid(string filePath): " + ex);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     Make key registre Wow.
 /// </summary>
 /// <returns></returns>
 public static void MakeWowRegistry()
 {
     try
     {
         MessageBox.Show(String.Format("{0}.", Translate.Get(Translate.Id.Please_select_exe_in_the_install_folder_of_the_game)));
         string      path = Others.DialogBoxOpenFile("", "Profile files (Wow.exe)|Wow.exe");
         RegistryKey key  = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Blizzard Entertainment\\World of Warcraft") ??
                            Registry.LocalMachine.CreateSubKey("SOFTWARE\\Blizzard Entertainment\\World of Warcraft");
         if (key != null)
         {
             key.SetValue("InstallPath", path.Replace("Wow.exe", ""), RegistryValueKind.String);
         }
     }
     catch (Exception e)
     {
         Logging.WriteError("MakeWowRegistry(): " + e);
     }
 }
Ejemplo n.º 4
0
        private void loadB_Click(object sender, EventArgs e)
        {
            try
            {
                string file =
                    Others.DialogBoxOpenFile(Application.StartupPath + "\\Profiles\\Fisherbot\\",
                                             "Profile files (*.xml)|*.xml|All files (*.*)|*.*");

                if (File.Exists(file))
                {
                    _profile = new FisherbotProfile();
                    _profile = XmlSerializer.Deserialize <FisherbotProfile>(file);
                    RefreshForm();
                }
            }
            catch (Exception ex)
            {
                Logging.WriteError("Fisherbot > Bot > ProfileCreator > loadB_Click(object sender, EventArgs e): " + ex);
                RefreshForm();
            }
        }