private static void joinTopicsManager(string username) { ChannelFactory <TopicsManager> dupFactory = null; TopicsManager clientProxy = null; dupFactory = new ChannelFactory <TopicsManager>( new NetTcpBinding(), new EndpointAddress("net.tcp://localhost:9000/TopicManager")); dupFactory.Open(); clientProxy = dupFactory.CreateChannel(); while (true) { Console.WriteLine("************TOPICS MANAGER************"); Console.WriteLine("Liste des rooms diponibles : "); List <string> list = clientProxy.listTopics(); foreach (var t in list) { Console.WriteLine(t); } Console.WriteLine("1. Se connecter a une room \n2.Créer un nouveau chatroom"); switch (Console.ReadLine()) { case "1": Console.WriteLine("Entrez le nom de la room"); joinChatroom(clientProxy.joinTopic(Console.ReadLine()), username); break; case "2": Console.WriteLine("Entrez le nom de la room"); clientProxy.createTopic(Console.ReadLine()); break; } } }
private void button2_Click(object sender, EventArgs e) { clientProxy.createTopic(CreatTextBox.Text); listBox1.Items.Clear(); List <string> l = new List <string>(); l = clientProxy.listTopics(); foreach (var t in l) { listBox1.Items.Add(t); } }
public TopicManForm() { InitializeComponent(); ChannelFactory<TopicsManager> dupFactory = null; dupFactory = new ChannelFactory<TopicsManager>( new NetTcpBinding(), new EndpointAddress("net.tcp://localhost:9000/TopicManager")); dupFactory.Open(); clientProxy = dupFactory.CreateChannel(); List<string> l = new List<string>(); l = clientProxy.listTopics(); foreach (var t in l) { listBox1.Items.Add(t); } }
public TopicManForm() { InitializeComponent(); ChannelFactory <TopicsManager> dupFactory = null; dupFactory = new ChannelFactory <TopicsManager>( new NetTcpBinding(), new EndpointAddress("net.tcp://localhost:9000/TopicManager")); dupFactory.Open(); clientProxy = dupFactory.CreateChannel(); List <string> l = new List <string>(); l = clientProxy.listTopics(); foreach (var t in l) { listBox1.Items.Add(t); } }