Exemplo n.º 1
0
        public XuFuEncounterHandler(Button button, TextProgressBar progressBar, XuFuEncounterDataManager dataManager)
        {
            this.button         = button;
            this.progressBar    = progressBar;
            progressBar.Minimum = 1;
            this.dataManager    = dataManager;

            backgroundWorker = new BackgroundWorker
            {
                WorkerReportsProgress = true
            };
            backgroundWorker.DoWork             += BackgroundWorker_DoWork;
            backgroundWorker.ProgressChanged    += BackgroundWorker_ProgressChanged;
            backgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted;
        }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            txtCategoryName.GotFocus         += TxtCategoryName_GotFocus;
            txtFunctionValue.GotFocus        += TxtFunctionValue_GotFocus;
            txtAchievementID.GotFocus        += TxtAchievementID_GotFocus;
            txtWoWPetBattleCriteria.GotFocus += TxtWoWPetBattleCriteria_GotFocus;
            txtWoWPetBattleCriteria.ResetText(); // Trigger text changes

            var connStrBuilder = new SqliteConnectionStringBuilder();

            connStrBuilder.DataSource = "../../../../Krowi_AchievementFilter.db";
            var connection = new SqliteConnection(connStrBuilder.ConnectionString);

            connection.Open();

            functionDataManager = new FunctionDataManager(connection);
            functionHandler     = new FunctionHandler(cbxFunctions, functionDataManager);

            achievementCategoryDataManager = new AchievementCategoryDataManager(connection, functionDataManager);
            achievementCategoryHandler     = new AchievementCategoryHandler(tvwAchievementCategories, achievementCategoryDataManager, functionHandler);

            achievementDataManager = new AchievementDataManager(connection);
            achievementHandler     = new AchievementHandler(lsbAchievements, btnUpdateAchievement_AGT, pgbUpdateAchievement_AGT, achievementDataManager, achievementCategoryHandler);

            xuFuEncounterDataManager = new XuFuEncounterDataManager(connection);
            xuFuEncounterHandler     = new XuFuEncounterHandler(btnUpdateXuFuEncounter, pgbUpdateXuFuEncounter, xuFuEncounterDataManager);

            petBattleLinksDataManager = new PetBattleLinksDataManager(connection);
            petBattleLinksHandler     = new PetBattleLinksHandler(petBattleLinksDataManager, achievementDataManager, xuFuEncounterDataManager);

            uiMapDataManager = new UIMapDataManager(connection);
            uiMapHandler     = new UIMapHandler(btnUpdateUIMap, pgbUpdateUIMap, uiMapDataManager);

            exportHandler = new ExportHandler((AchievementDataManager)achievementHandler.DataManager, (AchievementCategoryDataManager)achievementCategoryHandler.DataManager, (FunctionDataManager)functionHandler.DataManager, (PetBattleLinksDataManager)petBattleLinksHandler.DataManager, (UIMapDataManager)uiMapHandler.DataManager);

            achievementCategoryHandler.RefreshTreeView();
            functionHandler.RefreshComboBox();

            btnAchievementCategoryMoveLeft.Text  = char.ConvertFromUtf32(0x2190);
            btnAchievementCategoryMoveUp.Text    = char.ConvertFromUtf32(0x2191);
            btnAchievementCategoryMoveDown.Text  = char.ConvertFromUtf32(0x2193);
            btnAchievementCategoryMoveRight.Text = char.ConvertFromUtf32(0x2192);
            btnAchievementMoveUp.Text            = char.ConvertFromUtf32(0x2191);
            btnAchievementMoveDown.Text          = char.ConvertFromUtf32(0x2193);

            //// test
            //WebClient client = new WebClient();
            //StreamWriter writer = new StreamWriter(Path.Combine(Path.GetTempPath(), "testfile.txt"), true);
            //for (int i = 2; i < 1000; i++)
            //{
            //    var source = client.DownloadString($"https://www.wow-petguide.com/Strategy/{i}");
            //    var match = Regex.Match(source, "id=\"treasure_box.*?div", RegexOptions.Singleline);

            //    if (match.Success)
            //    {
            //        var s = Regex.Replace($"-- {i} -- {match.Value}", @"\s+", " ");
            //        writer.WriteLine(s);
            //    }
            //}
            //writer.Close();
        }
Exemplo n.º 3
0
 public PetBattleLinksHandler(PetBattleLinksDataManager dataManager, AchievementDataManager achievementDataManager, XuFuEncounterDataManager xuFuEncounterDataManager)
 {
     this.dataManager              = dataManager;
     this.achievementDataManager   = achievementDataManager;
     this.xuFuEncounterDataManager = xuFuEncounterDataManager;
 }