Example #1
0
 public SignUpWindow(int port)
 {
     brokerIntermediate = new BrokerIntermediate();
     broker             = (IBroker)GetRemote.New(typeof(IBroker));
     InitializeComponent();
     this.port = port;
 }
Example #2
0
        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;
        }
Example #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;
 }
Example #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());
            }
        }