/// <summary> /// Creates a connection from a GUI to the bot /// </summary> /// <param name="token">The token that specifies how to connect to the bot</param> public Connection(Listener.LogDelegate log, Token token) { this.log = log; State = ConnectionState.Connecting; worker = new Thread(new ParameterizedThreadStart(client_Connect)); worker.Start(token); }
private void button1_Click(object sender, EventArgs e) { try { ConnectToken = Token.FromXML(textBox1.Text); DialogResult = System.Windows.Forms.DialogResult.OK; } catch (Exception ex) { MessageBox.Show("The entered connection token is not valid, please check the token\n\nAdditional information: " + ex.Message, "Bad token"); } }
public ConnectDialog(Token token) { InitializeComponent(); textBox1.Text = token.ToXML(); }
/// <summary> /// Returns a token valid for the local host only /// </summary> /// <returns>Token identifying localhost</returns> public static Token LocalHostToken() { Token result = new Token(); result.IP = "127.0.0.1"; return result; }