public void RefreshCharacterValues() { string previousName = CharacterName; CharacterName = ProcessHandler.ReadStringAddress(ClientProcess, Variables.Addresses.characterName); //Listview will ignore \0, so no need to replace if (previousName != null && !previousName.Equals(CharacterName)) { //Means the user restarted the client and logged in to a different client. DefaultValues(); } }
private void RefreshListView() //The method which thread executes, so value this. { //TODO : There could be a better way. Now it works. if (listView_Characters.InvokeRequired) { listView_Characters.Invoke((MethodInvoker) delegate() { RefreshListView(); }); } else { bool didProcessChange = characterHelper.RenewAndCheckForChange(ProcessHandler.GetRelativeProcesses()); if (didProcessChange) { listView_Characters.Items.Clear(); //My way of refreshing. AddRowsToList(); } else { //Seems nothing has been changed. } } }
public void HideClient() { ProcessHandler.ChangeProcessState(ClientProcess.MainWindowHandle, Variables.WindowHandles.hide); HiddenState = true; }
public void ShowClient() { ProcessHandler.ChangeProcessState(ClientProcess.MainWindowHandle, Variables.WindowHandles.show); HiddenState = false; }