Exemple #1
0
        public ChatWindow(ChatClientCtrl ctrl)
        {
            InitializeComponent();
            this.ctrl             = ctrl;
            friendsData           = ctrl.getLoggedFriends();
            messageData           = new List <string>();
            friendList.DataSource = friendsData;

            messageList.DataSource = messageData;
            ctrl.updateEvent      += userUpdate;
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public LoginWindow(ChatClientCtrl ctrl)
 {
     InitializeComponent();
     this.ctrl = ctrl;
 }