private void UpdateDataForBankTable(object sender, System.Timers.ElapsedEventArgs e) { LoadDataForBankList(true); BankListBox.Invoke(new MethodInvoker(delegate { BankListBox.Invalidate(); })); }
public void HandleEvent <T>(string eventName, T obj) { if (eventName == "LoginEvent") { MainTabControl.Visible = true; LoadDataForBankList(); if (User.Instance.Rank == MemberRanks.GUILD_MASTER) { ManageBankTabButton.Visible = true; AddBankTabButton.Visible = true; NewTabNameTextBox.Visible = true; AddonPathTextBox.Visible = true; FolderDialButton.Visible = true; BankItemManage.Visible = true; ManagementToolsBox.Visible = true; BankKeyLabel.Visible = true; BankKeyTextBox.Visible = true; ChangeBankKeyButton.Visible = true; AddonPathLabel.Visible = true; EventItemsList.SelectionMode = SelectionMode.One; m_PollPendingTimer = new System.Timers.Timer(50000); // 1 sec = 1000, 60 sec = 60000 m_PollPendingTimer.AutoReset = true; m_PollPendingTimer.Elapsed += new System.Timers.ElapsedEventHandler(UpdateDataForBankTable); m_PollPendingTimer.Start(); GetBankKey(); } } if (eventName == "BankItemSelected") { LoadDataForItem((obj as Item).ItemID); } if (eventName == "DeleteFromBank") { DeleteItemFromBank(TabComboBox.SelectedIndex, (obj as Item).ItemID, (obj as Item).StackSize); LoadDataForBankList(true); BankListBox.Invalidate(); } if (eventName == "ApprovePending") { // update document RemoveItemFromPendingXML((obj as Item)); // add to bank SendItemToBank((obj as Item), (obj as Item).StackSize); // refresh list LoadDataForBankList(true); BankListBox.Invalidate(); } if (eventName == "RefreshBankList") { LoadDataForBankList(true); BankListBox.Invalidate(); } if (eventName == "DeleteFromEvent") { RemoveItemFromEvent((obj as Item).Name); } if (eventName == "RefreshEventData") { LoadUserForEvent(); } }