コード例 #1
0
 public SignUpWindow(int port)
 {
     brokerIntermediate = new BrokerIntermediate();
     broker             = (IBroker)GetRemote.New(typeof(IBroker));
     InitializeComponent();
     this.port = port;
 }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: ArthurMatta/TDINProject
        public MainWindow(User user, int port)
        {
            //intermediate to handle notifications of updates
            brokerIntermediate = new BrokerIntermediate();
            brokerIntermediate.UpdateOnlineUsers += OnUpdateOnlineUsers;
            //remote object
            broker = (IBroker)GetRemote.New(typeof(IBroker));
            broker.UpdateOnlineUsers += brokerIntermediate.FireUpdateOnlineUsers;
            this.self = user;
            this.port = port;
            InitializeComponent();
            this.textBox1.Text           = user.Name;
            this.comboBox1.SelectedIndex = this.comboBox1.Items.IndexOf(user.Status);
            onlineUsers = broker.GetOnlineUsers();
            UpdateUserList();

            this.button1.Click += new System.EventHandler(this.RequestConvo);
            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.ChangeStatus);
            this.button3.Click        += new System.EventHandler(this.Logout);
            this.textBox1.TextChanged += new System.EventHandler(this.ChangeName);
            this.FormClosing          += new FormClosingEventHandler(this.CloseWindow);
            chatWindow = new ChatWindow(self, port);
            messenger  = (Messenger)RemotingServices.Connect(typeof(Messenger), "tcp://localhost:" + port + "/Messenger");
            messenger.ReceivedRequest += OnReceivedRequest;
            messenger.ReceivedMessage += OnReceivedMessage;
        }
コード例 #3
0
 public LoginWindow(int port)
 {
     brokerIntermediate = new BrokerIntermediate();
     broker             = (IBroker)GetRemote.New(typeof(IBroker));
     InitializeComponent();
     this.FormClosing += new FormClosingEventHandler(this.CloseWindow);
     this.port         = port;
 }