public ChatWindow(ChatClientCtrl ctrl) { InitializeComponent(); this.ctrl = ctrl; friendsData = ctrl.getLoggedFriends(); messageData = new List <string>(); friendList.DataSource = friendsData; messageList.DataSource = messageData; ctrl.updateEvent += userUpdate; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider(); serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider(); IDictionary props = new Hashtable(); props["port"] = 0; TcpChannel channel = new TcpChannel(props, clientProv, serverProv); ChannelServices.RegisterChannel(channel, false); IChatServices services = (IChatServices)Activator.GetObject(typeof(IChatServices), "tcp://localhost:55555/Chat"); ChatClientCtrl ctrl = new ChatClientCtrl(services); LoginWindow win = new LoginWindow(ctrl); Application.Run(win); }
public LoginWindow(ChatClientCtrl ctrl) { InitializeComponent(); this.ctrl = ctrl; }