Ejemplo n.º 1
0
 public ClientViewModel()
 {
     var channelFactory = new DuplexChannelFactory<IChattingService>(new ClientService(), "ChattingServiceEndPoint");
     _server = channelFactory.CreateChannel();
     This = this;
     CreateCommands();
 }
Ejemplo n.º 2
0
 public RegisterViewModel()
 {
     var channelFactory = new DuplexChannelFactory<IChattingService>(new ClientService(), "ChattingServiceEndPoint");
     _server = channelFactory.CreateChannel();
     Register = new RelayCommand(OnRegister, () => !(string.IsNullOrEmpty(UserName) || string.IsNullOrEmpty(Password)));
     ClearCommand = new RelayCommand(OnClear);
 }
Ejemplo n.º 3
0
        public MainWindow()
        {
            InitializeComponent();

            _channelFactory = new DuplexChannelFactory <IChattingService>(new ClientCallback(), "ChattingServiceEndpoint");
            Server          = _channelFactory.CreateChannel();
        }
Ejemplo n.º 4
0
 public GroupChatController(IChattingService chattingService, IRelatedDataService dataService,
                            IGroupService groupService)
 {
     _chattingService = chattingService;
     _dataService     = dataService;
     _groupService    = groupService;
 }
Ejemplo n.º 5
0
        public MainWindow()
        {
            InitializeComponent();
            _channelFactory = new DuplexChannelFactory <IChattingService>(new ClientCallback(),
                                                                          "ChattingServicesEndPoint");
            Server = _channelFactory.CreateChannel();

            //I have slpit the classes into sections so it is easier to read and understand.
        }
        public MainWindow()
        {
            InitializeComponent();
            var clientCallback = new ClientCallback();

            clientCallback.ClientLoginLogoff += ClientCallback_ClientLoginLogoff;
            _channelFactory = new DuplexChannelFactory <IChattingService>(clientCallback, "ChattingServiceEndPoint");
            _server         = _channelFactory.CreateChannel();
        }
        //public Window1()
        //{
        //   InitializeComponent();
        //   _channelFactory = new DuplexChannelFactory<IChattingService>(new ClientCallback(), "ChattingServiceEndPoint");
        //   Server = _channelFactory.CreateChannel();
        //}

        public Window1(List <string> usersChatting)
        {
            InitializeComponent();
            _channelFactory = new DuplexChannelFactory <IChattingService>(new ClientCallback(), "ChattingServiceEndPoint");
            Server          = _channelFactory.CreateChannel();

            this.usersChatting = usersChatting;
            //Server.GetCurrentUsers();
            WelcomeLabel.Content = "Private chat with " + usersChatting[1] + " !";
        }
Ejemplo n.º 8
0
 public MainWindow()
 {
     InitializeComponent();
     try
     {
         _channelFactory = new DuplexChannelFactory <IChattingService>(new ClientCallback(), "ChattingServiceEndPoint");
         Server          = _channelFactory.CreateChannel();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }
        // this is run when the messenger window is opened
        public MainWindow()
        {
            InitializeComponent();
            // channel is setup to allow communication to the server
            _channelFactory = new DuplexChannelFactory <IChattingService>(new ClientCallback(), "ChattingServiceEndPoint");
            Server          = _channelFactory.CreateChannel();

            // When the window is initialised all of the textbox/buttons that cannot be used yet are unenabled
            TextDisplayTextBox.IsEnabled = false;
            MessageTextBox.IsEnabled     = false;
            SendButton.IsEnabled         = false;
            checkBox.IsEnabled           = false;
            UsersListBox.IsEnabled       = false;
        }
Ejemplo n.º 10
0
        public MainWindow()
        {
            InitializeComponent();

            _channelfactory = new DuplexChannelFactory <IChattingService>(new ClientCallback(), "ChattingServiceEndPoint");

            Server = _channelfactory.CreateChannel();

            btn_Send.Click   += btn_Send_Click;
            btn_Login.Click  += btn_Login_Click;
            btn_Logout.Click += btn_Logout_Click;
            btn_Update.Click += btn_Update_Click;

            this.Closed     += MainWindow_Closed;
            this.DataContext = this;
        }
Ejemplo n.º 11
0
        public ChatWPFClient()
        {
            InitializeComponent();
            _channelFactory = new DuplexChannelFactory <IChattingService>(new ClientCallback(), "ChattingServiceEndPoint");
            Server          = _channelFactory.CreateChannel();

            int returnValue = Server.Login(loggedInUser.username);

            if (returnValue == 1)
            {
                MessageBox.Show("You are already logged in, check to see who is logged into system");
            }
            else if (returnValue == 0)
            {
                MessageBox.Show("You are now logged in! Welcome!");
                welcomeLabel.Text = "Welcome, " + loggedInUser.username;
            }
        }
        public ChatWPFClient()
        {
            InitializeComponent();
            _channelFactory = new DuplexChannelFactory<IChattingService>(new ClientCallback(), "ChattingServiceEndPoint");
            Server = _channelFactory.CreateChannel();

            int returnValue = Server.Login(loggedInUser.username);
            if (returnValue == 1)
            {
                MessageBox.Show("You are already logged in, check to see who is logged into system");

            }
            else if (returnValue == 0)
            {
                MessageBox.Show("You are now logged in! Welcome!");
                welcomeLabel.Text = "Welcome, " + loggedInUser.username;

            }
        }