public ParameterDialog(List <RconCommandParameter> parameters, ServerSession serverSession) { this.InitializeComponent(); this.ParameterToUserInput = new Dictionary <RconCommandParameter, InputBox>(); foreach (RconCommandParameter parameter in parameters) { this.CreateAndBindInputField(parameter, serverSession); } if (this.m_elementToFocus == null) { return; } this.m_elementToFocus.Focus(); }
public bool GetData(ServerSession serverSession, out string[] data) { data = new string[0]; string receivedMessage = ""; if (!serverSession.SendMessage(this.m_messageTemplate, true) || !serverSession.ReceiveMessage(out receivedMessage, true, false)) { return(false); } if (this.IsArray) { string[] strArray = Regex.Split(receivedMessage, "\t"); int count = int.Parse(strArray[0]); data = ((IEnumerable <string>)strArray).Skip <string>(1).Take <string>(count).ToArray <string>(); } else { data = new string[1] { receivedMessage } }; return(true); }
private void StartNewSessionAndCreateUI(ConnectDialog connectDialog) { ServerSession newSession = new ServerSession(connectDialog.ConnectionDetails); this.Dispatcher.Invoke((Action)(() => this.MainWindowContainer.Children.Add((UIElement) new ServerControl(newSession)))); }