public static void AppendConsoleThread(CsgoListenerObject Sender, string Text) { bool ShouldDisplay = false; if (ShouldFilterSelected) { if (FilterSelected != null) { if (Sender.Hostname == FilterSelected.Hostname && Sender.Port == FilterSelected.Port) { ShouldDisplay = true; } } } else { ShouldDisplay = true; } if (ShouldDisplay) { if (VirtCon.InvokeRequired) { VirtCon.Invoke((MethodInvoker) delegate { VirtCon.AppendText("[" + Sender.ToString() + "]" + Text + "\n"); VirtCon.SelectionStart = VirtCon.Text.Length; VirtCon.ScrollToCaret(); }); } } }
private void ListenerListBox_SelectedIndexChanged(object sender, EventArgs e) { if (ListenerListBox.SelectedItem != null) { FilterSelected = (CsgoListenerObject)ListenerListBox.SelectedItem; } }
public void AddNewListener(ScanObject Result) { CsgoListenerObject Listener = new CsgoListenerObject(Result); ListenerList.Add(Listener); RefreshListenerListBox(); }
private void RemoveAllCsgoButton_Click(object sender, EventArgs e) { for (int i = 0; i < ListenerListBox.Items.Count; i++) { CsgoListenerObject CsListen = (CsgoListenerObject)ListenerListBox.Items[i]; RemoveAListenerFromList(CsListen); } }
private void CmdSelectedButton_Click(object sender, EventArgs e) { if (ListenerListBox.SelectedItem != null && VirtualConsoleRichTextBox.Text != "") { CsgoListenerObject Selected = (CsgoListenerObject)ListenerListBox.SelectedItem; string[] Lines = VirtualConsoleRichTextBox.Lines; foreach (string Line in Lines) { AppendConsoleNormally("[Local] Sent command: " + Line); Selected.SendMessage(Line); } } }
public void RemoveAListenerFromList(CsgoListenerObject Listener) { for (int i = 0; i < ListenerList.Count; i++) { CsgoListenerObject CsgoList = ListenerList[i]; if (CsgoList.Hostname == Listener.Hostname && CsgoList.Port == Listener.Port) { CsgoList.CloseConnection(); ListenerList.RemoveAt(i); } } RefreshListenerListBox(); }