using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using TradeIdeas.TIProData; using TradeIdeas.TIProData.Configuration; namespace WindowsFormsApplication1 { public partial class Form1 : Form { static private ConnectionMaster _connectionMaster; static public ConnectionMaster Connection { get { return _connectionMaster; } } public Form1() { InitializeComponent(); // It's best to create this at the very beginning, rather than waiting until // you log in. If this is null, other windows will have trouble and could // cause null pointer exceptions. If we are not logged in and not connected, // but this object exists, most messages will be safely ignored. _connectionMaster = new ConnectionMaster(); } private bool initialized; private void loginButton_Click(object sender, EventArgs e) { if (!initialized) { // This is neat for debugging and development, but I don't see anything // like this in a real client. initialized = true; } _connectionMaster.LoginManager.Username = usernameTextBox.Text; _connectionMaster.LoginManager.Password = passwordTextBox.Text; } private void historyWindowButton_Click(object sender, EventArgs e) { new HistoryForm().Show(); } } }