public WindowSwitchToolStrip(GUIIrcConnection con) { InitializeComponent(); ConnectionValue = con; StatusButtonValue = new WindowSwitchToolStripButton(con.Status); Items.Add(StatusButtonValue); Connection.WindowOpened += new GUIIrcConnection.WindowOpenedEventHandler(Connection_WindowOpened); }
void Connection_WindowOpened(GUIIrcConnection sender, WindowOpenedEventArgs args) { WindowSwitchToolStripButton newBtn = new WindowSwitchToolStripButton(args.OpenedWindow); Items.Add(newBtn); }