コード例 #1
0
ファイル: ProfileCreator.cs プロジェクト: zneel/TheNoobBot
        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();
            }
        }
コード例 #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);
     }
 }
コード例 #3
0
ファイル: Usefuls.cs プロジェクト: zneel/TheNoobBot
 /// <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);
     }
 }
コード例 #4
0
ファイル: ProfileCreator.cs プロジェクト: zneel/TheNoobBot
        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();
            }
        }