Esempio n. 1
0
 public void RegisterListener(Listener listener)
 {
     if (listener.GetType() == typeof(ImLoginListener))
     {
         this.loginListener = listener as ImLoginListener;
     }
     else if (listener.GetType() == typeof(ImNotifyListener))
     {
         this.notifyListener = listener as ImNotifyListener;
     }
     else if (listener.GetType() == typeof(ImNotifyListener))
     {
         this.chatListener = listener as ImChatListener;
     }
 }
Esempio n. 2
0
        public ImManager()
        {
            this.mysqlHelper = new MysqlHelper(new ConnectParam()
            {
                Server   = "127.0.0.1",
                UserID   = "root",
                Password = "******",
                Database = "chat_system",
            });
            this.cmdExecutor = new CommandExecutor();

            this.loginListener  = new ImLoginListener();
            this.notifyListener = new ImNotifyListener();
            this.chatListener   = new ImChatListener();
            this.userListener   = new ImUserListener();
        }