示例#1
0
        static void Main()
        {
            chatController = ChatController.getController();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new LoginForm(chatController));
        }
        public void clientListUpdated(long count)
        {
            if (controller == null)
                controller = ChatController.getController();

            Console.WriteLine("* New client list is ready, event is: " + count);

            Thread t = new Thread(() => controller.updateClientList(count));
            t.TrySetApartmentState(ApartmentState.STA);
            t.Start();
        }
示例#3
0
        public LoginForm(ChatController chatController)
        {
            this.controller = chatController;
            InitializeComponent();
            this.serverPort.Text = TDIN_chatlib.Constants.DEFAULT_SERVER_PORT.ToString();
            this.serverHost.Text = "127.0.0.1";

            INIT_HEIGHT = this.Height;

            setRegisto(false);
        }
        public MainWindow(ChatController controller)
        {
            InitializeComponent();

            this.userList.DisplayMember = "DisplayName";
            this.userList.ValueMember = "UID";

            Program.window = this;
            this.controller = controller;

            this.Text = controller.Session.DisplayName;

            _refreshList(controller.UserList);
        }
 public LocalClient()
 {
     if (controller == null)
         controller = ChatController.getController();
 }
        public static ChatController getController()
        {
            if( _singleton == null )
                _singleton = new ChatController();

            return _singleton;
        }