private void lootBox_Click(object sender, EventArgs e) { keys.Halt(); keys = new SetKeys(lootBox, 7, settings); Thread thread = new Thread(keys.DoWork); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
public RediReadTask <TKey, TValue> Read() { var progressIndicator = new Progress <int>(); RediReadOptions readOptions = new() { Progress = progressIndicator, }; if (IsMessages) { RediReadTask <TKey, TValue>?reader = new(Task.Run(() => GetMessages()), progressIndicator) { TotalItems = Subscriptions.Count }; return(reader); Dictionary <TKey, TValue>?GetMessages() { var result = Redipal.IFactory !.RediPalInstance.Read.Messages(SetKeys.ToArray()); if (result is not null) { var d = new Dictionary <TKey, TValue>(); foreach (var item in result) { if (item.Key is TKey key && item.Value is TValue value) { d.Add(key, value); } } return(d); } else { return(default);
public void initialize() { try { settings.Load(); if ((lastProfile = settings.Profile) != null) { profile = new Profile(); profile.Load(settings.Profile); profileLoaded = true; profileLabel2.Text = Path.GetFileName(settings.Profile); } if ((lastSpells = settings.Spells) != null) { spells = new Spells(); spells.Load(lastSpells); spellsLoaded = true; spellsLabel2.Text = Path.GetFileName(settings.Spells); } if (settings.IgnoreMobs) { mobsBox.Checked = true; } if (settings.IgnorePlayers) { playersBox.Checked = true; } if (settings.Skinning) { skinningBox.Checked = true; } if (settings.Looting) { lootBox1.Checked = true; } if (settings.Linear) { linearBox.Checked = true; } if (settings.Sell) { sellingBox.Checked = true; } if (settings.Mining) { gatheringBox2.Checked = true; } if (settings.Herbing) { gatheringBox1.Checked = true; } sellTextBox.Text = settings.SellLoops + ""; mountBox.Text = settings.GeneralKeybinds[0, 1]; forwardBox.Text = settings.GeneralKeybinds[1, 1]; leftBox.Text = settings.GeneralKeybinds[2, 1]; rightBox.Text = settings.GeneralKeybinds[3, 1]; downBox.Text = settings.GeneralKeybinds[4, 1]; upBox.Text = settings.GeneralKeybinds[5, 1]; tabBox.Text = settings.GeneralKeybinds[6, 1]; lootBox.Text = settings.GeneralKeybinds[7, 1]; drinkBox.Text = settings.GeneralKeybinds[8, 1]; eatBox.Text = settings.GeneralKeybinds[9, 1]; escBox.Text = settings.GeneralKeybinds[10, 1]; retrieveBox.Text = settings.GeneralKeybinds[12, 1]; releaseBox.Text = settings.GeneralKeybinds[11, 1]; this.FormBorderStyle = FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; } catch (Exception ex) { attachLabel.Text = "Loading settings failed."; errorLabel.Text = ex.Message; } startButton.Hide(); stopButton.Hide(); keys = new SetKeys(mountBox, 0, settings); //Check this. panel1.Show(); panel2.Hide(); panel3.Hide(); loadButton2.Show(); loadButton1.Show(); attachButton.Show(); newSpellLabel.Hide(); addSpellLabel.Hide(); saveLabel2.Hide(); wstartLabel.Hide(); gstartLabel.Hide(); sstartLabel.Hide(); mpointLabel.Hide(); sstopLabel.Hide(); newProfileLabel.Hide(); saveLabel.Hide(); menuButton2.BackColor = System.Drawing.ColorTranslator.FromHtml("#222326 "); menuButton1.BackColor = System.Drawing.ColorTranslator.FromHtml("#2E2F33 "); menuButton3.BackColor = System.Drawing.ColorTranslator.FromHtml("#222326 "); menuButton3.Hide(); openFile.Hide(); sendMsgBox.Hide(); sendMsgButton.Hide(); sayLabel.Hide(); whisperLabel.Hide(); replyLabel.Hide(); partyLabel.Hide(); guildLabel.Hide(); /*magic = new BlackMagic(); * magic.OpenProcessAndThread(SProcess.GetProcessFromProcessName("WoW")); * testLabel.Text = magic.ReadShort((uint)TbcOffsets.General.Cursor)+"";*/ }