public SignUpWindow(int port)
 {
     brokerIntermediate = new BrokerIntermediate();
     broker             = (IBroker)GetRemote.New(typeof(IBroker));
     InitializeComponent();
     this.port = port;
 }
        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;
        }
 public LoginWindow(int port)
 {
     brokerIntermediate = new BrokerIntermediate();
     broker             = (IBroker)GetRemote.New(typeof(IBroker));
     InitializeComponent();
     this.FormClosing += new FormClosingEventHandler(this.CloseWindow);
     this.port         = port;
 }
Exemple #4
0
        // TODO Implement events for logging

        public ClientRules(ClientForm cf)
        {
            clientForm = cf;
            RemotingConfiguration.Configure("Client.exe.config", false);
            diginoteSystem = (IDiginoteSystem)GetRemote.New(typeof(IDiginoteSystem));

            repeater.UpdateQuote    += UpdateQuoteHandler;
            repeater.NewTransaction += NewTransactionHandler;
            try
            {
                diginoteSystem.UpdateQuote    += repeater.FireUpdateQuoteEvent;
                diginoteSystem.NewTransaction += repeater.FireNewTransactionEvent;
            }
            catch (Exception ex)
            {
                Console.WriteLine("ERROR: " + ex.ToString());
            }
        }